diff --git a/pages/index/index.js b/pages/index/index.js index aa44569..5bffddb 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -52,7 +52,8 @@ Page({ ], searchValue: "", policyList:[],//政策列表 - getUserInfo:{} + getUserInfo:{}, + bindPhone:false }, /** @@ -63,8 +64,11 @@ Page({ this.setData({ statusHeight: app.globalData.deviceInfo.statusHeight, navigationHeight: app.globalData.deviceInfo.navigationHeight, - }); + this.init() + }, + init(){ + this.login() }, login() { const that = this @@ -75,14 +79,12 @@ Page({ code: res.code }).then(res => { wx.setStorageSync('token',res.data.token) - if(res.data.bindPhone){ - wx.redirectTo({ - url: '/pages/register/register', - }) - } - that.getPolicyList() - that.getMessage() that.getUserInfo() + that.setData({ + bindPhone:res.data.bindPhone + }) + this.getPolicyList() + this.getMessage() }).catch(err => { console.log(err); wx.redirectTo({ @@ -106,9 +108,16 @@ Page({ }) }, toPolicyDetail(e){ + if(!this.data.bindPhone){ + wx.redirectTo({ + url: '/pages/register/register', + }) + }else{ wx.navigateTo({ url: '/subpages/index/policy/detail/detail?id=' + e.currentTarget.dataset.id, }) + } + }, getMessage(){ message({pageNum:1,pageSize:1}).then(res=>{ @@ -134,7 +143,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow() { - this.login() + }, /** @@ -181,15 +190,18 @@ Page({ url: e.currentTarget.dataset.url, }) }else if(e.currentTarget.dataset.url){ - if(this.data.userInfo.idCard){ - wx.navigateTo({ - url: `/subpages/index/checkInUser/checkInUser?idCard=${this.data.userInfo.idCard}`, - }) - }else{ - wx.navigateTo({ - url: `/subpages/OCRCard/pages/index/index`, - }) - } + wx.navigateTo({ + url: `/subpages/OCRCard/pages/index/index`, + }) + // if(this.data.userInfo.idCard){ + // wx.navigateTo({ + // url: `/subpages/index/checkInUser/checkInUser?idCard=${this.data.userInfo.idCard}`, + // }) + // }else{ + // wx.navigateTo({ + // url: `/subpages/OCRCard/pages/index/index`, + // }) + // } } } }); \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index 5ed07df..8ea26ca 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -2,7 +2,7 @@ "libVersion": "3.8.9", "projectname": "epmet-apartment-mp", "setting": { - "urlCheck": false, + "urlCheck": true, "coverView": true, "lazyloadPlaceholderEnable": false, "skylineRenderEnable": false, @@ -14,12 +14,19 @@ "condition": { "miniprogram": { "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", "pathName": "subpages/signingCompleted/signingCompleted/signingCompleted", "query": "", - "scene": null, - "launchMode": "default" + "launchMode": "default", + "scene": null }, { "name": "subpages/index/checkInWait/checkInWait",