【前端模版】修复APP付费会员支付问题

This commit is contained in:
evoxwht 2022-03-29 12:25:36 +08:00
parent 8445111aab
commit e407201253

View File

@ -170,14 +170,17 @@
value: 'weixin',
title: '微信快捷支付',
payStatus: true
},
}
// #ifdef H5 ||APP-PLUS
,
{
name: '支付宝支付',
icon: 'icon-zhifubao',
value: 'alipay',
title: '支付宝支付',
payStatus: true
}
},
// #endif
],
pay_close: false,
totalPrice: '0',
@ -330,7 +333,9 @@
pay_weixin_open
} = res.data;
this.payMode[0].payStatus = pay_weixin_open === 1 ? true : false;
this.payMode[1].payStatus = ali_pay_status == 1 ? true : false;
// #ifdef APP-PLUS || H5
this.payMode[1].payStatus = !!ali_pay_status;
// #endif
//#ifdef MP
this.payMode[1].payStatus = false;
//#endif
@ -410,6 +415,9 @@
// #ifdef MP
from: 'routine',
// #endif
// #ifdef APP-PLUS
from: 'app',
// #endif
member_type: this.svip.type,
mc_id: this.mc_id,
price: this.svip.pre_price,
@ -520,7 +528,7 @@
}
});
// #endif
// #ifndef MP
// #ifdef H5
this.$wechat.pay(result.jsConfig).then(res => {
this.$util.Tips({
title: '支付成功',
@ -538,6 +546,31 @@
}
});
// #endif
// #ifdef APP-PLUS
uni.requestPayment({
provider: 'wxpay',
orderInfo: jsConfig,
success: (e) => {
uni.showToast({
title: "支付成功"
})
setTimeout(res => {
uni.navigateBack()
}, 2000)
},
fail: (e) => {
uni.showToast({
title: "支付失败",
icon: 'none',
duration: 2000
})
},
complete: () => {
uni.hideLoading();
},
});
// #endif
break;
case 'WECHAT_H5_PAY':
uni.showToast({
@ -567,6 +600,35 @@
url: `/pages/users/alipay_invoke/index?id=${data.data.result.order_id}&link=${jsConfig.qrCode}&from=member`
});
// #endif
// #ifdef APP-PLUS
uni.requestPayment({
provider: 'alipay',
orderInfo: jsConfig,
success: (e) => {
uni.showToast({
title: "支付成功"
})
setTimeout(res => {
uni.navigateBack()
}, 2000)
},
fail: (e) => {
uni.showModal({
content: "支付失败",
showCancel: false,
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {}
}
})
},
complete: () => {
uni.hideLoading();
},
});
// #endif
break;
}
},