|
@ -139,41 +139,14 @@ |
|
|
try { |
|
|
try { |
|
|
console.log('开始领取提现,item:', item) |
|
|
console.log('开始领取提现,item:', item) |
|
|
|
|
|
|
|
|
// 先确认是否要领取 |
|
|
|
|
|
const confirmResult = await new Promise((resolve) => { |
|
|
|
|
|
uni.showModal({ |
|
|
|
|
|
title: '确认领取', |
|
|
|
|
|
content: `确定要领取¥${item.amount}吗?`, |
|
|
|
|
|
success: (res) => { |
|
|
|
|
|
resolve(res.confirm) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
if (!confirmResult) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: '处理中...' |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 检查是否支持微信转账 |
|
|
// 检查是否支持微信转账 |
|
|
if (typeof wx === 'undefined' || !wx.canIUse('requestMerchantTransfer')) { |
|
|
if (typeof wx === 'undefined' || !wx.canIUse('requestMerchantTransfer')) { |
|
|
console.log('微信API不可用,尝试直接调用后端接口') |
|
|
|
|
|
// 如果微信API不可用,直接调用后端接口标记为已领取 |
|
|
|
|
|
const result = await withdrawalSuccessful({ |
|
|
|
|
|
id: item.id, |
|
|
|
|
|
userId: store.state.user.userInfo.userId |
|
|
|
|
|
}) |
|
|
|
|
|
console.log('withdrawalSuccessful result:', result) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log('微信API不可用') |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
|
|
|
|
|
|
if (result.code === 200) { |
|
|
if (result.code === 200) { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: '领取成功', |
|
|
|
|
|
icon: 'success', |
|
|
|
|
|
|
|
|
title: '领取失败,请将微信升级到最新版本', |
|
|
|
|
|
icon: 'icon', |
|
|
duration: 1500, |
|
|
duration: 1500, |
|
|
success() { |
|
|
success() { |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|