sys 2 жил өмнө
parent
commit
39ab08a459

+ 7 - 0
pages.json

@@ -57,6 +57,13 @@
         "navigationBarTitleText": "",
         "enablePullDownRefresh": false
       }
+    },
+    {
+      "path": "pages/login/forgetPass",
+      "style": {
+        "navigationBarTitleText": "",
+        "enablePullDownRefresh": false
+      }
     }
   ],
   "globalStyle": {

+ 161 - 0
pages/login/forgetPass.vue

@@ -0,0 +1,161 @@
+<template>
+  <view class="other-box">
+    <en-nav @navHeight="setNavHeight" ></en-nav>
+    <view class="login-box" :style="{'height':'calc(100vh - '+navHeight+'px)'}">
+      <view class="login-top">
+        <view class="login-title">
+          <text class="title-item sys-color-black sys-weight-600">验证登录</text>
+        </view>
+        <view class="login-from">
+          <view class="from-text">
+            <input type="tel" class="from-input sys-color-gray-3" v-model="phone" placeholder="请输入手机号"></input>
+          </view>
+          <view class="from-code">
+            <view class="from-text">
+              <input type="tel" class="from-input sys-color-gray-3" v-model="code" placeholder="请输入验证码"></input>
+            </view>
+            <view class="code-text">
+              <text class="sys-color-gray-3" v-if="time<=0" @click="senCode">获取验证码</text>
+              <text class="sys-color-gray-3" v-else>{{time}} s</text>
+            </view>
+          </view>
+          <view class="from-text from-item">
+            <input type="password" class="from-input sys-color-gray-3" v-model="password" placeholder="请输入密码"></input>
+          </view>
+        </view>
+        <view class="login-but sys-color-white sys-background-black sys-selected-but" :class="{'sys-unselected-but':!isLogin}">提交</view>
+
+      </view>
+    </view>
+
+  </view>
+</template>
+
+<script>
+import EnNav from "@/components/en-utils/en-nav/en-nav";
+import tools from "@/service/tools";
+import OtherLogin from "@/pages/login/model/otherLogin";
+export default {
+  name:'forgetPass',
+  components: {OtherLogin, EnNav},
+  data() {
+    return {
+      navHeight:40,
+      isLogin:false,
+      phone:'',
+      code:'',
+      password:'',
+      time:0
+    }
+  },
+  watch:{
+    'phone':function (){
+      this.verifyIsLogin()
+    },
+    'code':function (){
+      this.verifyIsLogin()
+    },
+    'password':function (){
+      this.verifyIsLogin()
+    },
+  },
+  methods: {
+    setNavHeight(navHeight){
+      this.navHeight=navHeight
+    },
+    verifyIsLogin(){
+      this.isLogin = this.phone.length === 11 && this.code !== '' && this.password.length>=6;
+    },
+    senCode(){
+      if(this.phone.length !== 11){
+        tools.error('请输入手机号码')
+        return false
+      }
+      this.time=60
+      let timeServe=setInterval(()=>{
+        --this.time
+        if(this.time<=0){
+          clearInterval(timeServe)
+        }
+      },1000)
+    },
+    goToPass(){
+      uni.navigateTo({
+        'url':'/pages/login/passLogin'
+      })
+    }
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.other-box{
+  padding: 82rpx 80rpx 0 80rpx;
+  box-sizing: border-box;
+  position: relative;
+  .login-top{
+    .login-title{
+      padding-bottom: 60rpx;
+      .title-item{
+        font-size: 48rpx;
+      }
+    }
+    .login-from{
+      .from-text{
+        width: 100%;
+        padding-bottom: 40rpx;
+        border-bottom: 1rpx solid #E0E0E0;
+        .from-input{
+          font-size: 32rpx;
+          height: 44rpx;
+          line-height: 44rpx;
+        }
+        .from-input::placeholder{
+          color: #999999;
+        }
+      }
+      .from-code{
+        margin-top: 60rpx;
+        display: flex;
+        justify-content: space-between;
+        .from-text{
+          width: 344rpx;
+        }
+        .code-text{
+          width: 180rpx;
+          height: 44rpx;
+          line-height: 44rpx;
+          text-align: center;
+          text{
+            font-size: 32rpx;
+          }
+        }
+
+      }
+      .from-item{
+        margin-top: 60rpx;
+      }
+
+    }
+
+    .login-but{
+      margin-top: 120rpx;
+
+    }
+
+    .local-txt{
+      padding-top: 32rpx;
+      font-size: 24rpx;
+      text-align: center;
+    }
+  }
+  .login-bottom{
+    padding-bottom: calc(186rpx + env(safe-area-inset-bottom));
+    position: absolute;
+    bottom: 0;
+    left: 80rpx;
+    width:calc(100vw - 160rpx);
+  }
+}
+
+</style>

+ 4 - 11
pages/login/otherPhoneLogin.vue

@@ -12,7 +12,7 @@
           </view>
           <view class="from-code">
             <view class="from-text">
-              <input type="tel" class="from-input sys-color-gray-3" v-model="code" placeholder="请输入手机号"></input>
+              <input type="tel" class="from-input sys-color-gray-3" v-model="code" placeholder="请输入验证码"></input>
             </view>
             <view class="code-text">
               <text class="sys-color-gray-3" v-if="time<=0" @click="senCode">获取验证码</text>
@@ -20,7 +20,7 @@
             </view>
           </view>
         </view>
-        <view class="login-but sys-color-white sys-background-black" :class="{'login-but-no':!isLogin}">登录</view>
+        <view class="login-but sys-color-white sys-background-black sys-selected-but" :class="{'sys-unselected-but':!isLogin}">登录</view>
         <view  class="local-txt sys-color-gray-9">若长时间未收到验证码,请使用以下方式快速登录</view>
       </view>
     </view>
@@ -132,16 +132,9 @@ export default {
 
     .login-but{
       margin-top: 120rpx;
-      border-radius: 200rpx;
-      height: 88rpx;
-      line-height: 88rpx;
-      text-align: center;
-      transition: .5s ease;
-    }
-    .login-but-no{
-      opacity: 0.1;
-      transition: .5s ease;
+
     }
+
     .local-txt{
       padding-top: 32rpx;
       font-size: 24rpx;

+ 20 - 31
pages/login/passLogin.vue

@@ -4,25 +4,26 @@
     <view class="login-box" >
       <view class="login-top">
         <view class="login-title">
-          <text class="title-item sys-color-black sys-weight-600">验证登录</text>
+          <text class="title-item sys-color-black sys-weight-600">账号登录</text>
         </view>
         <view class="login-from">
           <view class="from-text">
             <input type="tel" class="from-input sys-color-gray-3" v-model="phone" placeholder="请输入手机号"></input>
           </view>
-          <view class="from-text">
-            <input type="password" class="from-input sys-color-gray-3" v-model="password" placeholder="请输入手机号"></input>
+          <view class="from-text from-item">
+            <input type="password" class="from-input sys-color-gray-3" v-model="password" placeholder="请输入密码"></input>
           </view>
         </view>
-        <view class="login-but sys-color-white sys-background-black" :class="{'login-but-no':!isLogin}">登录</view>
-        <view  class="local-txt sys-color-gray-9">若长时间未收到验证码,请使用以下方式快速登录</view>
+        <view class="login-but sys-color-white sys-background-black sys-selected-but" :class="{'sys-unselected-but':!isLogin}">登录</view>
       </view>
     </view>
   </view>
 </template>
 
 <script>
+import EnNav from "@/components/en-utils/en-nav/en-nav";
 export default {
+  components: {EnNav},
   data() {
     return {
       isLogin:false,
@@ -30,10 +31,21 @@ export default {
       password:'',
     }
   },
+  watch:{
+    'phone':function (){
+      this.verifyIsLogin()
+    },
+    'password':function (){
+      this.verifyIsLogin()
+    },
+  },
   methods: {
+    verifyIsLogin(){
+      this.isLogin = this.phone.length === 11 && this.password.length>=6;
+    },
     goToEditPass(){
       uni.navigateTo({
-        'url':'/pages/login/passLogin'
+        'url':'/pages/login/forgetPass'
       })
     }
   }
@@ -66,39 +78,16 @@ export default {
           color: #999999;
         }
       }
-      .from-code{
+      .from-item{
         margin-top: 60rpx;
-        display: flex;
-        justify-content: space-between;
-        .from-text{
-          width: 344rpx;
-        }
-        .code-text{
-          width: 180rpx;
-          height: 44rpx;
-          line-height: 44rpx;
-          text-align: center;
-          text{
-            font-size: 32rpx;
-          }
-        }
-
       }
 
     }
 
     .login-but{
       margin-top: 120rpx;
-      border-radius: 200rpx;
-      height: 88rpx;
-      line-height: 88rpx;
-      text-align: center;
-      transition: .5s ease;
-    }
-    .login-but-no{
-      opacity: 0.1;
-      transition: .5s ease;
     }
+
     .local-txt{
       padding-top: 32rpx;
       font-size: 24rpx;

+ 13 - 0
static/css/sys.css

@@ -38,4 +38,17 @@
 .sys-background-gray-9{
   background-color: #999999;
 }
+/*未选中按钮*/
+.sys-unselected-but{
+  opacity: 0.1;
+  transition: .5s ease;
+}
+
+.sys-selected-but{
+  border-radius: 200rpx;
+  height: 88rpx;
+  line-height: 88rpx;
+  text-align: center;
+  transition: .5s ease;
+}