You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xxdj1/user/pages/stored/list.vue

332 lines
7.4 KiB

2 years ago
<template>
<view class="master-income-record">
<view class="mine-menu-list c-base" :style="{background:primaryColor}">
2 years ago
<!-- <view class="space-lg"></view>
<view class="space-lg"></view> -->
<view class="flex-center" style="font-size: 36rpx;padding-top:113rpx;color:#ffffff">充值</view>
<view class="money-info">
<view class="money">{{balance}}</view>
<view class="yuan">
当前余额
2 years ago
</view>
</view>
<view class="space-md"></view>
<view class="space-lg"></view>
</view>
2 years ago
<view class="fill-base item">
2 years ago
<view @tap.stop="$util.goUrl({url:`/user/pages/stored/record`})"
2 years ago
class="item-record-btn"
>
2 years ago
<image src="../../../static/m1.png" mode=""></image>
2 years ago
<view class="text">充值记录</view>
</view>
2 years ago
<view @tap.stop="$util.goUrl({url:`/user/pages/stored/consume`})"
2 years ago
class="item-record-btn"
>
<image src="../../../static/m2.png" mode=""></image>
<view class="text">消费明细</view>
</view>
2 years ago
<view @tap.stop="$util.goUrl({url:`/user/pages/stored/commission`})"
class="item-record-btn"
>
<image src="../../../static/m3.png" mode=""></image>
<view class="text">返佣记录</view>
</view>
<!-- :style="{color:primaryColor,border:`1rpx solid ${primaryColor}`}" -->
2 years ago
</view>
2 years ago
<view class="jineContent">
<view class="titleText">
充值金额
</view>
<view class="moneyContent">
<view @tap="chongzhiHandle(index)" :class="index==activeIndex?'list-item activeStyle fill-base mt-md pd-lg radius-16':'list-item fill-base mt-md pd-lg radius-16'"
v-for="(item,index) in list.data" :key="index">
<view class="priceNum">¥{{item.price}}</view>
<view class="name">{{item.title}}</view>
</view>
2 years ago
</view>
2 years ago
<view @click="toPay" class="item-btn flex-center f-caption c-base radius-5" :style="{background:primaryColor}">立即充值
2 years ago
</view>
</view>
2 years ago
2 years ago
<view class="list-item fill-base mt-md ml-lg mr-lg radius-16">
<view class="pd-lg b-1px-b">
<view class="pl-md f-paragraph" :style="{lineHeight: 1.1,borderLeft: `5rpx solid ${primaryColor}`}">充值说明
</view>
</view>
<view class="pd-lg f-caption c-caption">
2 years ago
<view>1本金和赠送金额均不可提现转移转赠退款</view>
<view>2充值套餐赠送金额部分不可进行退款</view>
<view>3使用范围本平台所以项目购买以及交通费用支付</view>
<view>4套餐充值绑定理疗师有效期为6小时过期将不可绑定</view>
2 years ago
</view>
</view>
<view class="space-footer"></view>
</view>
</template>
<script>
import {
mapState,
mapActions,
mapMutations
} from "vuex"
export default {
components: {},
data() {
return {
color: '#ffffff',
balance: 0,
param: {
page: 1,
limit: 10
},
list: {
data: []
},
loading: true,
2 years ago
lockTap: false,
activeIndex:0
2 years ago
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
userInfo: state => state.user.userInfo,
mineInfo: state => state.user.mineInfo,
}),
async onLoad() {
this.$util.showLoading()
let {
balance = 0
} = this.mineInfo
this.balance = balance
await this.initIndex()
},
onPullDownRefresh() {
// #ifndef APP-PLUS
uni.showNavigationBarLoading()
// #endif
this.initRefresh();
uni.stopPullDownRefresh()
},
onReachBottom() {
if (this.list.current_page >= this.list.last_page || this.loading) return;
this.param.page = this.param.page + 1;
this.loading = true;
this.getList();
},
methods: {
...mapActions(['getMineInfo']),
...mapMutations([]),
async initIndex(refresh = false) {
// #ifdef H5
2 years ago
if (!refresh && this.$jweixin.isWechat()) {
await this.$jweixin.initJssdk();
this.$jweixin.wxReady(() => {
this.$jweixin.hideOptionMenu()
})
}
2 years ago
// #endif
await this.getList()
this.$util.setNavigationBarColor({
bg: this.primaryColor
})
},
initRefresh() {
this.param.page = 1
this.initIndex(true)
},
async getList() {
let {
list: oldList,
param,
} = this
let newList = await this.$api.mine.cardList(param);
if (this.param.page == 1) {
this.list = newList
} else {
newList.data = oldList.data.concat(newList.data)
this.list = newList
}
this.loading = false
this.$util.hideAll()
},
2 years ago
chongzhiHandle(index){
this.activeIndex = index
},
2 years ago
// 去支付
2 years ago
async toPay() {
let index = this.activeIndex
2 years ago
let {
id: card_id,
true_price
} = this.list.data[index]
if (this.lockTap) return;
this.lockTap = true;
this.$util.showLoading()
try {
let {
pay_list
} = await this.$api.mine.payBalanceOrder({
card_id
})
1 year ago
console.log(pay_list,"jjjj")
1 year ago
2 years ago
this.$util.hideAll()
if (pay_list) {
try {
await this.$util.pay(pay_list)
this.lockTap = false;
await this.getMineInfo()
this.$util.back()
} catch (e) {
1 year ago
console.log(e,"===")
2 years ago
this.lockTap = false;
return;
}
}
} catch (e) {
setTimeout(() => {
this.lockTap = false
this.$util.hideAll()
}, 2000)
}
},
}
}
</script>
<style lang="scss">
.master-income-record {
.mine-menu-list {
2 years ago
height:530rpx;
2 years ago
.money-info {
2 years ago
font-size: 70rpx;
text-align: center;
margin-top:65rpx;
2 years ago
.money {
font-size: 70rpx;
}
2 years ago
.yuan{
font-size: 28rpx;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #FFFFFF;
}
2 years ago
}
}
2 years ago
.jineContent{
background: #FFFFFF;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(16,132,86,0.06);
border-radius: 20rpx;
margin:20rpx 30rpx;
padding:30rpx;
.titleText{
font-size: 30rpx;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #09090B;
}
2 years ago
.item-btn {
2 years ago
height: 100rpx;
line-height: 100rpx;
background: #08BF77;
border-radius: 50px;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
margin-top:50rpx;
}
}
.moneyContent{
display:flex;
justify-content: space-between;
.list-item {
border: 1px solid #08BF77;
// flex:1;
width:48%;
text-align: center;
.priceNum{
font-size: 50rpx;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #08BF77;
}
.name{
font-size: 28rpx;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #08BF77;
}
}
}
.activeStyle{
background-color: #08BF77 !important;
.priceNum{
color: #fff !important;
}
.name{
color: #fff !important;
2 years ago
}
}
2 years ago
2 years ago
.item{
display:flex;
align-items: center;
justify-content: space-around;
padding:35rpx 0;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(16,132,86,0.06);
border-radius: 30rpx;
margin:-60rpx 24rpx 0 24rpx;
.item-record-btn {
// text-align: center;
display: flex;
flex-direction: column;
align-items: center;
image{
width:43rpx;
height:42rpx;
}
.text{
font-size: 28rpx;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #333333;
margin-top:21rpx;
}
}
}
2 years ago
.stored-item {
.item-input {
height: 90rpx;
border-radius: 15rpx 0 0 15rpx;
}
.item-btn {
width: 130rpx;
height: 90rpx;
border-radius: 0 15rpx 15rpx 0;
}
}
}
</style>