tianyi 1 month ago
parent
commit
f86f9ab3cb
  1. 65
      pages/shop/wallet.vue

65
pages/shop/wallet.vue

@ -256,7 +256,10 @@
this.syncActiveWallet()
this.$forceUpdate();
} else {
this.tui.toast(res.message)
uni.showToast({
title: res.message,
icon: 'none'
})
}
uni.hideLoading()
})
@ -370,35 +373,56 @@
let that = this
if (!this.lockWithdrawClick()) return
if (this.submittingWithdraw) {
that.tui.toast('提现处理中,请勿重复提交')
uni.showToast({
title: '提现处理中,请勿重复提交',
icon: 'none'
})
return
}
const amount = Number(this.commionAmount)
const maxAmount = Number(this.withdrawMaxAmount) || 0
if(!amount || amount < 1){
that.tui.toast('提现金额不能小于1元')
uni.showToast({
title: '提现金额不能小于1元',
icon: 'none'
})
return
}
if(amount > 5000){
that.tui.toast('单笔提现金额不能超过5000元')
uni.showToast({
title: '单笔提现金额不能超过5000元',
icon: 'none'
})
return
}
if(amount > maxAmount){
that.tui.toast('提现金额不能超过可提现金额')
uni.showToast({
title: '提现金额不能超过可提现金额',
icon: 'none'
})
return
}
const aliName = (this.aliName || '').trim()
const aliAccount = (this.aliAccount || '').trim()
if(!aliName){
that.tui.toast('支付宝实名名称不能为空')
uni.showToast({
title: '支付宝实名名称不能为空',
icon: 'none'
})
return
}
if(!aliAccount){
that.tui.toast('支付宝账号不能为空')
uni.showToast({
title: '支付宝账号不能为空',
icon: 'none'
})
return
}
if(!this.isValidAliAccount(aliAccount)){
that.tui.toast('支付宝账号需为手机号或邮箱')
uni.showToast({
title: '支付宝账号需为手机号或邮箱',
icon: 'none'
})
return
}
this.submittingWithdraw = true
@ -423,13 +447,19 @@
that.beginData();
} else {
that.closeWithdrawPopup()
that.tui.toast(failMessage || '提现失败,请稍后再试', 2500)
uni.showToast({
title: failMessage || '提现失败,请稍后再试',
icon: 'none'
})
return
}
uni.hideLoading()
}).catch((res) => {
that.closeWithdrawPopup()
that.tui.toast(that.getWithdrawErrorMessage(res) || '提现失败,请稍后再试', 2500)
uni.showToast({
title: that.getWithdrawErrorMessage(res) || '提现失败,请稍后再试',
icon: 'none'
})
})
},
isValidAliAccount(account){
@ -535,11 +565,17 @@
}
})
} else {
this.tui.toast(res.message || '未找到关联订单')
uni.showToast({
title: res.message || '未找到关联订单',
icon: 'none'
})
}
this.resolvingSettlementOrderId = false
}).catch((res) => {
this.tui.toast(res && res.message ? res.message : '未找到关联订单')
uni.showToast({
title: res && res.message ? res.message : '未找到关联订单',
icon: 'none'
})
this.resolvingSettlementOrderId = false
})
},
@ -563,7 +599,10 @@
}
that.$forceUpdate()
} else {
that.tui.toast(res.message)
uni.showToast({
title: res.message,
icon: 'none'
})
return
}
uni.hideLoading()

Loading…
Cancel
Save