feat: 支付
This commit is contained in:
@@ -275,6 +275,23 @@ export default {
|
||||
category: 'balance',
|
||||
payway: this.curSelect == '0' ? 'wechat' : 'alipay'
|
||||
}
|
||||
if (params.payway == "wechat") {
|
||||
// #ifdef MP-WEIXIN
|
||||
params["payway"] = "wechatMiniProgram";
|
||||
params["code"] = await new Promise((resolve) => {
|
||||
uni.login({
|
||||
provider: "weixin",
|
||||
onlyAuthorize: true,
|
||||
success: function (loginRes) {
|
||||
resolve(loginRes.code);
|
||||
},
|
||||
fail: (err) => {
|
||||
resolve(""); // 登录失败时返回空字符串,避免后续流程中断
|
||||
},
|
||||
});
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
recharge(params).then(result => {
|
||||
if (result && result.bizcode === 100) {
|
||||
const item = result.data;
|
||||
|
||||
Reference in New Issue
Block a user