|
|
@@ -188,7 +188,13 @@
|
|
|
type="tel"
|
|
|
@blur="telFn(item, index, 'A')">
|
|
|
<template #button>
|
|
|
- <van-button size="small" type="primary">发送验证码</van-button>
|
|
|
+ <van-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ @click="sendCode(item)"
|
|
|
+ :disabled="time != null"
|
|
|
+ >发送验证码<span v-if="time">({{ timeNum }})</span>
|
|
|
+ </van-button>
|
|
|
</template>
|
|
|
</van-field>
|
|
|
<p
|
|
|
@@ -2888,6 +2894,8 @@ export default {
|
|
|
productTitles: null,
|
|
|
inspectionType: '',
|
|
|
competitortableData: [],
|
|
|
+ time: null, //计时
|
|
|
+ timeNum: 0,
|
|
|
};
|
|
|
},
|
|
|
beforeRouteLeave(to, from, next) {
|
|
|
@@ -2925,6 +2933,8 @@ export default {
|
|
|
store.dispatch('setShotsNum', 0);
|
|
|
this.show = false;
|
|
|
this.stillDistribute = false;
|
|
|
+ this.time = null; //计时
|
|
|
+ this.timeNum = 0;
|
|
|
},
|
|
|
watch: {
|
|
|
$route(to, from) {
|
|
|
@@ -4364,7 +4374,9 @@ export default {
|
|
|
this.collectionItemList[b].answerType == 'sm' ||
|
|
|
this.collectionItemList[b].answerType == 'wb' ||
|
|
|
this.collectionItemList[b].answerType == 'tel' ||
|
|
|
- this.collectionItemList[b].answerType == 'date'
|
|
|
+ this.collectionItemList[b].answerType == 'date' ||
|
|
|
+ this.collectionItemList[b].answerType == 'tel_send_code' ||
|
|
|
+ this.collectionItemList[b].answerType == 'check_code'
|
|
|
) {
|
|
|
formData.collectionAnswers.push({
|
|
|
collectionId: this.collectionItemList[b].collectionId,
|
|
|
@@ -4896,6 +4908,19 @@ export default {
|
|
|
return true;
|
|
|
}
|
|
|
},
|
|
|
+ // 发送验证码
|
|
|
+ sendCode(val) {
|
|
|
+ if (!/^1[3456789]\d{9}$/.test(val.answerValue) || val.answerValue == '') {
|
|
|
+ this.$toast(val.collectionName + '格式错误');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.time) return;
|
|
|
+ this.timeNum = 0;
|
|
|
+ this.time = setInterval(() => {
|
|
|
+ this.timeNum++;
|
|
|
+ if (this.timeNum == 60) this.time = null;
|
|
|
+ }, 1000);
|
|
|
+ },
|
|
|
onClickLeft() {
|
|
|
this.$router.go(-1);
|
|
|
},
|