wangxin 5 лет назад
Родитель
Сommit
a5ece8e1fd
2 измененных файлов с 33 добавлено и 25 удалено
  1. 31 23
      src/view/interview/xiapu.vue
  2. 2 2
      src/view/talent_exchange/Index.vue

+ 31 - 23
src/view/interview/xiapu.vue

@@ -444,30 +444,34 @@
                 })
             },
             onSubmit(data) {
-                for (let key in data) {
-                    if (message[key] && !data[key]) {
-                        this.$toast(message[key]);
-                        this.$refs.form.scrollToField(key)
-                        return
-                    }
-                }
-                if (!isMobile(data.phone)) {
-                    this.$toast.fail('手机号格式错误');
-                    this.$refs.form.scrollToField('phone')
-                    return
-                }
-                if (data.contact_number && !isMobile(data.contact_number) && !isPhone(data.contact_number)) {
-                    this.$toast.fail('紧急联系人电话号码格式错误');
-                    this.$refs.form.scrollToField('contact_number')
-                    return
-                }
-                if (data.idcardNumber.length !== 15 && data.idcardNumber.length !== 18) {
-                    this.$toast.fail('身份证格式错误');
-                    this.$refs.form.scrollToField('idcardNumber')
-                    return
-                }
                 if (!this.loading) {
                     this.loading = true
+                    for (let key in data) {
+                        if (message[key] && !data[key]) {
+                            this.$toast(message[key]);
+                            this.$refs.form.scrollToField(key)
+                            this.loading = false
+                            return
+                        }
+                    }
+                    if (!isMobile(data.phone)) {
+                        this.$toast.fail('手机号格式错误');
+                        this.$refs.form.scrollToField('phone')
+                        this.loading = false
+                        return
+                    }
+                    if (data.contact_number && !isMobile(data.contact_number) && !isPhone(data.contact_number)) {
+                        this.$toast.fail('紧急联系人电话号码格式错误');
+                        this.$refs.form.scrollToField('contact_number')
+                        this.loading = false
+                        return
+                    }
+                    if (data.idcardNumber.length !== 15 && data.idcardNumber.length !== 18) {
+                        this.$toast.fail('身份证格式错误');
+                        this.$refs.form.scrollToField('idcardNumber')
+                        this.loading = false
+                        return
+                    }
                     const query = {}
                     query.id = this.id
                     query.user_token = this.user_token;
@@ -489,17 +493,21 @@
                     }
                     postAction(hpInterviewRegister, query).then(() => {
                         this.$toast.success({
+                            forbidClick: true,
+                            duration: 1200,
                             message: '提交成功',
                             onClose: () => {
                                 if (miniProgram) {
                                     wx.miniProgram.switchTab({
                                         url: '/pages/index/index'
                                     })
-                                    this.loading = false
                                 }
                             }
                         })
+                        this.loading = false
                     })
+                } else {
+                    this.$toast.fail({icon: 'close', message: '请勿重复点击'})
                 }
             },
             showLocation(data) {

+ 2 - 2
src/view/talent_exchange/Index.vue

@@ -214,8 +214,8 @@
                     // data.member_id = this.member_id
                     postAction(checkIns, data).then(() => {
                         this.$toast.success({
-                            message: '提交中...',
-                            onClose: () => {
+                            message: '提交成功',
+                            onOpened: () => {
                                 document.title = '提交成功'
                                 this.isRegister = true
                             }