|
|
|
@ -12,6 +12,7 @@ |
|
|
|
<script> |
|
|
|
import vButton from './vButton.vue' |
|
|
|
import serve from "@/api/serve"; |
|
|
|
import Member from "@/api/member"; |
|
|
|
export default { |
|
|
|
name: "vCode", |
|
|
|
props: { |
|
|
|
@ -44,7 +45,26 @@ export default { |
|
|
|
type: String, |
|
|
|
require: false, |
|
|
|
}, |
|
|
|
sendAAA: { |
|
|
|
type: Boolean |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
sendAAA(n,o){ |
|
|
|
if(n){ |
|
|
|
console.log(n, '-------'); |
|
|
|
// setTimeout(()=>{ |
|
|
|
// this.inSend = false; |
|
|
|
// this.load = true; |
|
|
|
// this.countDown(); |
|
|
|
// this.$toast(this.$t('common.sendSuccess')); |
|
|
|
// this.$emit('changeSendAAA', false) |
|
|
|
// }, 500) |
|
|
|
// return; |
|
|
|
this.send(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
components:{ |
|
|
|
vButton |
|
|
|
}, |
|
|
|
@ -64,6 +84,7 @@ export default { |
|
|
|
methods: { |
|
|
|
// 发送验证码 |
|
|
|
send() { |
|
|
|
console.log(this.sendAAA, '-------this.sendAAA'); |
|
|
|
if(this.data.phone==''){ |
|
|
|
this.$toast(this.$t('reg.a3')) |
|
|
|
return |
|
|
|
@ -74,24 +95,29 @@ export default { |
|
|
|
} |
|
|
|
if (this.load) return; |
|
|
|
this.inSend = true; |
|
|
|
serve.post(this.url, this.data) |
|
|
|
.then((res) => { |
|
|
|
// ss |
|
|
|
if(res.code=='4001'){ |
|
|
|
this.inSend = false |
|
|
|
this.$toast(res.message); |
|
|
|
}else{ |
|
|
|
this.inSend = false; |
|
|
|
this.load = true; |
|
|
|
this.countDown(); |
|
|
|
this.$toast(this.$t('common.sendSuccess')); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
this.inSend = false; |
|
|
|
}); |
|
|
|
if(this.url==="/register/sendEmailCode" && !this.sendAAA){ |
|
|
|
this.$emit('changeSLider', true); |
|
|
|
|
|
|
|
}else{ |
|
|
|
// serve.post(this.url, this.data) |
|
|
|
Member.sendEmailCode(this.data) |
|
|
|
.then((res) => { |
|
|
|
if(res.code=='4001'){ |
|
|
|
this.inSend = false |
|
|
|
this.$toast(res.message); |
|
|
|
}else{ |
|
|
|
this.inSend = false; |
|
|
|
this.load = true; |
|
|
|
this.countDown(); |
|
|
|
this.$toast(this.$t('common.sendSuccess')); |
|
|
|
this.$emit('changeSendAAA', false) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
this.inSend = false; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
countDown() { |
|
|
|
clearInterval(this.Interval); |
|
|
|
|