瀏覽代碼

Merge branch '新功能开发/增加验证码登录方式' into lsa/验证码登录

# Conflicts:
#	utils/Http.js
xiaohaizhao 1 年之前
父節點
當前提交
d5b8bc1447
共有 6 個文件被更改,包括 135 次插入78 次删除
  1. 5 3
      pages/login/modules/phone.js
  2. 6 0
      pages/login/phone.js
  3. 22 0
      pages/login/phone.scss
  4. 6 3
      pages/login/phone.wxml
  5. 96 72
      static/font-icon.wxss
  6. 0 0
      static/stylesheet.wxss

+ 5 - 3
pages/login/modules/phone.js

@@ -17,9 +17,11 @@ Component({
     },
     lifetimes: {
         attached: function () {
+            let loginMsg = wx.getStorageSync('loginMsg');
             /* 恢复缓存中保存的账号密码 */
             this.setData({
-                ...wx.getStorageSync('loginMsg')
+                phonenumber: loginMsg.phonenumber || "",
+                password: ""
             });
             setTimeout(this.allowOrNot, 300)
         }
@@ -61,14 +63,14 @@ Component({
             this.setData({
                 [e.target.dataset.name]: e.detail.value.trim()
             })
-            this.allowOrNot();
+            // this.allowOrNot();
         },
         /* 验证是否允许登录 */
         allowOrNot() {
             getCurrentPages().forEach(v => {
                 if (['pages/login/phone'].includes(v.__route__)) {
                     v.setData({
-                        disabled: this.data.phonenumber.length == 0 || this.data.password.length == 0
+                        disabled: this.data.phonenumber.length != 0
                     })
                 }
             })

+ 6 - 0
pages/login/phone.js

@@ -10,6 +10,7 @@ Page({
         isAgree: false,
         disabled: true, //是否禁用
         loading: false, //登陆中
+        loginFunc: "account",
     },
     onLoad(options) {
         if (wx.getStorageSync('isAgree')) this.setData({
@@ -19,6 +20,11 @@ Page({
             devCount: 0
         })
     },
+    changFun() {
+        this.setData({
+            loginFunc: this.data.loginFunc == 'account' ? "phone" : "account"
+        })
+    },
     /* 微信登录 */
     wechatLogin() {
         if (!this.data.isAgree) return Toast({

+ 22 - 0
pages/login/phone.scss

@@ -30,4 +30,26 @@ page {
     font-size: 28rpx;
     font-family: PingFang SC-Regular, PingFang SC;
     color: #FFFFFF;
+}
+
+.funs-box {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+
+.login-fun {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    background-color: #FA8C16;
+    width: 72rpx;
+    height: 72rpx;
+    border-radius: 50%;
+    margin-left: 16rpx;
+
+    .iconfont {
+        font-size: 36rpx;
+        color: #fff;
+    }
 }

+ 6 - 3
pages/login/phone.wxml

@@ -3,8 +3,8 @@
 </view>
 
 <!-- 手机号登录/账号登录  -->
-<phone id='login' wx:if="{{false}}" />
-<account wx:else id='login' />
+<account wx:if="{{loginFunc=='account'}}" id='login' />
+<phone id='login' wx:else />
 
 <view style="width: 100vw; text-align: center;margin-top: 60rpx;margin-bottom: 40rpx;">
     <van-button disabled='{{disabled}}' custom-class='login' bindtap="userLogin" loading='{{loading}}' loading-text="登陆中..." color='linear-gradient(90deg, #3874F6 0%, #095DE0 100%);'>登录</van-button>
@@ -17,8 +17,11 @@
 <block>
     <view style="height: 100rpx;" />
     <van-divider contentPosition="center">其他登录方式</van-divider>
-    <view style="width: 100%; text-align: center;">
+    <view class="funs-box">
         <text class="iconfont icon-a-wodebangdingweixin" style="font-size: 100rpx; color:#07C160;" bindtap="wechatLogin" />
+        <view class="login-fun" bindtap="changFun">
+            <text class="iconfont {{loginFunc=='account'?'icon-a-biaoqianlanxiaoxixuanzhong':'icon-a-biaoqianlanwodexuanzhong'}} " />
+        </view>
     </view>
 </block>
 

+ 96 - 72
static/font-icon.wxss

@@ -1,262 +1,286 @@
 @import "./work-icon.wxss";
-/* @import "./stylesheet.wxss"; */
+@import "./stylesheet.wxss";
 
 @font-face {
-    font-family: "iconfont";
-    /* Project id 3830173 */
-    src: url('//at.alicdn.com/t/c/font_3830173_34tbwfk4rzu.woff2?t=1688717856416') format('woff2'),
-        url('//at.alicdn.com/t/c/font_3830173_34tbwfk4rzu.woff?t=1688717856416') format('woff'),
-        url('//at.alicdn.com/t/c/font_3830173_34tbwfk4rzu.ttf?t=1688717856416') format('truetype');
+  font-family: "iconfont";
+  /* Project id 3830173 */
+  src: url('//at.alicdn.com/t/c/font_3830173_34tbwfk4rzu.woff2?t=1688717856416') format('woff2'),
+    url('//at.alicdn.com/t/c/font_3830173_34tbwfk4rzu.woff?t=1688717856416') format('woff'),
+    url('//at.alicdn.com/t/c/font_3830173_34tbwfk4rzu.ttf?t=1688717856416') format('truetype');
 }
 
 .iconfont {
-    font-family: "iconfont" !important;
-    font-size: 16px;
-    font-style: normal;
-    -webkit-font-smoothing: antialiased;
-    -moz-osx-font-smoothing: grayscale;
+  font-family: "iconfont" !important;
+  font-size: 16px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+.icon-a-wodemendianxinxidianhua:before {
+  content: "\e64c";
+}
+
+.icon-a-tuiguangsucaifenxiangliang:before {
+  content: "\e635";
+}
+
+.icon-a-tuiguangsucaishangchuan:before {
+  content: "\e636";
+}
+
+.icon-shujubodadianhua1:before {
+  content: "\e64f";
+}
+
+.icon-a-tonggaoshujuliulanliang:before {
+  content: "\e624";
+}
+
+.icon-a-shangxueyuanxuexi:before {
+  content: "\e63d";
 }
 
 .icon-a-tonggaofujian:before {
-    content: "\e61d";
+  content: "\e61d";
 }
 
 .icon-a-tonggaoliulanliang:before {
-    content: "\e61e";
+  content: "\e61e";
 }
 
 .icon-a-tuiguangsucaishangchuan1:before {
-    content: "\e63b";
+  content: "\e63b";
 }
 
 .icon-a-wodemendianxinxidizhi:before {
-    content: "\e64b";
+  content: "\e64b";
 }
 
 .icon-a-biaoqianlanzhiku:before {
-    content: "\e608";
+  content: "\e608";
 }
 
 .icon-webqiyeshuiyintupian:before {
-    content: "\e671";
+  content: "\e671";
 }
 
 .icon-gouwuche:before {
-    content: "\e680";
+  content: "\e680";
 }
 
 .icon-gongjuchaxun:before {
-    content: "\e681";
+  content: "\e681";
 }
 
 .icon-a-shouyeshujugaikuangzhanshishuju:before {
-    content: "\e64e";
+  content: "\e64e";
 }
 
 .icon-daoruxialajiantou:before {
-    content: "\e682";
+  content: "\e682";
 }
 
 .icon-niandu:before {
-    content: "\e693";
+  content: "\e693";
 }
 
 .icon-zanwushuju:before {
-    content: "\e652";
+  content: "\e652";
 }
 
 .icon-a-fanshenhetuihui:before {
-    content: "\e6c7";
+  content: "\e6c7";
 }
 
 .icon-a-baobeibohuituihui:before {
-    content: "\e6c8";
+  content: "\e6c8";
 }
 
 .icon-tijiao:before {
-    content: "\e6c9";
+  content: "\e6c9";
 }
 
 .icon-tijiaobaobei:before {
-    content: "\e6ca";
+  content: "\e6ca";
 }
 
 .icon-shenhe:before {
-    content: "\e6cb";
+  content: "\e6cb";
 }
 
 .icon-tabdizhi:before {
-    content: "\e6cc";
+  content: "\e6cc";
 }
 
 .icon-tabgenjindongtai1:before {
-    content: "\e6cd";
+  content: "\e6cd";
 }
 
 .icon-tabgongjuqingdan:before {
-    content: "\e6ce";
+  content: "\e6ce";
 }
 
 .icon-tabfujian1:before {
-    content: "\e6cf";
+  content: "\e6cf";
 }
 
 .icon-tabbaojiadan:before {
-    content: "\e6d0";
+  content: "\e6d0";
 }
 
 .icon-tabchanpinleibie:before {
-    content: "\e6d1";
+  content: "\e6d1";
 }
 
 .icon-tabgenjinjilu:before {
-    content: "\e6d2";
+  content: "\e6d2";
 }
 
 .icon-tabchanpin:before {
-    content: "\e6d3";
+  content: "\e6d3";
 }
 
 .icon-tabcaozuojilu1:before {
-    content: "\e6d4";
+  content: "\e6d4";
 }
 
 .icon-tabkehu:before {
-    content: "\e6d5";
+  content: "\e6d5";
 }
 
 .icon-tabjingzhengduishou:before {
-    content: "\e6d6";
+  content: "\e6d6";
 }
 
 .icon-tabrenwu:before {
-    content: "\e6d7";
+  content: "\e6d7";
 }
 
 .icon-tabkaipiaoxinxi:before {
-    content: "\e6d8";
+  content: "\e6d8";
 }
 
 .icon-tabxiansuo:before {
-    content: "\e6d9";
+  content: "\e6d9";
 }
 
 .icon-tabxiangxixinxi1:before {
-    content: "\e6da";
+  content: "\e6da";
 }
 
 .icon-tablianxiren:before {
-    content: "\e6db";
+  content: "\e6db";
 }
 
 .icon-tabxiangmu:before {
-    content: "\e6dc";
+  content: "\e6dc";
 }
 
 .icon-tabxiangmupinggu:before {
-    content: "\e6dd";
+  content: "\e6dd";
 }
 
 .icon-tabhetong:before {
-    content: "\e6de";
+  content: "\e6de";
 }
 
 .icon-a-wodemima:before {
-    content: "\e651";
+  content: "\e651";
 }
 
 .icon-a-wodetuanduiguanli:before {
-    content: "\e640";
+  content: "\e640";
 }
 
 .icon-a-wodeguanyuyingyong:before {
-    content: "\e646";
+  content: "\e646";
 }
 
 .icon-a-wodebangdingweixin:before {
-    content: "\e650";
+  content: "\e650";
 }
 
 .icon-shouhuo:before {
-    content: "\e677";
+  content: "\e677";
 }
 
 .icon-dingdan:before {
-    content: "\e678";
+  content: "\e678";
 }
 
 .icon-zhanghu:before {
-    content: "\e679";
+  content: "\e679";
 }
 
 .icon-kaipiao:before {
-    content: "\e67a";
+  content: "\e67a";
 }
 
 .icon-tuifan:before {
-    content: "\e67b";
+  content: "\e67b";
 }
 
 .icon-shangcheng:before {
-    content: "\e67c";
+  content: "\e67c";
 }
 
 .icon-shujuchaxun:before {
-    content: "\e67d";
+  content: "\e67d";
 }
 
 .icon-cuxiaohuodong:before {
-    content: "\e67e";
+  content: "\e67e";
 }
 
 .icon-yejimubiao:before {
-    content: "\e67f";
+  content: "\e67f";
 }
 
 .icon-a-biaoqianlanshouyexuanzhong:before {
-    content: "\e606";
+  content: "\e606";
 }
 
 .icon-a-biaoqianlanxiaoxi:before {
-    content: "\e609";
+  content: "\e609";
 }
 
 .icon-a-biaoqianlanwode:before {
-    content: "\e62a";
+  content: "\e62a";
 }
 
 .icon-a-biaoqianlanwodexuanzhong:before {
-    content: "\e643";
+  content: "\e643";
 }
 
 .icon-a-biaoqianlanxiaoxixuanzhong:before {
-    content: "\e64a";
+  content: "\e64a";
 }
 
 .icon-E-dingdanxitong:before {
-    content: "\e675";
+  content: "\e675";
 }
 
 .icon-a-sousuolansousuo:before {
-    content: "\e621";
+  content: "\e621";
 }
 
 .icon-dibu-bianji:before {
-    content: "\e69c";
+  content: "\e69c";
 }
 
 .icon-guanlian-shanchu:before {
-    content: "\e6ab";
+  content: "\e6ab";
 }
 
 .icon-shaixuan:before {
-    content: "\e6b4";
+  content: "\e6b4";
 }
 
 .icon-shengxu:before {
-    content: "\e6b5";
+  content: "\e6b5";
 }
 
 .icon-jiangxu1:before {
-    content: "\e6b6";
+  content: "\e6b6";
 }

File diff suppressed because it is too large
+ 0 - 0
static/stylesheet.wxss


Some files were not shown because too many files changed in this diff