|
|
@@ -242,20 +242,38 @@ Page({
|
|
|
},
|
|
|
(res) => {
|
|
|
if (res.code === 0) {
|
|
|
+ if (!res.data.packageInfo) {
|
|
|
+ wx.showToast({
|
|
|
+ title: "该数据异常,请稍后重试",
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ setTimeout(() => {
|
|
|
+ _this.getWalletInfo();
|
|
|
+ _this.getWithdrawRecords();
|
|
|
+ }, 500);
|
|
|
+ return;
|
|
|
+ }
|
|
|
// console.log(res.data);
|
|
|
// 小程序前端代码示例
|
|
|
wx.requestMerchantTransfer({
|
|
|
mchId: res.data.mchId, // 商户号
|
|
|
appId: 'wx0ca047da2ecada85', // 小程序AppID
|
|
|
- package: res.data.package, // 后端返回的加密包
|
|
|
+ package: res.data.packageInfo, // 后端返回的加密包
|
|
|
success(res) {
|
|
|
- wx.showToast({
|
|
|
- title: "确认收款成功",
|
|
|
- icon: "success",
|
|
|
- });
|
|
|
- // 重新请求接口更新数据
|
|
|
- _this.getWalletInfo();
|
|
|
- _this.getWithdrawRecords();
|
|
|
+ // console.log("确认收款成功", res);
|
|
|
+ try {
|
|
|
+ wx.showToast({
|
|
|
+ title: "确认收款成功",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ _this.getWalletInfo();
|
|
|
+ _this.getWithdrawRecords();
|
|
|
+ // console.log("确认收款成功,刷新钱包信息和提现记录");
|
|
|
+ }, 1000);
|
|
|
},
|
|
|
fail(res) {
|
|
|
// 用户取消或网络错误
|