cyl/dev
jscyl13849007907 1 year ago
parent f966fd7fbc
commit eb740db87c

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

Loading…
Cancel
Save