<template>
|
<div class="login_page">
|
<headers />
|
<div class="login_title animated slideInDown">
|
<span>{{ $t("hj18") }}</span>
|
</div>
|
<div class="logins_content">
|
<div class="login_forms">
|
<div class="top_forms">
|
<el-input
|
:placeholder="placeholder"
|
size="medium"
|
v-model="phone"
|
maxlength="10"
|
clearable
|
@input="handleInput()"
|
>
|
<el-select v-model="select11" style="width: 100px;" slot="prepend" placeholder="请选择">
|
<el-option label="+90" value="90"></el-option>
|
<el-option label="+91" value="91"></el-option>
|
<el-option label="+92" value="92"></el-option>
|
<el-option label="+93" value="93"></el-option>
|
<el-option label="+94" value="94"></el-option>
|
<el-option label="+95" value="95"></el-option>
|
<el-option label="+960" value="960"></el-option>
|
<el-option label="+961" value="961"></el-option>
|
<el-option label="+962" value="962"></el-option>
|
<el-option label="+963" value="963"></el-option>
|
<el-option label="+964" value="964"></el-option>
|
<el-option label="+965" value="965"></el-option>
|
<el-option label="+966" value="966"></el-option>
|
<el-option label="+967" value="967"></el-option>
|
<el-option label="+968" value="968"></el-option>
|
<el-option label="+969" value="969"></el-option>
|
<el-option label="+970" value="970"></el-option>
|
<el-option label="+971" value="971"></el-option>
|
<el-option label="+972" value="972"></el-option>
|
<el-option label="+973" value="973"></el-option>
|
<el-option label="+974" value="974"></el-option>
|
<el-option label="+975" value="975"></el-option>
|
<el-option label="+976" value="976"></el-option>
|
<el-option label="+977" value="977"></el-option>
|
<el-option label="+978" value="978"></el-option>
|
<el-option label="+979" value="979"></el-option>
|
<el-option label="+98" value="98"></el-option>
|
<el-option label="+990" value="990"></el-option>
|
<el-option label="+991" value="991"></el-option>
|
<el-option label="+992" value="992"></el-option>
|
<el-option label="+993" value="993"></el-option>
|
<el-option label="+994" value="994"></el-option>
|
<el-option label="+995" value="995"></el-option>
|
<el-option label="+996" value="996"></el-option>
|
<el-option label="+997" value="997"></el-option>
|
<el-option label="+998" value="998"></el-option>
|
<el-option label="+999" value="999"></el-option>
|
|
</el-select>
|
</el-input>
|
|
<!-- 添加发送验证码的输入框和按钮 -->
|
<div style="margin-top: 0.46rem; display: flex; align-items: center;">
|
<el-input
|
style="flex-grow: 1;"
|
:placeholder="$t('hj25')"
|
size="medium"
|
v-model="yzmCode"
|
maxlength="6"
|
clearable
|
@input="handleInput()"
|
>
|
</el-input>
|
<el-button
|
style="margin-left: 0.2rem;"
|
:disabled="isCounting"
|
@click="sendVerificationCode"
|
>
|
{{ $t('获取验证码') }}
|
</el-button>
|
</div>
|
|
<el-input
|
style="margin-top: 0.46rem"
|
show-password
|
:placeholder="$t('hj19')"
|
size="medium"
|
v-model="userPassword"
|
@input="handleInput()"
|
>
|
</el-input>
|
|
<el-input
|
style="margin-top: 0.46rem"
|
show-password
|
:placeholder="$t('hj20')"
|
size="medium"
|
v-model="rePassword"
|
@input="handleInput()"
|
>
|
</el-input>
|
|
<el-input
|
style="margin-top: 0.46rem"
|
:placeholder="$t('hj21')"
|
size="medium"
|
v-model="userName"
|
clearable
|
@input="handleInput()"
|
>
|
</el-input>
|
</div>
|
<div
|
class="radio-con"
|
style="display: flex; align-items: center; font-size: 14px"
|
>
|
<van-checkbox v-model="checked">{{
|
$t("我已閱讀並同意")
|
}}</van-checkbox>
|
<span @click="gotoxy" style="color: rgb(5, 106, 239)">{{
|
$t("《用戶服務協議》")
|
}}</span>
|
</div>
|
<div class="bottom_btns" :class="btnClass ? 'on' : 'off'">
|
<van-button
|
type="info"
|
:disabled="!btnClass"
|
class="butn"
|
@click="gook"
|
>{{ $t("立即注册") }}</van-button
|
>
|
|
<div class="register" @click="$router.push('/login')">
|
{{ $t("已有賬號?")
|
}}<span style="color: rgb(5, 106, 239)">{{ $t("馬上登錄") }}</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import headers from "./components/header.vue";
|
import { isNull, isPhone, pwdReg } from "@/utils/utils";
|
import * as api from "@/axios/api";
|
import { Notify } from "vant";
|
import { mapMutations } from "vuex";
|
|
export default {
|
components: {
|
headers
|
},
|
name: "newRegister",
|
data() {
|
return {
|
select11: '91',
|
checked: false,
|
verification: this.$t("hj25"),
|
loginWay: this.$t("hj26"),
|
loginWay: this.$t("hj26"),
|
placeholder: this.$t("hj27"),
|
phone: "",
|
userName: "",
|
yzmCode: "",
|
code: "",
|
userPassword: "",
|
btnClass: false,
|
rePassword: "",
|
isCounting: false,
|
countdown: 60,
|
codeText: "获取验证码",
|
timer: null
|
};
|
},
|
mounted() {
|
this.userName = this.$route.query.agentCode
|
? this.$route.query.agentCode
|
: "";
|
},
|
methods: {
|
gotoxy() {
|
this.$router.push("/help_fwxy");
|
},
|
handleInput() {
|
if (
|
this.userPassword !== "" &&
|
this.phone !== "" &&
|
this.userPassword == this.rePassword &&
|
this.userName != "" &&
|
this.phoneNum != ""
|
) {
|
this.btnClass = true;
|
} else {
|
this.btnClass = false;
|
}
|
},
|
|
async gook() {
|
if (this.phone.length == 0) {
|
Notify({ type: "warning", message: this.$t("hj28") });
|
} else if (isNull(this.userPassword)) {
|
Notify({ type: "warning", message: this.$t("hj30") });
|
} else if (isNull(this.rePassword)) {
|
Notify({ type: "warning", message: this.$t("hj31") });
|
} else {
|
if (this.userPassword !== this.rePassword) {
|
this.password = 0;
|
this.password2 = 0;
|
Notify({ type: "warning", message: this.$t("hj32") });
|
} else if (!pwdReg(this.userPassword)) {
|
Notify({ type: "warning", message: this.$t("hj19") });
|
} else if (isNull(this.userName)) {
|
Notify({ type: "warning", message: this.$t("hj33") });
|
} else {
|
let opts = {
|
// agentCode:'4023', // SR330001
|
phone: this.phone,
|
yzmCode: this.yzmCode,
|
userPwd: this.userPassword,
|
agentCode: this.userName
|
};
|
let data = await api.register(opts);
|
if (data.status === 0) {
|
setTimeout(() => {
|
this.$router.push("/login");
|
}, 1000);
|
} else {
|
Notify({ type: "warning", message: data.msg });
|
}
|
}
|
}
|
if (navigator.vibrate) {
|
// 支持
|
navigator.vibrate([55]);
|
}
|
},
|
async sendVerificationCode() {
|
if (!this.isCounting) {
|
this.isCounting = true;
|
const { success } = await api.getCode({ phoneNum: this.phone });
|
if (!success) return;
|
|
this.timer = setInterval(() => {
|
if (this.countdown <= 1) {
|
clearInterval(this.timer);
|
this.isCounting = false;
|
this.countdown = 60;
|
this.codeText = $t("获取验证码");
|
return;
|
}
|
this.countdown--;
|
|
this.codeText = $t("重新获取") + `(${this.countdown}s)`;
|
}, 1000);
|
}
|
}
|
}
|
};
|
</script>
|
|
<style scoped lang="less">
|
.register {
|
font-style: normal;
|
font-weight: 400;
|
font-size: 0.37333rem;
|
color: #8c9fad;
|
text-align: center;
|
margin: 20px auto;
|
// margin-top: 10px;
|
}
|
.radio-con {
|
margin-top: 0.32rem;
|
}
|
/deep/ .van-checkbox__label {
|
font-style: normal;
|
font-weight: 400;
|
font-size: 0.37333rem;
|
line-height: 0.53333rem;
|
color: #8c9fad;
|
}
|
/deep/ .van-button__text {
|
font-size: 24px;
|
font-family: "DINPro";
|
}
|
.login_title {
|
font-family: "DINPro", serif;
|
font-style: normal;
|
font-weight: 500;
|
font-size: 0.48rem;
|
line-height: 0.66667rem;
|
color: #14181f;
|
margin-left: 0.53333rem;
|
}
|
.login_page {
|
position: relative;
|
width: 100%;
|
height: 100%;
|
overflow: hidden;
|
overflow-y: auto;
|
display: flex;
|
flex-direction: column;
|
height: 100vh;
|
}
|
|
.logins_content {
|
display: flex;
|
flex-direction: column;
|
flex: 1;
|
width: 100%;
|
height: 9.7436rem;
|
margin-top: 0.4359rem;
|
background: #fff;
|
border-top-left-radius: 0.26667rem;
|
border-top-right-radius: 0.26667rem;
|
|
.login_title {
|
width: 100%;
|
height: 2.0513rem;
|
display: flex;
|
|
align-items: center;
|
font-size: 0.7023rem;
|
color: #000;
|
font-weight: 600 !important;
|
|
> span {
|
font-weight: 600 !important;
|
}
|
}
|
|
.login_forms {
|
width: 100%;
|
|
border-top-left-radius: 0.26667rem;
|
border-top-right-radius: 0.26667rem;
|
padding: 0.34667rem 0.4rem;
|
flex: 1;
|
display: flex;
|
flex-direction: column;
|
|
.top_forms {
|
width: 100%;
|
height: auto;
|
display: flex;
|
align-items: center;
|
flex-wrap: wrap;
|
|
.user_name,
|
.password {
|
width: 100%;
|
height: 35%;
|
background: rgb(246, 246, 247);
|
// background: #1e1e1e;
|
border-radius: 0.3564rem;
|
|
> input {
|
width: 100%;
|
height: 100%;
|
padding-left: 0.3564rem;
|
font-size: 0.4615rem;
|
}
|
}
|
}
|
|
/deep/.el-input__inner {
|
width: 100%;
|
height: 70px;
|
background-color: rgb(246, 246, 247) !important;
|
// background: #1e1e1e;
|
// border-radius: 8px;
|
font-size: 0.45rem !important;
|
border: none;
|
}
|
|
.bottom_btns {
|
width: 100%;
|
height: 3.3333rem;
|
// margin-top: 0.8528rem;
|
.butn {
|
width: 100%;
|
margin-top: 40px;
|
height: 60px;
|
border-radius: 8px;
|
}
|
.mes {
|
width: 100%;
|
height: 20%;
|
margin-top: 0.4rem;
|
display: flex;
|
justify-content: flex-end;
|
align-items: center;
|
font-size: 0.3846rem;
|
}
|
}
|
}
|
}
|
|
.login_bom {
|
position: absolute;
|
bottom: 2.6rem;
|
width: 100%;
|
height: 4rem;
|
padding: 0 2rem;
|
}
|
|
.line {
|
//分割线
|
width: 100%;
|
height: 0.3846rem;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
margin-top: 0.3846rem;
|
|
.left_line {
|
width: 20%;
|
height: 0.01rem;
|
background: #e5e5e5;
|
}
|
|
.center_line {
|
width: 50%;
|
height: 0.01rem;
|
background: #fff;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
|
> span {
|
font-size: 0.3046rem;
|
color: #000;
|
background-color: #fff;
|
}
|
}
|
|
.right_line {
|
width: 20%;
|
height: 0.01rem;
|
background: #e5e5e5;
|
}
|
}
|
|
.myzh {
|
width: calc(100% - 4rem);
|
position: absolute;
|
bottom: 0.01rem;
|
text-align: center;
|
|
.mes {
|
width: 100%;
|
height: 40%;
|
|
font-size: 0.3846rem;
|
}
|
}
|
|
.imgDemo {
|
display: flex;
|
justify-content: space-between;
|
position: relative;
|
transform: translateY(50%);
|
}
|
|
.appImg {
|
width: 1.4rem;
|
height: 1.4rem;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
background-color: rgb(246, 246, 247);
|
border-radius: 100%;
|
}
|
|
.appImg img {
|
width: 0.8rem;
|
height: 0.8rem;
|
}
|
|
.img_mess {
|
width: 100%;
|
height: 4.0513rem;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
|
.logo_content {
|
width: 3rem;
|
height: 3.5769rem;
|
|
> img {
|
width: 100%;
|
height: 100%;
|
}
|
}
|
}
|
|
/deep/.el-alert {
|
width: 70% !important;
|
height: 1rem !important;
|
position: absolute !important;
|
top: 0 !important;
|
bottom: 0 !important;
|
left: 0 !important;
|
right: 0 !important;
|
margin: auto !important;
|
font-size: 0.3rem !important;
|
}
|
|
/deep/.el-alert__title {
|
font-size: 0.3rem !important;
|
}
|
|
/deep/el-input__suffix {
|
width: 1rem !important;
|
}
|
|
/deep/.el-input__suffix-inner {
|
width: 1rem !important;
|
}
|
|
/deep/.el-input__icon {
|
width: 1rem !important;
|
}
|
|
/deep/.el-icon-circle-close::before {
|
font-size: 0.5rem !important;
|
}
|
|
/deep/.el-input__clear {
|
font-size: 0.5rem !important;
|
}
|
/deep/ .el-input-group__prepend {
|
border: none !important;
|
border-radius: 0 !important;
|
font-size: 0.45rem !important;
|
}
|
|
.on .top_btn {
|
background: #2d8cf0 !important;
|
}
|
|
.agree-model {
|
margin-top: 0.2rem;
|
}
|
</style>
|