Commit 50bf3782 authored by wuwangwolihui's avatar wuwangwolihui

样式调整-lh

parent cc15c522
...@@ -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,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</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 class="camp_left_box" ref="leftBox" :class="{ <ul class="camp_left_box" ref="leftBox" :class="{
'is-fixed':isPosition==1, 'is-fixed':isPosition==1,
'is-absolute':isPosition==2, 'is-absolute':isPosition==2,
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
:class="{ active: campindex_type === index }" :class="{ active: campindex_type === index }"
@click="ToSignUp(index)" @click="ToSignUp(index)"
> >
<img :src="item.image" /> <img :src="item.image"/>
{{ item.desc }} {{ item.desc }}
</li> </li>
</ul> </ul>
...@@ -71,44 +71,51 @@ ...@@ -71,44 +71,51 @@
}, },
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;
} }
} }
...@@ -116,9 +123,10 @@ ...@@ -116,9 +123,10 @@
if (this.isPosition == 1) { if (this.isPosition == 1) {
this.isPosition = 2; this.isPosition = 2;
} }
}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';
} }
} }
}, },
...@@ -178,7 +186,7 @@ ...@@ -178,7 +186,7 @@
&.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;
} }
......
...@@ -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