|
@@ -27,7 +27,7 @@
|
|
|
:placeholder="L['请输入邮箱验证码']"
|
|
|
type="number"
|
|
|
></el-input>
|
|
|
- <div class="get_sms pointer" @click="getSmsCode">
|
|
|
+ <div class="get_sms pointer" @click="showHMVerify">
|
|
|
{{ countDownM ? countDownM + L["s后获取"] : L["获取验证码"] }}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -55,9 +55,9 @@
|
|
|
:placeholder="L['请输入邮箱验证码']"
|
|
|
type="number"
|
|
|
></el-input>
|
|
|
- <div class="get_sms pointer" @click="getSmsCode">
|
|
|
+ <el-button :disabled="countDownM" :loading="getSmsLoading" class="get_sms pointer" @click="showHMVerify">
|
|
|
{{ countDownM ? countDownM + L["s后获取"] : L["获取验证码"] }}
|
|
|
- </div>
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
<el-input
|
|
|
v-if="step == 2"
|
|
@@ -66,6 +66,13 @@
|
|
|
:placeholder="L['请输入新邮箱']"
|
|
|
>
|
|
|
</el-input>
|
|
|
+ <div class="error_tip" v-if="emailErrorMsg">
|
|
|
+ <span
|
|
|
+ style="color: #e1251b; font-size: 14px"
|
|
|
+ class="iconfont icon-jubao"
|
|
|
+ ></span>
|
|
|
+ {{ emailErrorMsg }}
|
|
|
+ </div>
|
|
|
<div
|
|
|
v-if="step == 2"
|
|
|
class="sms_code_con flex_row_center_center margin"
|
|
@@ -75,9 +82,9 @@
|
|
|
:placeholder="L['请输入邮箱验证码']"
|
|
|
maxlength="6"
|
|
|
></el-input>
|
|
|
- <div class="get_sms pointer" @click="getSmsCode">
|
|
|
+ <el-button :disabled="countDownM" :loading="getSmsLoading" class="get_sms pointer" @click="showHMVerify">
|
|
|
{{ countDownM ? countDownM + L["s后获取"] : L["获取验证码"] }}
|
|
|
- </div>
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
<div class="error_tip">
|
|
|
<span
|
|
@@ -103,6 +110,20 @@
|
|
|
<!-- </p>-->
|
|
|
<!-- </div>-->
|
|
|
</div>
|
|
|
+ <el-dialog
|
|
|
+ :title="L['register']['滑动验证']"
|
|
|
+ destroy-on-close
|
|
|
+ width="500px"
|
|
|
+ center
|
|
|
+ modal-class="email-verify-model"
|
|
|
+ v-model="modalVisible"
|
|
|
+ >
|
|
|
+ <SliderVerify
|
|
|
+ :slideVerifyOptions="{ show: false, w: 450, h: 220 }"
|
|
|
+ @onSuccess="verifySuccess"
|
|
|
+ @onFail="verifyFail"
|
|
|
+ />
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -122,15 +143,16 @@ definePageMeta({
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const step = ref(1);
|
|
|
const errorMsg = ref("");
|
|
|
+const emailErrorMsg = ref("");
|
|
|
const old_sms_code = ref("");
|
|
|
const new_sms_code = ref("");
|
|
|
const new_mobile = ref("");
|
|
|
const timeOutId = ref(""); //定时器的返回值
|
|
|
const countDownM = ref(0); //短信验证码倒计时
|
|
|
const memberInfo = reactive({ data: filtersStore.getMemberInfo });
|
|
|
-const preventFre = ref(false);
|
|
|
const getLatestMemberInfo = ref(false)
|
|
|
-
|
|
|
+const modalVisible = ref(false);
|
|
|
+const getSmsLoading = ref(false)
|
|
|
|
|
|
const getMemberInfo = () => {
|
|
|
get("v3/member/front/member/getInfo").then((res) => {
|
|
@@ -141,33 +163,41 @@ const getMemberInfo = () => {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-const getSmsCode = () => {
|
|
|
- if (preventFre.value) {
|
|
|
- return;
|
|
|
- }
|
|
|
- preventFre.value = true;
|
|
|
- if (countDownM.value > 1) {
|
|
|
- preventFre.value = false;
|
|
|
- return;
|
|
|
- } else {
|
|
|
- //验证新邮箱是否正确
|
|
|
- if (memberInfo.data.memberMobile && step.value == 2) {
|
|
|
- if (!new_mobile.value) {
|
|
|
- preventFre.value = false;
|
|
|
- errorMsg.value = L["请输入邮箱号"];
|
|
|
+//开启人机校验
|
|
|
+const showHMVerify = () => {
|
|
|
+ //验证新邮箱是否正确
|
|
|
+ if (step.value == 2) {
|
|
|
+ if (!new_mobile.value) {
|
|
|
+ emailErrorMsg.value = L["请输入邮箱号"];
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ let checkEmailVal = checkEmail(new_mobile.value);
|
|
|
+ if (checkEmailVal !== true) {
|
|
|
+ emailErrorMsg.value = checkEmailVal;
|
|
|
return;
|
|
|
} else {
|
|
|
- let checkEmailVal = checkEmail(new_mobile.value);
|
|
|
- if (checkEmailVal !== true) {
|
|
|
- errorMsg.value = checkEmailVal;
|
|
|
- preventFre.value = false;
|
|
|
- return;
|
|
|
- } else {
|
|
|
- errorMsg.value = "";
|
|
|
- }
|
|
|
+ emailErrorMsg.value = "";
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+ modalVisible.value = true;
|
|
|
+};
|
|
|
+
|
|
|
+// 人机验证成功
|
|
|
+const verifySuccess = () => {
|
|
|
+ modalVisible.value = false;
|
|
|
+ getSmsCode();
|
|
|
+};
|
|
|
+
|
|
|
+// 人机校验失败
|
|
|
+const verifyFail = () => {
|
|
|
+ showMessage({
|
|
|
+ message: L["register"]["校验不通过"],
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const getSmsCode = () => {
|
|
|
var param = {};
|
|
|
param.verifyType = 1;
|
|
|
//未绑定邮箱
|
|
@@ -179,34 +209,35 @@ const getSmsCode = () => {
|
|
|
step.value == 1 ? memberInfo.data.memberEmail : new_mobile.value;
|
|
|
param.changeType = step.value == 1 ? "old" : "new";
|
|
|
}
|
|
|
+ getSmsLoading.value = true;
|
|
|
get("v3/msg/front/commons/sendVerifyCode", param).then((res) => {
|
|
|
if (res.state == 200) {
|
|
|
countDownM.value = 60;
|
|
|
countDown();
|
|
|
- preventFre.value = false;
|
|
|
} else {
|
|
|
ElMessage.error(res.msg);
|
|
|
- preventFre.value = false;
|
|
|
}
|
|
|
- });
|
|
|
- }
|
|
|
+ }).finally(() => {
|
|
|
+ getSmsLoading.value = false;
|
|
|
+ })
|
|
|
+
|
|
|
};
|
|
|
|
|
|
//绑定邮箱
|
|
|
const bindEmail = () => {
|
|
|
-
|
|
|
//验证邮箱是否正确
|
|
|
- if (memberInfo.data.memberMobile && step.value == 2) {
|
|
|
+ if (step.value == 2) {
|
|
|
if (!new_mobile.value) {
|
|
|
- errorMsg.value = L["请输入邮箱号"];
|
|
|
+ emailErrorMsg.value = L["请输入邮箱号"];
|
|
|
return false;
|
|
|
} else {
|
|
|
let checkEmailVal = checkEmail(new_mobile.value);
|
|
|
if (checkEmailVal !== true) {
|
|
|
- errorMsg.value = checkEmailVal;
|
|
|
+ emailErrorMsg.value = checkEmailVal;
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
+ emailErrorMsg.value = ''
|
|
|
}
|
|
|
//验证码校验
|
|
|
if (!new_sms_code.value) {
|
|
@@ -266,10 +297,8 @@ const bindEmail = () => {
|
|
|
});
|
|
|
};
|
|
|
const next = () => {
|
|
|
-
|
|
|
let param = {};
|
|
|
let url = "";
|
|
|
- preventFre.value = false;
|
|
|
if (step.value == 1) {
|
|
|
//验证码校验
|
|
|
if (!old_sms_code.value) {
|
|
@@ -341,7 +370,6 @@ const next = () => {
|
|
|
const countDown = () => {
|
|
|
countDownM.value--;
|
|
|
if (countDownM.value == 0) {
|
|
|
- preventFre.value = false;
|
|
|
clearTimeout(timeOutId.value);
|
|
|
} else {
|
|
|
timeOutId.value = setTimeout(countDown, 1000);
|
|
@@ -371,7 +399,19 @@ onUnmounted(() => {
|
|
|
})
|
|
|
|
|
|
</script>
|
|
|
+<style lang="scss">
|
|
|
+.email-verify-model {
|
|
|
+ .el-dialog__title {
|
|
|
+ font-weight: 900 !important;
|
|
|
+ }
|
|
|
|
|
|
+ .el-dialog__body {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
<style lang="scss" scoped>
|
|
|
.sld_email_mange {
|
|
|
width: 957px;
|
|
@@ -437,17 +477,25 @@ onUnmounted(() => {
|
|
|
}
|
|
|
|
|
|
.sms_code_con {
|
|
|
+ position: relative;
|
|
|
width: 100%;
|
|
|
|
|
|
.get_sms {
|
|
|
- width: 100px;
|
|
|
+ // display: flex;
|
|
|
+ // justify-content: center; /* 水平居中 */
|
|
|
+ // align-items: center; /* 垂直居中 */
|
|
|
+ // text-align: center; /* 多行文本居中 */
|
|
|
+ // position: absolute;
|
|
|
+ white-space: pre-wrap;
|
|
|
+ right: -25px;
|
|
|
+ top: 0;
|
|
|
+ width: 120px;
|
|
|
height: 40px;
|
|
|
- line-height: 38px;
|
|
|
background: #00985e;
|
|
|
- text-align: center;
|
|
|
color: white;
|
|
|
font-size: 14px;
|
|
|
border-radius: 0 3px 3px 0;
|
|
|
+ padding: 5px 10px;
|
|
|
}
|
|
|
}
|
|
|
|