Browse Source

页面登录逻辑修改

epass
mk 2 months ago
parent
commit
9b2b0730c3
  1. 50
      pages/index/index.js
  2. 13
      project.private.config.json

50
pages/index/index.js

@ -52,7 +52,8 @@ Page({
], ],
searchValue: "", searchValue: "",
policyList:[],//政策列表 policyList:[],//政策列表
getUserInfo:{} getUserInfo:{},
bindPhone:false
}, },
/** /**
@ -63,8 +64,11 @@ Page({
this.setData({ this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight, statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight, navigationHeight: app.globalData.deviceInfo.navigationHeight,
}); });
this.init()
},
init(){
this.login()
}, },
login() { login() {
const that = this const that = this
@ -75,14 +79,12 @@ Page({
code: res.code code: res.code
}).then(res => { }).then(res => {
wx.setStorageSync('token',res.data.token) wx.setStorageSync('token',res.data.token)
if(res.data.bindPhone){
wx.redirectTo({
url: '/pages/register/register',
})
}
that.getPolicyList()
that.getMessage()
that.getUserInfo() that.getUserInfo()
that.setData({
bindPhone:res.data.bindPhone
})
this.getPolicyList()
this.getMessage()
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
wx.redirectTo({ wx.redirectTo({
@ -106,9 +108,16 @@ Page({
}) })
}, },
toPolicyDetail(e){ toPolicyDetail(e){
if(!this.data.bindPhone){
wx.redirectTo({
url: '/pages/register/register',
})
}else{
wx.navigateTo({ wx.navigateTo({
url: '/subpages/index/policy/detail/detail?id=' + e.currentTarget.dataset.id, url: '/subpages/index/policy/detail/detail?id=' + e.currentTarget.dataset.id,
}) })
}
}, },
getMessage(){ getMessage(){
message({pageNum:1,pageSize:1}).then(res=>{ message({pageNum:1,pageSize:1}).then(res=>{
@ -134,7 +143,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
this.login()
}, },
/** /**
@ -181,15 +190,18 @@ Page({
url: e.currentTarget.dataset.url, url: e.currentTarget.dataset.url,
}) })
}else if(e.currentTarget.dataset.url){ }else if(e.currentTarget.dataset.url){
if(this.data.userInfo.idCard){ wx.navigateTo({
wx.navigateTo({ url: `/subpages/OCRCard/pages/index/index`,
url: `/subpages/index/checkInUser/checkInUser?idCard=${this.data.userInfo.idCard}`, })
}) // if(this.data.userInfo.idCard){
}else{ // wx.navigateTo({
wx.navigateTo({ // url: `/subpages/index/checkInUser/checkInUser?idCard=${this.data.userInfo.idCard}`,
url: `/subpages/OCRCard/pages/index/index`, // })
}) // }else{
} // wx.navigateTo({
// url: `/subpages/OCRCard/pages/index/index`,
// })
// }
} }
} }
}); });

13
project.private.config.json

@ -2,7 +2,7 @@
"libVersion": "3.8.9", "libVersion": "3.8.9",
"projectname": "epmet-apartment-mp", "projectname": "epmet-apartment-mp",
"setting": { "setting": {
"urlCheck": false, "urlCheck": true,
"coverView": true, "coverView": true,
"lazyloadPlaceholderEnable": false, "lazyloadPlaceholderEnable": false,
"skylineRenderEnable": false, "skylineRenderEnable": false,
@ -14,12 +14,19 @@
"condition": { "condition": {
"miniprogram": { "miniprogram": {
"list": [ "list": [
{
"name": "pages/webView/webView",
"pathName": "pages/webView/webView",
"query": "url=http://10.10.10.67:8080/#/home",
"scene": null,
"launchMode": "default"
},
{ {
"name": "subpages/signingCompleted/signingCompleted/signingCompleted", "name": "subpages/signingCompleted/signingCompleted/signingCompleted",
"pathName": "subpages/signingCompleted/signingCompleted/signingCompleted", "pathName": "subpages/signingCompleted/signingCompleted/signingCompleted",
"query": "", "query": "",
"scene": null, "launchMode": "default",
"launchMode": "default" "scene": null
}, },
{ {
"name": "subpages/index/checkInWait/checkInWait", "name": "subpages/index/checkInWait/checkInWait",

Loading…
Cancel
Save