mk 1 month ago
parent
commit
ec8a9cf6b1
  1. 29
      pages/index/index.js
  2. 8
      pages/register/register.js
  3. 7
      subpages/index/checkInUser/checkInUser.js
  4. 2
      subpages/index/checkInUser/checkInUser.wxml

29
pages/index/index.js

@ -72,7 +72,6 @@ Page({
statusHeight: app.globalData.deviceInfo.statusHeight, statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight, navigationHeight: app.globalData.deviceInfo.navigationHeight,
}); });
this.init()
}, },
init(){ init(){
this.login() this.login()
@ -122,15 +121,7 @@ Page({
}) })
}, },
toPolicyDetail(e){ 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(){ getMessage(){
@ -157,7 +148,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
this.init()
}, },
/** /**
@ -194,6 +185,7 @@ Page({
}) })
}, },
navigateTo(e){ navigateTo(e){
if(e.currentTarget.dataset.url && e.currentTarget.dataset.url != '/subpages/OCRCard/pages/index/index'){ if(e.currentTarget.dataset.url && e.currentTarget.dataset.url != '/subpages/OCRCard/pages/index/index'){
if(e.currentTarget.dataset.url === '/pages/serve/serve'){ if(e.currentTarget.dataset.url === '/pages/serve/serve'){
wx.switchTab({ wx.switchTab({
@ -204,15 +196,22 @@ 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.bindPhone){
if(this.data.userInfo.idCard){ if(this.data.userInfo.idCard){
wx.navigateTo({ wx.navigateTo({
url: `/subpages/index/checkInUser/checkInUser?idCard=${this.data.userInfo.idCard}`, url: `/subpages/index/checkInUser/checkInUser?idCard=${this.data.userInfo.idCard}&name=${this.data.userInfo.name}&phone=${this.data.userInfo.phone}`,
}) })
}else{
wx.navigateTo({
url: `/subpages/OCRCard/pages/index/index`,
})
}
}else{ }else{
wx.navigateTo({ wx.navigateTo({
url: `/subpages/OCRCard/pages/index/index`, url: '/pages/register/register',
}) })
} }
} }
} }
}); });

8
pages/register/register.js

@ -72,7 +72,15 @@ Page({
wx.switchTab({ wx.switchTab({
url: '/pages/index/index', url: '/pages/index/index',
}) })
}else{
wx.switchTab({
url: '/pages/index/index',
})
} }
}).catch(err=>{
wx.switchTab({
url: '/pages/index/index',
})
}) })
}, },
back(){ back(){

7
subpages/index/checkInUser/checkInUser.js

@ -21,7 +21,7 @@ Page({
onLoad(options) { onLoad(options) {
if(options.idCard){ if(options.idCard){
this.setData({ this.setData({
'form.idCard':options.idCard 'form.idCard':options.idCard,
}) })
this.selectMzGraduateInfo() this.selectMzGraduateInfo()
} }
@ -88,6 +88,11 @@ Page({
'form.telephone':e.detail 'form.telephone':e.detail
}) })
}, },
onChangeName(e){
this.setData({
'form.graduateName':e.detail
})
},
submit(){ submit(){
selectMzGraduateInfo({idCard:this.data.form.idCard}).then(res=>{ selectMzGraduateInfo({idCard:this.data.form.idCard}).then(res=>{

2
subpages/index/checkInUser/checkInUser.wxml

@ -10,7 +10,7 @@
</view> </view>
<view class="info"> <view class="info">
<van-cell-group inset> <van-cell-group inset>
<van-field label="姓名" model:value="{{form.graduateName}}" border placeholder="请输入"/> <van-field label="姓名" model:value="{{form.graduateName}}" bind:change="onChangeName" border placeholder="请输入"/>
<van-field label="身份证" model:value="{{form.idCard}}" bind:change="onChange" border placeholder="请输入"/> <van-field label="身份证" model:value="{{form.idCard}}" bind:change="onChange" border placeholder="请输入"/>
<van-field label="手机号" model:value="{{form.telephone}}" bind:change="onChangePhone" placeholder="请输入"/> <van-field label="手机号" model:value="{{form.telephone}}" bind:change="onChangePhone" placeholder="请输入"/>
</van-cell-group> </van-cell-group>

Loading…
Cancel
Save