Commit a62a68cc authored by zengqiang's avatar zengqiang

fix(withdraw): 处理微信确认收款回调结果

- 成功时跳转到处理状态页面 - 用户取消时显示Toast提示 - 其他错误显示操作失败提示
parent e2ef00ab
...@@ -97,13 +97,15 @@ export default defineComponent({ ...@@ -97,13 +97,15 @@ export default defineComponent({
try { try {
// 调用原生方法唤起微信确认收款 // 调用原生方法唤起微信确认收款
await requestMerchantTransfer({ const result = await requestMerchantTransfer({
mchId: this.mchId, mchId: this.mchId,
appId: this.appId, appId: this.appId,
package: this.packageInfo package: this.packageInfo
}) })
// 跳转到处理状态页面 console.log('requestMerchantTransfer result:', result)
// 成功:跳转到处理状态页面
this.$router.replace({ this.$router.replace({
path: '/withdraw/processing-status', path: '/withdraw/processing-status',
query: { query: {
...@@ -112,9 +114,14 @@ export default defineComponent({ ...@@ -112,9 +114,14 @@ export default defineComponent({
amount: this.amount amount: this.amount
} }
}) })
} catch (error) { } catch (error: any) {
console.error('requestMerchantTransfer error:', error) console.error('requestMerchantTransfer error:', error)
Toast.fail('确认收款失败') // 用户取消
if (error.message === 'cancel') {
Toast('用户取消')
} else {
Toast.fail('操作失败')
}
} }
}, },
handleBack () { handleBack () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment