|
@ -15,6 +15,7 @@ Page({ |
|
|
*/ |
|
|
*/ |
|
|
data: { |
|
|
data: { |
|
|
messageTotal: Number, |
|
|
messageTotal: Number, |
|
|
|
|
|
isAuth:false, |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -27,10 +28,16 @@ Page({ |
|
|
onShow: function () { |
|
|
onShow: function () { |
|
|
if (store.hasBindUserInfo()) { |
|
|
if (store.hasBindUserInfo()) { |
|
|
this.getUserInfo() |
|
|
this.getUserInfo() |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
isAuth: true |
|
|
|
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
wx.redirectTo({ |
|
|
this.setData({ |
|
|
url: '/pages/weChatAuth/index', |
|
|
isAuth: false |
|
|
}) |
|
|
}) |
|
|
|
|
|
// wx.redirectTo({
|
|
|
|
|
|
// url: '/pages/weChatAuth/index',
|
|
|
|
|
|
// })
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -47,6 +54,7 @@ Page({ |
|
|
userInfo: res.result, |
|
|
userInfo: res.result, |
|
|
avatarUrl: res.result.avatarUrl, |
|
|
avatarUrl: res.result.avatarUrl, |
|
|
nickName: res.result.nickName, |
|
|
nickName: res.result.nickName, |
|
|
|
|
|
isAuth:true, |
|
|
},()=>{ |
|
|
},()=>{ |
|
|
if (store.hasPhone()) { |
|
|
if (store.hasPhone()) { |
|
|
//console.log('已经绑定手机号码')
|
|
|
//console.log('已经绑定手机号码')
|
|
@ -93,7 +101,8 @@ Page({ |
|
|
onTapItem (e) { |
|
|
onTapItem (e) { |
|
|
const { type } = e.currentTarget.dataset |
|
|
const { type } = e.currentTarget.dataset |
|
|
//console.log(type)
|
|
|
//console.log(type)
|
|
|
if (type === 'myInfo'){ |
|
|
if(this.data.isAuth){ |
|
|
|
|
|
if (type === 'myInfo') { |
|
|
wx.navigateTo({ |
|
|
wx.navigateTo({ |
|
|
url: `/pages/user/${type}/index?userIcon=${this.data.userInfo.avatarUrl}&userName=${this.data.userInfo.nickName}&userPhone=${this.data.userInfo.phone || ''}&company=${this.data.userInfo.company || ''}&position=${this.data.userInfo.position || ''}`, |
|
|
url: `/pages/user/${type}/index?userIcon=${this.data.userInfo.avatarUrl}&userName=${this.data.userInfo.nickName}&userPhone=${this.data.userInfo.phone || ''}&company=${this.data.userInfo.company || ''}&position=${this.data.userInfo.position || ''}`, |
|
|
}) |
|
|
}) |
|
@ -102,5 +111,10 @@ Page({ |
|
|
url: `/pages/user/${type}/index`, |
|
|
url: `/pages/user/${type}/index`, |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
wx.redirectTo({ |
|
|
|
|
|
url: '/pages/weChatAuth/index', |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |