Commit f861fb64 by chenwq

```

feat(withdrawal): 添加积分分笔提现功能

- 新增分笔提现对话框相关数据状态
- 实现分笔提现逻辑判断和API调用
- 添加分笔提现样式和模板
```
1 parent 664bb912
...@@ -12,6 +12,8 @@ Page({ ...@@ -12,6 +12,8 @@ Page({
isConfig: true, isConfig: true,
showAuthDialog: false, showAuthDialog: false,
showConfirmDialog: false, showConfirmDialog: false,
showSplitWithdrawalDialog: false,
beforeSepWithdrawalScore: 0,
sumbitScore: '', sumbitScore: '',
disclaimerAgreementUrl: '', disclaimerAgreementUrl: '',
buttons: [{ buttons: [{
...@@ -26,6 +28,10 @@ Page({ ...@@ -26,6 +28,10 @@ Page({
text: '确认', text: '确认',
extClass: 'btn_primary' extClass: 'btn_primary'
}], }],
splitWithdrawalButtons: [{
text: '知道了',
extClass: 'btn_primary'
}],
score: '0', score: '0',
bankInfo: {}, bankInfo: {},
bankList: [] bankList: []
...@@ -207,6 +213,15 @@ Page({ ...@@ -207,6 +213,15 @@ Page({
}) })
return false return false
} }
const beforeSepWithdrawalScore = await this.getBeforeSepWithdrawalScore()
if (beforeSepWithdrawalScore === null) return false
if (beforeSepWithdrawalScore > 0 && Number(sumbitScore) !== beforeSepWithdrawalScore) {
this.setData({
showSplitWithdrawalDialog: true,
beforeSepWithdrawalScore
})
return false
}
wx.p.router.go('/packageIndex/pages/integral/withdrawalRules/withdrawalRules', { wx.p.router.go('/packageIndex/pages/integral/withdrawalRules/withdrawalRules', {
sumbitScore, sumbitScore,
disclaimerAgreementUrl, disclaimerAgreementUrl,
...@@ -221,6 +236,29 @@ Page({ ...@@ -221,6 +236,29 @@ Page({
return null return null
} }
}, },
async getBeforeSepWithdrawalScore() {
const {
phone,
channelSource,
merchantId
} = wx.p.storage.get('userInfo')
const params = {
staffPhone: phone,
channelSource,
merchantId
}
try {
const res = await wx.p.api.withdrawalApi.searchScoreSummary(params)
if (res.code == 0) {
return Number(res.data?.beforeSepWithdrawalScore || 0)
}
wx.p.wxApi.showToast(res.message || '系统异常')
return null
} catch (err) {
wx.p.wxApi.showToast(JSON.stringify(err))
return null
}
},
accSub(arg1, arg2) { accSub(arg1, arg2) {
let r1, r2, m, n; let r1, r2, m, n;
try { try {
...@@ -352,6 +390,15 @@ Page({ ...@@ -352,6 +390,15 @@ Page({
} }
}, },
splitWithdrawalConfirm() {
const {
beforeSepWithdrawalScore
} = this.data
this.setData({
showSplitWithdrawalDialog: false,
sumbitScore: beforeSepWithdrawalScore
})
},
onClose(e) { onClose(e) {
console.log(e) console.log(e)
}, },
......
...@@ -200,4 +200,15 @@ ...@@ -200,4 +200,15 @@
font-size: 28rpx; font-size: 28rpx;
color: #1B233D; color: #1B233D;
} }
.split-withdrawal-message {
margin: var(--fontSize20) 0 var(--fontSize30);
color: #666666;
text-align: center;
font-size: var(--fontSize28);
line-height: 44rpx;
}
.split-withdrawal-message .strong {
font-weight: 700;
color: #1B233D;
}
...@@ -52,5 +52,10 @@ ...@@ -52,5 +52,10 @@
<text catchtap="jump" data-url="privacy">《免责协议》</text> <text catchtap="jump" data-url="privacy">《免责协议》</text>
</view> </view>
</Dialog> </Dialog>
<Dialog show="{{ showSplitWithdrawalDialog }}" mask="true" bindbuttontap="splitWithdrawalConfirm" buttons="{{splitWithdrawalButtons}}" title="积分需分笔提现">
<view class="split-withdrawal-message">
<text>因支付系统升级,不同时段获取的积分需分开提现。请先</text><text class="strong">全额</text><text>提现9月1日前获取的</text><text class="strong">{{beforeSepWithdrawalScore}}</text><text>积分,再提现其余积分。</text>
</view>
</Dialog>
<picker-bank-card showBank="{{showBank}}" bankList="{{bankList}}" bindPickerChange="bindPickerChange"></picker-bank-card> <picker-bank-card showBank="{{showBank}}" bankList="{{bankList}}" bindPickerChange="bindPickerChange"></picker-bank-card>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!