| | |
| | | <Step :step="1"></Step> |
| | | <div class="title textColor">{{ $t("register") }}</div> |
| | | <div class="flex re-tab"> |
| | | <!-- <div class="textColor1" :class="activeIndex == 0 ? 'active' : ''" @click="changeIndex(0)"> |
| | | <div class="textColor1" :class="activeIndex == 0 ? 'active' : ''" @click="changeIndex(0)"> |
| | | {{ $t("account") }} |
| | | </div> --> |
| | | <div class="textColor1" :class="activeIndex == 2 ? 'active' : ''" @click="changeIndex(2)"> |
| | | {{ $t("phoneNum") }} |
| | | </div> |
| | | <div class="textColor1" :class="activeIndex == 1 ? 'active' : ''" @click="changeIndex(1)"> |
| | | {{ $t("email") }} |
| | | </div> |
| | | <!-- yyhh --> |
| | | <!-- yyhh --> |
| | | <!-- <div class="textColor1" :class="activeIndex == 2 ? 'active' : ''" @click="changeIndex(2)"> |
| | | {{ $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('setPassword')" :placeholderText="$t('passwordTips')" v-model="password" typeText="password" /> |
| | | <ExInput :label="$t('repassword')" :placeholderText="$t('surePassword')" v-model="repassword" typeText="password" /> |
| | | |
| | | <!-- <ExInput :label="$t('setSafeword')" :placeholderText="$t('safewordTips')" v-model="safeword" typeText="password" |
| | | v-if="activeIndex === 1" /> --> |
| | | |
| | | <div class="inputCom" v-if="activeIndex === 2"> |
| | | <ExInput :label="$t('setSafeword')" :placeholderText="$t('safewordTips')" v-model="safeword" typeText="password" |
| | | v-if="activeIndex === 1" /> |
| | | <div class="inputCom" v-if="activeIndex === 1"> |
| | | <p class="label textColor">{{ $t("验证码") }}</p> |
| | | <div class="iptbox inputBackground"> |
| | | <input class="inputBackground textColor" type="text" :placeholder="$t('entryVerifyCode')" |
| | | v-model="verifyCode" /> |
| | | <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> |
| | | |
| | | <ExInput :label="$t('invitCode')" :placeholderText="$t('entryInvitCode')" v-model="invitCode" :clearBtn="false" /> |
| | | <div class="protocol textColor"> |
| | | <i @click="agreeProt"> |
| | |
| | | </i> |
| | | {{ $t("readAgree") |
| | | }}<span class="colorMain" @click="router.push('/aboutUs?serviceTerm=1')">{{ |
| | | $t("serviceConf") |
| | | }}</span> |
| | | $t("serviceConf") |
| | | }}</span> |
| | | </div> |
| | | <van-button class="w-full" style="margin-top: 10px" type="primary" @click="register">{{ $t("register") }} |
| | | </van-button> |
| | |
| | | </div> |
| | | <nationality-list ref="controlChildRef" :title="$t('selectArea')" @getName="getName"></nationality-list> |
| | | |
| | | <Vcode :imgs="[img1, img2]" :show="show" @success="onSuccess" :canvasHeight="200" @fail="onFail" |
| | | @close="show = false" sliderText="" :successText="$t('vertifyPass')" :failText="$t('vertifuFail')" /> |
| | | <Vcode :imgs="[img1, img2]" :show="show" @success="onSuccess" :canvasHeight="200" @fail="onFail" @close="show = false" |
| | | sliderText="" :successText="$t('vertifyPass')" :failText="$t('vertifuFail')" /> |
| | | |
| | | <div>{{ msg }}</div> |
| | | </div> |
| | |
| | | <script setup> |
| | | import ExInput from "@/components/ex-input/index.vue"; |
| | | import Step from "./step.vue"; |
| | | import { _registerUser, _sendVerifyCode, _registerVerifcodeUser } from "@/service/login.api"; |
| | | import { _registerUser, _sendVerifyCode } from "@/service/login.api"; |
| | | import { _bindEmailRegister } from "@/service/user.api.js"; |
| | | import { useUserStore } from "@/store/user"; |
| | | import { GET_USERINFO } from "@/store/types.store"; |
| | |
| | | const safeword = ref(""); |
| | | const fundPassword = ref(""); |
| | | const refundPassword = ref(""); |
| | | const activeIndex = ref(2); |
| | | const activeIndex = ref(0); |
| | | const typeText = ref("password"); |
| | | let isArea = ref(true); |
| | | let isArea = ref(false); |
| | | let dialCode = ref(0); |
| | | let icon = ref(""); |
| | | const state = reactive({ |
| | |
| | | } |
| | | |
| | | _sendVerifyCode({ |
| | | target: activeIndex.value === 1 ? username.value : `${dialCode.value}${username.value}`, |
| | | target: username.value, |
| | | }) |
| | | .then((res) => { |
| | | time.value = 60; |
| | |
| | | showToast(t("entryCorrectEmail")); |
| | | return; |
| | | } |
| | | // if (safeword.value == "") { |
| | | // showToast(t("safewordTips")); |
| | | // return; |
| | | // } |
| | | // if (verifyCode.value.length < 6) { |
| | | // showToast(t("entryVerifyTips")); |
| | | // return; |
| | | // } |
| | | if (safeword.value == "") { |
| | | showToast(t("safewordTips")); |
| | | return; |
| | | } |
| | | if (verifyCode.value.length < 6) { |
| | | showToast(t("entryVerifyTips")); |
| | | return; |
| | | } |
| | | } else if (activeIndex.value == 2) { |
| | | if (!/(^[1-9]\d*$)/.test(username.value)) { |
| | | showToast(t("entryPhone")); |
| | |
| | | } |
| | | if (username.value == "") { |
| | | showToast(t("entryPhone")); |
| | | return; |
| | | } |
| | | if (verifyCode.value == "") { |
| | | showToast(t("请输入6位验证码")); |
| | | return; |
| | | } |
| | | } |
| | |
| | | break; |
| | | } |
| | | } |
| | | // 需要验证码 |
| | | if (activeIndex.value === 2) { |
| | | // _bindEmailRegister({ |
| | | _registerVerifcodeUser({ |
| | | // username: username.value, |
| | | userName: activeIndex.value === 1 ? username.value : `${dialCode.value}${username.value}`, |
| | | |
| | | if (activeIndex.value === 1) { |
| | | _bindEmailRegister({ |
| | | username: username.value, |
| | | password: password.value, |
| | | type: activeIndex.value === 1 ? "2" : '1', // 2邮箱,1手机号 |
| | | type: "2", // 2邮箱 |
| | | verifcode: verifyCode.value, |
| | | // usercode: invitCode.value, |
| | | userCode: invitCode.value, |
| | | // safeword: safeword.value, |
| | | usercode: invitCode.value, |
| | | safeword: safeword.value, |
| | | }).then((res) => { |
| | | userStore[GET_USERINFO](res); |
| | | store.state.user.userInfo = res; |
| | | // 其他操作?? |
| | | // router.push("/identity"); // 身份认证 |
| | | router.push("/setFond"); // 资金密码认证 |
| | | router.push("/identity"); |
| | | }); |
| | | } |
| | | // 手机账户注册, 无需验证码 (邮箱注册也调用这) |
| | | else { |
| | | } else { |
| | | _registerUser({ |
| | | userName: |
| | | activeIndex.value === 0 || activeIndex.value === 1 |
| | |
| | | }).then((res) => { |
| | | userStore[GET_USERINFO](res); |
| | | store.state.user.userInfo = res; |
| | | // if (activeIndex.value != 2) { |
| | | router.push("/setFond"); |
| | | // } |
| | | // 手机号注册跳转获取验证码 |
| | | // else { |
| | | // router.push({ |
| | | // name: "verify", |
| | | // query: { |
| | | // type: activeIndex.value, |
| | | // account: |
| | | // activeIndex.value == 1 |
| | | // ? username.value |
| | | // : `${dialCode.value}${username.value}`, |
| | | // }, |
| | | // }); |
| | | // } |
| | | if (activeIndex.value == 0) { |
| | | router.push("/setFond"); |
| | | } else { |
| | | router.push({ |
| | | name: "verify", |
| | | query: { |
| | | type: activeIndex.value, |
| | | account: |
| | | activeIndex.value == 1 |
| | | ? username.value |
| | | : `${dialCode.value}${username.value}`, |
| | | }, |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }; |