Commit b4eded4d authored by 杨梦雪's avatar 杨梦雪

登录注册

parent 1c0f3c03
...@@ -74,18 +74,15 @@ ...@@ -74,18 +74,15 @@
}, },
// 去个人中心 // 去个人中心
toCenter() { toCenter() {
let code = this.$store.state.indexIdentity; this.$router.replace("/signUpList");
this.$router.replace("/signUp/examInfo?code=" + code);
}, },
// 去注册 // 去注册
toRegister() { toRegister() {
let code = this.$store.state.indexIdentity; this.$router.push("/baseRegister" );
this.$router.push("/register?code=" + code);
}, },
// 去登录页 // 去登录页
toLogin() { toLogin() {
let code = this.$store.state.indexIdentity; this.$router.push("/baseLogin");
this.$router.push("/login?code=" + code);
}, },
// 退出登录 // 退出登录
async logout() { async logout() {
......
...@@ -8,7 +8,7 @@ import store from '@/store' ...@@ -8,7 +8,7 @@ import store from '@/store'
export function login(data) { export function login(data) {
return request({ return request({
method: 'post', method: 'post',
url: '/web/auth/login', url: '/modules-campsite/web/auth/login',
params: data params: data
}) })
} }
......
export default [{
path: '/signUpList',
name: 'signUpList',
component: () => import(/* webpackChunkName: "login" */ 'v/base/myInfo/signUp.vue'),
meta: {
title: '我的报名'
}
},
]
...@@ -209,8 +209,8 @@ router.beforeEach((to, from, next) => { ...@@ -209,8 +209,8 @@ router.beforeEach((to, from, next) => {
toBaseReset = "/baseReset", toBaseReset = "/baseReset",
toHome = "/home", toHome = "/home",
toActive = "/active"; toActive = "/active";
let toMyInfo; let toInfo;
toMyInfo = "/myInfo"; toInfo = "/myInfo";
let code = false; let code = false;
document.title = to.meta.title; document.title = to.meta.title;
if (to.path == toLogin || to.path == toRegister || to.path == toReset) { if (to.path == toLogin || to.path == toRegister || to.path == toReset) {
...@@ -227,7 +227,7 @@ router.beforeEach((to, from, next) => { ...@@ -227,7 +227,7 @@ router.beforeEach((to, from, next) => {
// } // }
// }); // });
return next(); return next();
} else if (to.path == toBaseLogin ||to.path == toBaseRegister ||to.path == toBaseReset || to.path == toMyInfo || to.path == toHome || to.path == toActive || to.path.indexOf(toActive) != -1) { } else if (to.path == toBaseLogin ||to.path == toBaseRegister ||to.path == toBaseReset || to.path == toInfo || to.path == toHome || to.path == toActive || to.path.indexOf(toActive) != -1) {
return next(); return next();
} else if (to.name == "recruit") { } else if (to.name == "recruit") {
code = to.params.code; code = to.params.code;
......
<template> <template>
<div class="home-container"> <div class="home-container">
<div> <div class="bannerImg">
<el-carousel height="300px"> <el-carousel :height="bannerHeight+'px'">
<el-carousel-item :key="index" v-for="(item,index) in bannerlist"> <el-carousel-item :key="index" v-for="(item,index) in bannerlist">
<img :src="item.url" class="small" style="width: 100%;"/> <img :src="item.url" class="small" style="width: 100%;"/>
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
</div> </div>
<div class="com-container home_content"> <div class="com-container home_content">
<!-- 热门活动 --> <!-- 热门活动 -->
<div > <div>
<div class="home_title"> <div class="home_title">
热门活动 热门活动
</div> </div>
...@@ -86,16 +86,18 @@ ...@@ -86,16 +86,18 @@
<script> <script>
import img from "../../../assets/img/recruit.png"; import img from "../../../assets/img/recruit.png";
import banner from "../../../assets/img/Banner/banner@2x.png"; import banner1 from "../../../assets/img/Banner/banner1.jpg";
import banner2 from "../../../assets/img/Banner/banner2.jpg";
export default { export default {
name: "Home", name: "Home",
data() { data() {
return { return {
bannerHeight: "",
bannerlist: [{ bannerlist: [{
url: banner url: banner1
}, { }, {
url: banner url: banner2
}], }],
activeList: [ activeList: [
{ {
...@@ -197,6 +199,17 @@ ...@@ -197,6 +199,17 @@
}] }]
}; };
}, },
mounted() {
// 首次加载时,初始化高度
this.screenWidth = window.innerWidth
this.bannerHeight = 600 / 1550 * this.screenWidth
// 窗口大小发生改变
window.onresize = () => {
this.screenWidth = window.innerWidth
this.bannerHeight = 600 / 1550 * this.screenWidth
}
},
} }
</script> </script>
...@@ -231,6 +244,13 @@ ...@@ -231,6 +244,13 @@
} }
} }
.bannerImg {
img {
width: 100%;
height: inherit;
}
}
.active-list { .active-list {
margin-top: 30px; margin-top: 30px;
display: flex; display: flex;
...@@ -390,9 +410,11 @@ ...@@ -390,9 +410,11 @@
color: #333333; color: #333333;
font-family: "PingFang SC"; font-family: "PingFang SC";
} }
.home_content{
.home_content {
padding: 50px; padding: 50px;
} }
.line { .line {
align-items: center; align-items: center;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@media (min-width: 1024px) { @media screen and (max-width: 1500px) {
.login-index .big-right .info-box { .login-index .big-right .info-box {
width: 32%!important; width: 32%!important;
top: 60%!important; top: 60%!important;
......
...@@ -288,14 +288,11 @@ ...@@ -288,14 +288,11 @@
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("登录成功");请访问正确的营地链接地址
// 跳转到报名 window.localStorage.setItem("index-token-all", res.data.token);
// token存储
window.localStorage.setItem("base-token", res.data.token);
window.localStorage.setItem("phone", this.loginForm.phone); window.localStorage.setItem("phone", this.loginForm.phone);
window.localStorage.setItem("email", res.data.email); window.localStorage.setItem("email", res.data.email);
// 报名信息 this.$router.replace("/myInfo");
this.$router.replace("/signUpList");
}); });
}); });
}, },
...@@ -305,8 +302,6 @@ ...@@ -305,8 +302,6 @@
<style lang="scss" scoped> <style lang="scss" scoped>
@media screen and (max-width: 1500px){ @media screen and (max-width: 1500px){
.container { .container {
height: 300px !important; height: 300px !important;
padding: 30px 37px 70px 37px!important; padding: 30px 37px 70px 37px!important;
...@@ -325,8 +320,30 @@ ...@@ -325,8 +320,30 @@
} }
::v-deep .el-form { ::v-deep .el-form {
margin-top: 20px !important; margin-top: 25px !important;
.el-form-item {
/*margin-bottom: 25px !important;*/
.el-form-item__content {
img.img_l {
width: 24px !important;
}
.el-input {
font-size: 12px !important;
}
.el-input__inner {
height: 40px !important;
}
.el-button {
font-size: 15px !important;
/*margin-top:10px !important;*/
height: 50px !important;
line-height: 50px !important;
}}
}
} }
} }
......
...@@ -7,15 +7,15 @@ ...@@ -7,15 +7,15 @@
<el-form <el-form
:model="registerForm" :model="registerForm"
:rules="registerRules" :rules="registerRules"
ref="registerFormRef"
class="demo-registerForm" class="demo-registerForm"
ref="registerFormRef"
> >
<el-form-item prop="phone"> <el-form-item prop="phone">
<img class="img_l" src="@/assets/img/reset/username.png" alt="" /> <img alt="" class="img_l" src="@/assets/img/reset/username.png"/>
<el-input <el-input
v-model="registerForm.phone"
placeholder="请输入手机号"
maxlength="11" maxlength="11"
placeholder="请输入手机号"
v-model="registerForm.phone"
></el-input> ></el-input>
</el-form-item> </el-form-item>
...@@ -29,11 +29,11 @@ ...@@ -29,11 +29,11 @@
></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 alt="" class="img_l" src="@/assets/img/reset/code.png"/>
<el-input <el-input
v-model="registerForm.code"
placeholder="请输入短信验证码"
maxlength="20" maxlength="20"
placeholder="请输入短信验证码"
v-model="registerForm.code"
></el-input> ></el-input>
<!-- 短信验证码 --> <!-- 短信验证码 -->
...@@ -54,19 +54,19 @@ ...@@ -54,19 +54,19 @@
></el-input> --> ></el-input> -->
<!-- 短信验证码 --> <!-- 短信验证码 -->
<div class="phoneCode"> <div class="phoneCode">
<span class="code" v-show="showCode" @click="getCode" <span @click="getCode" class="code" v-show="showCode"
>获取验证码</span >获取验证码</span
> >
<span v-show="!showCode" class="count">{{ count }} s</span> <span class="count" v-show="!showCode">{{ count }} s</span>
</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 alt="" class="img_l" src="@/assets/img/reset/password.png"/>
<el-input <el-input
v-model="registerForm.password" :autocomplete="isShowPwd ? 'new-password' : 'off'"
maxlength="20" maxlength="20"
placeholder="设置密码:6-12位字符,包含字母或数字" placeholder="设置密码:6-12位字符,包含字母或数字"
:autocomplete="isShowPwd ? 'new-password' : 'off'" v-model="registerForm.password"
></el-input> ></el-input>
<!-- <img <!-- <img
@click="changePwdStatus()" @click="changePwdStatus()"
...@@ -84,11 +84,11 @@ ...@@ -84,11 +84,11 @@
/> --> /> -->
</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 alt="" class="img_l" src="@/assets/img/reset/password.png"/>
<el-input <el-input
v-model="registerForm.rq_password"
placeholder="请再次输入登录密码"
maxlength="20" maxlength="20"
placeholder="请再次输入登录密码"
v-model="registerForm.rq_password"
></el-input> ></el-input>
</el-form-item> </el-form-item>
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<el-button @click="submitForm()"> 注册</el-button> <el-button @click="submitForm()"> 注册</el-button>
</el-form-item> </el-form-item>
<div class="box"> <div class="box">
<div class="fr" @click="toLogin()">已有账号?马上登录</div> <div @click="toLogin()" class="fr">已有账号?马上登录</div>
</div> </div>
</el-form> </el-form>
</div> </div>
...@@ -107,14 +107,9 @@ ...@@ -107,14 +107,9 @@
<script> <script>
/* eslint-disable */ /* eslint-disable */
import { import {registerCode, setAccountInfo,} from "r/base/register";
registerCode, import {mobileCheck} from "@/common/utils.js";
setAccountInfo, import {intervalTime} from "store/time";
registerEmailCode,
} from "r/base/register";
import { mobileCheck, checkStrong } from "@/common/utils.js";
import validator from "common/validator";
import { intervalTime } from "store/time";
export default { export default {
name: "base-register", name: "base-register",
...@@ -146,7 +141,7 @@ ...@@ -146,7 +141,7 @@
registerRules: { registerRules: {
// 对手机号进行校验 // 对手机号进行校验
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) {
...@@ -168,8 +163,8 @@ ...@@ -168,8 +163,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: [
...@@ -206,7 +201,7 @@ ...@@ -206,7 +201,7 @@
], ],
// 对密码进行校验 // 对密码进行校验
rq_password: [ rq_password: [
{ required: true, message: "请输入确认密码", trigger: "blur" }, {required: true, message: "请输入确认密码", trigger: "blur"},
{ {
validator: pwdCheck, validator: pwdCheck,
trigger: "blur", trigger: "blur",
...@@ -216,7 +211,7 @@ ...@@ -216,7 +211,7 @@
}; };
}, },
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()) { if (endTime && Number(endTime) > new Date().getTime()) {
this.resetForm.phone = phone; this.resetForm.phone = phone;
this.intervalHandle(new Date(), Number(endTime)); this.intervalHandle(new Date(), Number(endTime));
...@@ -271,7 +266,7 @@ ...@@ -271,7 +266,7 @@
this.codeTime = res.data.data.now * 1000; this.codeTime = res.data.data.now * 1000;
// console.log(this.codeTime) // console.log(this.codeTime)
window.localStorage.setItem( window.localStorage.setItem(
"register_code_time" , "register_code_time",
res.data.data.now * 1000 res.data.data.now * 1000
); );
this.intervalHandle(new Date(), res.data.data.now * 1000); this.intervalHandle(new Date(), res.data.data.now * 1000);
...@@ -295,18 +290,18 @@ ...@@ -295,18 +290,18 @@
} }
// this.$message.success(res.data.message); // this.$message.success(res.data.message);
// token存储 // token存储
window.localStorage.setItem("index-token" , res.data.token); window.localStorage.setItem("index-token", res.data.token);
window.localStorage.setItem("phone" , this.registerForm.phone); window.localStorage.setItem("phone", this.registerForm.phone);
// window.localStorage.setItem("email" + code, this.registerForm.email); // window.localStorage.setItem("email" + code, this.registerForm.email);
// 报名信息 // 报名信息
window.localStorage.setItem("camp_name" , res.data.cam.name); window.localStorage.setItem("camp_name", res.data.cam.name);
//获取主题色 //获取主题色
window.localStorage.setItem( window.localStorage.setItem(
"system_color" , "system_color",
res.data.cam.system_color res.data.cam.system_color
); );
// 跳转到报名 // 跳转到报名
this.$router.replace("/signUpList" ); this.$router.replace("/signUpList");
}); });
}); });
}, },
...@@ -314,7 +309,46 @@ ...@@ -314,7 +309,46 @@
}; };
</script> </script>
<style scoped lang="scss"> <style lang="scss" scoped>
@media screen and (max-width: 1500px) {
.container {
padding: 30px 50px 20px 50px !important;
.title {
font-size: 20px !important;
}
::v-deep .el-form {
margin-top: 20px !important;
.el-form-item {
margin-bottom: 20px !important;
.el-form-item__content {
img.img_l {
width: 24px !important;
}
.el-input {
font-size: 12px !important;
}
.el-input__inner {
height: 40px !important;
}
.el-button {
font-size: 15px !important;
margin: 0 !important;
height: 42px !important;
line-height: 50px !important;
}
}
}
}
}
}
// 注册输入 // 注册输入
.container { .container {
background: #ffffff; background: #ffffff;
...@@ -433,6 +467,7 @@ ...@@ -433,6 +467,7 @@
color: #999999; color: #999999;
margin-top: -10px; margin-top: -10px;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
color: var(--color); color: var(--color);
text-decoration: underline; text-decoration: underline;
......
...@@ -302,6 +302,44 @@ ...@@ -302,6 +302,44 @@
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@media screen and (max-width: 1500px) {
.container {
padding: 30px 50px 20px 50px !important;
.title {
font-size: 20px !important;
}
::v-deep .el-form {
margin-top: 20px !important;
.el-form-item {
margin-bottom: 20px !important;
.el-form-item__content {
img.img_l {
width: 24px !important;
}
.el-input {
font-size: 12px !important;
}
.el-input__inner {
height: 40px !important;
}
.el-button {
font-size: 15px !important;
margin: 0 !important;
height: 42px !important;
line-height: 50px !important;
}
}
}
}
}
}
// 注册输入 // 注册输入
.container { .container {
background: #ffffff; background: #ffffff;
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<div class="signUp"> <div class="signUp">
<el-tabs @tab-click="handleClick" v-model="activeName"> <el-tabs @tab-click="handleClick" v-model="activeName">
<el-tab-pane label="正在报名" name="1"> <el-tab-pane label="正在报名" name="1">
111 111
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="即将开营" name="2"> <el-tab-pane label="即将开营" name="2">
...@@ -26,7 +25,6 @@ ...@@ -26,7 +25,6 @@
<el-tab-pane label="已结营" name="4">已结营</el-tab-pane> <el-tab-pane label="已结营" name="4">已结营</el-tab-pane>
<el-tab-pane label="已退营" name="5">已退营</el-tab-pane> <el-tab-pane label="已退营" name="5">已退营</el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</template> </template>
......
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