Browse Source

注册改进

XWookey 2 years ago
parent
commit
b862abe1ee
6 changed files with 55 additions and 28 deletions
  1. 2 6
      app.js
  2. 4 0
      pages/index/index.js
  3. 1 0
      pages/index/index.wxml
  4. 9 0
      pages/index/index.wxss
  5. 28 10
      pages/register/register.js
  6. 11 12
      pages/register/register.wxss

+ 2 - 6
app.js

@@ -3,14 +3,12 @@ let wechat = require('./utils/wechat.js');
 let log = require('./utils/log.js');
 App({
   globalData: {
-    // 本机调试
-    // postHeadAgreement: 'http://127.0.0.1:10301',
 
     // 测试
-    // postHeadAgreement: 'https://jqcs.pjnes.com/cloud/chargapi',
+    postHeadAgreement: 'https://jqcs.pjnes.com/cloud/chargapi',
 
     // 正式
-    postHeadAgreement: 'https://cdglyy.pjnes.com/cloud/chargapi',
+    // postHeadAgreement: 'https://cdglyy.pjnes.com/cloud/chargapi',
     helpPhoneNum: '4009608068',
     version:'2.0'
   },
@@ -43,8 +41,6 @@ App({
   onShow() {
     let userInfo = wx.getStorageSync('userInfo');
     let isLogin = wx.getStorageSync('isLogin');
-    console.info("cccccccccccccccccccccccccccccccccccccccccccccccccccccc")
-    console.info(userInfo)
     // 页面显示
     if (userInfo && isLogin) {
       if ((!userInfo.userId && userInfo.userId != 0)) {

+ 4 - 0
pages/index/index.js

@@ -320,6 +320,7 @@ Page({
                 data
               } = res;
               let markers = [];
+              if(data){
               data.forEach((item, index) => {
                 //item.callout = {
                 // content: item.name, //文本	String	1.2.0
@@ -361,6 +362,7 @@ Page({
                 };
                 markers[index] = marker;
               });
+            }
               that.setData({
                 markers
               });
@@ -750,6 +752,7 @@ Page({
                 } = res;
                 let markers = [];
                 var flag = false;
+                if(data){
                 data.forEach((item, index) => {
                   var iconPath;
                   if (that.data.markerId && that.data.markerId == item.id) {
@@ -801,6 +804,7 @@ Page({
                   };
                   markers[index] = marker;
                 });
+              }
                 if (!flag) {
                   that.setData({
                     textData: null,

+ 1 - 0
pages/index/index.wxml

@@ -33,6 +33,7 @@
     </map>
   </view>
   <view class="map_text" hover-class='active' wx:if="{{textData}}">
+  <view class="see_info" bindtap='seeInfo'>查看详情 > </view>
     <view class="map_text_info">
       <view class='charging_text_title'>
         <view class='charging_text_title1'>

+ 9 - 0
pages/index/index.wxss

@@ -454,4 +454,13 @@ rich-text{
 .footer text.selected{
   color:#fcd943;
 }
+
+.see_info{
+  position: absolute;
+  right: 0;
+  top: 0;
+  padding: 10rpx;
+  color: rgba(3,155,229,1);
+  font-size: 26rpx;
+}
 /* 通知相关 end */

+ 28 - 10
pages/register/register.js

@@ -39,6 +39,7 @@ Page({
     let that = this
     wx.request({
       url: getApp().globalData.postHeadAgreement + '/restapi/wechat/vcodeInfo',
+      // 场景(LOGIN:登录;LN_PHONE:绑定手机;UN_PHONE:解绑手机;FORGET_PWD:忘记密码;REGIST:注册;MDF_PWD:修改密码)
       data: {
         scene,
       },
@@ -46,7 +47,7 @@ Page({
       success(res) {
         that.setData({
           vcodeInfo:false,
-          vcodeTimeOut:res.data.result.expire,
+          // vcodeTimeOut:res.data.result.expire,
           vcodeTimeOutDefault:res.data.result.expire,
           vcodeLen:res.data.result.len
         })
@@ -213,9 +214,11 @@ Page({
       })
       return false;
     }
-    this.setData({
-      vcodeFlag:true
-    })
+    if(this.data.vcodeTimeOut<=0){
+      this.setData({
+        vcodeFlag:true,
+      })
+    }
     return true;
   },
   checkMail() {
@@ -257,18 +260,23 @@ Page({
         errorMsg: ''
       });
     }
-    that.setData({
-      vcodeTimeOut:this.data.vcodeTimeOutDefault
-    })
+
 
     let phone = that.data.phone;
+
+
+    that.setData({
+      vcodeTimeOut:that.data.vcodeTimeOutDefault
+    })
     let vcodeInterval = setInterval(that.vcodeFun,1000);
     that.setData({
       vcodeInterval 
     })
 
+
     wx.request({
       url: getApp().globalData.postHeadAgreement + '/restapi/wechat/sendPhoneVcodeUnique',
+      // url: getApp().globalData.postHeadAgreement + '/restapi/wechat/sendPhoneVcode',
       data: {
         scene: that.data.scene,
         terminal: phone,
@@ -278,6 +286,11 @@ Page({
         //console.log(res1);
         //console.log(res1.data.code == 1);
         if (res.data.code == 1) {
+            this.setData({
+              vcodeTimeOut:0,
+              vcodeFlag:true,
+              vcode_button_text:'获取验证码'
+            })
           wx.showModal({
             title: '提示',
             content:res.data.msg,
@@ -285,13 +298,18 @@ Page({
             confirmColor:'#4359b5'
           });
         }else if (res.data.code == 2) {
+          this.setData({
+            vcodeTimeOut:0,
+            vcodeFlag:true,
+            vcode_button_text:'获取验证码'
+          })
           // 跳转
           wx.showModal({
             title: '提示',
             content: '手机号已绑定账户,请检查手机号是否填写正确或联系客服',
             showCancel:true,
-            confirmText: '去登',
-            confirmColor:'#36a9a6',
+            confirmText: '去登',
+            confirmColor:'#00aadd',
             success: function (res1) {
               if (res1.confirm) {
                 let url = '/pages/login/login';
@@ -303,7 +321,7 @@ Page({
       
           });
         }else{
-          
+
         }
       }
     });

+ 11 - 12
pages/register/register.wxss

@@ -11,7 +11,7 @@
   margin-top: -128rpx;
 }
 .logo_view{
-  margin: 0rpx 268rpx;
+  margin: 10rpx 268rpx;
 }
 .login_logo1 {
   height: 213rpx;
@@ -109,7 +109,7 @@
 .input_view{
   box-shadow: 0rpx 0rpx 10rpx  #dedede;
   border-radius: 10rpx;
-  margin: 15rpx 0rpx;
+  margin: 30rpx 0rpx;
   height: 88rpx;
   position: relative;
 }
@@ -146,7 +146,7 @@
   border-radius: 40rpx;
   height: 80rpx;
   border: none;
-  margin: 20rpx 135rpx 0 135rpx;
+  margin: 40rpx 135rpx 0 135rpx;
 }
 .login_button_disable{
    width: calc(100% - 270rpx);
@@ -166,16 +166,15 @@
   border-radius: 40rpx;
   height: 80rpx;
   border: none;
-  margin: 20rpx 135rpx 0 135rpx;
+  margin: 40rpx 135rpx 0 135rpx;
 }
 
 .vcode_button {
-  font-size: 32rpx;
   font-family: 'Lucida Sans','Lucida Sans Regular','Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,sans-serif;
   position: absolute;
   display: inline-block;
-  font-size: 30rpx;
-  right: 20rpx;
+  font-size: 26rpx;
+  right: 0rpx;
   margin: 20rpx 10rpx;
   border: none;
   border-radius: 10rpx;
@@ -185,7 +184,6 @@
   padding: 10rpx 10rpx;
 }
 .vcode_button_disable{
-  font-size: 32rpx;
   font-family: 'Lucida Sans','Lucida Sans Regular','Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,sans-serif;
   position: absolute;
   display: inline-block;
@@ -193,11 +191,12 @@
   right: 0rpx;
   margin: 20rpx 10rpx;
   border: none;
-  border-radius: 5rpx;
-  background: #c9c9c9;
-  color: #FFF;
+  border-radius: 10rpx;
+  background: rgb(0, 170, 221);
   z-index: 9999;
+  color: #FFF;
   padding: 10rpx 10rpx;
+  background: #c9c9c9;
 }
 
 .login_button.button-hover {
@@ -206,7 +205,7 @@
 
 .phone_call_class{
   text-align: center;
-  margin: 40rpx;
+  margin: 100rpx 0rpx;
   color: #c9c9c9;
   font-size: 28rpx;
 }