Browse Source

Merge branch 'V2.0' of http://39.98.84.232:3000/CDZ/wechat-pilelog into V2.0

# Conflicts:
#	pages/ucenter/index/index.wxml
XWookey 1 year ago
parent
commit
bf3cb85973

+ 13 - 4
pages/chargemoney/chargemoney.js

@@ -165,10 +165,19 @@ Page({
     // 页面显示
     if (userInfo && isLogin) {
       if(userInfo.bindingPhone==0){
-        let url = `/pages/bindPhone/bindPhone`;
-        wx.navigateTo({
-          url
-        });
+        wx.showModal({
+          title: '提示',
+          content: '当前账户未绑定手机号,请您进行手机号绑定操作',
+          showCancel:false,
+          confirmText: '去绑定',
+          confirmColor:'#00aadd',
+          success: function (res1) {
+              let url = `/pages/bindPhone/bindPhone`;
+              wx.navigateTo({
+                url
+              });
+          }
+        })
         return;
       }
       //console.log(userInfo);

+ 25 - 0
pages/index/index.js

@@ -603,6 +603,9 @@ Page({
   },
   //打开扫一扫
   click_scan_control(e) {
+    if(!this.phoneCheck()){
+      return;
+    }
     if(this.scanFlag){
       return;
     }
@@ -862,6 +865,28 @@ Page({
       }
     }
   },
+
+  phoneCheck(){
+    if (this.data.userInfo.bindingPhone==0) {
+      wx.showModal({
+        title: '提示',
+        content: '当前账户未绑定手机号,请您进行手机号绑定操作',
+        showCancel:false,
+        confirmText: '去绑定',
+        confirmColor:'#00aadd',
+        success: function (res1) {
+            let url = `/pages/bindPhone/bindPhone`;
+            wx.navigateTo({
+              url
+            });
+        }
+      })
+      return false;
+    }else{
+      return true;
+    }
+  },
+
   /**
    * 生命周期函数--监听页面显示
    */

+ 0 - 7
pages/scan_result/scan_result.js

@@ -73,13 +73,6 @@ Page({
     
     let userInfo = wx.getStorageSync('userInfo');
     let isLogin = wx.getStorageSync('isLogin');
-    if(userInfo.bindingPhone==0){
-      let url = `/pages/bindPhone/bindPhone`;
-      wx.navigateTo({
-        url
-      });
-      return;
-    }
     wx.showLoading({
       title: '开启充电中...',
       mask: true

+ 1 - 1
pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity.json

@@ -1,3 +1,3 @@
 {
-  "navigationBarTitleText": "安全验证"
+  "navigationBarTitleText": "账户安全"
 }

+ 25 - 14
pages/ucenter/accountsecurity/index/index.js

@@ -11,31 +11,42 @@ Page({
   },
 
   goModifuPassword(e) {
-    if (this.data.isBindPhone==0) {
-      let url = `/pages/bindPhone/bindPhone`;
+    if(this.phoneCheck()){
+      let url = '/pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity?scene='+this.data.reviserPasswordScene;
       wx.navigateTo({
         url
       });
-      return;
     }
-    let url = '/pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity?scene='+this.data.reviserPasswordScene;
-    wx.navigateTo({
-      url
-    });
   },
 
   goModifyPhone(e) {
-    if (this.data.isBindPhone==0) {
-      let url = `/pages/bindPhone/bindPhone`;
+    if(this.phoneCheck()){
+      let url = '/pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity?scene='+this.data.unbindPhoneScene;
       wx.navigateTo({
         url
       });
-      return;
     }
-    let url = '/pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity?scene='+this.data.unbindPhoneScene;
-    wx.navigateTo({
-      url
-    });
+  },
+
+  phoneCheck(){
+    if (this.data.isBindPhone==0) {
+      wx.showModal({
+        title: '提示',
+        content: '当前账户未绑定手机号,请您进行手机号绑定操作',
+        showCancel:false,
+        confirmText: '去绑定',
+        confirmColor:'#00aadd',
+        success: function (res1) {
+            let url = `/pages/bindPhone/bindPhone`;
+            wx.navigateTo({
+              url
+            });
+        }
+      })
+      return false;
+    }else{
+      return true;
+    }
   },
 
   /**

+ 4 - 10
pages/ucenter/center/center.js

@@ -118,8 +118,10 @@ Page({
   },
 
   checkMail(email) {
-    if (!(/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(email))) {
-      return false;
+    if(email){
+      if (!(/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(email))) {
+        return false;
+      }
     }
     return true;
   },
@@ -135,14 +137,6 @@ Page({
 
   bindUpdateUser(userdata) {
     let that = this;
-    if(this.data.isBindPhone==0){
-      let url = `/pages/bindPhone/bindPhone`;
-      wx.navigateTo({
-        url
-      });
-      return;
-    }
-
     let loginName = this.data.userInfo.loginName;
     let {
       sexIndex,

+ 27 - 4
pages/ucenter/index/index.js

@@ -17,10 +17,12 @@ Page({
     });
   },
   toUserCenter(e){
-    let url = '/pages/ucenter/center/center';
-    wx.navigateTo({
-      url
-    });
+    if (this.phoneCheck()) {
+      let url = '/pages/ucenter/center/center';
+      wx.navigateTo({
+        url
+      });
+    }
   },
   logout(e){
     if (this.data.isLogin) {
@@ -35,6 +37,27 @@ Page({
       phoneNumber: getApp().globalData.helpPhoneNum
     });
   },
+
+  phoneCheck(){
+    if (this.data.userInfo.bindingPhone==0 && !this.data.userInfo.flag) {
+      wx.showModal({
+        title: '提示',
+        content: '当前账户未绑定手机号,请您进行手机号绑定操作',
+        showCancel:false,
+        confirmText: '去绑定',
+        confirmColor:'#00aadd',
+        success: function (res1) {
+            let url = `/pages/bindPhone/bindPhone`;
+            wx.navigateTo({
+              url
+            });
+        }
+      })
+      return false;
+    }else{
+      return true;
+    }
+  },
  
   /**
    * 生命周期函数--监听页面加载

+ 24 - 9
pages/ucenter/purse/purse.js

@@ -9,21 +9,36 @@ Page({
     isLogin: false
   },
   chargemony(e) {
-    let userInfo = wx.getStorageSync('userInfo');
-    console.info(userInfo)
-    if(userInfo.bindingPhone==0){
-      let url = `/pages/bindPhone/bindPhone`;
-      wx.navigateTo({
-        url
-      });
-      return;
-    }else if(userInfo.bindingPhone==1){
+    if(this.phoneCheck()){
       let url = "/pages/chargemoney/chargemoney";
       wx.navigateTo({
         url
       });
     }
   },
+
+  phoneCheck(){
+    let userInfo = wx.getStorageSync('userInfo');
+    if (userInfo.bindingPhone==0) {
+      wx.showModal({
+        title: '提示',
+        content: '当前账户未绑定手机号,请您进行手机号绑定操作',
+        showCancel:false,
+        confirmText: '去绑定',
+        confirmColor:'#00aadd',
+        success: function (res1) {
+            let url = `/pages/bindPhone/bindPhone`;
+            wx.navigateTo({
+              url
+            });
+        }
+      })
+      return false;
+    }else{
+      return true;
+    }
+  },
+
   withdrawDeposit(e) {
     let url = "/pages/outmoney/outmoney";
     wx.navigateTo({