Sfoglia il codice sorgente

bugfix:增加图形验证码、验证交互处理问题

leo 1 anno fa
parent
commit
8189673d56

+ 56 - 39
pages/claimCloudPhone/components/bargainingAssistance.vue

@@ -225,7 +225,6 @@
                 'login-code',
                 'login-code',
                 {
                 {
                   disabled:
                   disabled:
-                    !agreementBool ||
                     codeNumber !== '获取验证码' ||
                     codeNumber !== '获取验证码' ||
                     laoginData.phone.length < 11,
                     laoginData.phone.length < 11,
                 },
                 },
@@ -257,6 +256,13 @@
         </div>
         </div>
       </div>
       </div>
     </van-dialog>
     </van-dialog>
+    <Verify
+      @success="success"
+      mode="pop"
+      captchaType="blockPuzzle"
+      :imgSize="{ width: '300px', height: '155px' }"
+      ref="verify"
+    ></Verify>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -265,6 +271,7 @@ import { sha256 } from 'js-sha256';
 import customProgress from './customProgress.vue';
 import customProgress from './customProgress.vue';
 import loadList from '@/components/loadList';
 import loadList from '@/components/loadList';
 import { fileKeyToUrl } from '@/plugins/file-center.js';
 import { fileKeyToUrl } from '@/plugins/file-center.js';
+import Verify from '@/components/verifition/Verify';
 export default {
 export default {
   props: {
   props: {
     operateActivityId: {
     operateActivityId: {
@@ -329,6 +336,7 @@ export default {
   components: {
   components: {
     customProgress,
     customProgress,
     loadList,
     loadList,
+    Verify,
   },
   },
   mounted() {
   mounted() {
     if (sessionStorage.getItem('isAgreementBool')) {
     if (sessionStorage.getItem('isAgreementBool')) {
@@ -670,8 +678,7 @@ export default {
     getCode() {
     getCode() {
       if (
       if (
         this.laoginData.phone.length < 11 ||
         this.laoginData.phone.length < 11 ||
-        this.codeNumber !== '获取验证码' ||
-        !this.agreementBool
+        this.codeNumber !== '获取验证码'
       ) {
       ) {
         return;
         return;
       }
       }
@@ -679,41 +686,7 @@ export default {
         this.$toast('手机号码有误,请重填');
         this.$toast('手机号码有误,请重填');
         return;
         return;
       }
       }
-      this.$toast.loading({
-        message: '加载中...',
-        forbidClick: true,
-        duration: 0,
-      });
-      const params = {
-        type: 'common',
-        authorizationType: 4,
-        phone: this.laoginData.phone,
-      };
-      this.$axios
-        .$post('message/v5/phone/send', params)
-        .then((res) => {
-          if (res.success) {
-            this.codeNumber = 60;
-            const timer = setInterval(() => {
-              this.codeNumber--;
-              if (this.codeNumber === 0) {
-                this.codeNumber = '获取验证码';
-                clearInterval(timer);
-              }
-            }, 1000);
-            setTimeout(() => {
-              this.$toast('获取成功');
-            });
-          }
-        })
-        .catch((error) => {
-          setTimeout(() => {
-            this.$toast(error.message);
-          });
-        })
-        .finally(() => {
-          this.$toast.clear();
-        });
+      this.$refs.verify.show()
     },
     },
     // 登录
     // 登录
     async login() {
     async login() {
@@ -762,7 +735,7 @@ export default {
               JSON.stringify({ type: Object, data: res.data }),
               JSON.stringify({ type: Object, data: res.data }),
             );
             );
             this.$toast('登录成功');
             this.$toast('登录成功');
-            const url = res.data.jumpToPage
+            const url = !res.data.jumpToPage
               ? '/claimCloudPhone?bool=1'
               ? '/claimCloudPhone?bool=1'
               : '/claimCloudPhone/firstReward';
               : '/claimCloudPhone/firstReward';
             this.$router[res.data.jumpToPage ? 'replace' : 'push'](url);
             this.$router[res.data.jumpToPage ? 'replace' : 'push'](url);
@@ -807,6 +780,44 @@ export default {
         '/claimCloudPhone/agreement?agreementCoding=XYPZYHXY2002',
         '/claimCloudPhone/agreement?agreementCoding=XYPZYHXY2002',
       );
       );
     },
     },
+    success(data) {
+      this.$toast.loading({
+        message: '加载中...',
+        forbidClick: true,
+        duration: 0,
+      });
+      const params = {
+        type: 'common',
+        authorizationType: 4,
+        phone: this.laoginData.phone,
+        captchaVerification: data.captchaVerification
+      };
+      this.$axios
+        .$post('message/v5/phone/send', params)
+        .then((res) => {
+          if (res.success) {
+            this.codeNumber = 60;
+            const timer = setInterval(() => {
+              this.codeNumber--;
+              if (this.codeNumber === 0) {
+                this.codeNumber = '获取验证码';
+                clearInterval(timer);
+              }
+            }, 1000);
+            setTimeout(() => {
+              this.$toast('获取成功');
+            });
+          }
+        })
+        .catch((error) => {
+          setTimeout(() => {
+            this.$toast(error.message);
+          });
+        })
+        .finally(() => {
+          this.$toast.clear();
+        });
+    }
   },
   },
 };
 };
 </script>
 </script>
@@ -814,6 +825,12 @@ export default {
 <style lang="less" scoped>
 <style lang="less" scoped>
 .bargaining-assistance {
 .bargaining-assistance {
   height: 100%;
   height: 100%;
+  /deep/ .van-overlay{
+    z-index: 0 !important;
+  }
+  /deep/ .van-dialog{
+    z-index: 0 !important;
+  }
   .inviter-tips,
   .inviter-tips,
   .invitee-tips {
   .invitee-tips {
     font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
     font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;

+ 1 - 0
pages/claimCloudPhone/components/customProgress.vue

@@ -48,6 +48,7 @@ export default {
   background: #fae8d4;
   background: #fae8d4;
   border-radius: 6px;
   border-radius: 6px;
   position: relative;
   position: relative;
+  z-index: 0;
   .progress-inner {
   .progress-inner {
     height: 12px;
     height: 12px;
     background: linear-gradient(90deg, #fde08d 0%, #ff0000 100%);
     background: linear-gradient(90deg, #fde08d 0%, #ff0000 100%);

+ 1 - 1
plugins/axios.js

@@ -26,7 +26,7 @@ export default function ({ $axios, $auth, $userAgent, query, redirect }) {
         await $auth.reset();
         await $auth.reset();
         // await $auth.setUserToken(null);
         // await $auth.setUserToken(null);
       }
       }
-      if (response.data.status !== 0) {
+      if (response.data.status !== 0 && !response.data.repCode) {
         // const err = new Error(
         // const err = new Error(
         //   response.data.msg || response.data.data || '未知错误',
         //   response.data.msg || response.data.data || '未知错误',
         // );
         // );