cyl/dev
jscyl13849007907 1 year ago
parent f966fd7fbc
commit eb740db87c

@ -884,6 +884,7 @@
<recordModal :show.sync="recordShow" :jobDetail="currentInfo"></recordModal>
<div class="top-obj g_flex_c"
ref="backToTop"
style="width: 40px;height: 40px;background-color: #fff;border-radius: 50%;position: fixed;bottom: 100px;right: calc(50vw - 470px);cursor: pointer;"
@click="totop"
v-if="!isspinning"
@ -1262,30 +1263,39 @@ export default {
methods: {
// ...
handleScroll() {
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
const windowHeight = document.documentElement.clientHeight;
const scrollHeight = document.documentElement.scrollHeight;
if (scrollTop + windowHeight >= scrollHeight - 100 && !this.isFetching && !this.isStop) { // 100
this.isFetching = true;
setTimeout(() => {
this.speed = 1;
this.loadMoreData();
}, 300);
}
},
loadMoreData() {
this.formvalue.pageNum += 1; //
if (this.signType != 0) {
this.getJobList({isScroll:1}).then(() => {
this.isFetching = false;
});
} else {
this.getJobList({isScroll:1}).then(() => {
this.isFetching = false;
});
}
},
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
const windowHeight = document.documentElement.clientHeight;
const scrollHeight = document.documentElement.scrollHeight;
const threshold = windowHeight * 0.4;
if (scrollTop + windowHeight >= scrollHeight - 100 && !this.isFetching && !this.isStop) { // 100
this.isFetching = true;
setTimeout(() => {
this.speed = 1;
this.loadMoreData();
}, 300);
}
if (scrollTop >= threshold) {
this.$refs.backToTop.style.opacity = 1;
this.$refs.backToTop.style.pointerEvents = 'auto';
} else {
this.$refs.backToTop.style.opacity = 0;
this.$refs.backToTop.style.pointerEvents = 'none';
}
},
loadMoreData() {
this.formvalue.pageNum += 1; //
if (this.signType != 0) {
this.getJobList({isScroll:1}).then(() => {
this.isFetching = false;
});
} else {
this.getJobList({isScroll:1}).then(() => {
this.isFetching = false;
});
}
},
removePageInfo() {
sessionStorage.removeItem("PAGE_TYPE");
},
@ -3760,4 +3770,25 @@ p {
.stoggle{
transform: rotate(90deg);
}
.top-obj {
width: 40px;
height: 40px;
background-color: #fff;
border-radius: 50%;
position: fixed;
bottom: 100px;
right: calc(50vw - 470px);
cursor: pointer;
transition: opacity 0.3s ease;
opacity: 0;
pointer-events: none;
}
.top-obj:hover {
background-color: #1890ffdd;
}
.top-obj:active {
background-color: #1890ffdd;
}
</style>

Loading…
Cancel
Save