描述:登录页面优化

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