订单逻辑修改

This commit is contained in:
GaoHao
2024-09-26 09:20:08 +08:00
parent 5f03e44701
commit 1de598f1b1
16 changed files with 856 additions and 135 deletions

49
App.vue
View File

@@ -14,7 +14,9 @@
uni.cache.set('menuInfo', uni.getMenuButtonBoundingClientRect());
// #endif
uni.cache.set('NAME', '零点八零');
// this.$store.dispatch("loginEvent")
if (!uni.cache.get('token')) {
this.$store.dispatch("loginEvent")
}
},
onLoad() {
@@ -66,50 +68,7 @@
// console.log('App Hide');
},
methods: {
userlogin() {
if (!uni.cache.get('token')) {
// this.$store.dispatch("loginEvent"); //获取shapid
uni.login({
// #ifndef MP-WEIXIN
provider: 'weixin',
// #endif
// #ifndef MP-ALIPAY
provider: 'alipay',
// #endif
success: (data) => {
uni.getUserInfo({
// #ifndef MP-WEIXIN
provider: 'weixin',
// #endif
// #ifndef MP-ALIPAY
provider: 'alipay',
// #endif
success: async (infoRes) => {
console.log(infoRes)
let res = await Api.userwxlogin({
code: data.code, //临时登录凭证
rawData: infoRes.rawData,
// #ifdef MP-WEIXIN
source: 'wechat',
// #endif
// #ifdef MP-ALIPAY
source: 'alipay',
// #endif
})
if (res.code == 0) {
uni.cache.set('token', res.data.token);
uni.cache.set('miniAppOpenId', res.data.userInfo
.miniAppOpenId)
uni.cache.set('userInfo', res.data.userInfo);
this.$isResolve()
}
},
fail: (err) => {}
});
},
})
}
}
}
};
</script>