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

11

parent f524d5a6
...@@ -5,39 +5,16 @@ ...@@ -5,39 +5,16 @@
</template> </template>
<script> <script>
/* eslint-disable */ /* eslint-disable */
import { getCam } from "r/index/login";
export default { export default {
name: "recruit", name: "app",
data() { data() {
return {}; return {};
}, },
created() { created() {
this.getCam();
}, },
methods: { methods: {
getCam() {
getCam({}).then((res) => {
console.log(res, "getCam");
let root = document.querySelector(":root");
root.style.setProperty("--color", res.data.system_color);
root.style.setProperty("--bk_pic", res.data.background_picture); //当前营地的背景图
window.localStorage.setItem("bk_pic", res.data.background_picture);
//当前营地logo
window.localStorage.setItem("system_logo", res.data.system_logo);
window.localStorage.setItem(
"doubt_code",
res.data.fill_individual_Invitationcode
); //是否填写邀请码
window.localStorage.setItem(
"doubt_info",
res.data.fill_individual_information
); //是否填写个人资料
window.localStorage.setItem(
"doubt_check",
res.data.audit_individual_information
); //是否审核个人资料
});
},
}, },
}; };
</script> </script>
......
...@@ -41,7 +41,7 @@ export default { ...@@ -41,7 +41,7 @@ export default {
const doubt_code = window.localStorage.getItem("doubt_code"); const doubt_code = window.localStorage.getItem("doubt_code");
const doubt_info = window.localStorage.getItem("doubt_info"); const doubt_info = window.localStorage.getItem("doubt_info");
const doubt_check = window.localStorage.getItem("doubt_check"); const doubt_check = window.localStorage.getItem("doubt_check");
console.log(doubt_check, "doubt_check"); // console.log(doubt_check, "doubt_check");
const newArr = [ const newArr = [
{ {
name: "确认报名须知", name: "确认报名须知",
...@@ -64,23 +64,20 @@ export default { ...@@ -64,23 +64,20 @@ export default {
status: 4, status: 4,
}, },
]; ];
let arr = [];
console.log(newArr, "newArr"); console.log(newArr, "newArr");
newArr.forEach((item, index, array) => { for (let i = 0; i < newArr.length; i++) {
console.log(item, "item"); const item = newArr[i];
// 在位置 2后面删除 2 个项目: if (
//.splice(2, 2); (doubt_code == 0 && item.status == 1) ||
if (doubt_code == 0 && item.status == 1) { (doubt_info == 0 && item.status == 2) ||
array.splice(item.status, 1); (doubt_check == 0 && item.status == 3)
) {
} else {
arr.push(item);
} }
if (doubt_info == 0 && item.status == 2) {
array.splice(item.status, 1);
} }
if (doubt_check == 0 && item.status == 3) { this.bCList = arr;
array.splice(item.status, 1);
}
});
this.bCList = newArr;
console.log(this.bCList, "this.bCList");
}, },
watch: { watch: {
statusNum(val) { statusNum(val) {
...@@ -105,7 +102,7 @@ export default { ...@@ -105,7 +102,7 @@ export default {
color: var(--color) !important; color: var(--color) !important;
} }
.steps { .steps {
.step { .step {
align-items: center; align-items: center;
.cricle { .cricle {
...@@ -135,6 +132,5 @@ export default { ...@@ -135,6 +132,5 @@ export default {
margin: 0 15px 0 10px; margin: 0 15px 0 10px;
} }
} }
} }
</style> </style>
...@@ -798,6 +798,7 @@ export default { ...@@ -798,6 +798,7 @@ export default {
setAccount(this.referForm).then((res) => { setAccount(this.referForm).then((res) => {
console.log(res, "setAccount"); console.log(res, "setAccount");
if (res.data.code != 200) { if (res.data.code != 200) {
// window.scrollTo(0, 0)
return this.$message.error(res.data.message); return this.$message.error(res.data.message);
} }
this.$emit("getstatus", res.data.status); this.$emit("getstatus", res.data.status);
......
...@@ -34,8 +34,11 @@ export default { ...@@ -34,8 +34,11 @@ export default {
created() {}, created() {},
methods: { methods: {
handleDownload() { handleDownload() {
getCam({}).then((res) => { getCam(false).then((res) => {
console.log(res, "getCam"); if (res.data.code != 200) {
return this.$message.error(res.data.message);
}
this.$message.success(res.data.message);
window.location.href = res.data.pdf_address; window.location.href = res.data.pdf_address;
}); });
}, },
......
...@@ -6,8 +6,12 @@ import { ...@@ -6,8 +6,12 @@ import {
const identity = localStorage.getItem('index-identity') const identity = localStorage.getItem('index-identity')
//登录前获取营地主题 //登录前获取营地主题
export function getCam(data) { export function getCam(code) {
data['identity'] = identity; let data = {};
data['identity'] = code ? code : identity;
if(!data['identity']){
return false;
}
return request({ return request({
method: 'get', method: 'get',
url: '/web/auth/getCam', url: '/web/auth/getCam',
......
...@@ -2,28 +2,18 @@ ...@@ -2,28 +2,18 @@
import Vue from 'vue' import Vue from 'vue'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
// import store from '@/store' import store from '@/store'
import indexLogin from './index/login' import indexLogin from './index/login'
import indexCamp from './index/camp' import indexCamp from './index/camp'
import { getCam } from "r/index/login";
Vue.use(VueRouter) Vue.use(VueRouter)
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
const routes = [{ const routes = [
path: '/',
name: 'recruit',
meta: {
title: '招生简章'
},
component: () =>
import('v/index/recruit/Index.vue')
},
{ {
path: '/login', path: '/login',
name: 'loginIndex', name: 'loginIndex',
...@@ -35,7 +25,7 @@ const routes = [{ ...@@ -35,7 +25,7 @@ const routes = [{
children: [...indexLogin] children: [...indexLogin]
}, },
{ {
path: '/:cerificate', path: '/',
name: 'cerificateIndex', name: 'cerificateIndex',
meta: { meta: {
title: '营地报名' title: '营地报名'
...@@ -44,8 +34,17 @@ const routes = [{ ...@@ -44,8 +34,17 @@ const routes = [{
component: () => component: () =>
import('v/index/camp/Index.vue'), import('v/index/camp/Index.vue'),
children: [...indexCamp] children: [...indexCamp]
} },
{
path: '/:code',
name: 'recruit',
meta: {
title: '招生简章'
},
component: () =>
import('v/index/recruit/Index.vue')
}
] ]
...@@ -55,60 +54,74 @@ const router = new VueRouter({ ...@@ -55,60 +54,74 @@ const router = new VueRouter({
// base: process.env.BASE_URL, // base: process.env.BASE_URL,
routes routes
}) })
// 运用vue-router的错误处理函数 onError 捕获错误
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
// 运用vue-router的错误处理函数 onError 捕获错误(当捕获到了Loading chunk {n} failed的错误时,重新渲染目标页面。)
router.onError((error) => { router.onError((error) => {
const pattern = /Loading chunk (\d)+ failed/g const pattern = /Loading chunk (\d)+ failed/g;
const isChunkLoadFailed = error.message.match(pattern) const isChunkLoadFailed = error.message.match(pattern);
const targetPath = router.history.pending.fullPath // const targetPath = router.history.pending.fullPath;
// 用路由的replace方法,并没有相当于F5刷新页面,失败的js文件并没有从新请求,会导致一直尝试replace页面导致死循环,
// 而用 location.reload 方法,相当于触发F5刷新页面,虽然用户体验上来说会有刷新加载察觉,但不会导致页面卡死及死循环,从而曲线救国解决该问题
if (isChunkLoadFailed) { if (isChunkLoadFailed) {
router.replace(targetPath) location.reload();
// router.replace(targetPath);
} }
}) })
// 页面跳转之后页面回滚到顶部 // 页面跳转之后页面回滚到顶部
router.afterEach((to, from, next) => { router.afterEach((to, from, next) => {
window.scrollTo(0, 0) window.scrollTo(0, 0)
}); });
// router.beforeEach((to, from, next) => { function checkCam(code,cb){
// // 记录上一页 getCam(code).then((res) => {
// if (from) { if (res.data.code != 200) {
// store.commit('setPrePage', from.path) this.$store.$message.error(res.data.message);
// } cb && cb(false);
// // 1.修改页面标题 return false;
// document.title = to.meta.title }
code && window.localStorage.setItem("index-identity",code);
// let token = localStorage.getItem(tokenKey) // this.$message.success(res.data.message);
// if (to.meta.authorization && to.meta.authorization === true) { let root = document.querySelector(":root");
// store.commit('setPrePage', to.path) root.style.setProperty("--color", res.data.system_color);
// // 2.1.获取登录信息 root.style.setProperty("--bk_pic", res.data.background_picture); //当前营地的背景图
// if (token == null) { window.localStorage.setItem("bk_pic", res.data.background_picture);
// // 2.1.1.未登录,跳转到登录页面 //当前营地logo
// router.push({ window.localStorage.setItem("system_logo", res.data.system_logo);
// path: toLogin window.localStorage.setItem(
// }) "doubt_code",
// } else { res.data.fill_individual_Invitationcode
// next() ); //是否填写邀请码
// // authInfo = JSON.parse(authInfo); window.localStorage.setItem(
// // // 2.1.2.判断token是否过期 "doubt_info",
// // let dt = new Date(authInfo.dt); res.data.fill_individual_information
// // let overDt = new Date(dt.getTime() + authInfo.data.expires_in * 1000); ); //是否填写个人资料
// // if (overDt >= new Date()) { window.localStorage.setItem(
// // // 2.1.2.1未过期 "doubt_check",
// // next(); res.data.audit_individual_information
// // } else { ); //是否审核个人资料
// // // 2.1.2.2过期,刷新token cb && cb(true);
// // next(); }).catch(()=>{
// // } cb && cb(false);
// } })
// } else { }
// if (token) { router.beforeEach((to, from, next) => {
// router.push({ let code = false;
// path: toPage if(to.name == "recruit"){
// }) code = to.params.code;
// } else { }
// next() checkCam(code,(res)=>{
// } if(res){
// } next();
// }) }
});
})
export default router export default router
...@@ -79,11 +79,12 @@ export default { ...@@ -79,11 +79,12 @@ export default {
type(val) { type(val) {
window.localStorage.setItem("campindex_type", val); window.localStorage.setItem("campindex_type", val);
}, },
}, },
created() { created() {
window.localStorage.setItem("campindex_type", 0); window.localStorage.setItem("campindex_type", 0);
this.campindex_type = window.localStorage.getItem("campindex_type"); this.campindex_type = window.localStorage.getItem("campindex_type");
// this.campindex_type= 0
this.getStatus();
}, },
mounted() { mounted() {
window.addEventListener("scroll", this.handleScrollX, true); window.addEventListener("scroll", this.handleScrollX, true);
...@@ -97,14 +98,12 @@ export default { ...@@ -97,14 +98,12 @@ export default {
getStatus(val) { getStatus(val) {
console.log(val, "index_type"); console.log(val, "index_type");
this.index_status = val; this.index_status = val;
this.ToSignUp() this.ToSignUp();
}, },
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("/signUp/"+this.index_status); this.$router.push("/signUp/" + this.index_status);
// this.$router.replace({name: "index-signUp"});
} else if (this.campindex_type == 1) { } else if (this.campindex_type == 1) {
this.$router.push("/homework"); this.$router.push("/homework");
} else if (this.campindex_type == 2) { } else if (this.campindex_type == 2) {
......
...@@ -46,19 +46,18 @@ export default { ...@@ -46,19 +46,18 @@ export default {
status: "", //进度 status: "", //进度
doubt_code: window.localStorage.getItem("doubt_code"), doubt_code: window.localStorage.getItem("doubt_code"),
doubt_info: window.localStorage.getItem("doubt_info"), doubt_info: window.localStorage.getItem("doubt_info"),
doubt_check: window.localStorage.getItem("doubt_check"), doubt_check: window.localStorage.getItem("doubt_check"),
status_val: "", status_val: "",
}; };
}, },
created() { created() {
this.type = this.$route.params.type; this.type = this.$route.params.type;
console.log(this.$route, "router"); // console.log(this.$route, "router");
// this.statuss(); this.statuss();
this.signUpInit();
},
mounted() {
// this.signUpInit(); // this.signUpInit();
}, },
watch: { watch: {
$route: { $route: {
handler(val) { handler(val) {
...@@ -73,7 +72,6 @@ export default { ...@@ -73,7 +72,6 @@ export default {
status(val) { status(val) {
console.log(val, "status"); console.log(val, "status");
}, },
}, },
methods: { methods: {
// 点击下一步,触发父组件方法 // 点击下一步,触发父组件方法
...@@ -98,18 +96,20 @@ export default { ...@@ -98,18 +96,20 @@ export default {
}, },
// status=4,跳到审核页面;status=3时,根据doubt_check做判断 // status=4,跳到审核页面;status=3时,根据doubt_check做判断
signUpInit(status_val) { signUpInit(status_val) {
// console.log(status_val, "11111"); console.log(status_val, "11111");
signUpInit({}).then((res) => { signUpInit({}).then((res) => {
console.log(res, "signUpInit"); console.log(res, "signUpInit");
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.status = res.data.status;
// console.log(this.status, "11111");
// 点击下一步传值给status,更新 // 点击下一步传值给status,更新
if (status_val != null) { if (status_val != null) {
this.status = status_val; this.status = status_val;
} else { } else {
this.status = res.data.status; this.status = res.data.status;
console.log(this.status, "11111");
} }
// doubt_code,doubt_info,doubt_check。0为不填写,1为填写 // doubt_code,doubt_info,doubt_check。0为不填写,1为填写
if (this.status == 0) { if (this.status == 0) {
...@@ -124,6 +124,7 @@ export default { ...@@ -124,6 +124,7 @@ export default {
this.status = 1; this.status = 1;
} }
} else if (this.status == 2) { } else if (this.status == 2) {
console.log(this.doubt_info, "doubt_info");
// 是否填写个人资料 // 是否填写个人资料
if (this.doubt_info == 0) { if (this.doubt_info == 0) {
this.type = "check"; this.type = "check";
...@@ -159,7 +160,7 @@ export default { ...@@ -159,7 +160,7 @@ export default {
} else if (this.status == 6) { } else if (this.status == 6) {
this.type = "success"; this.type = "success";
} }
this.$emit("getStatus",this.type) this.$emit("getStatus", this.type);
// console.log(this.status) // console.log(this.status)
//审核报名资料状态 //审核报名资料状态
...@@ -167,7 +168,6 @@ export default { ...@@ -167,7 +168,6 @@ export default {
window.localStorage.setItem("has_amount", res.data.has_amount); window.localStorage.setItem("has_amount", res.data.has_amount);
window.localStorage.setItem("campsite_id", res.data.campsite_id); window.localStorage.setItem("campsite_id", res.data.campsite_id);
window.localStorage.setItem("order_no", res.data.order_no); window.localStorage.setItem("order_no", res.data.order_no);
}); });
}, },
}, },
......
...@@ -233,7 +233,7 @@ export default { ...@@ -233,7 +233,7 @@ export default {
border: 0; border: 0;
border-bottom: 2px solid #d9d9d9; border-bottom: 2px solid #d9d9d9;
&:focus { &:focus {
border-bottom-color: #563279; border-bottom-color: var(--color);
} }
} }
::v-deep .el-form-item__error { ::v-deep .el-form-item__error {
......
...@@ -200,10 +200,11 @@ export default { ...@@ -200,10 +200,11 @@ export default {
const timeLag = intervalTime(startTime, endTime); const timeLag = intervalTime(startTime, endTime);
console.log(timeLag); console.log(timeLag);
if (!this.timer) { if (!this.timer) {
this.count = timeLag; this.count = timeLag-1;
this.show = false; this.show = false;
this.timer = setInterval(() => { this.timer = setInterval(() => {
if (this.count > 0 && this.count <= timeLag) { if (this.count > 0 && this.count <= timeLag) {
this.count--; this.count--;
} else { } else {
this.show = true; this.show = true;
...@@ -359,7 +360,7 @@ export default { ...@@ -359,7 +360,7 @@ export default {
border-bottom: 2px solid #d9d9d9; border-bottom: 2px solid #d9d9d9;
&:focus { &:focus {
border-bottom-color: #563279; border-bottom-color: var(--color);
} }
} }
......
...@@ -201,7 +201,7 @@ export default { ...@@ -201,7 +201,7 @@ export default {
const timeLag = intervalTime(startTime, endTime); const timeLag = intervalTime(startTime, endTime);
console.log(timeLag); console.log(timeLag);
if (!this.timer) { if (!this.timer) {
this.count = timeLag; this.count = timeLag-1;
this.showCode = false; this.showCode = false;
this.timer = setInterval(() => { this.timer = setInterval(() => {
if (this.count > 0 && this.count <= timeLag) { if (this.count > 0 && this.count <= timeLag) {
...@@ -350,7 +350,7 @@ export default { ...@@ -350,7 +350,7 @@ export default {
border-bottom: 2px solid #d9d9d9; border-bottom: 2px solid #d9d9d9;
&:focus { &:focus {
border-bottom-color: #563279; border-bottom-color:var(--color);
} }
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</p> </p>
</div> </div>
<div class="paper"> <div class="paper">
<img src="../../../assets/img/recruit.png" alt=""/> <img src="../../../assets/img/recruit.png" alt="" />
</div> </div>
<div class="part"> <div class="part">
<span>第三部分</span> <span>第三部分</span>
...@@ -45,60 +45,31 @@ ...@@ -45,60 +45,31 @@
</template> </template>
<script> <script>
/* eslint-disable */ /* eslint-disable */
import Header from "@/components/index/Header.vue"; import Header from "@/components/index/Header.vue";
import Footer from "@/components/index/Footer.vue"; import Footer from "@/components/index/Footer.vue";
import {getCam} from "r/index/login";
export default { export default {
name: "recruit", name: "recruit",
data() { data() {
return {}; return {};
}, },
created() { created() {
window.localStorage.setItem(
"index-identity",
"c59086fdb37848e7a10765812d1da349"
);
this.getCam();
}, },
methods: { methods: {
toLogin() { toLogin() {
this.$router.replace({name: "index-login"}); this.$router.replace({ name: "index-login" });
},
getCam() {
getCam({}).then((res) => {
console.log(res, "getCam");
let root = document.querySelector(":root");
root.style.setProperty("--color", res.data.system_color);
root.style.setProperty("--bk_pic", res.data.background_picture); //当前营地的背景图
window.localStorage.setItem('bk_pic',res.data.background_picture)
//当前营地logo
window.localStorage.setItem("system_logo", res.data.system_logo);
window.localStorage.setItem(
"doubt_code",
res.data.fill_individual_Invitationcode
); //是否填写邀请码
window.localStorage.setItem(
"doubt_info",
res.data.fill_individual_information
); //是否填写个人资料
window.localStorage.setItem(
"doubt_check",
res.data.audit_individual_information
); //是否审核个人资料
});
}, },
}, },
components: { components: {
Header, Header,
Footer, Footer,
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
@import "a/scss/common"; @import "a/scss/common";
.recruit { .recruit {
font-family: PingFang SC; font-family: PingFang SC;
.el-header { .el-header {
position: fixed; position: fixed;
...@@ -126,7 +97,7 @@ ...@@ -126,7 +97,7 @@
text-align: center; text-align: center;
} }
.paper{ .paper {
text-align: center; text-align: center;
margin: 8px 0 24px 0; margin: 8px 0 24px 0;
img { img {
...@@ -169,5 +140,5 @@ ...@@ -169,5 +140,5 @@
} }
} }
} }
} }
</style> </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