|
|
<template>
|
|
|
<div v-if="showBind" class="third-bind-wrapper">
|
|
|
<div v-if="dialogEnable" class="third-bind-wrapper">
|
|
|
<div class="bind-dialog">
|
|
|
<p class="bind-title">关联有货UFO账户</p>
|
|
|
<div class="under-row">
|
|
|
<div class="left-row-title">
|
|
|
<CubeSelect class="area-code-select" v-model="code" :options="options" :title="selectTitle"></CubeSelect>
|
|
|
<span @click="chooseArea">{{code}}</span>
|
|
|
<span class="iconfont icondownn"></span>
|
|
|
</div>
|
|
|
<CubeInput class="bind-input" :class="phone ? '' : 'bind-input-phone'" v-model="phone"></CubeInput>
|
|
|
</div>
|
...
|
...
|
@@ -24,74 +25,44 @@ |
|
|
|
|
|
<script>
|
|
|
|
|
|
import { Button, Input, Select } from 'cube-ui';
|
|
|
import { Button, Input } from 'cube-ui';
|
|
|
import { mapActions, mapState } from 'vuex';
|
|
|
|
|
|
const areaList = [{
|
|
|
value: '+61',
|
|
|
name: '澳大利亚'
|
|
|
}, {
|
|
|
value: '+82',
|
|
|
text: '韩国'
|
|
|
}, {
|
|
|
value: '+1',
|
|
|
text: '加拿大'
|
|
|
}, {
|
|
|
value: '+60',
|
|
|
text: '马来西亚'
|
|
|
}, {
|
|
|
value: '+1',
|
|
|
text: '美国'
|
|
|
}, {
|
|
|
value: '+81',
|
|
|
text: '日本'
|
|
|
}, {
|
|
|
value: '+65',
|
|
|
text: '新加坡'
|
|
|
}, {
|
|
|
value: '+44',
|
|
|
text: '英国'
|
|
|
}, {
|
|
|
value: '+86',
|
|
|
text: '中国'
|
|
|
}, {
|
|
|
value: '+853',
|
|
|
text: '中国澳门'
|
|
|
}, {
|
|
|
value: '+886',
|
|
|
text: '中国台湾'
|
|
|
}, {
|
|
|
value: '+852',
|
|
|
text: '中国香港'
|
|
|
}];
|
|
|
|
|
|
export default {
|
|
|
name: 'ThirdBind',
|
|
|
data() {
|
|
|
return {
|
|
|
showBind: false,
|
|
|
code: '+86',
|
|
|
options: areaList,
|
|
|
selectTitle: '选择国家和地区',
|
|
|
phone: '',
|
|
|
smsCode: '',
|
|
|
sendBtnText: ''
|
|
|
sendBtnText: '',
|
|
|
binded: false
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
dialogEnable() {
|
|
|
return this.showBind && !this.binded;
|
|
|
},
|
|
|
submitDisable() {
|
|
|
return !(this.phone && this.smsCode);
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['sendBindSms', 'submitThirdBind']),
|
|
|
show() {
|
|
|
open() {
|
|
|
this.bindCode = this.$route.query.bind_code;
|
|
|
this.showBind = true;
|
|
|
this.phone = '';
|
|
|
this.smsCode = '';
|
|
|
this.clearSendTimer();
|
|
|
this.show();
|
|
|
},
|
|
|
close() {
|
|
|
this.showBind = false;
|
|
|
},
|
|
|
show() {
|
|
|
this.showBind = true;
|
|
|
},
|
|
|
toast(msg, time = 2000) {
|
|
|
this.$createToast && this.$createToast({
|
|
|
txt: msg,
|
...
|
...
|
@@ -99,14 +70,22 @@ export default { |
|
|
time
|
|
|
}).show();
|
|
|
},
|
|
|
chooseArea() {
|
|
|
this.$router.push({
|
|
|
name: 'passport.area'
|
|
|
});
|
|
|
},
|
|
|
changeArea(code) {
|
|
|
code && (this.code = code);
|
|
|
},
|
|
|
sendSMS() {
|
|
|
let total = 60;
|
|
|
let timer = setInterval(() => {
|
|
|
|
|
|
this.timer = setInterval(() => {
|
|
|
if (--total) {
|
|
|
this.sendBtnText = '重发' + total;
|
|
|
} else {
|
|
|
this.sendBtnText = '';
|
|
|
clearInterval(timer);
|
|
|
this.clearSendTimer();
|
|
|
}
|
|
|
}, 1000);
|
|
|
this.sendBtnText = '重发' + total;
|
...
|
...
|
@@ -116,6 +95,10 @@ export default { |
|
|
bindCode: this.bindCode
|
|
|
});
|
|
|
},
|
|
|
clearSendTimer() {
|
|
|
this.sendBtnText = '';
|
|
|
clearInterval(this.timer);
|
|
|
},
|
|
|
bindSubmit() {
|
|
|
if (this.phone && this.smsCode) {
|
|
|
this.submitThirdBind({
|
...
|
...
|
@@ -124,6 +107,7 @@ export default { |
|
|
bindCode: this.bindCode
|
|
|
}).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.binded = true;
|
|
|
this.close();
|
|
|
} else {
|
|
|
this.toast(res.message);
|
...
|
...
|
@@ -136,7 +120,6 @@ export default { |
|
|
},
|
|
|
components: {
|
|
|
CubeInput: Input,
|
|
|
CubeSelect: Select,
|
|
|
CubeButton: Button
|
|
|
}
|
|
|
};
|
...
|
...
|
@@ -183,17 +166,9 @@ export default { |
|
|
flex-shrink: 0;
|
|
|
color: #999;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.area-code-select {
|
|
|
display: inline-block;
|
|
|
|
|
|
&:after {
|
|
|
border: 0;
|
|
|
}
|
|
|
|
|
|
/deep/ .cube-select-text {
|
|
|
font-size: 14px;
|
|
|
.iconfont {
|
|
|
font-size: 28px;
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|