From 02585f38aa696c99a8a3fcfc290ac1b78d6f1438 Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Mon, 25 Aug 2025 11:40:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=8F=90=E7=8E=B0=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/user/user.js | 5 +++- config/dev.js | 2 +- pages/requestWithdrawal/requestWithdrawal.vue | 27 ++++++++++--------- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/api/user/user.js b/api/user/user.js index 482d259..a941960 100644 --- a/api/user/user.js +++ b/api/user/user.js @@ -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) { diff --git a/config/dev.js b/config/dev.js index a348a6e..3ad287e 100644 --- a/config/dev.js +++ b/config/dev.js @@ -2,7 +2,7 @@ export const DEV_CONFIG = { // 临时token,用于开发测试 TEMP_TOKEN: - 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImY5YWQ3NGQzLWUyM2ItNDQxYy1iYTk2LWYxMDBhNzRmYWI4NyJ9.hAI6gDAp3PT6tu-x2VKGGCUI5HokC01eHdOsgPGTw1WIKyvbBQ7aPr7boG1aqTLswhTVgpunMNMHcdFZJXXRAA', + 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjAwMjdjYTRkLTMwOTktNDA4OC04ZTI2LTUzOTQwNGJkZDg0MyJ9.4zQ96QGHIvWy3cJciCPF0e8XWHY2NC9e9svrc9rqNKarnHhiqrAXZ2ZqMfN2AGbSVYVEs6OhUkkrEedupOXYGQ', // 是否使用临时token USE_TEMP_TOKEN: true, diff --git a/pages/requestWithdrawal/requestWithdrawal.vue b/pages/requestWithdrawal/requestWithdrawal.vue index f1e0970..0d41545 100644 --- a/pages/requestWithdrawal/requestWithdrawal.vue +++ b/pages/requestWithdrawal/requestWithdrawal.vue @@ -74,7 +74,7 @@ 实际到账: {{ withdrawInfo.actualAmount }}元 - 提现手续费: {{ fee }}元 + 提现手续费: {{ withdrawInfo.fee }}元 最小提现金额: {{ withdrawInfo.minAmount }}元 @@ -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 // 使用API返回的手续费或默认0元 - }, - }, + 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) {