Commit 50bf3782 authored by wuwangwolihui's avatar wuwangwolihui

样式调整-lh

parent cc15c522
......@@ -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,7 +6,7 @@
</el-header>
<div class="com-container">
<div class="index-container">
<div class="camp_left">
<div class="camp_left" ref="leftBoxFu">
<ul class="camp_left_box" ref="leftBox" :class="{
'is-fixed':isPosition==1,
'is-absolute':isPosition==2,
......@@ -17,7 +17,7 @@
:class="{ active: campindex_type === index }"
@click="ToSignUp(index)"
>
<img :src="item.image" />
<img :src="item.image"/>
{{ item.desc }}
</li>
</ul>
......@@ -71,44 +71,51 @@
},
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('resize', this.onResize, true);
},
beforeDestroy() {
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){
} else {
if (this.isPosition = 1) {
this.isPosition = 0;
}
}
......@@ -116,9 +123,10 @@
if (this.isPosition == 1) {
this.isPosition = 2;
}
}else if(top < this.scorllHeight) {
} else if (top < this.scorllHeight) {
if (this.isPosition == 2) {
this.isPosition = 1;
refLeft.style.width = leftBoxFu.offsetWidth + 'px';
}
}
},
......@@ -178,7 +186,7 @@
&.is-fixed {
position: fixed;
top: 104px;
width: 14.4%;
/*width: 14.4%;*/
max-width: 280px;
min-width: 216px;
}
......
......@@ -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