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