Explorar o código

feature_20250722_金牌店档案收集

zhujindu hai 4 meses
pai
achega
81f67ad41d
Modificáronse 1 ficheiros con 32 adicións e 3 borrados
  1. 32 3
      src/views/deviceWithin/addStoreVisit.vue

+ 32 - 3
src/views/deviceWithin/addStoreVisit.vue

@@ -2963,6 +2963,7 @@ export default {
       competitortableData: [],
       time: null, //计时
       timeNum: 0,
+      sendPhone: '', //当前验证的电话
     };
   },
   beforeRouteLeave(to, from, next) {
@@ -5005,16 +5006,44 @@ export default {
       }
       if (this.time) return;
       this.timeNum = 0;
-      sendAndCheckVerCode({}).then((res) => {
-        if (res.code == 200) {
+      this.sendPhone = val.answerValue;
+      this.sendCodeFun(
+        {
+          type: '1', //String	调用类型:1:发送验证码 2:校验验证码
+          phone: val.answerValue, //String	手机号
+          verification: '', //String	手机号验证码
+        },
+        () => {
           this.time = setInterval(() => {
             this.timeNum++;
             if (this.timeNum == 60) this.time = null;
           }, 1000);
+          this.$toast('发送成功');
+        }
+      );
+    },
+    verification(item) {
+      if (item.answerValue == '' || this.sendPhone == '') {
+        return;
+      }
+      this.sendCodeFun(
+        {
+          type: '2', //String	调用类型:1:发送验证码 2:校验验证码
+          phone: this.sendPhone, //String	手机号
+          verification: item.answerValue, //String	手机号验证码
+        },
+        (res) => {
+          this.$toast(res.data ? '验证成功' : '验证失败');
+        }
+      );
+    },
+    sendCodeFun(params, callback) {
+      sendAndCheckVerCode(params).then((res) => {
+        if (res.code == 200) {
+          callback && callback(res);
         }
       });
     },
-    verification(item) {},
     onClickLeft() {
       this.$router.go(-1);
     },