申请提现功能完善
This commit is contained in:
parent
4ae27f7ae2
commit
02585f38aa
|
|
@ -190,7 +190,10 @@ export function computedServiceAmount(amount) {
|
||||||
* 提交提现申请
|
* 提交提现申请
|
||||||
* @param {Object} data 提现数据
|
* @param {Object} data 提现数据
|
||||||
* @param {number} data.amount 提现金额
|
* @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} 返回提现申请结果
|
* @returns {Promise} 返回提现申请结果
|
||||||
*/
|
*/
|
||||||
export function submitWithdraw(data) {
|
export function submitWithdraw(data) {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
export const DEV_CONFIG = {
|
export const DEV_CONFIG = {
|
||||||
// 临时token,用于开发测试
|
// 临时token,用于开发测试
|
||||||
TEMP_TOKEN:
|
TEMP_TOKEN:
|
||||||
'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImY5YWQ3NGQzLWUyM2ItNDQxYy1iYTk2LWYxMDBhNzRmYWI4NyJ9.hAI6gDAp3PT6tu-x2VKGGCUI5HokC01eHdOsgPGTw1WIKyvbBQ7aPr7boG1aqTLswhTVgpunMNMHcdFZJXXRAA',
|
'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjAwMjdjYTRkLTMwOTktNDA4OC04ZTI2LTUzOTQwNGJkZDg0MyJ9.4zQ96QGHIvWy3cJciCPF0e8XWHY2NC9e9svrc9rqNKarnHhiqrAXZ2ZqMfN2AGbSVYVEs6OhUkkrEedupOXYGQ',
|
||||||
|
|
||||||
// 是否使用临时token
|
// 是否使用临时token
|
||||||
USE_TEMP_TOKEN: true,
|
USE_TEMP_TOKEN: true,
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
<text>实际到账: {{ withdrawInfo.actualAmount }}元</text>
|
<text>实际到账: {{ withdrawInfo.actualAmount }}元</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="explanation-item">
|
<view class="explanation-item">
|
||||||
<text>提现手续费: {{ fee }}元</text>
|
<text>提现手续费: {{ withdrawInfo.fee }}元</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="explanation-item">
|
<view class="explanation-item">
|
||||||
<text>最小提现金额: {{ withdrawInfo.minAmount }}元</text>
|
<text>最小提现金额: {{ withdrawInfo.minAmount }}元</text>
|
||||||
|
|
@ -123,7 +123,10 @@ export default {
|
||||||
},
|
},
|
||||||
withdrawalData: {
|
withdrawalData: {
|
||||||
amount: '',
|
amount: '',
|
||||||
bankId: '',
|
accountId: '',
|
||||||
|
serviceType: '',
|
||||||
|
serviceCharge: '',
|
||||||
|
arrivalAmount: '',
|
||||||
},
|
},
|
||||||
selectedBank: {
|
selectedBank: {
|
||||||
id: '',
|
id: '',
|
||||||
|
|
@ -139,12 +142,7 @@ export default {
|
||||||
showDeleteModal: false,
|
showDeleteModal: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {},
|
||||||
fee() {
|
|
||||||
const amount = parseFloat(this.withdrawalData.amount) || 0
|
|
||||||
return this.withdrawInfo.fee || 0 // 使用API返回的手续费或默认0元
|
|
||||||
},
|
|
||||||
},
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.fetchWithdrawInfo()
|
this.fetchWithdrawInfo()
|
||||||
this.fetchUserBankList()
|
this.fetchUserBankList()
|
||||||
|
|
@ -195,7 +193,7 @@ export default {
|
||||||
// 如果有账号,设置默认选中的账号
|
// 如果有账号,设置默认选中的账号
|
||||||
if (this.userBankList.length > 0) {
|
if (this.userBankList.length > 0) {
|
||||||
this.selectedBank = this.userBankList[0]
|
this.selectedBank = this.userBankList[0]
|
||||||
this.withdrawalData.bankId = this.selectedBank.id
|
this.withdrawalData.accountId = this.selectedBank.id
|
||||||
console.log('设置默认账号:', this.selectedBank)
|
console.log('设置默认账号:', this.selectedBank)
|
||||||
} else {
|
} else {
|
||||||
console.log('没有找到账号,显示空状态')
|
console.log('没有找到账号,显示空状态')
|
||||||
|
|
@ -302,7 +300,7 @@ export default {
|
||||||
success: res => {
|
success: res => {
|
||||||
const selectedBank = this.userBankList[res.tapIndex]
|
const selectedBank = this.userBankList[res.tapIndex]
|
||||||
this.selectedBank = selectedBank
|
this.selectedBank = selectedBank
|
||||||
this.withdrawalData.bankId = selectedBank.id
|
this.withdrawalData.accountId = selectedBank.id
|
||||||
console.log('选择账号:', selectedBank)
|
console.log('选择账号:', selectedBank)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
@ -316,7 +314,7 @@ export default {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.withdrawalData.bankId) {
|
if (!this.withdrawalData.accountId) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请选择提现账号',
|
title: '请选择提现账号',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
|
|
@ -361,8 +359,11 @@ export default {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
try {
|
try {
|
||||||
const response = await submitWithdraw({
|
const response = await submitWithdraw({
|
||||||
amount: amount,
|
amount: this.withdrawalData.amount,
|
||||||
bankId: this.withdrawalData.bankId,
|
accountId: this.selectedBank.id,
|
||||||
|
serviceType: '1',
|
||||||
|
serviceCharge: this.withdrawInfo.fee,
|
||||||
|
arrivalAmount: this.withdrawInfo.actualAmount,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user