| | |
| | | <img src="../../assets/image/icon-close.png" alt="" @click="router.go(-1)"> |
| | | <div @click="onRoute('/customerService')">{{ $t('onLineService') }}</div> |
| | | </div> |
| | | <div class="title textColor">{{ $t('更换绑定') }}</div> |
| | | <div class="title textColor">{{ $t('bind') }}</div> |
| | | <div class="flex re-tab"> |
| | | <!-- <div class="textColor1" :class="activeIndex == 0 ? 'active' : ''" @click="changeIndex(0)">{{ |
| | | $t('account') |
| | | }}</div> --> |
| | | <div class="textColor1" :class="activeIndex == 1 ? 'active' : ''" @click="changeIndex(1)"> |
| | | {{ $t('email') }} |
| | | </div> |
| | |
| | | {{ $t('phoneNum') }} |
| | | </div> |
| | | </div> |
| | | <ExInput :label="getRegType(activeIndex, true)" :placeholderText="getRegType(activeIndex, false)" |
| | | v-model="username" :area="isArea" :dialCode="dialCode" @selectArea="onSelectArea" :icon="icon" /> |
| | | |
| | | <ExInput :label="$t('repassword')" :placeholderText="$t('请输入')" v-model="password" |
| | | typeText="password" /> |
| | | <!-- <ExInput :label="$t('repassword')" :placeholderText="$t('surePassword')" v-model="repassword" |
| | | typeText="password" /> --> |
| | | <ExInput :label="$t('fundsPassword')" :placeholderText="$t('请输入')" v-model="safeword" typeText="password" |
| | | v-if="activeIndex === 1 || activeIndex === 2" /> |
| | | <div class="inputCom" v-if="activeIndex === 1 || activeIndex === 2"> |
| | | <p class="label textColor">{{ $t('验证码') }}</p> |
| | | <div class="iptbox inputBackground"> |
| | | <input class="inputBackground textColor" type="text" :placeholder="$t('entryVerifyCode')" |
| | | v-model="verifyCode"> |
| | | <span v-if="type !== 3" @click="senCode">{{ $t('sendVerifyCode') }} |
| | | <template v-if="time">({{ time }})s</template> |
| | | </span> |
| | | <template v-if="(activeIndex == 1 && !userdata.emailverif) || (activeIndex == 2 && !userdata.phoneverif)"> |
| | | <ExInput :label="getRegType(activeIndex, true)" :placeholderText="getRegType(activeIndex, false)" |
| | | v-model="username" :area="isArea" :dialCode="dialCode" @selectArea="onSelectArea" :icon="icon" /> |
| | | |
| | | <div class="inputCom" v-if="activeIndex === 1 || activeIndex === 2"> |
| | | <p class="label textColor">{{ $t('验证码') }}</p> |
| | | <div class="iptbox inputBackground"> |
| | | <input class="inputBackground textColor" type="text" :placeholder="$t('entryVerifyCode')" |
| | | v-model="verifyCode"> |
| | | <span v-if="type !== 3" @click="senCode">{{ $t('sendVerifyCode') }} |
| | | <template v-if="time">({{ time }})s</template> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- <ExInput :label="$t('金融机构代码')" :placeholderText="$t('请输入')" v-model="invitCode" :clearBtn="false" /> --> |
| | | <van-button class="w-full" style="margin-top:10px;" type="primary" @click="register">{{ $t('confirm') }} |
| | | </van-button> |
| | | </template> |
| | | |
| | | <div class="protocol textColor"> |
| | | <i @click="agreeProt"> |
| | | <img v-show="agree" src="../../assets/image/login/prot2.png" alt="" /> |
| | | <img v-show="!agree" src="../../assets/image/login/prot1.png" alt="" /> |
| | | </i> |
| | | <!-- {{ $t('readAgree') }}<span class="colorMain" @click="router.push('/TermsOfService')">{{ |
| | | $t('serviceConf') |
| | | }}</span> --> |
| | | {{ $t('readAgree') }}<span class="colorMain" @click="router.push('/aboutUs?serviceTerm=23')">{{ |
| | | $t('serviceConf') |
| | | }}</span> |
| | | </div> |
| | | <van-button class="w-full" style="margin-top:10px;" type="primary" @click="register">{{ $t('confirm') }} |
| | | </van-button> |
| | | <!-- <div class="noTips textColor">{{ $t('hasAccount') }}<span class="colorMain" @click="router.push('/login')"> |
| | | {{ $t('goLogin') }}</span> |
| | | </div> --> |
| | | <!-- 邮箱已绑定显示 --> |
| | | <template v-if="(activeIndex == 1 && userdata.emailverif)"> |
| | | <div>{{ $t('邮箱已绑定') }}:</div> |
| | | <div>{{ userdata.email }}</div> |
| | | </template> |
| | | <!-- 手机号已绑定显示 --> |
| | | <template v-if="(activeIndex == 2 && userdata.phoneverif)"> |
| | | <div>{{ $t('手机号已绑定') }}:</div> |
| | | <div>{{ userdata.phone }}</div> |
| | | </template> |
| | | |
| | | <nationality-list ref='controlChildRef' :title="$t('selectArea')" @getName="getName"></nationality-list> |
| | | |
| | | <Vcode :imgs="[img1, img2]" :show="show" @success="onSuccess" :canvasHeight="200" @fail="onFail" |
| | |
| | | <script setup> |
| | | import ExInput from "@/components/ex-input/index.vue"; |
| | | import { _registerUser, _sendVerifyCode } from "@/service/login.api"; |
| | | import { _bindEmailRegister, _registerEorP } from "@/service/user.api.js"; |
| | | import { _info, _bindEmail, _bindPhone } from "@/service/user.api.js"; |
| | | import { useUserStore } from '@/store/user'; |
| | | import { GET_USERINFO } from '@/store/types.store' |
| | | import nationalityList from '../authentication/components/nationalityList.vue' |
| | | import Vcode from "vue3-puzzle-vcode"; |
| | | import img1 from "@/assets/image/slider/1.png"; |
| | | import img2 from "@/assets/image/slider/2.png"; |
| | | import { getStorage } from '@/utils/index' |
| | | import { useI18n } from 'vue-i18n' |
| | | import { customerServiceUrl } from "@/config"; |
| | | import { useRouter } from 'vue-router'; |
| | |
| | | const msg = ref('') |
| | | const type = ref(1) |
| | | const time = ref(0) |
| | | let agree = ref(false) |
| | | const username = ref('') |
| | | const password = ref('') |
| | | const repassword = ref('') |
| | | const verifyCode = ref('') |
| | | const safeword = ref('') |
| | | const fundPassword = ref('') |
| | | const refundPassword = ref('') |
| | | const activeIndex = ref(1) |
| | | const typeText = ref('password') |
| | | let isArea = ref(false) |
| | | let dialCode = ref(0) |
| | | let icon = ref('') |
| | |
| | | timer: null |
| | | }) |
| | | |
| | | let invitCode = ref('') |
| | | onMounted(() => { |
| | | console.log(store) |
| | | let usercode = getStorage('usercode') |
| | | if (usercode) { |
| | | invitCode = usercode; |
| | | } |
| | | clearInterval(state.timer) |
| | | state.timer = null |
| | | }) |
| | |
| | | const onFail = () => { |
| | | msg.value = '' |
| | | } |
| | | const onRefresh = () => { |
| | | msg.value = '' |
| | | } |
| | | |
| | | const controlChildRef = ref(null) |
| | | const onSelectArea = () => { |
| | |
| | | const getName = (params) => { |
| | | icon.value = params.code; |
| | | dialCode.value = params.dialCode; |
| | | } |
| | | const agreeProt = () => { |
| | | agree.value = !agree.value |
| | | } |
| | | const register = () => { |
| | | console.log(activeIndex.value, 'activeIndex.value') |
| | |
| | | showToast(t('entryCorrectEmail')); |
| | | return |
| | | } |
| | | if (safeword.value == '') { |
| | | showToast(t('safewordTips')); |
| | | return |
| | | } |
| | | if (verifyCode.value.length < 6) { |
| | | showToast(t('entryVerifyTips')); |
| | | return |
| | |
| | | showToast(t('entryPhone')); |
| | | return |
| | | } |
| | | } |
| | | if (password.value == '') { |
| | | showToast(t('entryPassword')); |
| | | return |
| | | } |
| | | if (password.value.length < 6) { |
| | | showToast(t('passwordTips')); |
| | | return |
| | | } |
| | | // if (repassword.value !== password.value) { |
| | | // showToast(t('noSamePassword')); |
| | | // return |
| | | // } |
| | | if (!agree.value) { |
| | | showToast(t('agreeServiceCond')); |
| | | return |
| | | if (verifyCode.value.length < 6) { |
| | | showToast(t('entryVerifyTips')); |
| | | return |
| | | } |
| | | } |
| | | show.value = true |
| | | } |
| | |
| | | case 1: |
| | | { |
| | | type.value = 2; |
| | | |
| | | _bindEmail({ |
| | | email: username.value, |
| | | verifcode: verifyCode.value, // 验证码 |
| | | }).then(res => { |
| | | showToast(t('bindSuccess')); |
| | | getinfo() |
| | | }) |
| | | break; |
| | | } |
| | | case 2: |
| | | { |
| | | type.value = 1; |
| | | |
| | | _bindPhone({ |
| | | phone: username.value, |
| | | verifcode: verifyCode.value, // 验证码 |
| | | }).then(res => { |
| | | showToast(t('bindSuccess')); |
| | | getinfo() |
| | | }) |
| | | break; |
| | | } |
| | | } |
| | | |
| | | _registerEorP({ |
| | | username: activeIndex.value === 1 ? username.value : dialCode.value + username.value, |
| | | password: password.value, |
| | | type: activeIndex.value === 1 ? '2' : '1', // 2邮箱,1手机 |
| | | verifcode: verifyCode.value, |
| | | safeword: safeword.value |
| | | }).then((res) => { |
| | | userStore[GET_USERINFO](res) |
| | | store.state.user.userInfo = res |
| | | // 其他操作?? |
| | | // router.push('/identity') |
| | | router.push('/login') |
| | | }) |
| | | } |
| | | // 获取用户信息 |
| | | let userdata = ref({}) |
| | | const getinfo = () => { |
| | | _info().then((data) => { |
| | | userdata.value = data; // 确保 userdata 被正确声明 |
| | | }).catch(error => { |
| | | console.error('Error fetching data:', error); |
| | | }); |
| | | }; |
| | | getinfo() |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |