Commit fc3496b1 authored by 杨梦雪's avatar 杨梦雪
parents e0c1e0d3 860794ee
......@@ -5,14 +5,39 @@
</template>
<script>
import {getCam} from "r/index/login";
export default {
name: "recruit",
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>
......
......@@ -6,15 +6,11 @@
</el-header>
<div class="com-container">
<div class="index-container">
<div class="camp_left">
<ul
class="camp_left_box"
ref="leftBox"
:class="{
'is-fixed': isPosition == 1,
'is-absolute': isPosition == 2,
}"
>
<div class="camp_left" ref="leftBoxFu">
<ul class="camp_left_box" ref="leftBox" :class="{
'is-fixed':isPosition==1,
'is-absolute':isPosition==2,
}">
<li
v-for="(item, index) in tabs"
:key="index"
......@@ -38,10 +34,10 @@
<script>
/* eslint-disable */
import Header from "@/components/index/SignUp/Header.vue";
import Footer from "@/components/index/Footer.vue";
import Header from "@/components/index/SignUp/Header.vue";
import Footer from "@/components/index/Footer.vue";
export default {
export default {
name: "campIndex",
components: {
Header,
......@@ -50,9 +46,9 @@ export default {
data() {
return {
type: 1,
isPosition: 0, // 左侧box是否浮动
pageYOffset: 0, // 左侧box浮动时,滚动的高度
scorllHeight: 0, // 最大滚动高度
isPosition: 0,// 左侧box是否浮动
pageYOffset: 0,// 左侧box浮动时,滚动的高度
scorllHeight: 0,// 最大滚动高度
tabs: [
{
id: "0",
......@@ -76,44 +72,51 @@ export default {
},
watch: {
type(val) {
// console.log(val, "index");
window.localStorage.setItem("campindex_type", val);
},
},
created() {
window.localStorage.setItem("campindex_type", 0);
this.campindex_type = window.localStorage.getItem("campindex_type");
console.log(this.type, "type");
},
mounted() {
window.addEventListener("scroll", this.handleScrollX, true);
window.addEventListener('scroll', this.handleScrollX, true);
window.addEventListener('resize', this.onResize, true);
},
beforeDestroy() {
window.removeEventListener("scroll", this.handleScrollX, true);
window.removeEventListener('scroll', this.handleScrollX, true);
window.removeEventListener('resize', this.onResize, true);
},
methods: {
ToSignUp(index) {
this.campindex_type = index;
if (this.campindex_type == 0) {
this.$router.replace({ name: "index-signUp" });
this.$router.replace({name: "index-signUp"});
} else if (this.campindex_type == 1) {
this.$router.replace({ name: "index-homework" });
this.$router.replace({name: "index-homework"});
} else if (this.campindex_type == 2) {
this.$router.replace({ name: "index-certificate" });
this.$router.replace({name: "index-certificate"});
}
},
onResize() {
const refLeft = this.$refs['leftBox'];
const leftBoxFu = this.$refs['leftBoxFu'];
refLeft.style.width = leftBoxFu.offsetWidth + 'px';
},
// 页面滚动事件
handleScrollX() {
let top = document.documentElement.scrollTop || document.body.scrollTop;
let refLeft = this.$refs["leftBox"];
let refRight = this.$refs["rightBox"];
const top = document.documentElement.scrollTop || document.body.scrollTop;
const refLeft = this.$refs['leftBox'];
const leftBoxFu = this.$refs['leftBoxFu'];
const refRight = this.$refs['rightBox'];
if (top > 0) {
if (this.isPosition == 0) {
this.scorllHeight = refRight.offsetHeight - refLeft.offsetHeight;
refLeft.style.width = leftBoxFu.offsetWidth + 'px';
}
this.isPosition = 1;
} else {
if ((this.isPosition = 1)) {
if (this.isPosition = 1) {
this.isPosition = 0;
}
}
......@@ -124,25 +127,26 @@ export default {
} else if (top < this.scorllHeight) {
if (this.isPosition == 2) {
this.isPosition = 1;
refLeft.style.width = leftBoxFu.offsetWidth + 'px';
}
}
},
ToHomework() {
this.$router.replace({ name: "index-homework" });
this.$router.replace({name: "index-homework"});
this.type = 2;
},
ToCertificate() {
this.$router.replace({ name: "index-certificate" });
this.$router.replace({name: "index-certificate"});
this.type = 3;
},
},
};
};
</script>
<style lang="scss" scoped>
@import "a/scss/common";
@import "a/scss/common";
.camp-index {
.camp-index {
background: #f8f8f8;
.el-header {
......@@ -183,7 +187,7 @@ export default {
&.is-fixed {
position: fixed;
top: 104px;
width: 14.4%;
/*width: 14.4%;*/
max-width: 280px;
min-width: 216px;
}
......@@ -212,7 +216,7 @@ export default {
&.active,
&:hover {
cursor: pointer;
background-color: #f8f8f8;
background-color: #F8F8F8;
}
}
}
......@@ -224,5 +228,6 @@ export default {
background-color: #ffffff;
}
}
}
}
</style>
......@@ -59,7 +59,7 @@
"index-identity",
"c59086fdb37848e7a10765812d1da349"
);
this.getCam();
// this.getCam();
},
methods: {
toLogin() {
......
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