WIN-20230912WHV\Administrator 1 年間 前
コミット
37b0c939c3
8 ファイル変更206 行追加85 行削除
  1. 1 0
      App.vue
  2. 7 3
      api/common.js
  3. 0 58
      api/task.js
  4. 10 0
      api/user.js
  5. 0 6
      api/weChat.js
  6. 138 17
      pages/login/index.vue
  7. 0 1
      static/css/common.css
  8. 50 0
      static/css/shake.css

+ 1 - 0
App.vue

@@ -16,6 +16,7 @@ export default {
 /*每个页面公共css */
 @import "/static/css/common.css";
 @import "/static/css/default-color.scss";
+@import "/static/css/shake.css";
 
 
 checkbox .wx-checkbox-input {

+ 7 - 3
api/common.js

@@ -1,8 +1,12 @@
-import {request} from '../service/ajax.js'
+import {request,uploadFile} from '@/service/ajax'
 
 const commonUrl = '/api/common/'
 // 发送短信
 export const commonSend = (data) => request(commonUrl + 'send', 'post', { ...data })
-// 获取sts
-export const getSts = (data) => request(commonUrl + 'sts', 'post', { ...data })
+export const getRegion = (data) => request(commonUrl + 'region', 'post', { ...data })
+export const getTxySts = (data) => request(commonUrl + 'tx-sts', 'post', { ...data })
+export const getMessage = (data) => request(commonUrl + 'message', 'post', { ...data })
+export const getBaiDuImgRecognition = (data) => request(commonUrl + 'recognition', 'post', { ...data })
+export const getSn = (data) => request(commonUrl + 'sn', 'post', { ...data },true)
+
 

+ 0 - 58
api/task.js

@@ -1,58 +0,0 @@
-import {request} from '@/service/ajax.js'
-
-const newsUrl = '/api/task/'
-// 获取基本信息
-export const getTaskType = (data) => request(newsUrl + 'type', 'post', { ...data },false)
-export const getTaskTypeInfo = (data) => request(newsUrl + 'type-info', 'post', { ...data },true)
-//获取任务基本选项信息
-export const getTaskOptions = (data) => request(newsUrl + 'options', 'post', { ...data },true)
-//获取联系人关系
-export const getTaskRelations = (data) => request(newsUrl + 'relations', 'post', { ...data },true)
-export const getClientInfo = (data) => request(newsUrl + 'client', 'post', { ...data },true)
-export const addTask = (data) => request(newsUrl + 'add', 'post', { ...data },true)
-// 任务详情
-export const getTaskDetail = (data) => request(newsUrl + 'detail', 'post', { ...data },true)
-//任务接单
-export const takeTask = (data) => request(newsUrl + 'take', 'post', { ...data },true)
-//审核
-export const auditTask = (data) => request(newsUrl + 'audit', 'post', { ...data },true)
-export const setMsg = (data) => request(newsUrl + 'add-msg', 'post', { ...data },true)
-export const getMsgList = (data) => request(newsUrl + 'msg-list', 'post', { ...data },false)
-export const getExecuteList = (data) => request(newsUrl + 'execute-list', 'post', { ...data },false)
-export const setExecute = (data) => request(newsUrl + 'set-execute', 'post', { ...data },false)
-export const getTaskStage = (data) => request(newsUrl + 'stage', 'post', { ...data },false)
-export const setExecuteTask = (data) => request(newsUrl + 'execute', 'post', { ...data },true)
-//获取可接单列表
-export const getTaskReceiving = (data) => request(newsUrl + 'receiving', 'post', { ...data },false)
-export const getTaskList = (data) => request(newsUrl + 'task-list', 'post', { ...data },false)
-export const endTask = (data) => request(newsUrl + 'end', 'post', { ...data },false)
-export const cancellation = (data) => request(newsUrl + 'cancellation', 'post', { ...data },false)
-export const delTask = (data) => request(newsUrl + 'del', 'post', { ...data },false)
-export const getStageList = (data) => request(newsUrl + 'stage-list', 'post', { ...data },false)
-export const getStageUser = (data) => request(newsUrl + 'stage-user', 'post', { ...data },false)
-export const getBusinessStageList = (data) => request(newsUrl + 'business-stage', 'post', { ...data },false)
-export const getBusinessCache = (data) => request(newsUrl + 'get-cache', 'post', { ...data },false)
-export const setBusinessCache = (data) => request(newsUrl + 'set-cache', 'post', { ...data },false)
-export const delBusinessCache = (data) => request(newsUrl + 'del-cache', 'post', { ...data },true)
-
-// 草稿Api
-export const addDraft = (data) => request(newsUrl + 'draft-add', 'post', { ...data },true)
-export const getDraftList = (data) => request(newsUrl + 'draft-list', 'post', { ...data },true)
-export const getDraftItem = (data) => request(newsUrl + 'draft-item', 'post', { ...data },true)
-export const delDraft = (data) => request(newsUrl + 'draft-del', 'post', { ...data },true)
-//阶段操作
-export const setStageOperate = (data) => request(newsUrl + 'operate', 'post', { ...data },true)
-export const getReturnedBankList = (data) => request(newsUrl + 'banks', 'post', { ...data },true)
-//录入数据校验
-export const verifyBusinessModuleKey = (data) => request(newsUrl + 'verify', 'post', { ...data },true)
-
-export const getWeekList = (data) => request(newsUrl + 'week', 'post', { ...data },true)
-export const getDayBacklogList = (data) => request(newsUrl + 'backlog', 'post', { ...data },true)
-export const setDayBacklog = (data) => request(newsUrl + 'status', 'post', { ...data },true)
-export const getProductData = (data) => request(newsUrl + 'product-data', 'post', { ...data },true)
-export const setPostLoan = (data) => request(newsUrl + 'set-loan', 'post', { ...data },true)
-
-
-// 贷后管理列表
-export const getLoanList = (data) => request(newsUrl + 'loan-list', 'post', { ...data },true)
-export const getAdjust = (data) => request(newsUrl + 'adjust', 'post', { ...data },true)

+ 10 - 0
api/user.js

@@ -0,0 +1,10 @@
+import {request} from '@/service/ajax'
+
+const newsUrl = '/api/member/'
+// 获取基本信息
+export const getMemberInfo = (data) => request(newsUrl + 'info', 'post', { ...data },false)
+export const updateMemberInfo = (data) => request(newsUrl + 'update', 'post', { ...data },false)
+export const updatePhone = (data) => request(newsUrl + 'phone', 'post', { ...data },false)
+export const setPassword = (data) => request(newsUrl + 'password', 'post', { ...data },false)
+export const logout = (data) => request(newsUrl + 'logout', 'post', { ...data },false)
+export const getShareCode = (data) => request(newsUrl + 'share', 'post', { ...data },true)

+ 0 - 6
api/weChat.js

@@ -1,6 +0,0 @@
-import { request } from '@/service/ajax'
-// 商品模块路由
-const url = '/api/weChat/'
-// 猜你喜欢
-export const getWxJsSign = (data) => request(url + 'js-config', 'post', { ...data })
-

+ 138 - 17
pages/login/index.vue

@@ -12,23 +12,25 @@
         </view>
         <view class="from-box one-background-color">
           <view class="from-animation" v-if="type===1">
-            <view class="input-item  sys-from-background-color sys-radius-30 ">
-              <input type="number" class="login-input" placeholder="请输入手机号" maxlength="11"></input>
+            <view class="input-item  sys-from-background-color sys-radius-30 " :class="{'apply-shake':phoneShake}">
+              <input type="number" class="login-input" placeholder="请输入手机号" maxlength="11" v-model="loginData.phone"></input>
             </view>
-            <view class="input-item   sys-from-background-color sys-radius-30">
-              <input type="number" class="login-input" placeholder="请输入验证码"></input>
+            <view class="input-item  input-send sys-from-background-color sys-radius-30" :class="{'apply-shake':codedShake}">
+              <input type="number" class="login-input" placeholder="请输入验证码" v-model="loginData.code"></input>
+              <view class="login-send dominant-text-color sys-size-28 sys-weight-400" @click="getVerifiedCode" v-if="timeNum<=0">发送验证码</view>
+              <view class="login-send dominant-text-color sys-size-28 sys-weight-400" v-else>{{ timeNum }} s</view>
             </view>
           </view>
           <view class="from-animation" v-else>
-            <view class="input-item  sys-from-background-color sys-radius-30 ">
-              <input type="number" class="login-input" placeholder="请输入手机号" maxlength="11"></input>
+            <view class="input-item  sys-from-background-color sys-radius-30 " :class="{'apply-shake':phoneShake}">
+              <input type="number" class="login-input" placeholder="请输入手机号"  v-model="loginData.phone" maxlength="11"></input>
             </view>
-            <view class="input-item   sys-from-background-color sys-radius-30">
-              <input type="password" class="login-input" placeholder="请输入密码"></input>
+            <view class="input-item   sys-from-background-color sys-radius-30" :class="{'apply-shake':passwordShake}">
+              <input type="password" class="login-input" placeholder="请输入密码" v-model="loginData.password"></input>
             </view>
           </view>
 
-          <view class="input-agreement" @click="setIsConsent">
+          <view class="input-agreement" @click="setIsConsent" :class="{'apply-shake':consentShake}">
             <image class="agreement-agree" v-if="isConsent" src="/static/img/login/Checked2@3x.png" mode="aspectFill"></image>
             <image class="agreement-agree" v-else src="/static/img/login/Checked1@3x.png" mode="aspectFill"></image>
             <view class="agreement-text three-text-color sys-size-24">已阅读并同意</view>
@@ -38,6 +40,7 @@
           <view
               class="input-but dominant-background-color one-text-color sys-size-30 sys-radius-100 sys-weight-600"
               :class="{'sys-selected-but':isLogin,'sys-unselected-but':!isLogin}"
+              @click="login"
           >登陆</view>
         </view>
       </view>
@@ -46,6 +49,10 @@
   </view>
 </template>
 <script>
+  import {commonSend} from "@/api/common";
+  import tools from "@/service/tools";
+  import {login} from "@/api/login";
+
   export default {
     components: {
 
@@ -53,16 +60,118 @@
     data() {
       return {
         type:1,
-        password:'',
-        code:'',
+        loginData: {
+          phone: '',
+          password: '',
+          code: '',
+        },
+        phoneShake:false,
+        passwordShake:false,
+        codedShake:false,
+        consentShake:false,
         isConsent:false,
-        isLogin:false
+        isLogin:false,
+        timeNum: 0,
+        timer: null,
+      }
+    },
+    watch:{
+      'loginData': {
+        handler() {
+          this.verifyData()
+        },
+        deep: true
       }
     },
     mounted() {
 
     },
     methods: {
+      setShake(type){
+        if(type===1){
+          this.phoneShake=true
+        }else if(type===2){
+          this.passwordShake=true
+        }else if(type===3){
+          this.codedShake=true
+        }else if(type===4){
+          this.consentShake=true
+        }
+        setTimeout(()=>{
+          this.phoneShake=false
+          this.passwordShake=false
+        },500)
+      },
+      login() {
+        if (this.loginData.phone === '') {
+          tools.error('请输入手机号码');
+          this.setShake(1)
+          return;
+        }
+        if (this.type !== 1) {
+          if (this.loginData.password === '') {
+            this.setShake(2)
+            tools.error('请输入登陆密码');
+            return;
+          }
+        } else {
+          if (this.loginData.code === '') {
+            this.setShake(3)
+            tools.error('请输入验证码');
+            return;
+          }
+        }
+        if (!this.isConsent) {
+          this.setShake(4)
+          tools.error('请阅读并同意协议');
+          return;
+        }
+        login(this.loginData).then((res) => {
+          if (res.code === 1) {
+            tools.setLoginData(res.data, true)
+          } else {
+            tools.error(res.msg)
+          }
+        })
+      },
+      verifyData(){
+        if(this.type===1){
+          this.isLogin=this.loginData.phone!=='' && this.loginData.code!=='' && this.isConsent
+        }else {
+          this.isLogin=this.loginData.phone!=='' && this.loginData.password!=='' && this.isConsent
+        }
+      },
+      getVerifiedCode() {
+        if (this.timeNum > 0) {
+          return;
+        }
+        if (this.loginData.phone === '') {
+          tools.error("请输入手机号码")
+          return;
+        }
+        let regPhone = /^(?:(?:\+|00)86)?1\d{10}$/;
+        if (!regPhone.test(this.loginData.phone)) {
+          tools.error("手机号码格式错误")
+          return;
+        }
+        commonSend({
+          'phone': this.loginData.phone,
+          'send_type': 'retrieve'
+        }).then((res) => {
+          if (res.code === 1) {
+            tools.success(res.msg);
+            this.timeNum = 60;
+            this.timer = setInterval(() => {
+              this.timeNum--;
+              if (this.timeNum <= 0) {
+                clearInterval(this.timer);
+              }
+            }, 1000);
+          } else {
+            tools.error(res.msg);
+          }
+        })
+      },
       setIsConsent(){
         this.isConsent=!this.isConsent
       },
@@ -71,11 +180,7 @@
           this.type=type
         }
       },
-      login() {
-        uni.redirectTo({
-          url: '/pages/index/index'
-        })
-      },
+
     },
   }
 </script>
@@ -150,10 +255,26 @@
         .input-item{
           height: 96rpx;
           padding: 28rpx 40rpx;
+          box-sizing: border-box;
+          .login-input{
+            width: 100%;
+          }
         }
         .input-item:last-child{
           margin-top: 30rpx;
         }
+        .input-send{
+          display: flex;
+          justify-content: flex-start;
+          align-items: center;
+          .login-input{
+            width:calc(100% - 140rpx) ;
+          }
+          .login-send{
+            width: 140rpx;
+            text-align: center;
+          }
+        }
         .input-agreement{
           margin-top: 25rpx;
           display: flex;

+ 0 - 1
static/css/common.css

@@ -92,7 +92,6 @@
 
 /*按钮样式*/
 .sys-selected-but{
-    border-radius: 16rpx;
     height: 88rpx;
     line-height: 88rpx;
     text-align: center;

+ 50 - 0
static/css/shake.css

@@ -0,0 +1,50 @@
+/*抖动动画*/
+@keyframes shake {
+    10%,
+    90% {
+        transform: translate3d(-1px, 0 0);
+    }
+    20%,
+    80% {
+        transform: translate3d(2px, 0, 0);
+    }
+    30%,
+    50%,
+    70% {
+        transform: translate3d(-4px, 0, 0);
+    }
+    40%,
+    60% {
+        transform: translate3d(4px, 0, 0);
+    }
+}
+.apply-shake {
+    animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
+}
+
+/*翻转动画*/
+@keyframes rotate {
+    0% {
+        transform: rotateY(0deg);
+    }
+    100% {
+        transform: rotateY(10deg);
+    }
+}
+@keyframes rotateBack {
+    0% {
+        transform: rotateY(10deg);
+    }
+    100% {
+        transform: rotateY(0deg);
+    }
+}
+
+.overturn-shake {
+    animation: rotate 0.8s ease-in-out 1;
+    animation-fill-mode: forwards;
+}
+.overturn-back-shake {
+    animation: rotateBack 0.8s ease-in-out 1;
+    animation-fill-mode: forwards;
+}