Commit 29dda675 authored by 杨梦雪's avatar 杨梦雪

router +query

parent 5ddadbdd
...@@ -26,6 +26,9 @@ let state = { ...@@ -26,6 +26,9 @@ let state = {
token: localStorage.getItem("index-token-all") || "", token: localStorage.getItem("index-token-all") || "",
isLogin: localStorage.getItem("isLogin") || "0", // 只有1为已登录 isLogin: localStorage.getItem("isLogin") || "0", // 只有1为已登录
activeIndex: window.localStorage.getItem('index-active-path') || "0", activeIndex: window.localStorage.getItem('index-active-path') || "0",
query:{
disCode: localStorage.getItem("index-disCode") || "",
},
}; };
export default new Vuex.Store({ export default new Vuex.Store({
......
...@@ -415,7 +415,12 @@ ...@@ -415,7 +415,12 @@
//查看详情 //查看详情
toActive(id) { toActive(id) {
this.commonApi(36, id) this.commonApi(36, id)
this.$router.push('/active/' + id); this.$router.push({
path: '/active/'+id,
query: {
...this.$store.state.query,
}
});
}, },
} }
} }
......
...@@ -177,12 +177,22 @@ ...@@ -177,12 +177,22 @@
methods: { methods: {
// 查看更多 // 查看更多
viewMore() { viewMore() {
this.$router.push('/active'); this.$router.push({
path: "/active",
query: {
...this.$store.state.query,
}
});
}, },
//查看详情 //查看详情
toActive(id){ toActive(id){
this.commonApi(36,id) this.commonApi(36,id)
this.$router.push('/active/'+id); this.$router.push({
path: '/active/'+id,
query: {
...this.$store.state.query,
}
});
}, },
getHot() { getHot() {
hot().then((res) => { hot().then((res) => {
......
...@@ -222,7 +222,12 @@ ...@@ -222,7 +222,12 @@
methods: { methods: {
// 去注册 // 去注册
toLogin() { toLogin() {
this.$router.push("/baseLogin"); this.$router.push({
path: "/baseLogin",
query: {
...this.$store.state.query,
}
});
}, },
// 改变密码显示状态 // 改变密码显示状态
changePwdStatus() { changePwdStatus() {
......
...@@ -302,7 +302,12 @@ ...@@ -302,7 +302,12 @@
// token存储 // token存储
window.localStorage.setItem("login_code_phone", this.resetForm.phone); window.localStorage.setItem("login_code_phone", this.resetForm.phone);
// 跳转到登录 // 跳转到登录
this.$router.replace("/baseLogin"); this.$router.replace({
path: "/baseLogin",
query: {
...this.$store.state.query,
}
});
}); });
}); });
}, },
......
...@@ -84,7 +84,12 @@ ...@@ -84,7 +84,12 @@
ToSignUp(index) { ToSignUp(index) {
this.campindex_type = index; this.campindex_type = index;
if (this.campindex_type == 0) { if (this.campindex_type == 0) {
this.$router.push({path: '/myInfo/signUpList'}); this.$router.push({
path: "/myInfo/signUpList",
query: {
...this.$store.state.query,
}
});
} }
}, },
onResize() { onResize() {
......
...@@ -851,13 +851,11 @@ export default { ...@@ -851,13 +851,11 @@ export default {
// console.log(111); // console.log(111);
// console.log(this.referForm.birthday); // console.log(this.referForm.birthday);
this.$refs["referRef"].validate((valid, object) => { this.$refs["referRef"].validate((valid, object) => {
// console.log(valid, "valid");
if (!valid) { if (!valid) {
this.scrollView(object); this.scrollView(object);
return false; return false;
} }
setAccountInfo(this.referForm).then((res) => { setAccountInfo(this.referForm).then((res) => {
// console.log(res, "setAccount");
if (res.data.code != 200) { if (res.data.code != 200) {
if (res.data.code == 400068) { if (res.data.code == 400068) {
this.$parent.statuss(); this.$parent.statuss();
...@@ -865,11 +863,8 @@ export default { ...@@ -865,11 +863,8 @@ export default {
} }
return this.$message.error(res.data.msg); return this.$message.error(res.data.msg);
} }
// console.log(3333);
this.$emit("getstatus", res.data.status); this.$emit("getstatus", res.data.status);
this.$message.success(res.data.msg); this.$message.success(res.data.msg);
// let code = this.$store.state.indexIdentity;
// this.$router.push("/signUp/check?code=" + code);
this.referForm = res.data.data; this.referForm = res.data.data;
// this.getAccount(); // 页面信息个人获取(刷新) // this.getAccount(); // 页面信息个人获取(刷新)
}); });
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</template> </template>
<div class="camp_right" ref="rightBox"> <div class="camp_right" ref="rightBox">
<div class="back-arrow" @click="backArrow()"> <div @click="backArrow()" class="back-arrow">
<i class="el-icon-arrow-left"/> <i class="el-icon-arrow-left"/>
{{$store.state.info.name}} {{$store.state.info.name}}
</div> </div>
...@@ -159,7 +159,12 @@ ...@@ -159,7 +159,12 @@
backArrow() { backArrow() {
let root = document.querySelector(":root"); let root = document.querySelector(":root");
root.style.setProperty("--color", "#4FACFE"); root.style.setProperty("--color", "#4FACFE");
this.$router.push('/myInfo/signUpList'); this.$router.push({
path: "/myInfo/signUpList",
query: {
...this.$store.state.query,
}
});
}, },
// torefer(val) { // torefer(val) {
// console.log(val, "val"); // console.log(val, "val");
...@@ -173,12 +178,29 @@ ...@@ -173,12 +178,29 @@
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
this.campindex_type = index; this.campindex_type = index;
if (this.campindex_type == 0) { if (this.campindex_type == 0) {
this.$router.push("/signUp/" + this.index_status + "?code=" + code); this.$router.push({
// this.homework_val = ""; path: "/signUp/" + this.index_status,
query: {
...this.$store.state.query,
code: code
}
});
} else if (this.campindex_type == 1) { } else if (this.campindex_type == 1) {
this.$router.push("/homework?code=" + code); this.$router.push({
path: "/homework",
query: {
...this.$store.state.query,
code: code
}
});
} else if (this.campindex_type == 2) { } else if (this.campindex_type == 2) {
this.$router.push("/certificate?code=" + code); this.$router.push({
path: "/certificate",
query: {
...this.$store.state.query,
code: code
}
});
} }
}, },
onResize() { onResize() {
...@@ -320,6 +342,7 @@ ...@@ -320,6 +342,7 @@
color: #666666; color: #666666;
font-size: 14px; font-size: 14px;
line-height: 32px; line-height: 32px;
&:hover { &:hover {
color: var(--color); color: var(--color);
cursor: pointer; cursor: pointer;
......
...@@ -27,13 +27,18 @@ export default { ...@@ -27,13 +27,18 @@ export default {
if (bk_pic) { if (bk_pic) {
this.bigImg = bk_pic; this.bigImg = bk_pic;
} }
this.$emit("getStatus", false); this.$emit("getStatus", false);
}, },
methods: { methods: {
toHome() { toHome() {
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
this.$router.push("/"+code); this.$router.push({
path: "/",
query: {
...this.$store.state.query,
code: code
}
});
} }
}, },
}; };
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
<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 title_top" @click="toCodeLogin"> <div @click="toCodeLogin" class="title title_top">
<div :class="changeLogin == 2 ? 'change_login normal' : 'normal'">验证码登录</div> <div :class="changeLogin == 2 ? 'change_login normal' : 'normal'">验证码登录</div>
</div> </div>
<div class="title" @click="toLogin"> <div @click="toLogin" class="title">
<div :class="changeLogin == 1 ? 'change_login' : ''"> <div :class="changeLogin == 1 ? 'change_login' : ''">
账号密码登录 账号密码登录
</div> </div>
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
</div> </div>
<div v-else-if="changeLogin == 2"> <div v-else-if="changeLogin == 2">
<div class="title title_top" @click="toLogin"> <div @click="toLogin" class="title title_top">
<div :class="changeLogin == 1 ? 'change_login normal' : 'normal'"> <div :class="changeLogin == 1 ? 'change_login normal' : 'normal'">
账号密码登录 账号密码登录
</div> </div>
</div> </div>
<div class="title" @click="toCodeLogin"> <div @click="toCodeLogin" class="title">
<div :class="changeLogin == 2 ? 'change_login' : ''">验证码登录</div> <div :class="changeLogin == 2 ? 'change_login' : ''">验证码登录</div>
</div> </div>
</div> </div>
...@@ -27,80 +27,80 @@ ...@@ -27,80 +27,80 @@
<el-form <el-form
:model="loginForm" :model="loginForm"
:rules="loginFormRules" :rules="loginFormRules"
ref="loginFormRef"
class="demo-ruleForm" class="demo-ruleForm"
ref="loginFormRef"
> >
<el-form-item ref="phone" prop="phone"> <el-form-item prop="phone" ref="phone">
<img <img
alt=""
class="img_l" class="img_l"
src="../../../assets/img/login/username.png" src="../../../assets/img/login/username.png"
alt=""
/> />
<el-input <el-input
v-model="loginForm.phone"
placeholder="请输入手机号"
maxlength="11" maxlength="11"
placeholder="请输入手机号"
v-model="loginForm.phone"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-if="changeLogin == 1"
:prop="changeLogin == 1 ? 'password' : ''" :prop="changeLogin == 1 ? 'password' : ''"
ref="password" ref="password"
v-if="changeLogin == 1"
> >
<img <img
alt=""
class="img_l" class="img_l"
src="../../../assets/img/login/password.png" src="../../../assets/img/login/password.png"
alt=""
/> />
<el-input <el-input
v-model="loginForm.password"
:type="isShowPwd ? 'password' : 'text'" :type="isShowPwd ? 'password' : 'text'"
maxlength="20" maxlength="20"
placeholder="请输入密码" placeholder="请输入密码"
v-model="loginForm.password"
></el-input> ></el-input>
<img <img
@click="changePwdStatus()" @click="changePwdStatus()"
v-if="!isShowPwd" alt=""
class="img_r" class="img_r"
src="../../../assets/img/login/eye01.png" src="../../../assets/img/login/eye01.png"
alt="" v-if="!isShowPwd"
/> />
<img <img
@click="changePwdStatus()" @click="changePwdStatus()"
v-if="isShowPwd" alt=""
class="img_r" class="img_r"
src="../../../assets/img/login/eye01.png" src="../../../assets/img/login/eye01.png"
alt="" v-if="isShowPwd"
/> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-else-if="changeLogin == 2"
:prop="changeLogin == 2 ? 'code' : ''" :prop="changeLogin == 2 ? 'code' : ''"
ref="code" ref="code"
v-else-if="changeLogin == 2"
> >
<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="loginForm.code"
placeholder="请输入短信验证码"
maxlength="20" maxlength="20"
placeholder="请输入短信验证码"
v-model="loginForm.code"
></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 style="margin: 40px 0 0 0"></el-form-item> <el-form-item style="margin: 40px 0 0 0"></el-form-item>
<el-form-item> <el-form-item>
<el-button @click="submitForm()">登 录</el-button> <el-button @click="submitForm()">登 录</el-button>
</el-form-item> </el-form-item>
<div v-if="changeLogin == 1" class="box"> <div class="box" v-if="changeLogin == 1">
<div> <div>
<div class="fr" @click="register()">还没有账号?立即注册</div> <div @click="register()" class="fr">还没有账号?立即注册</div>
<div class="fl" @click="forgetPwd()">忘记密码?</div> <div @click="forgetPwd()" class="fl">忘记密码?</div>
</div> </div>
<!-- <div class="fc">忘记密码请联系管理员邮箱:service@campcenter.cn</div> --> <!-- <div class="fc">忘记密码请联系管理员邮箱:service@campcenter.cn</div> -->
</div> </div>
...@@ -111,7 +111,6 @@ ...@@ -111,7 +111,6 @@
<script> <script>
/* eslint-disable */ /* eslint-disable */
import Cookie from "js-cookie";
import {login, loginCode} from "r/index/login"; import {login, loginCode} from "r/index/login";
import {mobileCheck} from "@/common/utils.js"; import {mobileCheck} from "@/common/utils.js";
import {intervalTime} from "store/time"; import {intervalTime} from "store/time";
...@@ -259,13 +258,25 @@ ...@@ -259,13 +258,25 @@
// 忘记账号/密码 // 忘记账号/密码
forgetPwd() { forgetPwd() {
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
this.$router.push("/reset?code=" + code); this.$router.push({
path: "/reset",
query: {
...this.$store.state.query,
code: code
}
});
}, },
// 去注册 // 去注册
register() { register() {
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
this.$router.push("/register?code=" + code); this.$router.push({
path: "/register",
query: {
...this.$store.state.query,
code: code
}
});
}, },
// 改变密码显示状态 // 改变密码显示状态
changePwdStatus() { changePwdStatus() {
...@@ -315,7 +326,13 @@ ...@@ -315,7 +326,13 @@
//获取主题色 //获取主题色
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); this.$router.replace({
path: "/signUp/undefined",
query: {
...this.$store.state.query,
code: code
}
});
}); });
}); });
}, },
...@@ -328,7 +345,7 @@ ...@@ -328,7 +345,7 @@
}; };
</script> </script>
<style scoped lang="scss"> <style lang="scss" scoped>
.flex { .flex {
display: flex; display: flex;
} }
...@@ -354,6 +371,7 @@ ...@@ -354,6 +371,7 @@
color: var(--color); color: var(--color);
line-height: 20px; line-height: 20px;
text-align: right; text-align: right;
&.title_top { &.title_top {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
......
...@@ -230,7 +230,13 @@ ...@@ -230,7 +230,13 @@
// 去注册 // 去注册
toLogin() { toLogin() {
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
this.$router.push("/login?code=" + code); this.$router.push({
path: "/login",
query: {
...this.$store.state.query,
code: code
}
});
}, },
// 改变密码显示状态 // 改变密码显示状态
changePwdStatus() { changePwdStatus() {
...@@ -316,7 +322,13 @@ ...@@ -316,7 +322,13 @@
//获取主题色 //获取主题色
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); this.$router.replace({
path: "/signUp/undefined",
query: {
...this.$store.state.query,
code: code
}
});
}); });
}); });
}, },
......
...@@ -219,7 +219,13 @@ ...@@ -219,7 +219,13 @@
// 去注册 // 去注册
toLogin() { toLogin() {
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
this.$router.push("/login?code=" + code); this.$router.push({
path: "/login",
query: {
...this.$store.state.query,
code: code
}
});
}, },
// 改变密码显示状态 // 改变密码显示状态
changePwdStatus() { changePwdStatus() {
...@@ -303,7 +309,13 @@ ...@@ -303,7 +309,13 @@
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
window.localStorage.setItem("login_code_phone", this.resetForm.phone); window.localStorage.setItem("login_code_phone", this.resetForm.phone);
// 跳转到登录 // 跳转到登录
this.$router.replace("/login?code=" + code); this.$router.replace({
path: "/login",
query: {
...this.$store.state.query,
code: code
}
});
}); });
}); });
}, },
......
...@@ -77,9 +77,21 @@ ...@@ -77,9 +77,21 @@
toLogin() { toLogin() {
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
if (!window.localStorage.getItem("index-token-all")) { if (!window.localStorage.getItem("index-token-all")) {
this.$router.push("/login?code=" + code); this.$router.push({
path: "/login",
query: {
...this.$store.state.query,
code: code
}
});
} else { } else {
this.$router.push("/signUp/undefined?code=" + code); this.$router.push({
path: "/signUp/undefined",
query: {
...this.$store.state.query,
code: code
}
});
} }
}, },
// 锚点跳转方法 // 锚点跳转方法
......
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