|
@@ -49,15 +49,15 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="item confirm">
|
|
<div class="item confirm">
|
|
- <span
|
|
|
|
- style="color: #bbb; font-size: 21px; padding-top: 7px"
|
|
|
|
- class="icon iconfont icon-mima1"
|
|
|
|
- ></span>
|
|
|
|
|
|
+ <span style="color: #bbb; font-size: 21px; padding-top: 7px" class="icon"
|
|
|
|
+ ><img src="/pwd_confirm.png" alt=""
|
|
|
|
+ /></span>
|
|
<input
|
|
<input
|
|
- :type="showConfirmPwdFlag ? 'text' : 'password'"
|
|
|
|
|
|
+ class="input"
|
|
v-model="confirmPassword"
|
|
v-model="confirmPassword"
|
|
|
|
+ :type="showConfirmPwdFlag ? 'text' : 'password'"
|
|
:placeholder="L['register']['请确认密码']"
|
|
:placeholder="L['register']['请确认密码']"
|
|
- class="input"
|
|
|
|
|
|
+ @blur="checkPwdMatched"
|
|
/>
|
|
/>
|
|
<div class="cancel" @click="isShowConfirmPwd">
|
|
<div class="cancel" @click="isShowConfirmPwd">
|
|
<span
|
|
<span
|
|
@@ -74,6 +74,13 @@
|
|
></span>
|
|
></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="error" v-if="checkErrorMsg">
|
|
|
|
+ <span
|
|
|
|
+ style="color: #e1251b; font-size: 14px"
|
|
|
|
+ class="iconfont icon-jubao"
|
|
|
|
+ ></span>
|
|
|
|
+ {{ checkErrorMsg }}
|
|
|
|
+ </div>
|
|
<a
|
|
<a
|
|
href="javascript:void(0)"
|
|
href="javascript:void(0)"
|
|
@click="joinForFree"
|
|
@click="joinForFree"
|
|
@@ -115,6 +122,7 @@
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import { getCurLanguage } from "@/composables/common.js";
|
|
import { getCurLanguage } from "@/composables/common.js";
|
|
|
|
+import { showMessage } from "@/utils/common";
|
|
|
|
|
|
const L = getCurLanguage();
|
|
const L = getCurLanguage();
|
|
|
|
|
|
@@ -122,12 +130,17 @@ const agreeFlag = ref(false); //同意注册协议标识,默认不同意
|
|
const agreeErrorMsg = ref(); // 协议错误提示
|
|
const agreeErrorMsg = ref(); // 协议错误提示
|
|
const name = ref(""); //用户名
|
|
const name = ref(""); //用户名
|
|
const nameErrorMsg = ref(""); //用户名错误提示
|
|
const nameErrorMsg = ref(""); //用户名错误提示
|
|
|
|
+const checkErrorMsg = ref(""); // 密码一致性错误提示
|
|
const password = ref(""); //密码
|
|
const password = ref(""); //密码
|
|
-const confirmPassword = ref("") //二次确认密码
|
|
|
|
|
|
+const confirmPassword = ref(""); //二次确认密码
|
|
const showPwdFlag = ref(false); //密码是否明文显示,默认密文
|
|
const showPwdFlag = ref(false); //密码是否明文显示,默认密文
|
|
-const showConfirmPwdFlag = ref(false) // 二次密码是否明文显示,默认密文
|
|
|
|
|
|
+const showConfirmPwdFlag = ref(false); // 二次密码是否明文显示,默认密文
|
|
|
|
|
|
-const joinForFreeDisabled = computed(() => false);
|
|
|
|
|
|
+const joinForFreeDisabled = computed(
|
|
|
|
+ () => !name.value || !password.value || !confirmPassword.value
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+const isPasswordMatched = computed(() => password.value === confirmPassword.value)
|
|
|
|
|
|
const clearInputVal = () => {
|
|
const clearInputVal = () => {
|
|
name.value = "";
|
|
name.value = "";
|
|
@@ -141,7 +154,7 @@ const isShowPwd = () => {
|
|
// 二次确认密码是否显示
|
|
// 二次确认密码是否显示
|
|
const isShowConfirmPwd = () => {
|
|
const isShowConfirmPwd = () => {
|
|
showConfirmPwdFlag.value = !showConfirmPwdFlag.value;
|
|
showConfirmPwdFlag.value = !showConfirmPwdFlag.value;
|
|
-}
|
|
|
|
|
|
+};
|
|
|
|
|
|
//是否同意用户注册协议
|
|
//是否同意用户注册协议
|
|
const agree = () => {
|
|
const agree = () => {
|
|
@@ -149,11 +162,17 @@ const agree = () => {
|
|
};
|
|
};
|
|
|
|
|
|
const joinForFree = () => {
|
|
const joinForFree = () => {
|
|
|
|
+ if (!isPasswordMatched) return;
|
|
if (!agreeFlag.value) {
|
|
if (!agreeFlag.value) {
|
|
agreeErrorMsg.value = L["请同意用户注册协议及隐私政策"];
|
|
agreeErrorMsg.value = L["请同意用户注册协议及隐私政策"];
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
agreeErrorMsg.value = "";
|
|
agreeErrorMsg.value = "";
|
|
|
|
+
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const checkPwdMatched = () => {
|
|
|
|
+ checkErrorMsg.value = isPasswordMatched.value ? "" : L["register"]["两次输入的密码不一致"];
|
|
};
|
|
};
|
|
|
|
|
|
watch(name, (val) => {
|
|
watch(name, (val) => {
|
|
@@ -183,11 +202,8 @@ watch(name, (val) => {
|
|
height: 38px;
|
|
height: 38px;
|
|
background: #f8f8f8;
|
|
background: #f8f8f8;
|
|
|
|
|
|
- .input {
|
|
|
|
- border: 1px solid #e8e8e8;
|
|
|
|
- height: 40px;
|
|
|
|
- padding: 0 44px 0 60px;
|
|
|
|
- width: 326px;
|
|
|
|
|
|
+ img {
|
|
|
|
+ width: 20px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|