mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 04:59:37 +08:00
描述:登录页面优化
This commit is contained in:
parent
b637200487
commit
cc5bc281d0
@ -278,4 +278,20 @@ App({
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
selfShowMsg(content, url) {
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: content,
|
||||
confirmText: '确认',
|
||||
showCancel: false,
|
||||
success: res => {
|
||||
if (url) {
|
||||
wx.navigateTo({
|
||||
url
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
@ -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
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user