Commit 08ad47dd authored by wuwangwolihui's avatar wuwangwolihui

营地2.0-修改

parent 125f4dc2
......@@ -1382,8 +1382,7 @@
created() {
const code = this.$store.state.indexIdentity;
this.referForm.phone = window.localStorage.getItem("index-phone-all"); //本地取用户手机号
this.referForm.email = window.localStorage.getItem("email" + code); //本地取用户邮箱
// console.log(this.referForm.email, " this.referForm.email");
this.referForm.email = window.localStorage.getItem("index-email-all"); //本地取用户邮箱
let signUpFile = window.localStorage.getItem(
"sign_up_file_" + window.localStorage.getItem("index-phone-all") + code
);
......@@ -1542,8 +1541,7 @@
res.data.info.jiguan_city.toString();
}
if (res.data.info.email == null) {
const code = this.$store.state.indexIdentity;
this.referForm.email = window.localStorage.getItem("email" + code); //本地取用户邮箱
this.referForm.email = window.localStorage.getItem("index-email-all"); //本地取用户邮箱
}
});
},
......
......@@ -197,7 +197,10 @@ function checkCam(code, cb) {
}
router.beforeEach((to, from, next) => {
if (from.fullPath != '/' && from.fullPath != '/baseLogin' && from.fullPath != '/baseRegister') {
if (from.fullPath != '/' &&
from.fullPath != '/baseLogin' &&
from.fullPath != '/baseRegister' &&
from.fullPath != '/baseReset') {
store.commit('setPreviousPath', from.fullPath);
}
let toLogin = "/login",
......
......@@ -56,21 +56,20 @@
</div>
</div>
<div class="active-area">
<div class="left-area card-box" ref="left-area">
<div class="left-area card-box" ref="left-area"
v-if="(activeContent==1 && anchorList.length>0) ||
(activeContent==2 && anchorList2.length>0)">
<div class="left-area-box">
<ul v-if="activeContent==1 && anchorList.length>0">
<ul v-if="activeContent==1">
<li v-for="(item,index) in anchorList" :key="index">
<a @click="anchorSkip(item.id)">{{item.name}}</a>
</li>
</ul>
<ul v-else-if="activeContent==2 && anchorList2.length>0">
<ul v-else-if="activeContent==2">
<li v-for="(item,index) in anchorList2" :key="index">
<a @click="anchorSkip(item.id)">{{item.name}}</a>
</li>
</ul>
<ul v-else>
<li>暂无锚点</li>
</ul>
</div>
</div>
<div class="center-area card-box" :style="{
......@@ -115,7 +114,7 @@
<el-empty v-else description="暂无问题"></el-empty>
<div class="question-email bold">
如有其他问题需要咨询,请发送邮件至以下邮箱 xxxxxxx
如有其他问题需要咨询,请发送邮件至以下邮箱 service@campcenter.cn
</div>
</div>
</div>
......@@ -469,6 +468,12 @@
align-items: self-start;
justify-content: space-between;
position: relative;
>div{
margin-right: 20px;
&:last-child{
margin-right: 0;
}
}
.left-area {
flex: 1;
......@@ -515,7 +520,6 @@
.center-area {
flex: 4;
margin: 0 20px;
.center-area-title {
text-align: center;
......
......@@ -185,20 +185,37 @@
{min: 6, max: 20, message: "请输入正确的验证码", trigger: "blur"},
],
},
changeLogin: 2,
changeLogin: 1,
};
},
created() {
this.$emit("getStatus", false);
const endTime = window.localStorage.getItem("login_code_time");
if (endTime && Number(endTime) > new Date().getTime()) {
const phone = window.localStorage.getItem("login_code_phone");
if (endTime > 0) {
this.loginForm.phone = phone;
this.intervalHandle(new Date(), Number(endTime));
this.intervalHandleNew(endTime);
}
this.commonApi(31)
},
methods: {
// 定时器倒计时
intervalHandleNew(timeLag) {
if (!this.timer) {
this.count = timeLag - 1;
this.showCode = false;
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= timeLag) {
this.count--;
window.localStorage.setItem("login_code_time", this.count);
} else {
clearInterval(this.timer);
this.showCode = true;
this.timer = null;
}
}, 1000);
}
},
// 定时器倒计时
intervalHandle(startTime, endTime) {
// 时间差
......@@ -222,9 +239,6 @@
if (!this.loginForm.phone) {
return this.$message.error("请输入手机号");
}
// if (!this.codeTime) {
// return this.$message.error("您已经获取验证码,请去邮箱中进行查看");
// }
// 接口获得验证码
loginCode({
phone: this.loginForm.phone,
......@@ -234,9 +248,11 @@
return this.$message.error(res.data.message);
}
this.$message.success(res.data.message);
this.codeTime = res.data.data.now * 1000;
window.localStorage.setItem("login_code_time", res.data.data.now * 1000);
this.intervalHandle(new Date(), res.data.data.now * 1000);
this.codeTime = res.data.expire_time;
window.localStorage.setItem("login_code_time", res.data.expire_time);
window.localStorage.setItem("login_code_phone", this.loginForm.phone);
this.intervalHandleNew(res.data.expire_time)
});
},
// 忘记账号/密码
......@@ -282,10 +298,10 @@
if (res.data.code != 200) {
return this.$message.error(res.data.message);
}
this.$message.success("登录成功");
this.$message.success(res.data.message);
this.$store.commit('login', res.data.token);
window.localStorage.setItem("index-phone-all", this.loginForm.phone);
window.localStorage.setItem("email", res.data.email);
window.localStorage.setItem("index-email-all", res.data.email);
let previousPath = this.$store.state.previousPath;
this.$router.push(previousPath);
this.$store.commit('setPreviousPath', '/');
......@@ -293,6 +309,11 @@
});
},
},
destroyed() {
this.timer && clearInterval(this.timer);
localStorage.removeItem('login_code_time');
localStorage.removeItem('login_code_phone');
}
};
</script>
......@@ -313,11 +334,9 @@
.title_top {
display: flex;
justify-content: end;
}
.normal {
width: 100px;
cursor: pointer
}
......
......@@ -212,9 +212,10 @@
},
created() {
const endTime = window.localStorage.getItem("register_code_time");
if (endTime && Number(endTime) > new Date().getTime()) {
this.resetForm.phone = phone;
this.intervalHandle(new Date(), Number(endTime));
const phone = window.localStorage.getItem("register_code_phone");
if (endTime > 0) {
this.registerForm.phone = phone;
this.intervalHandleNew(endTime);
}
this.commonApi(30)
},
......@@ -228,6 +229,23 @@
this.isShowPwd = !this.isShowPwd;
},
// 定时器倒计时
intervalHandleNew(timeLag) {
if (!this.timer) {
this.count = timeLag - 1;
this.showCode = false;
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= timeLag) {
this.count--;
window.localStorage.setItem("register_code_time", this.count);
} else {
clearInterval(this.timer);
this.showCode = true;
this.timer = null;
}
}, 1000);
}
},
// 定时器倒计时
intervalHandle(startTime, endTime) {
// 时间差
const timeLag = intervalTime(startTime, endTime);
......@@ -251,51 +269,53 @@
if (!this.registerForm.phone) {
return this.$message.error("请输入邮箱");
}
// if (!this.codeTime) {
// return this.$message.error("您已经获取验证码,请去邮箱中进行查看");
// }
// 接口获得验证码
registerCode({
phone: this.registerForm.phone,
}).then((res) => {
console.log(res, "passwordCode");
if (res.data.code != 200) {
return this.$message.error(res.data.msg);
return this.$message.error(res.data.message);
}
this.$message.success(res.data.msg);
this.codeTime = res.data.data.now * 1000;
// console.log(this.codeTime)
window.localStorage.setItem("register_code_time",
res.data.data.now * 1000
);
this.intervalHandle(new Date(), res.data.data.now * 1000);
this.$message.success(res.data.message);
this.codeTime = res.data.expire_time;
window.localStorage.setItem("register_code_time", res.data.expire_time);
window.localStorage.setItem("register_code_phone", this.registerForm.phone);
this.intervalHandleNew(res.data.expire_time);
});
},
// 表单验证
submitForm() {
this.$refs["registerFormRef"].validate((valid) => {
if (!valid) return;
setAccountInfo({
phone: this.registerForm.phone,
// email: this.registerForm.email,
code: this.registerForm.code,
password: this.registerForm.password,
rq_password: this.registerForm.rq_password,
}).then((res) => {
console.log(res);
if (res.data.code != 200) {
return this.$message.error(res.data.msg);
return this.$message.error(res.data.message);
}
this.$message.success(res.data.message);
// token存储
this.$store.commit('login', res.data.token);
window.localStorage.setItem("index-phone-all", this.registerForm.phone);
// 跳转到报名
this.$router.replace("/myInfo/signUpList");
let previousPath = this.$store.state.previousPath;
this.$router.push(previousPath);
this.$store.commit('setPreviousPath', '/');
});
});
},
},
destroyed() {
this.timer && clearInterval(this.timer);
localStorage.removeItem('register_code_time');
localStorage.removeItem('register_code_phone');
}
};
</script>
......
......@@ -11,7 +11,7 @@
class="demo-resetForm"
>
<el-form-item prop="phone">
<img class="img_l" src="@/assets/img/reset/username.png" alt="" />
<img class="img_l" src="@/assets/img/reset/username.png" alt=""/>
<el-input
v-model="resetForm.phone"
placeholder="请输入手机号"
......@@ -27,7 +27,7 @@
></el-input>
</el-form-item> -->
<el-form-item prop="code">
<img class="img_l" src="@/assets/img/reset/code.png" alt="" />
<img class="img_l" src="@/assets/img/reset/code.png" alt=""/>
<el-input
v-model="resetForm.code"
placeholder="请输入短信验证码"
......@@ -58,7 +58,7 @@
</div>
</el-form-item>
<el-form-item prop="password">
<img class="img_l" src="@/assets/img/reset/password.png" alt="" />
<img class="img_l" src="@/assets/img/reset/password.png" alt=""/>
<el-input
v-model="resetForm.password"
maxlength="20"
......@@ -81,7 +81,7 @@
/> -->
</el-form-item>
<el-form-item prop="rq_password">
<img class="img_l" src="@/assets/img/reset/password.png" alt="" />
<img class="img_l" src="@/assets/img/reset/password.png" alt=""/>
<el-input
v-model="resetForm.rq_password"
placeholder="请再次输入新的登录密码"
......@@ -104,10 +104,10 @@
<script>
/* eslint-disable */
// 请求接口
import { passwordCode } from "r/base/register";
import { changePassCode } from "r/base/login";
import { mobileCheck } from "@/common/utils.js";
import { intervalTime } from "store/time";
import {passwordCode} from "r/base/register";
import {changePassCode} from "r/base/login";
import {mobileCheck} from "@/common/utils.js";
import {intervalTime} from "store/time";
import validator from "common/validator";
export default {
......@@ -138,7 +138,7 @@
resetRules: {
// 对手机号进行校验
phone: [
{ required: true, message: "请输入手机号", trigger: "blur" },
{required: true, message: "请输入手机号", trigger: "blur"},
{
validator: function (rule, value, callback) {
if (mobileCheck(value) === false) {
......@@ -160,8 +160,8 @@
// ],
// 对验证码进行校验
code: [
{ required: true, message: "请输入验证码", trigger: "blur" },
{ min: 6, max: 20, message: "请输入正确的验证码", trigger: "blur" },
{required: true, message: "请输入验证码", trigger: "blur"},
{min: 6, max: 20, message: "请输入正确的验证码", trigger: "blur"},
],
// 对密码进行校验
password: [
......@@ -198,7 +198,7 @@
],
// 对密码进行校验
rq_password: [
{ required: true, message: "请输入确认密码", trigger: "blur" },
{required: true, message: "请输入确认密码", trigger: "blur"},
{
validator: pwdCheck,
trigger: "blur",
......@@ -208,23 +208,40 @@
};
},
created() {
const endTime = window.localStorage.getItem("restet_code_time" );
const phone = window.localStorage.getItem("restet_code_phone" );
if (endTime && Number(endTime) > new Date().getTime()) {
const endTime = window.localStorage.getItem("reset_code_time");
const phone = window.localStorage.getItem("reset_code_phone");
if (endTime > 0) {
this.resetForm.phone = phone;
this.intervalHandle(new Date(), Number(endTime));
this.intervalHandleNew(endTime);
}
},
methods: {
// 去注册
toLogin() {
this.$router.push("/baseLogin" );
this.$router.push("/baseLogin");
},
// 改变密码显示状态
changePwdStatus() {
this.isShowPwd = !this.isShowPwd;
},
// 定时器倒计时
intervalHandleNew(timeLag) {
if (!this.timer) {
this.count = timeLag - 1;
this.showCode = false;
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= timeLag) {
this.count--;
window.localStorage.setItem("reset_code_time", this.count);
} else {
clearInterval(this.timer);
this.showCode = true;
this.timer = null;
}
}, 1000);
}
},
// 定时器倒计时
intervalHandle(startTime, endTime) {
// 时间差
const timeLag = intervalTime(startTime, endTime);
......@@ -248,9 +265,6 @@
if (!this.resetForm.phone) {
return this.$message.error("请输入手机号");
}
// if (!this.codeTime) {
// return this.$message.error("您已经获取验证码,请去邮箱中进行查看");
// }
// 接口获得验证码
passwordCode({
phone: this.resetForm.phone,
......@@ -261,15 +275,13 @@
return this.$message.error(res.data.message);
}
this.$message.success(res.data.message);
this.codeTime = res.data.data.now * 1000;
// console.log(this.codeTime)
window.localStorage.setItem("restet_code_time" ,
res.data.data.now * 1000
);
this.intervalHandle(new Date(), res.data.data.now * 1000);
this.codeTime = res.data.expire_time;
window.localStorage.setItem("reset_code_time", res.data.expire_time);
window.localStorage.setItem("reset_code_phone", this.resetForm.phone);
this.intervalHandleNew(res.data.expire_time);
});
},
// 表单验证
submitForm() {
this.$refs["resetFormRef"].validate((valid) => {
......@@ -287,14 +299,18 @@
}
this.$message.success(res.data.message);
// token存储
window.localStorage.setItem("restet_code_phone" ,
this.resetForm.phone
);
window.localStorage.setItem("login_code_phone", this.resetForm.phone);
// 跳转到登录
this.$router.replace("/baseLogin");
});
});
},
},
destroyed() {
this.timer && clearInterval(this.timer);
localStorage.removeItem('reset_code_time');
localStorage.removeItem('reset_code_phone');
}
};
</script>
......@@ -337,6 +353,7 @@
}
}
}
// 注册输入
.container {
background: #ffffff;
......
......@@ -535,7 +535,7 @@ export default {
created() {
const code = this.$store.state.indexIdentity;
this.referForm.phone = window.localStorage.getItem("index-phone-all"); //本地取用户手机号
this.referForm.email = window.localStorage.getItem("email" + code); //本地取用户邮箱
this.referForm.email = window.localStorage.getItem("index-email-all"); //本地取用户邮箱
console.log(this.referForm.email, " this.referForm.email");
let signUpFile = window.localStorage.getItem(
"sign_up_file_" + window.localStorage.getItem("index-phone-all") + code
......@@ -661,8 +661,7 @@ export default {
res.data.info.jiguan_city.toString();
}
if (res.data.info.email == null) {
const code = this.$store.state.indexIdentity;
this.referForm.email = window.localStorage.getItem("email" + code); //本地取用户邮箱
this.referForm.email = window.localStorage.getItem("index-email-all"); //本地取用户邮箱
}
});
},
......
......@@ -50,6 +50,7 @@
</template>
<div class="camp_right" ref="rightBox">
<i class="el-icon-arrow-left back-arrow" @click="backArrow()"/>
<SignUp @getStatus="getStatus" v-if="this.campindex_type == 0"></SignUp>
<Homework v-if="this.campindex_type == 1"></Homework>
<Certificate v-if="this.campindex_type == 2"></Certificate>
......@@ -150,6 +151,12 @@
window.removeEventListener("resize", this.onResize, true);
},
methods: {
// 箭头返回按钮
backArrow() {
let root = document.querySelector(":root");
root.style.setProperty("--color", "#4FACFE");
this.$router.push('/myInfo/signUpList');
},
// torefer(val) {
// console.log(val, "val");
// this.homework_val = val;
......@@ -296,10 +303,25 @@
}
.camp_right {
position: relative;
flex: 1;
width: calc(100% - 100px);
border-radius: 8px;
background-color: #ffffff;
.back-arrow.el-icon-arrow-left {
position: absolute;
left: 10px;
top: 10px;
color: #12141c;
font-weight: bold;
font-size: 40px;
&:hover {
color: var(--color);
cursor: pointer;
}
}
}
......
......@@ -2,7 +2,6 @@
<div class="signUp">
<div class="content">
<div class="">
<i class="el-icon-arrow-left back-arrow" @click="backArrow()"/>
<div
class="lastBtn"
v-show="
......@@ -229,12 +228,6 @@
},
},
methods: {
// 箭头返回按钮
backArrow(){
let root = document.querySelector(":root");
root.style.setProperty("--color", "#4FACFE");
this.$router.push('/myInfo/signUpList');
},
// 营地通知 详情内容
// toMsgDetail() {
// this.dialogVisibleList = false;
......@@ -430,22 +423,7 @@
}
.content {
position: relative;
padding: 70px 55px 50px;
.back-arrow.el-icon-arrow-left {
position: absolute;
left: 10px;
top: 10px;
color: #12141c;
font-weight: bold;
font-size: 40px;
&:hover {
color: var(--color);
cursor: pointer;
}
}
}
}
......
......@@ -2,8 +2,8 @@
<div class="container">
<div class="title_Login">
<div v-if="changeLogin == 1">
<div class="title" @click="toCodeLogin">
<div :class="changeLogin == 2 ? 'change_login' : ''">验证码登录</div>
<div class="title title_top" @click="toCodeLogin">
<div :class="changeLogin == 2 ? 'change_login normal' : 'normal'">验证码登录</div>
</div>
<div class="title" @click="toLogin">
<div :class="changeLogin == 1 ? 'change_login' : ''">
......@@ -13,8 +13,8 @@
</div>
<div v-else-if="changeLogin == 2">
<div class="title" @click="toLogin">
<div :class="changeLogin == 1 ? 'change_login' : ''">
<div class="title title_top" @click="toLogin">
<div :class="changeLogin == 1 ? 'change_login normal' : 'normal'">
账号密码登录
</div>
</div>
......@@ -186,21 +186,37 @@
{min: 6, max: 20, message: "请输入正确的验证码", trigger: "blur"},
],
},
changeLogin: 2,
changeLogin: 1,
};
},
created() {
this.$emit("getStatus", false);
const code = this.$store.state.indexIdentity;
const endTime = window.localStorage.getItem("login_code_time" + code);
if (endTime && Number(endTime) > new Date().getTime()) {
const endTime = window.localStorage.getItem("login_code_time");
const phone = window.localStorage.getItem("login_code_phone");
if (endTime > 0) {
this.loginForm.phone = phone;
this.intervalHandle(new Date(), Number(endTime));
this.intervalHandleNew(endTime);
}
this.commonApi(31)
},
methods: {
// 定时器倒计时
intervalHandleNew(timeLag) {
if (!this.timer) {
this.count = timeLag - 1;
this.showCode = false;
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= timeLag) {
this.count--;
window.localStorage.setItem("login_code_time_" + code, this.count);
} else {
clearInterval(this.timer);
this.showCode = true;
this.timer = null;
}
}, 1000);
}
},
// 定时器倒计时
intervalHandle(startTime, endTime) {
// 时间差
......@@ -225,9 +241,6 @@
if (!this.loginForm.phone) {
return this.$message.error("请输入手机号");
}
// if (!this.codeTime) {
// return this.$message.error("您已经获取验证码,请去邮箱中进行查看");
// }
// 接口获得验证码
loginCode({
phone: this.loginForm.phone,
......@@ -237,14 +250,10 @@
return this.$message.error(res.data.message);
}
this.$message.success(res.data.message);
this.codeTime = res.data.data.now * 1000;
// console.log(this.codeTime)
let code = this.$store.state.indexIdentity;
window.localStorage.setItem(
"login_code_time" + code,
res.data.data.now * 1000
);
this.intervalHandle(new Date(), res.data.data.now * 1000);
this.codeTime = res.data.expire_time;
window.localStorage.setItem("login_code_time", res.data.expire_time);
window.localStorage.setItem("login_code_phone", this.loginForm.phone);
this.intervalHandleNew(res.data.expire_time);
});
},
// 忘记账号/密码
......@@ -294,24 +303,28 @@
if (res.data.code != 200) {
return this.$message.error(res.data.message);
}
// this.$message.success("登录成功");
this.$message.success(res.data.message);
// 跳转到报名
const code = this.$store.state.indexIdentity;
// token存储
this.$store.commit('login', res.data.token);
window.localStorage.setItem("index-phone-all", this.loginForm.phone);
window.localStorage.setItem("email" + code, res.data.email);
window.localStorage.setItem("index-email-all", res.data.email);
// 报名信息
window.localStorage.setItem("camp_name" + code, res.data.cam.name);
//获取主题色
window.localStorage.setItem("system_color" + code,
res.data.cam.system_color
);
window.localStorage.setItem("system_color" + code, res.data.cam.system_color);
// 跳转到报名
this.$router.replace("/signUp/undefined?code=" + code);
});
});
},
},
destroyed() {
this.timer && clearInterval(this.timer);
localStorage.removeItem('login_code_time');
localStorage.removeItem('login_code_phone');
}
};
</script>
......@@ -341,6 +354,14 @@
color: var(--color);
line-height: 20px;
text-align: right;
&.title_top {
display: flex;
justify-content: end;
.normal {
cursor: pointer
}
}
}
.change_login {
......
......@@ -218,12 +218,11 @@
};
},
created() {
const code = this.$store.state.indexIdentity;
const endTime = window.localStorage.getItem("register_code_time" + code);
if (endTime && Number(endTime) > new Date().getTime()) {
this.resetForm.phone = phone;
this.intervalHandle(new Date(), Number(endTime));
const endTime = window.localStorage.getItem("register_code_time");
const phone = window.localStorage.getItem("register_code_phone");
if (endTime > 0) {
this.registerForm.phone = phone;
this.intervalHandleNew(endTime);
}
this.commonApi(30)
},
......@@ -238,6 +237,23 @@
this.isShowPwd = !this.isShowPwd;
},
// 定时器倒计时
intervalHandleNew(timeLag) {
if (!this.timer) {
this.count = timeLag - 1;
this.showCode = false;
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= timeLag) {
this.count--;
window.localStorage.setItem("register_code_time", this.count);
} else {
clearInterval(this.timer);
this.showCode = true;
this.timer = null;
}
}, 1000);
}
},
// 定时器倒计时
intervalHandle(startTime, endTime) {
// 时间差
const timeLag = intervalTime(startTime, endTime);
......@@ -261,61 +277,55 @@
if (!this.registerForm.phone) {
return this.$message.error("请输入邮箱");
}
// if (!this.codeTime) {
// return this.$message.error("您已经获取验证码,请去邮箱中进行查看");
// }
// 接口获得验证码
registerCode({
phone: this.registerForm.phone,
}).then((res) => {
console.log(res, "passwordCode");
if (res.data.code != 200) {
return this.$message.error(res.data.msg);
return this.$message.error(res.data.message);
}
this.$message.success(res.data.msg);
this.codeTime = res.data.data.now * 1000;
// console.log(this.codeTime)
let code = this.$store.state.indexIdentity;
window.localStorage.setItem("register_code_time" + code,
res.data.data.now * 1000
);
this.intervalHandle(new Date(), res.data.data.now * 1000);
this.$message.success(res.data.message);
this.codeTime = res.data.expire_time;
window.localStorage.setItem("register_code_time", res.data.expire_time);
window.localStorage.setItem("register_code_phone", this.registerForm.phone);
this.intervalHandleNew(res.data.expire_time);
});
},
// 表单验证
submitForm() {
this.$refs["registerFormRef"].validate((valid) => {
if (!valid) return;
setAccountInfo({
phone: this.registerForm.phone,
// email: this.registerForm.email,
code: this.registerForm.code,
password: this.registerForm.password,
rq_password: this.registerForm.rq_password,
}).then((res) => {
console.log(res);
if (res.data.code != 200) {
return this.$message.error(res.data.msg);
return this.$message.error(res.data.message);
}
// this.$message.success(res.data.msg);
this.$message.success(res.data.message);
let code = this.$store.state.indexIdentity;
// token存储
this.$store.commit('login', res.data.token);
window.localStorage.setItem("index-phone-all", this.registerForm.phone);
// window.localStorage.setItem("email" + code, this.registerForm.email);
// 报名信息
window.localStorage.setItem("camp_name" + code, res.data.cam.name);
//获取主题色
window.localStorage.setItem("system_color" + code,
res.data.cam.system_color
);
window.localStorage.setItem("system_color" + code, res.data.cam.system_color);
// 跳转到报名
this.$router.replace("/signUp/undefined?code=" + code);
});
});
},
},
destroyed() {
this.timer && clearInterval(this.timer);
localStorage.removeItem('register_code_time');
localStorage.removeItem('register_code_phone');
}
};
</script>
......
......@@ -208,12 +208,11 @@
};
},
created() {
const code = this.$store.state.indexIdentity;
const endTime = window.localStorage.getItem("restet_code_time" + code);
const phone = window.localStorage.getItem("restet_code_phone" + code);
if (endTime && Number(endTime) > new Date().getTime()) {
const endTime = window.localStorage.getItem("reset_code_time");
const phone = window.localStorage.getItem("reset_code_phone");
if (endTime > 0) {
this.resetForm.phone = phone;
this.intervalHandle(new Date(), Number(endTime));
this.intervalHandleNew(endTime);
}
},
methods: {
......@@ -227,6 +226,23 @@
this.isShowPwd = !this.isShowPwd;
},
// 定时器倒计时
intervalHandleNew(timeLag) {
if (!this.timer) {
this.count = timeLag - 1;
this.showCode = false;
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= timeLag) {
this.count--;
window.localStorage.setItem("reset_code_time", this.count);
} else {
clearInterval(this.timer);
this.showCode = true;
this.timer = null;
}
}, 1000);
}
},
// 定时器倒计时
intervalHandle(startTime, endTime) {
// 时间差
const timeLag = intervalTime(startTime, endTime);
......@@ -250,9 +266,6 @@
if (!this.resetForm.phone) {
return this.$message.error("请输入手机号");
}
// if (!this.codeTime) {
// return this.$message.error("您已经获取验证码,请去邮箱中进行查看");
// }
// 接口获得验证码
passwordCode({
phone: this.resetForm.phone,
......@@ -263,16 +276,13 @@
return this.$message.error(res.data.message);
}
this.$message.success(res.data.message);
this.codeTime = res.data.data.now * 1000;
// console.log(this.codeTime)
let code = this.$store.state.indexIdentity;
window.localStorage.setItem("restet_code_time" + code,
res.data.data.now * 1000
);
this.intervalHandle(new Date(), res.data.data.now * 1000);
this.codeTime = res.data.expire_time;
window.localStorage.setItem("reset_code_time", res.data.expire_time);
window.localStorage.setItem("reset_code_phone", this.resetForm.phone);
this.intervalHandleNew(res.data.expire_time);
});
},
// 表单验证
submitForm() {
this.$refs["resetFormRef"].validate((valid) => {
......@@ -291,12 +301,18 @@
this.$message.success(res.data.message);
// token存储
let code = this.$store.state.indexIdentity;
window.localStorage.setItem("restet_code_phone" + code, this.resetForm.phone);
window.localStorage.setItem("login_code_phone", this.resetForm.phone);
// 跳转到登录
this.$router.replace("/login?code=" + code);
});
});
},
},
destroyed() {
this.timer && clearInterval(this.timer);
localStorage.removeItem('reset_code_time');
localStorage.removeItem('reset_code_phone');
}
};
</script>
......
......@@ -18,16 +18,13 @@
<!-- <el-button @click="toLogin()">立即报名</el-button>-->
<!-- </div>-->
<div class="active-area">
<div class="left-area card-box">
<div class="left-area card-box" v-if="anchorList.length>0">
<div class="left-area-box">
<ul class="left" v-if="anchorList.length>0">
<ul class="left">
<li :key="index" v-for="(item,index) in anchorList">
<a @click="anchorSkip(item.id)">{{item.name}}</a>
</li>
</ul>
<ul v-else>
<li>暂无锚点</li>
</ul>
</div>
</div>
<div :style="{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment