yuantianjiao hace 6 años
padre
commit
2bc08e2828
Se han modificado 2 ficheros con 17 adiciones y 1 borrados
  1. 9
    1
      src/pages/sales/login/index.vue
  2. 8
    0
      src/pages/user/bindMobile/bindMobile.vue

+ 9
- 1
src/pages/sales/login/index.vue Ver fichero

@@ -55,6 +55,7 @@ import { createNamespacedHelpers } from 'vuex'
55 55
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
56 56
 const { mapActions: mapLoginActions } = createNamespacedHelpers('login')
57 57
 const { mapState: mapUserState } = createNamespacedHelpers('userCenter')
58
+let canSubmit
58 59
 export default {
59 60
   data () {
60 61
     return {
@@ -105,6 +106,10 @@ export default {
105 106
       return url.replace('sales.html', 'user.html') + '#/' + val + '?hideTabbar=1'
106 107
     },
107 108
     submit () {
109
+      if (!canSubmit) {
110
+        return
111
+      }
112
+      canSubmit = false
108 113
       if (!this.postData.captcha) {
109 114
         this.$toast('请填写验证码')
110 115
         return
@@ -118,13 +123,16 @@ export default {
118 123
         setTimeout(() => {
119 124
           window.location.replace(this.getUrl('mainPage/coffeeIndex'))
120 125
         }, 2000)
126
+      }).catch(() => {
127
+        canSubmit = true
121 128
       })
122 129
     }
123 130
   },
124 131
   created () {
132
+    canSubmit = true 
125 133
     if (this.userInfo.customer.MapUser) {
134
+      // this.showPage = true
126 135
       window.location.replace(this.getUrl('mainPage/coffeeIndex'))
127
-      // window.location.href = this.getUrl('mainPage/coffeeIndex')
128 136
     } else {
129 137
       this.showPage = true
130 138
     }

+ 8
- 0
src/pages/user/bindMobile/bindMobile.vue Ver fichero

@@ -65,6 +65,7 @@
65 65
 import logo from '../../../common/icon/logo.png'
66 66
 import { mapState, createNamespacedHelpers } from 'vuex'
67 67
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
68
+let canSubmit
68 69
 export default {
69 70
   data () {
70 71
     return {
@@ -90,6 +91,7 @@ export default {
90 91
     })
91 92
   },
92 93
   created () {
94
+    canSubmit = true
93 95
     this.getCaseInfo(1).then(() => {
94 96
       this.columns = this.caseInfo.cases
95 97
     })
@@ -163,6 +165,10 @@ export default {
163 165
       }, 1000)
164 166
     },
165 167
     submit () {
168
+      if (!canSubmit){
169
+        return
170
+      }
171
+      canSubmit = false
166 172
       if (!this.postData.captcha) {
167 173
         this.$toast('请填写验证码')
168 174
         return
@@ -187,6 +193,8 @@ export default {
187 193
             window.history.go(-1)
188 194
           }, 2000)
189 195
         }
196
+      }).catch(() => {
197
+        canSubmit = true
190 198
       })
191 199
     }
192 200
   }