Commit 08ad47dd authored by wuwangwolihui's avatar wuwangwolihui

营地2.0-修改

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