Procházet zdrojové kódy

修复界面验证码

lucheng před 1 rokem
rodič
revize
8c5ced5d15

+ 3 - 0
pages/bindPhone/bindPhone.js

@@ -1,4 +1,5 @@
 // pages/bindphone/bindPhone.js
+let log = require('../../utils/log.js');
 Page({
   /**
    * 组件的初始数据
@@ -199,6 +200,8 @@ Page({
           });
           log.info('[绑定手机号]', '[绑定手机号]', '[失败code==1]', res.data);
         } else {
+          wx.setStorageSync("userInfo", res.data);
+          wx.setStorageSync("isLogin", true);
           //跳转到上一页
           log.info('[绑定手机号]', '[绑定手机号]', '[成功返回上一个界面]', res.data);
           wx.navigateBack();

+ 7 - 9
pages/chargemoney/chargemoney.js

@@ -162,17 +162,15 @@ Page({
     log.info('[充值]', '[页面加载完成]');
     let userInfo = wx.getStorageSync('userInfo');
     let isLogin = wx.getStorageSync('isLogin');
-    let isBindPhone = wx.getStorageSync('isBindPhone');
-    if(isBindPhone==0){
-      let url = `/pages/bindPhone/bindPhone`;
-      wx.navigateTo({
-        url
-      });
-      return;
-    }
-
     // 页面显示
     if (userInfo && isLogin) {
+      if(userInfo.bindingPhone==0){
+        let url = `/pages/bindPhone/bindPhone`;
+        wx.navigateTo({
+          url
+        });
+        return;
+      }
       //console.log(userInfo);
       //userInfo.flag = true;
       this.setData({

+ 0 - 1
pages/login/phone_login/phone_login.js

@@ -216,7 +216,6 @@ Page({
           //返回该用户
           //跳转到上一页
           wx.setStorageSync("userInfo", res.data);
-          wx.setStorageSync("isBindPhone", res.data.bindingPhone);
           wx.setStorageSync("isLogin", true);
           //let url = `/pages/ucenter/index/index`;
           log.info('[登录]', '[登录]', '[成功返回上一个界面]', res.data);

+ 1 - 1
pages/login/phone_login/phone_login.wxss

@@ -246,7 +246,7 @@
 
  .phone_call_class{
   text-align: center;
-  margin: 40rpx;
+  margin: 160rpx;
   color: #c9c9c9;
   font-size: 28rpx;
 }

+ 0 - 1
pages/login/username_login/username_login.js

@@ -83,7 +83,6 @@ Page({
           //返回该用户
           //跳转到上一页
           wx.setStorageSync("userInfo", res.data);
-          wx.setStorageSync("isBindPhone", res.data.bindingPhone);
           wx.setStorageSync("isLogin", true);
           //let url = `/pages/ucenter/index/index`;
           log.info('[登录]', '[登录]', '[成功返回上一个界面]', res.data);

+ 2 - 2
pages/login/username_login/username_login.wxss

@@ -127,7 +127,7 @@
   color: #fff;
   text-overflow: ellipsis;
   white-space: nowrap;
-  background-color: #b14b4b;
+  background-color: #c9c9c9;
   border-radius: 40rpx;
   height: 80rpx;
   border: none;
@@ -194,7 +194,7 @@
 }
 .phone_call_class{
   text-align: center;
-  margin: 40rpx;
+  margin: 160rpx;
   color: #c9c9c9;
   font-size: 28rpx;
 }

+ 4 - 4
pages/scan_result/scan_result.js

@@ -70,8 +70,10 @@ Page({
     });
   },
   beginCharge(e) {
-    let isBindPhone = wx.getStorageSync('isBindPhone');
-    if(isBindPhone==0){
+    
+    let userInfo = wx.getStorageSync('userInfo');
+    let isLogin = wx.getStorageSync('isLogin');
+    if(userInfo.bindingPhone==0){
       let url = `/pages/bindPhone/bindPhone`;
       wx.navigateTo({
         url
@@ -84,8 +86,6 @@ Page({
     });
     log.info('[扫码]', '[开始充电流程]');
     //同步用户数据
-    let userInfo = wx.getStorageSync('userInfo');
-    let isLogin = wx.getStorageSync('isLogin');
     let that = this;
     log.info('[扫码]', '[同步用户数据]', '[请求]', {
       loginName: userInfo.loginName

+ 4 - 1
pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity.js

@@ -5,6 +5,7 @@ Page({
    * 页面的初始数据
    */
   data: {
+    vcode: null,
     scene: '',
     userInfo: {},
     hidePhone: null,
@@ -228,7 +229,9 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow() {
-
+    this.setData({
+      vcode: null
+    });
   },
 
   /**

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

@@ -12,7 +12,7 @@
 
       <view class='input_view'>
         <image class='phone_img' src='/images/vcode.png'></image><div class="line"></div>
-        <input placeholder='请输入验证码' bindinput='inputVerificatrCode' type='number' placeholder-class='placeholder'></input>
+        <input placeholder='请输入验证码' bindinput='inputVerificatrCode' type='number' placeholder-class='placeholder' value='{{vcode}}'></input>
         <view bindtap='{{vcodeFlag?"getVerificateCode":""}}' class='varification_button {{vcodeFlag?"getCode":"getCode_disable"}}'>{{vcode_button_text}}</view>
       </view>  
     </view>

+ 3 - 2
pages/ucenter/accountsecurity/index/index.js

@@ -42,9 +42,10 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-    let isBindPhone = wx.getStorageSync('isBindPhone');
+    
+    let userInfo = wx.getStorageSync('userInfo');
     this.setData({
-      isBindPhone
+      isBindPhone: userInfo.bindingPhone
     });
   },
 

+ 1 - 1
pages/ucenter/accountsecurity/index/index.wxml

@@ -12,7 +12,7 @@
       </view>
       <view class="zan-cell" hover-class="active" bindtap="goModifyPhone">
         <view class="zan-text">
-          <text>更绑定手机</text>
+          <text>更绑定手机</text>
         </view>
         <view class="zan-ft">
           <image src='/images/enter.png'></image>

+ 2 - 2
pages/ucenter/accountsecurity/mdfpassword/mdfpassword.js

@@ -19,7 +19,7 @@ Page({
       password
     } = this.data;
     wx.request({
-      url: getApp().globalData.postHeadAgreement + '/r1estapi/wechat/resetPassword',
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/resetPassword',
       data: {
         phonenumber,
         password
@@ -35,7 +35,7 @@ Page({
           });
         } else {
           let url = `/pages/ucenter/index/index`;
-          wx.navigateTo({
+          wx.redirectTo({
             url
           });
         }

+ 8 - 3
pages/ucenter/accountsecurity/unbindphone/unbindphone.js

@@ -1,4 +1,5 @@
 // pages/ucenter/accountsecurity/unbindphone/unbindphone.js
+let log = require('../../../../utils/log.js');
 Page({
 
   /**
@@ -180,7 +181,7 @@ Page({
     let { phone, vcode } = this.data;
     log.info('[绑定手机]', '[绑定手机]', '[请求]', { phone, vcode });
     wx.request({
-      url: getApp().globalData.postHeadAgreement +'/restapi/wechat/bindPhone',
+      url: getApp().globalData.postHeadAgreement +'/restapi/wechat/unbindPhone',
       data: {
         loginName,
         phonenumber: phone,
@@ -201,8 +202,12 @@ Page({
           log.info('[绑定手机号]', '[绑定手机号]', '[失败code==1]', res.data);
         } else {
           //跳转到上一页
-          log.info('[绑定手机号]', '[绑定手机号]', '[成功返回上一个界面]', res.data);
-          wx.navigateBack();
+          wx.setStorageSync("userInfo", res.data);
+          wx.setStorageSync("isLogin", true);
+          log.info('[绑定手机号]', '[绑定手机号]', '[成功返回首页]');
+          wx.redirectTo({
+            url:"/pages/ucenter/index/index"
+         })
         }
       },
       fail(e){

+ 7 - 6
pages/ucenter/center/center.js

@@ -43,7 +43,8 @@ Page({
       title: '修改车牌号',
       showCancel:true,
       editable: true,
-      confirmColor:'#36a9a6',
+      confirmColor:'#00AADD',
+      cancelColor:'#00AADD',
       success: function (res1) {
         if (res1.confirm) {
           let carNum = res1.content;
@@ -59,7 +60,7 @@ Page({
         title: '提示',
         showCancel:false,
         content: '车牌号输入有误,请重新输入',
-        confirmColor:'#36a9a6',
+        confirmColor:'#00AADD',
       });
       return;
     } else {
@@ -82,7 +83,8 @@ Page({
       title: '修改邮箱',
       showCancel:true,
       editable: true,
-      confirmColor:'#36a9a6',
+      confirmColor:'#00AADD',
+      cancelColor:'#00AADD',
       success: function (res1) {
         if (res1.confirm) {
           let email = res1.content;
@@ -98,7 +100,7 @@ Page({
         title: '提示',
         showCancel:false,
         content: '邮箱输入有误,请重新输入',
-        confirmColor:'#36a9a6',
+        confirmColor:'#00AADD',
       });
       return;
     } else {
@@ -209,7 +211,6 @@ Page({
   onShow: function() {
     let userInfo = wx.getStorageSync('userInfo');
     let isLogin = wx.getStorageSync('isLogin');
-    let isBindPhone = wx.getStorageSync('isBindPhone');
 
     // 页面显示
     if (userInfo && isLogin) {
@@ -218,7 +219,7 @@ Page({
       this.setData({
         userInfo: userInfo,
         isLogin: isLogin,
-        isBindPhone:isBindPhone,
+        isBindPhone: userInfo.bindingPhone,
         carNum: userInfo.license_number,
         email:userInfo.email,
         sexIndex:userInfo.sex

+ 0 - 1
pages/ucenter/center/center.wxml

@@ -9,7 +9,6 @@
       <image src='{{isLogin&&!userInfo.flag?userInfo.avatar:"/images/userhead.png"}}'></image>
     </view>
     <text class='bold'>{{userInfo.userName}}</text>
-    <text class="edit">更换头像</text>
   </view>
 </view>
 

+ 4 - 3
pages/ucenter/purse/purse.js

@@ -9,14 +9,15 @@ Page({
     isLogin: false
   },
   chargemony(e) {
-    let isBindPhone = wx.getStorageSync('isBindPhone');
-    if(isBindPhone==0){
+    let userInfo = wx.getStorageSync('userInfo');
+    console.info(userInfo)
+    if(userInfo.bindingPhone==0){
       let url = `/pages/bindPhone/bindPhone`;
       wx.navigateTo({
         url
       });
       return;
-    }else if(isBindPhone==1){
+    }else if(userInfo.bindingPhone==1){
       let url = "/pages/chargemoney/chargemoney";
       wx.navigateTo({
         url