更新详情

This commit is contained in:
魏啾
2024-06-19 17:11:23 +08:00
parent cba4e6065e
commit 802cc2d721
9 changed files with 223 additions and 214 deletions

View File

@@ -133,12 +133,12 @@
onLoad(e) {
console.log(e,'调试1')
try {
this.types = e.types
} catch (e) {
//TODO handle the exception
}
// console.log(e, '调试1')
// try {
// this.types = e.types
// } catch (e) {
// //TODO handle the exception
// }
// #ifdef APP-PLUS || H5
this.showbox = true
// #endif
@@ -285,7 +285,7 @@
uni.cache.set('miniAppOpenId', res.data.userInfo
.miniAppOpenId)
uni.cache.set('userInfo', res.data.userInfo);
if (this.types == 0) {
if (uni.cache.get('types') == 'types') {
uni.reLaunch({
url: '/pages/order_food/order_food'
});
@@ -319,42 +319,51 @@
// },
async userlogin(reslange) {
var resdataa = reslange
// #ifdef MP-WEIXIN
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,
signature: infoRes.signature,
iv: resdataa.detail.iv,
encryptedData: resdataa.detail.encryptedData
})
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);
if (this.types == 0) {
uni.reLaunch({
url: '/pages/order_food/order_food'
});
} else {
uni.pro.switchTab('index/index')
if (resdataa.detail.iv) {
// #ifdef MP-WEIXIN
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,
signature: infoRes.signature,
iv: resdataa.detail.iv,
encryptedData: resdataa.detail
.encryptedData
})
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);
if (uni.cache.get('types') == 'types') {
uni.reLaunch({
url: '/pages/order_food/order_food'
});
} else {
uni.pro.switchTab('index/index')
}
}
}
},
fail: (err) => {}
});
} catch (e) {}
}
});
// #endif
},
fail: (err) => {}
});
} catch (e) {}
}
});
// #endif
} else {
uni.showToast({
title: '获取手机号失败!请重新获取',
icon: 'none'
});
}
},
}
};
@@ -369,12 +378,12 @@
.container {
// position: relative;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
overflow: hidden;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
overflow: hidden;
.top {
position: absolute;
@@ -392,6 +401,7 @@
left: 50%;
z-index: 22;
transform: translateX(-50%);
image {
width: 128rpx;
height: 128rpx;
@@ -507,6 +517,7 @@
background: #ffffff;
border-radius: 40rpx 40rpx 0px 0px;
top: 220rpx;
.top_box_one {
position: relative;
width: 100%;