|
@@ -5,12 +5,20 @@ Page({
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
+ isLogin: false,
|
|
|
isBindPhone: 0,
|
|
|
reviserPasswordScene: 'MDF_PWD',
|
|
|
unbindPhoneScene: 'UN_PHONE'
|
|
|
},
|
|
|
|
|
|
goModifuPassword(e) {
|
|
|
+ if (!this.data.isLogin) {
|
|
|
+ let url = `/pages/login/phone_login/phone_login`;
|
|
|
+ wx.navigateTo({
|
|
|
+ url
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
if(this.phoneCheck()){
|
|
|
let url = '/pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity?scene='+this.data.reviserPasswordScene;
|
|
|
wx.navigateTo({
|
|
@@ -20,6 +28,13 @@ Page({
|
|
|
},
|
|
|
|
|
|
goModifyPhone(e) {
|
|
|
+ if (!this.data.isLogin) {
|
|
|
+ let url = `/pages/login/phone_login/phone_login`;
|
|
|
+ wx.navigateTo({
|
|
|
+ url
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
if(this.phoneCheck()){
|
|
|
let url = '/pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity?scene='+this.data.unbindPhoneScene;
|
|
|
wx.navigateTo({
|
|
@@ -53,11 +68,7 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad(options) {
|
|
|
-
|
|
|
- let userInfo = wx.getStorageSync('userInfo');
|
|
|
- this.setData({
|
|
|
- isBindPhone: userInfo.bindingPhone
|
|
|
- });
|
|
|
+
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -71,7 +82,19 @@ Page({
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow() {
|
|
|
-
|
|
|
+ let userInfo = wx.getStorageSync('userInfo');
|
|
|
+ let isLogin = wx.getStorageSync('isLogin');
|
|
|
+ if (userInfo && isLogin) {
|
|
|
+ this.setData({
|
|
|
+ isLogin,
|
|
|
+ isBindPhone: userInfo.bindingPhone
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.setData({
|
|
|
+ isLogin: false,
|
|
|
+ isBindPhone: 0
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
/**
|