接口顺序调整,会员充值调整

This commit is contained in:
GaoHao
2024-08-09 10:31:45 +08:00
parent 8ca9a73775
commit bf5460c304
6 changed files with 60 additions and 66 deletions

View File

@@ -409,40 +409,18 @@
uni.$off('message')
this.fixedtrue = true
},
onShow() {
async onShow() {
let _this = this;
this.orderdetailFlag = true;
uni.pageScrollTo({
scrollTop: 0,
duration: 0
});
uni.login({
provider: 'weixin',
success: async (data) => {
try {
uni.getUserInfo({
provider: 'weixin',
success: async (infoRes) => {
uni.cache.set('weixincode', data.code);
let res = await this.api.userwxlogin({
code: uni.cache.get('weixincode'), //临时登录凭证
rawData: infoRes.rawData
})
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);
uni.$on('message', this.getMessage)
_this.getLocation()
}
},
fail: (err) => {}
});
} catch (e) {}
}
});
if (!uni.cache.get('token')) {
await this.$onLaunched;
}
uni.$on('message', this.getMessage)
_this.getLocation()
},
methods: {
navigateBacknav() {