|
|
@ -113,7 +113,7 @@ export default { |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
if (amount > this.walletData.balance) { |
|
|
|
if (amount > this.userInfo.balance) { |
|
|
|
this.amountError = '提现金额不能大于余额' |
|
|
|
return false |
|
|
|
} |
|
|
@ -181,22 +181,24 @@ export default { |
|
|
|
title: '提交中...' |
|
|
|
}) |
|
|
|
|
|
|
|
// 模拟提交过程 |
|
|
|
// setTimeout(() => { |
|
|
|
// uni.hideLoading() |
|
|
|
// uni.showToast({ |
|
|
|
// title: '提现申请已提交', |
|
|
|
// icon: 'success' |
|
|
|
// }) |
|
|
|
|
|
|
|
// // 模拟余额变更 |
|
|
|
// this.walletData.balance -= parseFloat(this.withdrawAmount) |
|
|
|
// // 清空表单 |
|
|
|
// this.withdrawAmount = '' |
|
|
|
// this.realName = '' |
|
|
|
|
|
|
|
// this.isFormValid = true |
|
|
|
// }, 1500) |
|
|
|
// 提现 |
|
|
|
this.$api('cashout', { transferAmount: this.withdrawAmount, userName: this.realName }, res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.code === 200) { |
|
|
|
uni.showToast({ |
|
|
|
title: '提现成功', |
|
|
|
icon: 'success' |
|
|
|
}) |
|
|
|
this.$store.commit('getUserInfo') |
|
|
|
this.withdrawAmount = '' |
|
|
|
this.realName = '' |
|
|
|
}else { |
|
|
|
uni.showToast({ |
|
|
|
title: res.message, |
|
|
|
icon: 'error' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
recharge() { |
|
|
@ -228,15 +230,6 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
// 模拟重置时间 |
|
|
|
// setTimeout(() => { |
|
|
|
// // 模拟余额变更 |
|
|
|
// this.walletData.balance += parseFloat(this.rechargeAmount) |
|
|
|
// // 重置表单 |
|
|
|
// this.rechargeAmount = '' |
|
|
|
// this.isRecharge = false |
|
|
|
// }, 1500) |
|
|
|
} |
|
|
|
}, |
|
|
|
fail: (err) => { |
|
|
|