From 03043192ddf00f9a36b7454799a9152cd1b50a0b Mon Sep 17 00:00:00 2001
From: admin <344137771@qq.com>
Date: Tue, 06 Jan 2026 11:13:45 +0800
Subject: [PATCH] 1

---
 src/views/register/index.vue |  112 ++++++++++++++++++++++++++++++++------------------------
 1 files changed, 64 insertions(+), 48 deletions(-)

diff --git a/src/views/register/index.vue b/src/views/register/index.vue
index 08faeac..d404dda 100644
--- a/src/views/register/index.vue
+++ b/src/views/register/index.vue
@@ -6,33 +6,37 @@
     <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 -->
-   <!--   <div class="textColor1" :class="activeIndex == 2 ? 'active' : ''" @click="changeIndex(2)">
-        {{ $t("phoneNum") }}
-      </div> -->
+      <!-- yyhh -->
     </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 === 1">
+
+    <!-- <ExInput :label="$t('setSafeword')" :placeholderText="$t('safewordTips')" v-model="safeword" typeText="password"
+      v-if="activeIndex === 1" /> -->
+
+    <div class="inputCom" v-if="activeIndex === 2">
       <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">
@@ -41,8 +45,8 @@
       </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>
@@ -52,8 +56,8 @@
     </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>
@@ -62,7 +66,7 @@
 <script setup>
 import ExInput from "@/components/ex-input/index.vue";
 import Step from "./step.vue";
-import { _registerUser, _sendVerifyCode } from "@/service/login.api";
+import { _registerUser, _sendVerifyCode, _registerVerifcodeUser } from "@/service/login.api";
 import { _bindEmailRegister } from "@/service/user.api.js";
 import { useUserStore } from "@/store/user";
 import { GET_USERINFO } from "@/store/types.store";
@@ -95,9 +99,9 @@
 const safeword = ref("");
 const fundPassword = ref("");
 const refundPassword = ref("");
-const activeIndex = ref(0);
+const activeIndex = ref(2);
 const typeText = ref("password");
-let isArea = ref(false);
+let isArea = ref(true);
 let dialCode = ref(0);
 let icon = ref("");
 const state = reactive({
@@ -144,7 +148,7 @@
   }
 
   _sendVerifyCode({
-    target: username.value,
+    target: activeIndex.value === 1 ? username.value : `${dialCode.value}${username.value}`,
   })
     .then((res) => {
       time.value = 60;
@@ -204,14 +208,14 @@
       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"));
@@ -219,6 +223,10 @@
     }
     if (username.value == "") {
       showToast(t("entryPhone"));
+      return;
+    }
+    if (verifyCode.value == "") {
+      showToast(t("请输入6位验证码"));
       return;
     }
   }
@@ -263,22 +271,28 @@
       break;
     }
   }
-
-  if (activeIndex.value === 1) {
-    _bindEmailRegister({
-      username: username.value,
+  // 需要验证码
+  if (activeIndex.value === 2) {
+    // _bindEmailRegister({
+    _registerVerifcodeUser({
+      // username: username.value,
+      userName: activeIndex.value === 1 ? username.value : `${dialCode.value}${username.value}`,
       password: password.value,
-      type: "2", // 2邮箱
+      type: activeIndex.value === 1 ? "2" : '1', // 2邮箱,1手机号
       verifcode: verifyCode.value,
-      usercode: invitCode.value,
-      safeword: safeword.value,
+      // usercode: invitCode.value,
+      userCode: invitCode.value,
+      // safeword: safeword.value,
     }).then((res) => {
       userStore[GET_USERINFO](res);
       store.state.user.userInfo = res;
       // 其他操作??
-      router.push("/identity");
+      // router.push("/identity"); // 身份认证
+      router.push("/setFond"); // 资金密码认证
     });
-  } else {
+  }
+  // 手机账户注册, 无需验证码 (邮箱注册也调用这)
+  else {
     _registerUser({
       userName:
         activeIndex.value === 0 || activeIndex.value === 1
@@ -291,20 +305,22 @@
     }).then((res) => {
       userStore[GET_USERINFO](res);
       store.state.user.userInfo = res;
-      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}`,
-          },
-        });
-      }
+      // 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}`,
+      //     },
+      //   });
+      // }
     });
   }
 };

--
Gitblit v1.9.3