|
|
@ -137,14 +137,14 @@ |
|
|
<input type="text" v-model="aliName" placeholder="请输入姓名" /> |
|
|
<input type="text" v-model="aliName" placeholder="请输入姓名" /> |
|
|
</view> |
|
|
</view> |
|
|
<view class="popup-field"> |
|
|
<view class="popup-field"> |
|
|
<text>支付宝认证手机号</text> |
|
|
<text>支付宝账号</text> |
|
|
<input type="digit" v-model="aliAccount" placeholder="请输入手机号" /> |
|
|
<input type="text" v-model.trim="aliAccount" maxlength="64" placeholder="请输入手机号或邮箱" /> |
|
|
</view> |
|
|
</view> |
|
|
<view class="popup-field"> |
|
|
<view class="popup-field"> |
|
|
<text>提现金额</text> |
|
|
<text>提现金额</text> |
|
|
<input type="digit" v-model="commionAmount" placeholder="请输入金额" /> |
|
|
<input type="digit" v-model="commionAmount" placeholder="请输入金额" /> |
|
|
</view> |
|
|
</view> |
|
|
<view class="popup-btn" :style="{opacity: submittingWithdraw ? 0.6 : 1}" @tap="wxPayment"> |
|
|
<view class="popup-btn" :class="{disabled: submittingWithdraw}" :style="{opacity: submittingWithdraw ? 0.6 : 1}" @tap="wxPayment"> |
|
|
{{submittingWithdraw ? '提现中...' : '确认提现'}} |
|
|
{{submittingWithdraw ? '提现中...' : '确认提现'}} |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -186,6 +186,8 @@ |
|
|
balanceShop:[], |
|
|
balanceShop:[], |
|
|
submittingWithdraw: false, |
|
|
submittingWithdraw: false, |
|
|
withdrawRequestId: '', |
|
|
withdrawRequestId: '', |
|
|
|
|
|
withdrawClickLocked: false, |
|
|
|
|
|
withdrawClickTimer: null, |
|
|
showBalance: true, |
|
|
showBalance: true, |
|
|
resolvingSettlementOrderId: false, |
|
|
resolvingSettlementOrderId: false, |
|
|
skipWalletRefreshOnShow: false, |
|
|
skipWalletRefreshOnShow: false, |
|
|
@ -267,6 +269,11 @@ |
|
|
this.searchForm.pageNum+=1; |
|
|
this.searchForm.pageNum+=1; |
|
|
this.rewardList(); |
|
|
this.rewardList(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
beforeDestroy() { |
|
|
|
|
|
if (this.withdrawClickTimer) { |
|
|
|
|
|
clearTimeout(this.withdrawClickTimer) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
beginData(){ |
|
|
beginData(){ |
|
|
this.tui.request("/worker/getAllDepo/", "GET", {userId:uni.getStorageSync('id')}, false, true).then((res) => { |
|
|
this.tui.request("/worker/getAllDepo/", "GET", {userId:uni.getStorageSync('id')}, false, true).then((res) => { |
|
|
@ -295,6 +302,7 @@ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
userCommion(type,commion,item){ |
|
|
userCommion(type,commion,item){ |
|
|
|
|
|
if (!this.lockWithdrawClick()) return |
|
|
const withdrawAmount = Number(commion) || 0 |
|
|
const withdrawAmount = Number(commion) || 0 |
|
|
if(type=='user'){ |
|
|
if(type=='user'){ |
|
|
this.commionUrl = '/app/returnCommission/handleReturnUser' |
|
|
this.commionUrl = '/app/returnCommission/handleReturnUser' |
|
|
@ -314,6 +322,18 @@ |
|
|
createWithdrawRequestId(){ |
|
|
createWithdrawRequestId(){ |
|
|
return `${Date.now()}${Math.floor(Math.random() * 1000000)}` |
|
|
return `${Date.now()}${Math.floor(Math.random() * 1000000)}` |
|
|
}, |
|
|
}, |
|
|
|
|
|
lockWithdrawClick(){ |
|
|
|
|
|
if (this.withdrawClickLocked) return false |
|
|
|
|
|
this.withdrawClickLocked = true |
|
|
|
|
|
if (this.withdrawClickTimer) { |
|
|
|
|
|
clearTimeout(this.withdrawClickTimer) |
|
|
|
|
|
} |
|
|
|
|
|
this.withdrawClickTimer = setTimeout(() => { |
|
|
|
|
|
this.withdrawClickLocked = false |
|
|
|
|
|
this.withdrawClickTimer = null |
|
|
|
|
|
}, 800) |
|
|
|
|
|
return true |
|
|
|
|
|
}, |
|
|
syncActiveWallet(){ |
|
|
syncActiveWallet(){ |
|
|
if (this.targetWalletType) { |
|
|
if (this.targetWalletType) { |
|
|
const targetIndex = this.walletTabs.findIndex(tab => tab.key === this.targetWalletType) |
|
|
const targetIndex = this.walletTabs.findIndex(tab => tab.key === this.targetWalletType) |
|
|
@ -375,6 +395,7 @@ |
|
|
}, |
|
|
}, |
|
|
wxPayment(){ |
|
|
wxPayment(){ |
|
|
let that = this |
|
|
let that = this |
|
|
|
|
|
if (!this.lockWithdrawClick()) return |
|
|
if (this.submittingWithdraw) { |
|
|
if (this.submittingWithdraw) { |
|
|
that.tui.toast('提现处理中,请勿重复提交') |
|
|
that.tui.toast('提现处理中,请勿重复提交') |
|
|
return |
|
|
return |
|
|
@ -393,20 +414,26 @@ |
|
|
that.tui.toast('提现金额不能超过可提现金额') |
|
|
that.tui.toast('提现金额不能超过可提现金额') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if(!this.aliName){ |
|
|
const aliName = (this.aliName || '').trim() |
|
|
|
|
|
const aliAccount = (this.aliAccount || '').trim() |
|
|
|
|
|
if(!aliName){ |
|
|
that.tui.toast('支付宝实名名称不能为空') |
|
|
that.tui.toast('支付宝实名名称不能为空') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if(!this.aliAccount){ |
|
|
if(!aliAccount){ |
|
|
that.tui.toast('支付宝手机号不能为空') |
|
|
that.tui.toast('支付宝账号不能为空') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if(!this.isValidAliAccount(aliAccount)){ |
|
|
|
|
|
that.tui.toast('支付宝账号需为手机号或邮箱') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
this.submittingWithdraw = true |
|
|
this.submittingWithdraw = true |
|
|
let data = { |
|
|
let data = { |
|
|
id:this.withdrawRequestId || this.createWithdrawRequestId(), |
|
|
id:this.withdrawRequestId || this.createWithdrawRequestId(), |
|
|
commission:amount, |
|
|
commission:amount, |
|
|
aliName:this.aliName, |
|
|
aliName:aliName, |
|
|
aliAccount:this.aliAccount |
|
|
aliAccount:aliAccount |
|
|
} |
|
|
} |
|
|
if(this.commionType == 'user'){ |
|
|
if(this.commionType == 'user'){ |
|
|
data.userId = this.balanceUser.id |
|
|
data.userId = this.balanceUser.id |
|
|
@ -417,12 +444,13 @@ |
|
|
} |
|
|
} |
|
|
that.tui.request(this.commionUrl, "POST", data, false, false).then((res) => { |
|
|
that.tui.request(this.commionUrl, "POST", data, false, false).then((res) => { |
|
|
that.loadStatus = 'nomore'; |
|
|
that.loadStatus = 'nomore'; |
|
|
if (res.code == 200) { |
|
|
const failMessage = that.getWithdrawErrorMessage(res) |
|
|
|
|
|
if (res.code == 200 && !failMessage) { |
|
|
this.$refs.payPopup.close(); |
|
|
this.$refs.payPopup.close(); |
|
|
this.withdrawRequestId = '' |
|
|
this.withdrawRequestId = '' |
|
|
this.beginData(); |
|
|
this.beginData(); |
|
|
} else { |
|
|
} else { |
|
|
that.tui.toast(res.message) |
|
|
that.tui.toast(failMessage || '提现失败,请稍后再试') |
|
|
that.submittingWithdraw = false |
|
|
that.submittingWithdraw = false |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
@ -430,9 +458,23 @@ |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
}).catch((res) => { |
|
|
}).catch((res) => { |
|
|
that.submittingWithdraw = false |
|
|
that.submittingWithdraw = false |
|
|
that.tui.toast(res.message) |
|
|
that.tui.toast(that.getWithdrawErrorMessage(res) || '提现失败,请稍后再试') |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
isValidAliAccount(account){ |
|
|
|
|
|
const value = (account || '').trim() |
|
|
|
|
|
const phoneReg = /^1[3-9]\d{9}$/ |
|
|
|
|
|
const emailReg = /^[^\s@]+@[^\s@]+\.[^\s@]+$/ |
|
|
|
|
|
return phoneReg.test(value) || emailReg.test(value) |
|
|
|
|
|
}, |
|
|
|
|
|
getWithdrawErrorMessage(res){ |
|
|
|
|
|
if (!res) return '' |
|
|
|
|
|
const message = res.message || res.msg || '' |
|
|
|
|
|
const result = res.result || {} |
|
|
|
|
|
const reason = result.failMessage || result.remark || message |
|
|
|
|
|
if (res.code != 200 || res.success === false) return reason |
|
|
|
|
|
return /失败|异常/.test(message) ? reason : '' |
|
|
|
|
|
}, |
|
|
chooseLinkId(type,item){ |
|
|
chooseLinkId(type,item){ |
|
|
if(type == 'user'){ |
|
|
if(type == 'user'){ |
|
|
this.linkId = this.balanceUser.id |
|
|
this.linkId = this.balanceUser.id |
|
|
@ -1375,6 +1417,10 @@ |
|
|
transition: transform 0.16s ease; |
|
|
transition: transform 0.16s ease; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.popup-btn.disabled { |
|
|
|
|
|
pointer-events: none; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/* ---------- 动画 ---------- */ |
|
|
/* ---------- 动画 ---------- */ |
|
|
.enter-card { |
|
|
.enter-card { |
|
|
animation: cardIn 0.46s ease both; |
|
|
animation: cardIn 0.46s ease both; |
|
|
|