|
@@ -191,7 +191,7 @@
|
|
|
<van-button
|
|
<van-button
|
|
|
size="small"
|
|
size="small"
|
|
|
type="primary"
|
|
type="primary"
|
|
|
- @click="sendCode(item)"
|
|
|
|
|
|
|
+ @click="sendCode(item, index)"
|
|
|
:disabled="time != null"
|
|
:disabled="time != null"
|
|
|
>发送验证码<span v-if="time">({{ timeNum }})</span>
|
|
>发送验证码<span v-if="time">({{ timeNum }})</span>
|
|
|
</van-button>
|
|
</van-button>
|
|
@@ -214,7 +214,7 @@
|
|
|
v-model="item.answerValue"
|
|
v-model="item.answerValue"
|
|
|
:placeholder="item.text"
|
|
:placeholder="item.text"
|
|
|
type="number"
|
|
type="number"
|
|
|
- @blur="verification(item)"
|
|
|
|
|
|
|
+ @blur="verification(item, collectionItemList)"
|
|
|
@input="numberFn(item, index, 'A')"></van-field>
|
|
@input="numberFn(item, index, 'A')"></van-field>
|
|
|
<p
|
|
<p
|
|
|
style="color: red; font-size: 14px; margin: 0; padding: 10px 0; text-align: right"
|
|
style="color: red; font-size: 14px; margin: 0; padding: 10px 0; text-align: right"
|
|
@@ -559,7 +559,7 @@
|
|
|
<van-button
|
|
<van-button
|
|
|
size="small"
|
|
size="small"
|
|
|
type="primary"
|
|
type="primary"
|
|
|
- @click="sendCode(childitem)"
|
|
|
|
|
|
|
+ @click="sendCode(childitem, index)"
|
|
|
:disabled="time != null"
|
|
:disabled="time != null"
|
|
|
>发送验证码<span v-if="time">({{ timeNum }})</span>
|
|
>发送验证码<span v-if="time">({{ timeNum }})</span>
|
|
|
</van-button>
|
|
</van-button>
|
|
@@ -588,7 +588,7 @@
|
|
|
v-model="childitem.collectionOptionList[0].answerValue"
|
|
v-model="childitem.collectionOptionList[0].answerValue"
|
|
|
:placeholder="item.text"
|
|
:placeholder="item.text"
|
|
|
type="number"
|
|
type="number"
|
|
|
- @blur="verification(childitem)"
|
|
|
|
|
|
|
+ @blur="verification(childitem, child.collectionItems)"
|
|
|
@input="numberFn(childitem, index)"></van-field>
|
|
@input="numberFn(childitem, index)"></van-field>
|
|
|
<p
|
|
<p
|
|
|
style="
|
|
style="
|
|
@@ -2963,7 +2963,6 @@ export default {
|
|
|
competitortableData: [],
|
|
competitortableData: [],
|
|
|
time: null, //计时
|
|
time: null, //计时
|
|
|
timeNum: 0,
|
|
timeNum: 0,
|
|
|
- sendPhone: '', //当前验证的电话
|
|
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
beforeRouteLeave(to, from, next) {
|
|
beforeRouteLeave(to, from, next) {
|
|
@@ -5000,17 +4999,23 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 发送验证码
|
|
// 发送验证码
|
|
|
sendCode(val) {
|
|
sendCode(val) {
|
|
|
- if (!/^1[3456789]\d{9}$/.test(val.answerValue) || val.answerValue == '') {
|
|
|
|
|
|
|
+ let answerValue = '';
|
|
|
|
|
+ if (val.collectionOptionList && val.collectionOptionList.length) {
|
|
|
|
|
+ answerValue = val.collectionOptionList[0].answerValue;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ answerValue = val.answerValue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!/^1[3456789]\d{9}$/.test(answerValue) || answerValue == '') {
|
|
|
this.$toast(val.collectionName + '格式错误');
|
|
this.$toast(val.collectionName + '格式错误');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if (this.time) return;
|
|
if (this.time) return;
|
|
|
this.timeNum = 0;
|
|
this.timeNum = 0;
|
|
|
- this.sendPhone = val.answerValue;
|
|
|
|
|
this.sendCodeFun(
|
|
this.sendCodeFun(
|
|
|
{
|
|
{
|
|
|
type: '1', //String 调用类型:1:发送验证码 2:校验验证码
|
|
type: '1', //String 调用类型:1:发送验证码 2:校验验证码
|
|
|
- phone: val.answerValue, //String 手机号
|
|
|
|
|
|
|
+ phone: answerValue, //String 手机号
|
|
|
verification: '', //String 手机号验证码
|
|
verification: '', //String 手机号验证码
|
|
|
},
|
|
},
|
|
|
() => {
|
|
() => {
|
|
@@ -5022,18 +5027,40 @@ export default {
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
- verification(item) {
|
|
|
|
|
- if (item.answerValue == '' || this.sendPhone == '') {
|
|
|
|
|
|
|
+ verification(item, collectionItems) {
|
|
|
|
|
+ let answerValue = '';
|
|
|
|
|
+ if (item.collectionOptionList && item.collectionOptionList.length) {
|
|
|
|
|
+ answerValue = item.collectionOptionList[0].answerValue;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ answerValue = item.answerValue;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 验证码
|
|
|
|
|
+ if (answerValue == '') {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ let telSendCode = collectionItems.find((res) => {
|
|
|
|
|
+ if (res.answerType == 'tel_send_code') {
|
|
|
|
|
+ return res;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ // 手机号
|
|
|
|
|
+ let sendPhone = '';
|
|
|
|
|
+ if (telSendCode.collectionOptionList && telSendCode.collectionOptionList.length) {
|
|
|
|
|
+ sendPhone = telSendCode.collectionOptionList[0].answerValue;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ sendPhone = telSendCode.answerValue;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (sendPhone == '') {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
this.sendCodeFun(
|
|
this.sendCodeFun(
|
|
|
{
|
|
{
|
|
|
type: '2', //String 调用类型:1:发送验证码 2:校验验证码
|
|
type: '2', //String 调用类型:1:发送验证码 2:校验验证码
|
|
|
- phone: this.sendPhone, //String 手机号
|
|
|
|
|
- verification: item.answerValue, //String 手机号验证码
|
|
|
|
|
|
|
+ phone: sendPhone, //String 手机号
|
|
|
|
|
+ verification: answerValue, //String 手机号验证码
|
|
|
},
|
|
},
|
|
|
(res) => {
|
|
(res) => {
|
|
|
- this.$toast(res.data ? '验证成功' : '验证失败');
|
|
|
|
|
|
|
+ this.$toast(res.data ? '验证成功' : '验证码错误');
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|