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

11

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