支付宝兼容,排队预约修改,订单逻辑修改

This commit is contained in:
GaoHao
2024-09-24 15:22:34 +08:00
parent 861e97b775
commit 5f03e44701
31 changed files with 823 additions and 737 deletions

View File

@@ -244,6 +244,7 @@ const getUserInfo = function (successCallback, failCallback) {
uni.login({
provider: 'weixin',
success: (data) => {
console.log(data)
// 微信小程序环境
uni.getUserInfo({
provider: 'weixin',
@@ -251,23 +252,14 @@ const getUserInfo = function (successCallback, failCallback) {
let res = await Api.userwxlogin({
code: data.code, //临时登录凭证
rawData: infoRes.rawData,
source: 'wechat'
})
if (res.code == 0) {
resolve(res)
// uni.cache.set('token', res.data.token);
// uni.cache.set('miniAppOpenId', res.data.userInfo
// .miniAppOpenId)
// uni.cache.set('userInfo', res.data.userInfo);
// let pages = getCurrentPages()
// let curPage = pages[pages.length -1 ]
// curPage.onLoad(curPage.options)
// curPage.onShow()
// // curPage.mounted()
// curPage.onReady()
}
},
fail: (err) => {}
});
});
}
});
@@ -279,30 +271,21 @@ const getUserInfo = function (successCallback, failCallback) {
my.getAuthCode({
scopes: 'auth_user',
success: (data) => {
console.log(data)
// 支付宝小程序环境
my.getAuthUserInfo({
success: async (infoRes) => {
uni.cache.set('weixincode', data.authCode);
let res = await Api.userwxlogin({
code: uni.cache.get('weixincode'), //临时登录凭证
rawData: JSON.stringify(infoRes),
})
if (res.code == 0) {
resolve(res)
// uni.cache.set('token', res.data.token);
// uni.cache.set('miniAppOpenId', res.data.userInfo
// .miniAppOpenId)
// uni.cache.set('userInfo', res.data.userInfo);
// let pages = getCurrentPages()
// let curPage = pages[pages.length -1 ]
// curPage.onLoad(curPage.options)
// curPage.onShow()
// // curPage.mounted()
// curPage.onReady()
}
},
fail: (err) => {}
});
// my.getAuthUserInfo({
// success: async (infoRes) => {
// let res = await Api.userwxlogin({
// code: data.authCode, //临时登录凭证
// rawData: JSON.stringify(infoRes),
// source: 'alipay'
// })
// if (res.code == 0) {
// resolve(res)
// }
// },
// fail: (err) => {}
// });
}
});
})