|
@@ -54,6 +54,7 @@
|
|
|
title: '温馨提示',
|
|
|
content: '亲,授权微信登录后才能正常使用小程序功能',
|
|
|
})
|
|
|
+ let that = this;
|
|
|
wx.getUserProfile({
|
|
|
desc: '获取用户信息',
|
|
|
success: (res) => {
|
|
@@ -75,14 +76,7 @@
|
|
|
let d = result.data;
|
|
|
d.time = Date.now() / 1000;
|
|
|
uni.setStorageSync('infoData', JSON.stringify(d))
|
|
|
-
|
|
|
- // 跳转到下一个页面
|
|
|
- // uni.switchTab({
|
|
|
- // url:'/pages/home/home'
|
|
|
- // })
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pages/diningList/diningList`
|
|
|
- });
|
|
|
+ that.initdining()
|
|
|
} else {
|
|
|
// 处理错误情况
|
|
|
}
|
|
@@ -96,7 +90,7 @@
|
|
|
"profilePhoto": res.userInfo.avatarUrl
|
|
|
}
|
|
|
console.log('userInfo', userInfo)
|
|
|
- this.$request('post', '/system/user/editSysUser',
|
|
|
+ that.$request('post', '/system/user/editSysUser',
|
|
|
userInfo, true)
|
|
|
},
|
|
|
fail: (error) => {
|
|
@@ -108,6 +102,45 @@
|
|
|
console.error('获取用户信息失败:', error);
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ //获取餐车信息
|
|
|
+ async initdining() {
|
|
|
+ const response = await this.$request('post', '/sale/diningCar/queryDiningCar', {
|
|
|
+ "isAsc": "desc",
|
|
|
+ "orderByColumn": "createTime"});
|
|
|
+ if(response.code == 200) {
|
|
|
+ let current;
|
|
|
+ if(response.rows.length > 0){
|
|
|
+ for(const item of response.rows){
|
|
|
+ if(item.defaultState == '2'){
|
|
|
+ current = item;
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(current) {
|
|
|
+ const carl = {
|
|
|
+ id: current.id,
|
|
|
+ customerPhone: current.customerPhone,
|
|
|
+ name: current.name,
|
|
|
+ openState: current.openState
|
|
|
+ }
|
|
|
+ uni.setStorageSync("carl", carl)
|
|
|
+ // 跳转到下一个页面
|
|
|
+ uni.switchTab({
|
|
|
+ url:'/pages/home/home'
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/diningList/diningList`
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ wx.showModal({
|
|
|
+ title: '温馨提示',
|
|
|
+ content: '系统异常!',
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|