描述:登录页面优化

This commit is contained in:
SelfRidicule 2024-04-18 09:19:46 +08:00
parent b637200487
commit cc5bc281d0
2 changed files with 34 additions and 16 deletions

View File

@ -278,4 +278,20 @@ App({
}
})
},
selfShowMsg(content, url) {
wx.showModal({
title: '提示',
content: content,
confirmText: '确认',
showCancel: false,
success: res => {
if (url) {
wx.navigateTo({
url
})
}
}
})
},
})

View File

@ -185,22 +185,24 @@ Page({
if (userId) {
getUserInfoRq(userId).then(res => {
console.log('getUserInfoRq', res);
let userDetail = res.data;
// 存储用户信息
wx.setStorageSync('openid', userDetail.openid)
wx.setStorageSync('user', userDetail)
wx.setStorageSync('userId', userDetail.id)
_this.setData({
userDetail
})
// 登录用户是否选择园区
_this.userIsPark()
if (res.code == 0) {
let userDetail = res.data;
// 存储用户信息
wx.setStorageSync('openid', userDetail.openid)
wx.setStorageSync('user', userDetail)
wx.setStorageSync('userId', userDetail.id)
_this.setData({
userDetail
})
// 登录用户是否选择园区
_this.userIsPark()
} else {
app.selfShowMsg(res.msg, '/pages/login/login')
}
})
} else {
app.getlogin()
return
app.selfShowMsg('请登录账号', '/pages/login/login')
}
},
// 登录用户是否选择园区
@ -211,9 +213,9 @@ Page({
_this.setData({
parkName: wx.getStorageSync('parkName')
})
getParkRq(parkId).then(res=>{
console.log('getParkRq' , res);
let bannerList = res.bannerImages.map(item=>item.url)
getParkRq(parkId).then(res => {
console.log('getParkRq', res);
let bannerList = res.bannerImages.map(item => item.url)
_this.setData({
bannerList
})