|
|
|
@ -97,19 +97,69 @@ |
|
|
|
transferAmount, |
|
|
|
} |
|
|
|
|
|
|
|
await this.$fetch('cashout', params) |
|
|
|
const result = await this.$fetch('cashout', params) |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
icon: 'success', |
|
|
|
title: '提交成功', |
|
|
|
console.log('cashout', result) |
|
|
|
|
|
|
|
// 拉起微信收款确认页面 |
|
|
|
if (!wx.canIUse('requestMerchantTransfer')) { |
|
|
|
wx.showModal({ |
|
|
|
content: '你的微信版本过低,请更新至最新版本。', |
|
|
|
showCancel: false, |
|
|
|
}); |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 在真机环境中,调用API |
|
|
|
wx.requestMerchantTransfer({ |
|
|
|
mchId: this.$config.mchId, |
|
|
|
appId: wx.getAccountInfoSync().miniProgram.appId, |
|
|
|
package: result.packageInfo, |
|
|
|
success: (res) => { |
|
|
|
uni.showToast({ |
|
|
|
title: '提现申请已提交', |
|
|
|
icon: 'success' |
|
|
|
}) |
|
|
|
this.form.transferAmount = null |
|
|
|
this.form.userName = null |
|
|
|
|
|
|
|
this.$api('getMoney', { |
|
|
|
id : result.outBillNo, |
|
|
|
}).then(res => { |
|
|
|
this.$store.commit('getUserInfo') |
|
|
|
this.$store.commit('getUserCenterData') |
|
|
|
}) |
|
|
|
}, |
|
|
|
fail: (res) => { |
|
|
|
console.log('fail:', res); |
|
|
|
uni.showToast({ |
|
|
|
title: '提现失败,请稍后再试', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
}, |
|
|
|
complete: (res) => { |
|
|
|
console.log('requestMerchantTransfer完成:', res); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// uni.showToast({ |
|
|
|
// icon: 'success', |
|
|
|
// title: '提交成功', |
|
|
|
// }); |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
this.$utils.navigateBack() |
|
|
|
}, 800) |
|
|
|
|
|
|
|
} catch (err) { |
|
|
|
console.log('onSave err', err) |
|
|
|
console.log('cashout err', err) |
|
|
|
const { message } = err |
|
|
|
|
|
|
|
message && uni.showToast({ |
|
|
|
icon: 'none', |
|
|
|
title: message, |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|