Browse Source

'提现待联调'

hfll
hflllll 2 days ago
parent
commit
7766ca01a2
1 changed files with 69 additions and 8 deletions
  1. +69
    -8
      pages_order/mine/wallet.vue

+ 69
- 8
pages_order/mine/wallet.vue View File

@ -185,19 +185,80 @@ export default {
this.$api('cashout', { transferAmount: this.withdrawAmount, userName: this.realName }, res => {
uni.hideLoading()
if (res.code === 200) {
uni.showToast({
title: '提现成功',
icon: 'success'
})
this.$store.commit('getUserInfo')
this.withdrawAmount = ''
this.realName = ''
//
if (res.result && res.result.state === 'WAIT_USER_CONFIRM' && res.result.packageInfo && res.result.outBillNo) {
//
if (!wx.canIUse('requestMerchantTransfer')) {
wx.showModal({
content: '你的微信版本过低,请更新至最新版本。',
showCancel: false,
});
return
}
//
const systemInfo = uni.getSystemInfoSync();
const isDevTools = systemInfo.platform === 'devtools';
if (isDevTools) {
//
console.log('开发者工具中无法调试此API,请在真机上测试');
uni.showModal({
title: '提示',
content: '当前在开发者工具中,无法调试支付相关API,请在真机上测试。',
showCancel: false,
success: () => {
// 便
this.$store.commit('getUserInfo')
this.withdrawAmount = ''
this.realName = ''
this.isFormValid = true
}
});
} else {
// API
wx.requestMerchantTransfer({
mchId: res.result.outBillNo,
appId: wx.getAccountInfoSync().miniProgram.appId,
package: res.result.packageInfo,
success: (res) => {
uni.showToast({
title: '提现申请已提交',
icon: 'success'
})
this.$store.commit('getUserInfo')
this.withdrawAmount = ''
this.realName = ''
},
fail: (res) => {
console.log('fail:', res);
uni.showToast({
title: '提现失败,请稍后再试',
icon: 'none'
})
this.isFormValid = true
},
complete: (res) => {
console.log('requestMerchantTransfer完成:', res);
}
});
}
} else {
uni.showToast({
title: '提现成功',
icon: 'success'
})
this.$store.commit('getUserInfo')
this.withdrawAmount = ''
this.realName = ''
}
}else {
uni.showToast({
title: res.message,
title: 'res.message',
icon: 'error'
})
}
this.isFormValid = true
})
},


Loading…
Cancel
Save