|
@@ -5,6 +5,7 @@
|
|
|
<v-form @submit.prevent="submit()">
|
|
|
<validation-provider
|
|
|
v-slot="{ errors }"
|
|
|
+ ref="providerPhome"
|
|
|
name="手机号码"
|
|
|
rules="required|min:11|max:11"
|
|
|
slim
|
|
@@ -88,9 +89,9 @@ export default {
|
|
|
async submit() {
|
|
|
try {
|
|
|
this.submitting = true;
|
|
|
- this.$tongji.trackEvent('活动', '注册', '', 0);
|
|
|
- const validationResult = await this.$refs.observer.validate();
|
|
|
- if (validationResult) {
|
|
|
+ const valid = await this.$refs.observer.validate();
|
|
|
+ if (valid) {
|
|
|
+ this.$tongji.trackEvent('活动', '注册', '', 0);
|
|
|
const res = await registerForInvite(this, this.form);
|
|
|
this.$toast.success(res.msg);
|
|
|
}
|
|
@@ -101,19 +102,22 @@ export default {
|
|
|
async sendSmsCode() {
|
|
|
try {
|
|
|
this.codeSending = true;
|
|
|
- this.$tongji.trackEvent('活动', '发送短信', '', 0);
|
|
|
- const res = await sendSmsCode(this, {
|
|
|
- type: 'common',
|
|
|
- authorizationType: 4,
|
|
|
- phone: this.form.phone,
|
|
|
- });
|
|
|
- this.codeTime = 60;
|
|
|
- this.codeInterval = setInterval(() => {
|
|
|
- if (--this.codeTime <= 0) {
|
|
|
- clearInterval(this.codeInterval);
|
|
|
- }
|
|
|
- }, 1000);
|
|
|
- this.$toast.success(res.msg);
|
|
|
+ const validationResult = await this.$refs.providerPhome.validate();
|
|
|
+ if (validationResult.valid) {
|
|
|
+ this.$tongji.trackEvent('活动', '发送短信', '', 0);
|
|
|
+ const res = await sendSmsCode(this, {
|
|
|
+ type: 'common',
|
|
|
+ authorizationType: 4,
|
|
|
+ phone: this.form.phone,
|
|
|
+ });
|
|
|
+ this.codeTime = 60;
|
|
|
+ this.codeInterval = setInterval(() => {
|
|
|
+ if (--this.codeTime <= 0) {
|
|
|
+ clearInterval(this.codeInterval);
|
|
|
+ }
|
|
|
+ }, 1000);
|
|
|
+ this.$toast.success(res.msg);
|
|
|
+ }
|
|
|
} finally {
|
|
|
this.codeSending = false;
|
|
|
}
|