diff --git a/src/components/FirstJob/joblist.vue b/src/components/FirstJob/joblist.vue
index 4d45778..f738406 100644
--- a/src/components/FirstJob/joblist.vue
+++ b/src/components/FirstJob/joblist.vue
@@ -884,6 +884,7 @@
= 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;
+ }