diff --git a/pages.json b/pages.json index 76ad690..d56b993 100644 --- a/pages.json +++ b/pages.json @@ -243,6 +243,23 @@ "navigationBarTitleText": "提现余额", "enablePullDownRefresh": false, "navigationBarBackgroundColor": "#3175f9", + "navigationBarTextStyle": "white", + "app-plus": { + "titleNView": { + "buttons": [{ + "color": "#fff", + "text": "提现记录", + "fontSize": "15" + }] + } + } + } + }, { + "path": "withdrawList/withdrawList", + "style": { + "navigationBarTitleText": "提现记录", + "enablePullDownRefresh": false, + "navigationBarBackgroundColor": "#3175f9", "navigationBarTextStyle": "white" } diff --git a/subpkg/finance/finance.vue b/subpkg/finance/finance.vue index 8f83b9a..c7feb79 100644 --- a/subpkg/finance/finance.vue +++ b/subpkg/finance/finance.vue @@ -150,7 +150,7 @@ export default { let res = await accountLogLists({ type: 'um', //账户余额 page_no: this.loadConfig.page, - page_size: this.loadConfig.page_size + page_size: this.loadConfig.limit }); this.loadConfig.status="loadmore" if(res.data.lists.length{{item}} - + 备注 - 提现后将会由后台审核,审核通过后会直接往您所上传的银行卡汇款,请耐心等待,如由疑问也可拨打商城客服热线4008888888 + 提现后将会由后台审核,审核通过后会直接往您所上传的银行卡汇款,请耐心等待,如由疑问也可拨打商城客服热线4008888888 @@ -47,12 +49,20 @@ timeCount: 5, } }, + // 点击提现记录 + onNavigationBarButtonTap(res){ + if (res.index === 0) { + uni.navigateTo({ + url: '/subpkg/withdrawList/withdrawList' + }) + } + }, onLoad() {}, onShow() {}, methods: { - copyPhone(str=""){ + copyPhone(str = "") { uni.setClipboardData({ - data:str+"", + data: str + "", success: (e) => { Toast('号码已复制') }, @@ -61,36 +71,40 @@ } }) }, - changePrice(index){ - if(this.changeMoney == index)this.changeMoney = -1; + changePrice(index) { + if (this.changeMoney == index) this.changeMoney = -1; else this.changeMoney = index; - if(this.priceList[index]=='自定义')this.payMoney.money = ''; - else if(this.priceList[index]=='全部')this.payMoney.money = this.$store.state.app.userInfo.user_money||0; + if (this.priceList[index] == '自定义') this.payMoney.money = ''; + else if (this.priceList[index] == '全部') this.payMoney.money = this.$store.state.app.userInfo.user_money || 0; else this.payMoney.money = this.priceList[index].split('元')[0]; }, // 提现 - pay(){ - if(!this.payMoney.money)return Toast('请先填写提现金额!') - if(+this.payMoney.money<=0)return Toast('提现金额不能小于0!') - if(+this.payMoney.money>+this.$store.state.app.userInfo.user_money)return Toast('提现金额不能大于余额!') - if(!this.payTimer){ + pay() { + if (!this.payMoney.money) return Toast('请先填写提现金额!') + if (+this.payMoney.money <= 0) return Toast('提现金额不能小于0!') + if (+this.payMoney.money > +this.$store.state.app.userInfo.user_money) return Toast('提现金额不能大于余额!') + if (!this.payTimer) { this.goApply(); - this.payTimer = setInterval(()=>{ + this.payTimer = setInterval(() => { this.timeCount--; - if(this.timeCount<=0){ + if (this.timeCount <= 0) { clearInterval(this.payTimer); this.payTimer = null; this.timeCount = 5; } }, 1000) - } - else Toast(this.timeCount+'秒后再提现!') + } else Toast(this.timeCount + '秒后再提现!') }, - async goApply(){ + // 提现 + async goApply() { let res = await userWithdraw({ amount: this.payMoney.money }); - Toast(res.msg) + Toast(res.msg); + // 重新显示余额 + let info = this.$store.state.app.userInfo; + info.user_money -= this.payMoney.money; + this.$store.commit('setUserInfo', info); } }, onPullDownRefresh() { diff --git a/subpkg/withdrawList/withdrawList.vue b/subpkg/withdrawList/withdrawList.vue new file mode 100644 index 0000000..886731b --- /dev/null +++ b/subpkg/withdrawList/withdrawList.vue @@ -0,0 +1,161 @@ + + + + +