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

Merge remote-tracking branch 'origin/yingdi2.0' into yingdi2.0

parents 9e6090f1 31de37b9
...@@ -140,12 +140,13 @@ ...@@ -140,12 +140,13 @@
::v-deep .el-menu { ::v-deep .el-menu {
margin-right: 100px; margin-right: 100px;
border: 0;
.el-menu-item { .el-menu-item {
height: 44px; height: 44px;
line-height: 44px; line-height: 44px;
padding: 0 5px; padding: 0 5px;
margin: 20px; margin: 18px 20px;
color: #666666; color: #666666;
font-size: 15px; font-size: 15px;
font-family: "PingFang SC"; font-family: "PingFang SC";
......
...@@ -202,8 +202,6 @@ router.beforeEach((to, from, next) => { ...@@ -202,8 +202,6 @@ router.beforeEach((to, from, next) => {
// 页面跳转之后页面回滚到顶部 // 页面跳转之后页面回滚到顶部
router.afterEach((to, from, next) => { router.afterEach((to, from, next) => {
// console.log(to,'to')
window.scrollTo(0, 0) window.scrollTo(0, 0)
}); });
export default router export default router
...@@ -18,7 +18,6 @@ export default { ...@@ -18,7 +18,6 @@ export default {
localStorage.removeItem("isLogin"); localStorage.removeItem("isLogin");
}, },
setActiveIndex(state, path) { setActiveIndex(state, path) {
console.log(path)
let key = path.split('/')[1] == 'active' ? '/' + path.split('/')[1] : path; let key = path.split('/')[1] == 'active' ? '/' + path.split('/')[1] : path;
state.activeIndex = key; state.activeIndex = key;
window.localStorage.setItem('index-active-path', key); window.localStorage.setItem('index-active-path', key);
......
<template> <template>
<el-container> <el-container>
<el-header height="auto"> <el-header height="80px">
<Header></Header> <Header></Header>
</el-header> </el-header>
<el-container> <el-container>
<router-view :key="$route.name"></router-view> <router-view :key="$route.name"></router-view>
<Footer></Footer> <Footer></Footer>
</el-container> </el-container>
<div class="to-top"
v-if="show"
@click="toTop"
:style="style">
<i class="el-icon-top"></i>
</div>
</el-container> </el-container>
</template> </template>
<script> <script>
...@@ -21,12 +27,57 @@ ...@@ -21,12 +27,57 @@
Footer, Footer,
}, },
data() { data() {
return {}; return {
show: false,
style: {
position: 'fixed',
bottom: "10px"
},
};
}, },
created() { created() {
console.log('created'); console.log('created');
}, },
methods: {}, mounted() {
window.addEventListener('scroll', this.handleScrollY, true);
},
destroyed() {
window.removeEventListener('scroll', this.handleScrollY, true);
},
methods: {
toTop() {
document.body.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
},
handleScrollY() {
// 底部距离顶部的高度
let footerOffsetTop = document.querySelector('.footer').offsetTop;
// 底部的高度
let footerOffsetHeight = document.querySelector('.footer').offsetHeight;
// body的高度
let bodyOffsetHeight = document.body.offsetHeight;
// 页面滚动高度
let scrollTop = document.documentElement.scrollTop;
if (scrollTop > 0) {
this.show = true;
} else {
this.show = false;
}
if (scrollTop < (footerOffsetTop - bodyOffsetHeight + 60)) {
this.style = {
position: 'fixed',
bottom: "10px"
};
} else {
this.style = {
position: 'absolute',
bottom: (footerOffsetHeight + 10) + 'px'
}
}
},
},
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
...@@ -39,22 +90,42 @@ ...@@ -39,22 +90,42 @@
} }
.el-container { .el-container {
position: relative;
width: 100%; width: 100%;
height: 100%; min-height: 100%;
overflow: hidden; min-width: 1150px;
min-width: 1024px; /*box-sizing: border-box;*/
box-sizing: border-box;
background-color: #f5f5f5; background-color: #f5f5f5;
.el-header { .el-header {
position: fixed;
width: 100%;
z-index: 10000;
padding: 0; padding: 0;
} }
.el-container { .el-container {
width: 100%; width: 100%;
overflow: auto; /*overflow: auto;*/
display: flex; display: flex;
flex-flow: column; flex-flow: column;
margin-top: 80px;
}
.to-top {
right: 10px;
width: 50px;
height: 50px;
line-height: 50px;
text-align: center;
font-size: 30px;
border-radius: 8px;
color: #ffffff;
background-color: #919191;
cursor: pointer;
&:hover{
background-color: #999999;
}
} }
} }
</style> </style>
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
placeholder="最小天数" placeholder="最小天数"
class="ml" class="ml"
oninput="value=value.replace(/^0/g, '')" oninput="value=value.replace(/^0/g, '')"
@blur="onInputBlur"
></el-input> ></el-input>
<div class="line">——</div> <div class="line">——</div>
<el-input v-model="queryForm.num2" <el-input v-model="queryForm.num2"
...@@ -28,9 +27,15 @@ ...@@ -28,9 +27,15 @@
:min="1" :min="1"
placeholder="最大天数" placeholder="最大天数"
oninput="value=value.replace(/^0/g, '')" oninput="value=value.replace(/^0/g, '')"
@blur="onInputBlur"
></el-input> ></el-input>
<el-button @click="clearInput">清除</el-button> <el-button @click="resetHandle">重置</el-button>
<el-button @click="searchHandle">确定</el-button>
</div>
<div class="content-item">
<div class="content-item-tit">本站报名</div>
<div class="content-item-txt is-active">全部</div>
<div class="content-item-txt">支持</div>
<div class="content-item-txt">不支持</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -205,12 +210,12 @@ ...@@ -205,12 +210,12 @@
this.getList(); this.getList();
}, },
methods: { methods: {
// 输入框失去焦点 // 确定按钮
onInputBlur() { searchHandle() {
this.getList(); this.getList();
}, },
// 清除按钮 // 重置按钮
clearInput() { resetHandle() {
this.queryForm.num1 = null; this.queryForm.num1 = null;
this.queryForm.num2 = null; this.queryForm.num2 = null;
this.getList(); this.getList();
......
This diff is collapsed.
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