Commit 5c64e301 authored by zhengke's avatar zhengke

修改

parent 3548c419
......@@ -3,7 +3,24 @@
padding-top: 30px !important;
padding-bottom: 30px !important;
}
.goBackTop{
width:56px;
height:56px;
border-radius:50%;
background-color:#027be3;
position:fixed;
right:20px;
bottom:20px;
color: #fff;
text-align:center;
line-height: 56px;
z-index:999;
opacity:0;
transition:opacity 2s linear;
}
.showGoback{
opacity:100;
}
</style>
<template>
<q-layout view="hHh lpr fFf">
......@@ -12,7 +29,9 @@
<q-page-container>
<router-view />
</q-page-container>
<div class="goBackTop" :class="{'showGoback':isShowTop}" @click="hangleGoUp">
<i class="iconfont iconarrow-top"></i>
</div>
<q-footer elevated class="bg-grey-8 text-white" style="position: unset;">
<horBtm :dataList="dataList"></horBtm>
</q-footer>
......@@ -48,6 +67,7 @@
RB_Group_Id: 0,
//当天
ToDay: "",
isShowTop:false
};
},
created() {
......@@ -58,6 +78,7 @@
})
},
mounted() {
window.addEventListener('scroll',this.getScrollHeight,false);
//判断是不是同一天
if (localStorage.ToDay) {
if (localStorage.ToDay != this.ToDay) {
......@@ -99,6 +120,24 @@
}
},
methods: {
//点击回到顶部
hangleGoUp(){
let nowTop = document.body.scrollTop || document.documentElement.scrollTop; // 获取当前滚动条位置
if (nowTop > 0) {
window.requestAnimationFrame(this.hangleGoUp);
window.scrollTo (0,nowTop - (nowTop/5));
}
},
//监测滚动条位置
getScrollHeight(){
let nowTop = document.body.scrollTop || document.documentElement.scrollTop; // 获取当前滚动条位置
if(nowTop>200){
this.isShowTop=true;
}else{
this.isShowTop=false;
}
},
changeHeadHandler(t) {
this.headType = t;
},
......
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