Просмотр исходного кода

feat: 滚动逻辑判断修改

cuiyalong 3 лет назад
Родитель
Сommit
a82d064ebe
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      src/components/coupon/BuySubmitSticky.vue

+ 3 - 3
src/components/coupon/BuySubmitSticky.vue

@@ -154,7 +154,7 @@ export default {
       const offsetBottom = offset.bottom
 
       // 是否在可视区域
-      const inViewport = offsetTop <= window.innerHeight && offsetBottom >= 0
+      const inViewport = offsetTop <= window.innerHeight && offsetBottom >= x
       return inViewport
     },
     windowScrollFn () {
@@ -165,7 +165,7 @@ export default {
 
       if (!mainFooter.length) return
 
-      const show = this.isDOMLeave(mainFooter[0])
+      const show = !this.isInViewport(mainFooter[0])
 
       if (show) {
         stickyFooter.show()
@@ -319,4 +319,4 @@ $color_main: #2CB7CA;
     color: #888;
   }
 }
-</style>
+</style>