diff --git a/pages/template/long-list/long-list.uvue b/pages/template/long-list/long-list.uvue index 855cd76da5dca15d6068a2d0df75016198820c8e..3418f016be0b673baa9675401042d38629593cce 100644 --- a/pages/template/long-list/long-list.uvue +++ b/pages/template/long-list/long-list.uvue @@ -98,7 +98,7 @@ if (moveToIndex < 0) { moveToIndex = 0 } if (moveToIndex > this.$swiperTabsRect.length - 1) { moveToIndex = this.$swiperTabsRect.length - 1 } - const percentage = Math.abs(offsetX) / this.$swiperWidth + const percentage = Math.abs(offsetX % this.$swiperWidth) / this.$swiperWidth const currentSize = this.$swiperTabsRect[currentIndex] const moveToSize = this.$swiperTabsRect[moveToIndex] const indicatorlineL = currentSize.left + (moveToSize.left - currentSize.left) * percentage diff --git a/pages/template/swiper-list/swiper-list.uvue b/pages/template/swiper-list/swiper-list.uvue index 02819a4e8f145d40aad9ea832558b859a99757be..f0dcfc87ab9b4dce1403aff67289aa13c8a99dc3 100644 --- a/pages/template/swiper-list/swiper-list.uvue +++ b/pages/template/swiper-list/swiper-list.uvue @@ -73,7 +73,7 @@ if (moveToIndex < 0) { moveToIndex = 0 } if (moveToIndex > this.$swiperTabsRect.length - 1) { moveToIndex = this.$swiperTabsRect.length - 1 } - const percentage = Math.abs(offsetX) / this.$swiperWidth + const percentage = Math.abs(offsetX % this.$swiperWidth) / this.$swiperWidth const currentSize = this.$swiperTabsRect[currentIndex] const moveToSize = this.$swiperTabsRect[moveToIndex] const indicatorlineL = currentSize.left + (moveToSize.left - currentSize.left) * percentage