|
@@ -5,26 +5,22 @@ Page({
|
|
data: {
|
|
data: {
|
|
spinShow: false,
|
|
spinShow: false,
|
|
userInfo:{},
|
|
userInfo:{},
|
|
|
|
+ out:0,
|
|
|
|
+ visit:0
|
|
},
|
|
},
|
|
onShow: function () {
|
|
onShow: function () {
|
|
- app.checkLogin( userInfo=>{
|
|
|
|
|
|
+ app.checkLogin( userInfo =>{
|
|
this.setData({userInfo})
|
|
this.setData({userInfo})
|
|
- } )
|
|
|
|
- },
|
|
|
|
- doLoginByCode( code ){
|
|
|
|
- app.formPost( "Auth.WxLoginByCode", {code}).then( (res)=>{
|
|
|
|
- if( res.code == 200){
|
|
|
|
- this.setData( {userInfo: res.data})
|
|
|
|
- app.setUserInfo( res.data )
|
|
|
|
|
|
+ if( userInfo.adminId >0){
|
|
|
|
+ this.loadConfirm()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- doGetPhoneNumber( code, iv, encryptedData ){
|
|
|
|
- let param = {code, iv, encryptedData }
|
|
|
|
- app.formPost( "Auth.WxLoginByPhone", param).then( (res)=>{
|
|
|
|
- if( res.code == 200){
|
|
|
|
- this.setData( {userInfo: res.data})
|
|
|
|
- app.setUserInfo( res.data )
|
|
|
|
|
|
+ loadConfirm(){
|
|
|
|
+ app.formPost('User.confirmInfo', {} ).then(res => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ let {out, visit} = res.data;
|
|
|
|
+ this.setData({out, visit});
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -41,10 +37,20 @@ Page({
|
|
this.setData({userInfo})
|
|
this.setData({userInfo})
|
|
app.setUserInfo( userInfo )
|
|
app.setUserInfo( userInfo )
|
|
},
|
|
},
|
|
- gotoFileList( e ){
|
|
|
|
- let api = e.currentTarget.dataset.api;
|
|
|
|
|
|
+ gotoConfirmOut( e ){
|
|
|
|
+ if( this.data.userInfo.adminId==0){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ wx.navigateTo({
|
|
|
|
+ url: `/pages/user/out/index`,
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ gotoConfirmVisit( e ){
|
|
|
|
+ if( this.data.userInfo.adminId==0){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
- url: `/pages/user/filelist/index?api=${api}`,
|
|
|
|
|
|
+ url: `/pages/user/visit/index`,
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|