1
李凌
2025-10-12 1136b8d80116008cc1f8da51f0f53dc746d52f86
src/views/register/index.vue
@@ -4,20 +4,22 @@
        <Step :step="1"></Step>
        <div class="title textColor">{{ $t('register') }}</div>
        <div class="flex re-tab">
            <div class="text_color" :class="activeIndex == 0 ? 'active' : ''" @click="changeIndex(0)">{{
            <!-- <div class="text_color" :class="activeIndex == 0 ? 'active' : ''" @click="changeIndex(0)">{{
                $t('account')
            }}</div>
            <!-- <div class="textColor" :class="activeIndex == 1 ? 'active' : ''" @click="changeIndex(1)">{{ $t('email') }}
            }}</div> -->
            <div class="textColor" :class="activeIndex == 1 ? 'active' : ''" @click="changeIndex(1)">{{ $t('email') }}
            </div>
            <div class="textColor" :class="activeIndex == 2 ? 'active' : ''" @click="changeIndex(2)">{{
                $t('phoneNum')
            }}</div> -->
                }}</div>
        </div>
        <ExInput :label="getRegType(activeIndex, true)" :placeholderText="getRegType(activeIndex, false)" v-model="username"
            :area="isArea" :dialCode="dialCode" @selectArea="onSelectArea" :icon="icon" />
        <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('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 === 1">
@@ -30,7 +32,7 @@
                </span>
            </div>
        </div>
        <ExInput :label="$t('invitCode')" :placeholderText="$t('entryInvitCode')" v-model="invitCode" :clearBtn="false" />
        <ExInput :label="$t('邀请码(必填)')" :placeholderText="$t('entryInvitCode')" v-model="invitCode" :clearBtn="false" />
        <div class="protocol textColor">
            <i @click="agreeProt">
                <img v-show="agree" src="../../assets/image/login/prot2.png" alt="" />
@@ -38,7 +40,7 @@
            </i>
            {{ $t('readAgree') }}<span class="colorMain" @click="router.push('/TermsOfService')">{{
                $t('serviceConf')
            }}</span>
                }}</span>
        </div>
        <van-button class="w-full" style="margin-top:10px;" type="primary" @click="register">{{ $t('register') }}
        </van-button>
@@ -90,7 +92,7 @@
const safeword = ref('')
const fundPassword = ref('')
const refundPassword = ref('')
const activeIndex = ref(0)
const activeIndex = ref(1)
const typeText = ref('password')
let isArea = ref(false)
let dialCode = ref(0)
@@ -173,7 +175,7 @@
    agree.value = !agree.value
}
const register = () => {
    console.log(activeIndex.value,'activeIndex.value')
    console.log(activeIndex.value, 'activeIndex.value')
    if (activeIndex.value == 0) {
        if (username.value == '') {
            showToast(t('entryAccount'));
@@ -198,7 +200,7 @@
            return
        }
    } else if (activeIndex.value == 2) {
        if(!(/(^[1-9]\d*$)/.test(username.value))){
        if (!(/(^[1-9]\d*$)/.test(username.value))) {
            showToast(t('entryPhone'));
            return
        }
@@ -219,6 +221,10 @@
        showToast(t('noSamePassword'));
        return
    }
    if (invitCode.value == '') {
        showToast(t('请输入邀请码'));
        return
    }
    if (!agree.value) {
        showToast(t('agreeServiceCond'));
        return