申请提现功能完善

This commit is contained in:
WindowBird 2025-08-25 11:40:20 +08:00
parent 4ae27f7ae2
commit 02585f38aa
3 changed files with 19 additions and 15 deletions

View File

@ -190,7 +190,10 @@ export function computedServiceAmount(amount) {
* 提交提现申请
* @param {Object} data 提现数据
* @param {number} data.amount 提现金额
* @param {string} data.bankId 银行ID
* @param {string} data.accountId 账号id
* @param {string} data.serviceType 服务类型
* @param {string} data.serviceCharge 服务费
* @param {string} data.arrivalAmount 实际到达金额
* @returns {Promise} 返回提现申请结果
*/
export function submitWithdraw(data) {

View File

@ -2,7 +2,7 @@
export const DEV_CONFIG = {
// 临时token用于开发测试
TEMP_TOKEN:
'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImY5YWQ3NGQzLWUyM2ItNDQxYy1iYTk2LWYxMDBhNzRmYWI4NyJ9.hAI6gDAp3PT6tu-x2VKGGCUI5HokC01eHdOsgPGTw1WIKyvbBQ7aPr7boG1aqTLswhTVgpunMNMHcdFZJXXRAA',
'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjAwMjdjYTRkLTMwOTktNDA4OC04ZTI2LTUzOTQwNGJkZDg0MyJ9.4zQ96QGHIvWy3cJciCPF0e8XWHY2NC9e9svrc9rqNKarnHhiqrAXZ2ZqMfN2AGbSVYVEs6OhUkkrEedupOXYGQ',
// 是否使用临时token
USE_TEMP_TOKEN: true,

View File

@ -74,7 +74,7 @@
<text>实际到账: {{ withdrawInfo.actualAmount }}</text>
</view>
<view class="explanation-item">
<text>提现手续费: {{ fee }}</text>
<text>提现手续费: {{ withdrawInfo.fee }}</text>
</view>
<view class="explanation-item">
<text>最小提现金额: {{ withdrawInfo.minAmount }}</text>
@ -123,7 +123,10 @@ export default {
},
withdrawalData: {
amount: '',
bankId: '',
accountId: '',
serviceType: '',
serviceCharge: '',
arrivalAmount: '',
},
selectedBank: {
id: '',
@ -139,12 +142,7 @@ export default {
showDeleteModal: false,
}
},
computed: {
fee() {
const amount = parseFloat(this.withdrawalData.amount) || 0
return this.withdrawInfo.fee || 0 // 使API0
},
},
computed: {},
onLoad() {
this.fetchWithdrawInfo()
this.fetchUserBankList()
@ -195,7 +193,7 @@ export default {
//
if (this.userBankList.length > 0) {
this.selectedBank = this.userBankList[0]
this.withdrawalData.bankId = this.selectedBank.id
this.withdrawalData.accountId = this.selectedBank.id
console.log('设置默认账号:', this.selectedBank)
} else {
console.log('没有找到账号,显示空状态')
@ -302,7 +300,7 @@ export default {
success: res => {
const selectedBank = this.userBankList[res.tapIndex]
this.selectedBank = selectedBank
this.withdrawalData.bankId = selectedBank.id
this.withdrawalData.accountId = selectedBank.id
console.log('选择账号:', selectedBank)
},
})
@ -316,7 +314,7 @@ export default {
return
}
if (!this.withdrawalData.bankId) {
if (!this.withdrawalData.accountId) {
uni.showToast({
title: '请选择提现账号',
icon: 'none',
@ -361,8 +359,11 @@ export default {
this.loading = true
try {
const response = await submitWithdraw({
amount: amount,
bankId: this.withdrawalData.bankId,
amount: this.withdrawalData.amount,
accountId: this.selectedBank.id,
serviceType: '1',
serviceCharge: this.withdrawInfo.fee,
arrivalAmount: this.withdrawInfo.actualAmount,
})
if (response.code === 200) {