Selaa lähdekoodia

Merge branch 'dev/v1.0.67_yf' of jianyu/web into feature/v1.0.67

yangfeng 9 kuukautta sitten
vanhempi
commit
a4dffc3236
1 muutettua tiedostoa jossa 7 lisäystä ja 7 poistoa
  1. 7 7
      apps/mobile/src/components/search/bidding/filters.vue

+ 7 - 7
apps/mobile/src/components/search/bidding/filters.vue

@@ -1388,17 +1388,17 @@ export default {
     },
     navTabClick(index) {
       const cellItems = document.querySelectorAll('.more-filter-item')
-      // const scrollEle = document.querySelector('.scroll-nav-right')
-      // let total = cellItems[index].offsetTop
-      // scrollEle.scrollTop = total
+      const scrollEle = document.querySelector('.scroll-nav-right')
+      let total = cellItems[index].offsetTop
+      scrollEle.scrollTop = total
       this.markClickScroll = true
-      cellItems[index].scrollIntoView({ behavior: 'smooth' })
-      // 动画默认都是500ms 所以这里设置大于500ms 延时
+      // cellItems[index].scrollIntoView({ behavior: 'smooth' })
       setTimeout(() => {
         this.markClickScroll = false
-      }, 800)
+      }, 300)
     },
     handleScroll: throttle(function () {
+      console.log(this.markClickScroll, 'scroll')
       if (this.markClickScroll) return
       const cellItems = document.querySelectorAll('.more-filter-item')
       const offsetTopArr = []
@@ -1408,7 +1408,7 @@ export default {
       const scrollTop = document.querySelector('.scroll-nav-right')?.scrollTop
       let navIndex = 0
       for (let index = 0; index < offsetTopArr.length; index++) {
-        if (scrollTop >= offsetTopArr[index]) {
+        if (scrollTop >= offsetTopArr[index] - 20) {
           navIndex = index
         }
       }