diff --git a/pages/PayMoney/PayMoney.vue b/pages/PayMoney/PayMoney.vue index cf5ddc4..57e3bc7 100644 --- a/pages/PayMoney/PayMoney.vue +++ b/pages/PayMoney/PayMoney.vue @@ -88,21 +88,28 @@ icon: 'none' }) } else { - this.modelmoney.oldmoney=this.balance*100 - this.modelmoney.money=this.moneys*100 - this.modelmoney.nowmoney=this.modelmoney.oldmoney-this.modelmoney.money - let bool=this.AddMoney() - if(bool){ + this.modelmoney.oldmoney = this.balance * 100 + this.modelmoney.money = this.moneys * 100 + if (this.modelmoney.oldmoney < this.modelmoney.money) { + uni.showToast({ + title: '余额不足,无法进行提现', + icon: 'none' + }) + } else { + this.modelmoney.nowmoney = this.modelmoney.oldmoney - this.modelmoney.money + let bool = this.AddMoney() + if (bool) { uni.showToast({ - title:'已提交审核提现', - icon:'success' + title: '已提交审核提现', + icon: 'success' }) - }else{ + } else { uni.showToast({ - title:'提现失败', - icon:'none' + title: '提现失败', + icon: 'none' }) } + } } }, // 确认提现 @@ -110,7 +117,7 @@ let regs = /^\d+(\.\d{0,2})?$/; let storage = uni.getStorageSync('userinfo') this.model.openid = storage.data.openid - this.modelmoney.oldmoney=this.balance*100 + this.modelmoney.oldmoney = this.balance * 100 if (this.moneys == 0) { uni.showToast({ title: '请输入金额', @@ -128,47 +135,54 @@ }) } else { this.model.amount = this.moneys * 100 - this.API.GetPay(this.model).then(res => { - console.log('res支付', res) - if (res.data.code == 200) { - this.API.UpdBlanceByUser({ - userid: storage.data.id, - amount: this.model.amount - }).then(res => { - console.log('res更改金额') - if (res.data.code == 200) { - storage = res.data - uni.setStorageSync('userinfo', storage) - uni.showToast({ - title: '提现成功', - icon: 'success', - duration: 1000 - }) - this.modelmoney.status = 0 - setTimeout(() => { - uni.switchTab({ - url: '../my/my' + if (this.balance < this.moneys) { + uni.showToast({ + title: '余额不足,无法进行提现', + icon: 'none' + }) + }else{ + this.API.GetPay(this.model).then(res => { + console.log('res支付', res) + if (res.data.code == 200) { + this.API.UpdBlanceByUser({ + userid: storage.data.id, + amount: this.model.amount + }).then(res => { + console.log('res更改金额') + if (res.data.code == 200) { + storage = res.data + uni.setStorageSync('userinfo', storage) + uni.showToast({ + title: '提现成功', + icon: 'success', + duration: 1000 }) - }, 1000) - } else { - uni.showToast({ - title: '提现失败', - icon: 'none' - }) - this.modelmoney.status = -99 - } - this.modelmoney.money = this.model.amount - this.modelmoney.nowmoney = this.modelmoney.oldmoney - this.modelmoney.money - this.AddMoney() - }) - - } else { - uni.showToast({ - title: res.message, - icon: 'none' - }) - } - }) + this.modelmoney.status = 0 + setTimeout(() => { + uni.switchTab({ + url: '../my/my' + }) + }, 1000) + } else { + uni.showToast({ + title: '提现失败', + icon: 'none' + }) + this.modelmoney.status = -99 + } + this.modelmoney.money = this.model.amount + this.modelmoney.nowmoney = this.modelmoney.oldmoney - this.modelmoney.money + this.AddMoney() + }) + + } else { + uni.showToast({ + title: res.message, + icon: 'none' + }) + } + }) + } } @@ -177,11 +191,11 @@ AddMoney() { let jsonstorage = uni.getStorageSync('userinfo').data this.modelmoney.username = jsonstorage.username - this.modelmoney.openid=jsonstorage.openid - this.modelmoney.remark="提现" + this.modelmoney.openid = jsonstorage.openid + this.modelmoney.remark = "提现" this.modelmoney.userid = jsonstorage.id // this.modelmoney.oldmoney = jsonstorage.balance - this.model.status=0 + this.model.status = 0 this.API.AddOrUpdMoney(this.modelmoney).then(res => { console.log('添加记录', res) if (res.code == 200) { @@ -222,51 +236,41 @@ height: 100%; width: 100%; } - .YmContent { height: 100%; width: 100%; } - uni-page-body, #app { height: 100%; } - button::after { border: none; width: auto; } - input { outline: none; border: none; list-style: none; width: auto; } - .list_item { float: left; } - .ym_hide { display: none; } - .ym_show { display: block; } - .slide-image { width: 100%; height: 100%; } - .list_horizontal { width: auto; display: inline-block; } - .application_for_withdrawal_71 { white-space: normal; width: 749upx; @@ -278,7 +282,6 @@ border-radius: 0upx; font-size: 8upx; } - .application_for_withdrawal_71 .application_for_withdrawal_74 { white-space: normal; width: 181upx; @@ -293,7 +296,6 @@ font-size: 32upx; line-height: 34upx; } - .application_for_withdrawal_71 .application_for_withdrawal_75 { white-space: normal; width: 647upx; @@ -307,7 +309,6 @@ font-size: 43upx; line-height: 44upx; } - .application_for_withdrawal_71 .application_for_withdrawal_75 .application_for_withdrawal_76 { white-space: normal; width: auto; @@ -321,7 +322,6 @@ font-size: 43upx; line-height: 44upx; } - .application_for_withdrawal_71 .application_for_withdrawal_75 .application_for_withdrawal_77 { white-space: normal; width: auto; @@ -336,7 +336,6 @@ font-size: 43upx; line-height: 43upx; } - .application_for_withdrawal_71 .application_for_withdrawal_81 { white-space: normal; width: 704upx; @@ -350,7 +349,6 @@ font-size: 29upx; line-height: 36upx; } - .application_for_withdrawal_71 .application_for_withdrawal_81 .application_for_withdrawal_82 { white-space: normal; width: 377upx; @@ -364,7 +362,6 @@ font-size: 29upx; line-height: 36upx; } - .application_for_withdrawal_71 .application_for_withdrawal_81 .application_for_withdrawal_83 { white-space: normal; width: 128upx; @@ -378,7 +375,6 @@ font-size: 29upx; line-height: 36upx; } - .application_for_withdrawal_71 .payType { white-space: normal; width: 683upx; @@ -392,7 +388,6 @@ font-size: 49upx; line-height: 50upx; } - .application_for_withdrawal_71 .payType .application_for_withdrawal_85 { white-space: normal; width: 46upx; @@ -405,7 +400,6 @@ font-size: 48upx; line-height: 47upx; } - .application_for_withdrawal_71 .payType .application_for_withdrawal_86 { white-space: normal; width: 61upx; @@ -419,7 +413,6 @@ font-size: 27upx; line-height: 28upx; } - .application_for_withdrawal_71 .payType .application_for_withdrawal_87 { white-space: normal; width: 43upx; @@ -432,7 +425,6 @@ font-size: 43upx; line-height: 44upx; } - .application_for_withdrawal_71 .payType .application_for_withdrawal_88 { white-space: normal; width: 47upx; @@ -445,7 +437,6 @@ font-size: 49upx; line-height: 47upx; } - .application_for_withdrawal_71 .payType .application_for_withdrawal_89 { white-space: normal; width: 81upx; @@ -459,7 +450,6 @@ font-size: 27upx; line-height: 29upx; } - .application_for_withdrawal_71 .payType .application_for_withdrawal_90 { white-space: normal; width: 43upx; @@ -472,7 +462,6 @@ font-size: 42upx; line-height: 43upx; } - .application_for_withdrawal_71 .btSubmit { white-space: normal; width: 679upx; @@ -491,11 +480,9 @@ font-size: 27upx; line-height: 92upx; } - .application_for_withdrawal_71 .btSubmit_label { float: left; } - .application_for_withdrawal_71 .btSubmit_button { float: left; color: #000000; @@ -509,7 +496,6 @@ padding: 10rpx; margin: 15rpx; } - .application_for_withdrawal_71 .btSubmit_button_select { float: left; color: #ff8000; @@ -523,7 +509,6 @@ padding: 10rpx; margin: 15rpx; } - .application_for_withdrawal_71 .btSubmit_title { float: left; }