From 34171d550c6284bcf657e9b51dde1ccc6769b919 Mon Sep 17 00:00:00 2001
From: PC-20250623MANY\Administrator <344137771@qq.com>
Date: Wed, 17 Sep 2025 13:53:01 +0800
Subject: [PATCH] 1
---
src/page/login/register.vue | 500 ++++++++++++++++++++++--------------------------------
1 files changed, 204 insertions(+), 296 deletions(-)
diff --git a/src/page/login/register.vue b/src/page/login/register.vue
index 4c1d121..9e66320 100644
--- a/src/page/login/register.vue
+++ b/src/page/login/register.vue
@@ -1,78 +1,69 @@
<template>
<div class="login_page">
- <headers :mess="loginWay" />
- <!-- <div class="img_mess">
- <div class="logo_content animated fadeInRight">
- <img :src="Logo" alt />
- </div>
- </div> -->
+ <headers />
+ <div class="login_title animated slideInDown">
+ <span>{{ $t("hj15") }}</span>
+ </div>
<div class="logins_content">
- <div class="login_title animated slideInDown">
- <span>{{ '手机注册' }}</span>
- </div>
<div class="login_forms">
<div class="top_forms">
- <!-- <div class="user_name">
- <input type="text" :placeholder="placeholder" v-model="phone" />
- </div>
- <div class="captcha">
- <input type="text" :placeholder="verification" v-model="code" />
- <div v-if="codeshow" @click="checkCodeBox">获取验证码</div>
- <div v-if="!codeshow" class="getcode">{{count}}s</div>
- </div>
- <div class="password">
- <input type="password" placeholder="密码为6~12位数字、字母或符号" v-model="userPassword" />
- @input="handleInput()"
- </div>
- <div class="password">
- <input type="password" placeholder="请再次确认密码" v-model="rePassword" />
- </div>
- <div class="user_name">
- <input type="text" placeholder="机构代码" v-model="userName" />
- </div> -->
- <el-input :placeholder="placeholder" size="medium" v-model="phone" clearable @input="handleInput()" maxlength="11">
+ <div class="forms_title">{{ placeholder }}</div>
+ <el-input :placeholder="$t('请输入')" :size="medium" v-model="phone" clearable @input="handleInput()">
</el-input>
- <!-- <el-input style="margin-top: 0.46rem;" :placeholder="verification" :size="medium" v-model="code" clearable>
+
+ <!-- <div class="forms_title">{{ $t("hj25") }}</div>
+ <el-input :placeholder="$t('请输入')" :size="medium" v-model="yzmCode" clearable @input="handleInput()">
+ <template slot="append">
+ <van-button type="info" size="small" @click="getYzm" :loading="djs > 0" :loading-text="djs + ''">
+ <span style="font-size: 14px;">{{ $t('获取验证码') }}</span>
+ </van-button>
+ </template>
</el-input> -->
- <el-input style="margin-top: 0.46rem;" show-password placeholder="密码为6~12位数字、字母或符号" size="medium"
- v-model="userPassword" @input="handleInput()">
+
+ <div class="forms_title">{{ $t("Password") }}</div>
+ <el-input :placeholder="$t('hj19')" :size="medium" v-model="userPassword" clearable @input="handleInput()">
</el-input>
- <el-input style="margin-top: 0.46rem;" show-password placeholder="请再次确认密码" size="medium" v-model="rePassword"
- @input="handleInput()">
+
+ <div class="forms_title">{{ $t("hj20") }}</div>
+ <el-input :placeholder="$t('请输入')" :size="medium" v-model="rePassword" clearable @input="handleInput()">
</el-input>
- <el-input style="margin-top: 0.46rem;" placeholder="邀请码" size="medium" v-model="userName" clearable
- @input="handleInput()">
+
+ <div class="forms_title">{{ $t("hj21") }}</div>
+ <el-input :placeholder="$t('请输入')" :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" @change="handleInput()">
+ {{ $t("我已閱讀並同意") }}
+ </van-checkbox>
+ <span @click="gotoxy" style="color: #0e7ddd">
+ {{ $t("《用戶服務協議》") }}
+ </span>
+ </div>
<div class="bottom_btns" :class="btnClass ? 'on' : 'off'">
- <div class="top_btn " @click="gook" :class="dengl ? 'animated pulse' : ''">
- <span>{{ '安全注册' }}</span>
- </div>
- <!-- <div
- class="register-form-item agree-model"
+ <van-button type="info" :disabled="!btnClass" class="butn" @click="gook">{{ $t("立即注册") }}</van-button>
+
+ <!-- <van-button
+ type="info"
+ class="butn_2"
+ plain
+ @click="$router.push('/login')"
>
- <i @click="isAgree"
- :class="agree?'glyphicon glyphicon glyphicon-ok-sign blue':'glyphicon glyphicon-ok-circle'"></i>
- 我已阅读并同意
- <a style="color:#fff">《注册协议》</a>
- </div> -->
- <div class="mes">
- <span>{{ '已有账户?' }}</span>
- <span @click="$router.push('/login')" style="color: rgb(54,124,248);">{{ '登录>' }}</span>
- </div>
+ {{ $t("已有賬號?") + $t("馬上登錄") }}
+ </van-button> -->
</div>
</div>
</div>
- <el-alert v-show="alertShow" :closable="closable" :title="texts" :type="elType" center></el-alert>
</div>
</template>
<script>
import headers from "./components/header.vue";
-import Logo from "@/assets/img/LOGO2.png";
-import { isNull, isPhone, pwdReg } from '@/utils/utils'
-import { Toast } from 'mint-ui'
-import * as api from '@/axios/api'
+import { isNull, isPhone, pwdReg } from "@/utils/utils";
+import * as api from "@/axios/api";
+import { Notify } from "vant";
+import { mapMutations } from "vuex";
+import deTh from "@/utils/deTh";
export default {
components: {
headers
@@ -80,281 +71,182 @@
name: "newRegister",
data() {
return {
- verification: "验证码",
- loginWay: "手机号注册",
- loginWay: "手机号注册",
- placeholder: "手机号",
- Logo,
+ checked: false,
+ verification: this.$t("hj25"),
+ loginWay: this.$t("hj26"),
+ loginWay: this.$t("hj26"),
+ placeholder: this.$t("hj16"),
phone: "",
userName: "",
+ yzmCode: '6666',
code: "",
userPassword: "",
btnClass: false,
- codeshow: true,
- count: '', // 倒计时
- clickFalg: 0, // 点击次数
rePassword: "",
- agree: false,
- dengl: false,
- alertShow: false,
- closable: false,
- texts: "",
- elType: "warning",
- }
+ medium: "medium",
+ djs: 0,
+ };
},
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 != "") {
+ if (
+ this.userPassword !== "" &&
+ this.yzmCode !== "" &&
+ this.phone !== "" &&
+ this.userPassword == this.rePassword &&
+ this.userName != "" &&
+ this.checked
+ ) {
this.btnClass = true;
} else {
this.btnClass = false;
}
},
- checkCodeBox() {
- if (isNull(this.phone) || !isPhone(this.phone)) {
- // Toast('请输入正确的手机号')
- this.texts = "请输入正确的手机号"
- this.alertShow = true
- setTimeout(() => {
- this.alertShow = false
- }, 2000)
- } else {
- this.checkPhone()
- }
- },
- async is_login(){
- //获取localStorage中的token
- let token = localStorage.getItem('USERTOEKN')
- if(token){
- this.$router.push('/home')
- }
- },
-
- async getcode() {
- // if(!this.checkCode()){
- // // 验证图形码是否正确
- // Toast('请输入正确图形验证码')
- // return
- // }
- // 获取验证码
- if (this.clickFalg !== 0) {
- this.clickFalg = 0
- return
- }
- this.clickFalg++
- // var reg = 11 && /^((13|14|15|17|18)[0-9]{1}\d{8})$/
- let reg = /^[0-9]{11}$/ // 手机号码验证
- if (isNull(this.phone)) {
- this.texts = "手机号不能为空"
- this.alertShow = true
- setTimeout(() => {
- this.alertShow = false
- }, 2000)
- } else {
- if (!reg.test(this.phone)) {
- this.texts = "请输入正确的手机号码"
- this.alertShow = true
- setTimeout(() => {
- this.alertShow = false
- }, 2000)
- } else {
- // var sign = this.$md5(this.phone+'W&WzL42v').toUpperCase()
- let result = await api.getCode({ phoneNum: this.phone })
- if (result.status === 0) {
- const TIME_COUNT = 60
- if (!this.timer) {
- this.count = TIME_COUNT
- this.codeshow = false
- this.clickFalg = 0
- this.timer = setInterval(() => {
- if (this.count > 0 && this.count <= TIME_COUNT) {
- this.count--
- } else {
- this.codeshow = true
- clearInterval(this.timer)
- this.timer = null
- }
- }, 1000)
- } else {
- // Toast(result.msg)
- this.texts = result.msg
- this.elType = "success"
- this.alertShow = true
- setTimeout(() => {
- this.alertShow = false
- this.elType = "warning"
- }, 2000)
- }
- } else {
- this.texts = result.msg
- this.alertShow = true
- setTimeout(() => {
- this.alertShow = false
- }, 2000)
+ async getYzm() {
+
+ let data = await api.getsendmail({ email: this.phone });
+ if (data.status == 0) {
+ Notify({ type: 'primary', message: data.msg });
+
+ this.djs = 60;
+ let time = setInterval(() => {
+ this.djs--;
+ if (this.djs <= 0) {
+ clearInterval(time);
}
- }
+ }, 1000);
+ } else {
+ Notify({ type: "warning", message: data.msg });
}
},
async gook() {
- this.dengl = true
- setTimeout(() => {
- this.dengl = false
- }, 1000)
- if (this.loginBtn) {
- return;
- }
- this.loginBtn = true;
- // 注册
- // if (!this.agree) {
- // Toast('需同意注册协议才能注册!')
- // this.loginBtn = false;
- // } else
- if (isNull(this.phone) || !isPhone(this.phone)) {
-
- this.texts = "请输入正确的手机号码"
- this.alertShow = true
- setTimeout(() => {
- this.alertShow = false
- }, 2000)
- this.loginBtn = false;
+ if (this.phone.length == 0) {
+ Notify({ type: "warning", message: this.$t("hj28") });
} else if (isNull(this.userPassword)) {
- this.texts = "请输入密码"
- this.alertShow = true
- setTimeout(() => {
- this.alertShow = false
- }, 2000)
- this.loginBtn = false;
+ Notify({ type: "warning", message: this.$t("hj30") });
} else if (isNull(this.rePassword)) {
- this.texts = "请确认密码"
- this.alertShow = true
- setTimeout(() => {
- this.alertShow = false
- }, 2000)
- this.loginBtn = false;
+ Notify({ type: "warning", message: this.$t("hj31") });
} else {
if (this.userPassword !== this.rePassword) {
- this.texts = "两次输入的密码不一致"
- this.alertShow = true
- setTimeout(() => {
- this.alertShow = false
- }, 2000)
- this.password = 0
- this.password2 = 0
- this.loginBtn = false;
+ this.password = 0;
+ this.password2 = 0;
+ Notify({ type: "warning", message: this.$t("hj32") });
} else if (!pwdReg(this.userPassword)) {
-
- this.texts = "密码为6~12位,数字、字母或符号"
- this.alertShow = true
- setTimeout(() => {
- this.alertShow = false
- }, 2000)
- this.loginBtn = false;
+ Notify({ type: "warning", message: this.$t("hj19") });
} else if (isNull(this.userName)) {
- this.texts = "请输入邀请码"
- this.alertShow = true
- setTimeout(() => {
- this.alertShow = false
- }, 2000)
- this.loginBtn = false;
+ Notify({ type: "warning", message: this.$t("hj33") });
} else {
let opts = {
// agentCode:'4023', // SR330001
phone: this.phone,
- yzmCode: '6666',
+ yzmCode: this.yzmCode,
userPwd: this.userPassword,
agentCode: this.userName
- }
- let data = await api.register(opts)
+ };
+ let data = await api.register(opts);
if (data.status === 0) {
- this.texts = "注册成功,请登录"
- this.elType = "success"
- this.alertShow = true
setTimeout(() => {
- this.$router.push('/login')
- this.alertShow = false
- this.elType = "warning"
- }, 1000)
- this.loginBtn = false;
-
+ this.$router.push("/login");
+ }, 1000);
} else {
- this.texts = data.msg
- this.alertShow = true
- setTimeout(() => {
- this.alertShow = false
- }, 2000)
- this.loginBtn = false;
+ Notify({ type: "warning", message: data.msg });
}
}
}
if (navigator.vibrate) {
- // 支持
+ // 支持
navigator.vibrate([55]);
}
- // if (isNull(this.code)) {
- // this.texts="请输入验证码"
- // this.alertShow=true
- // setTimeout(()=>{
- // this.alertShow=false
- // },2000)
- // this.loginBtn = false;
- // } else
-
- },
- isAgree() {
- this.agree = !this.agree
- },
- async checkPhone() {
- // 先验证是否已经注册
- let data = await api.checkPhone({ phoneNum: this.phone })
- if (data.status === 0) {
- // 如果用户已存在返回 0
- this.texts = "用户已注册,请登录"
- this.alertShow = true
- setTimeout(() => {
- this.alertShow = false
- }, 2000)
- this.$router.push('/login')
- } else {
- // this.dialogShow = false
- // this.adminUrl = process.env.API_HOST
- // if (this.adminUrl === undefined) {
- // this.adminUrl = ''
- // }
- // this.gook()
- this.getcode()
- }
- },
- },
-
-}
+ }
+ }
+};
</script>
-<style scoped lang="less">
+<style scoped lang="less">
+@green: #0e7ddd;
+@Black1: #13161e;
+
+.register {
+ font-style: normal;
+ font-weight: 500;
+ font-size: 0.37333rem;
+ color: #8c9fad;
+ text-align: center;
+ margin: 20px auto;
+ // margin-top: 10px;
+}
+
+.radio-con {
+ margin-top: 0.32rem;
+}
+
+/deep/ .el-input-group__append {
+ background: #13161e;
+ border: none !important;
+ size: .3rem;
+}
+
+/deep/ .van-checkbox__icon--checked .van-icon {
+ background: @green;
+ border-color: @green;
+}
+
+/deep/ .van-checkbox__label {
+ font-style: normal;
+ font-weight: 500;
+ 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;
+ padding: 0.6rem 0.6rem 0;
+}
+
.login_page {
position: relative;
- background-color: #fff !important;
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;
- padding: 0 0.4564rem;
+ padding: 0.4rem 0.6rem 0;
+ border-top-left-radius: 0.26667rem;
+ border-top-right-radius: 0.26667rem;
.login_title {
width: 100%;
height: 2.0513rem;
display: flex;
-
+ padding: 0.6rem 0.6rem 0;
align-items: center;
font-size: 0.7023rem;
color: #000;
@@ -367,8 +259,12 @@
.login_forms {
width: 100%;
- height: auto;
- margin-top: 0.35rem;
+
+ border-top-left-radius: 0.26667rem;
+ border-top-right-radius: 0.26667rem;
+ flex: 1;
+ display: flex;
+ flex-direction: column;
.top_forms {
width: 100%;
@@ -376,6 +272,14 @@
display: flex;
align-items: center;
flex-wrap: wrap;
+
+ .forms_title {
+ font-size: 0.3rem;
+ margin-top: 0.5rem;
+ margin-bottom: 0.2rem;
+ font-weight: 300;
+ opacity: 0.7;
+ }
.user_name,
.password {
@@ -396,36 +300,37 @@
/deep/.el-input__inner {
width: 100%;
- height: 1.45rem !important;
- background-color: rgb(246, 246, 247) !important;
- // background: #1e1e1e;
- border-radius: 0.3564rem;
- font-size: 0.45rem !important;
+ height: 70px;
+ background-color: @Black1 !important;
+ font-size: 0.3rem !important;
+ border: @Black1 solid 1px;
+ color: #fff;
+ border-bottom: rgba(#fff, 0.7) solid 1px;
}
.bottom_btns {
width: 100%;
height: 3.3333rem;
- margin-top: 0.8528rem;
- .top_btn {
+ // margin-top: 0.8528rem;
+ .butn {
width: 100%;
- height: 1.25rem;
- border-radius: 0.3564rem;
- background: rgb(154, 197, 250);
- color: #fff;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 0.5128rem;
- margin-top: 0.75rem;
-
- >span {
- font-weight: 530 !important;
- }
+ margin-top: 40px;
+ height: 60px;
+ border-radius: 8px;
+ background-color: @green;
+ border-color: @green;
}
-
+ .butn_2 {
+ width: 100%;
+ margin-top: 40px;
+ height: 60px;
+ border-radius: 8px;
+ color: @green;
+ border-color: @green;
+ margin-top: 0.4rem;
+ }
.mes {
width: 100%;
@@ -475,7 +380,6 @@
font-size: 0.3046rem;
color: #000;
background-color: #fff;
-
}
}
@@ -484,7 +388,6 @@
height: 0.01rem;
background: #e5e5e5;
}
-
}
.myzh {
@@ -571,13 +474,18 @@
/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;
}
--
Gitblit v1.9.3