fix:修改瀑布流ios的抖动现象

This commit is contained in:
zerosaturation 2026-05-13 13:03:45 +08:00
parent 36e36b07c2
commit e81ef0a375
2 changed files with 8 additions and 10 deletions

View File

@ -1,3 +1 @@
# TopFans
密码R251Y>Y8inL_BM=W
https://testflight.apple.com/join/znR5FGdG

View File

@ -5,6 +5,7 @@
scroll-x
:show-scrollbar="false"
:scroll-left="isIOS ? undefined : scrollLeft"
:bounce="false"
@scroll="onScroll"
@touchstart="onTouchStart"
@touchend="onTouchEnd"
@ -224,8 +225,8 @@ let isManualScrolling = false // 是否正在手动滚动
const onTouchStart = (e) => {
if (isIOS) {
// iOS
stopIOSAutoScroll()
// iOS CSS
pauseIOSAutoScroll()
isManualScrolling = true
clearTimeout(momentumTimer)
} else {
@ -244,13 +245,12 @@ const onTouchEnd = () => {
const tick = () => {
momentumTimer = setTimeout(() => {
if (Math.abs(currentScrollLeft - lastTouchEndPos) < 2) {
// 300ms
// 500ms
clearTimeout(momentumTimer)
momentumTimer = setTimeout(() => {
isManualScrolling = false
autoScrollPos = currentScrollLeft
startIOSAutoScroll()
}, 300)
resumeIOSAutoScroll()
}, 1500)
} else {
//
lastTouchEndPos = currentScrollLeft
@ -951,6 +951,7 @@ const loadUsersAndStartScroll = () => {
<style scoped>
.waterfall-scroll {
white-space: nowrap;
overflow: hidden;
}
.waterfall-inner {
@ -962,7 +963,6 @@ const loadUsersAndStartScroll = () => {
.ios-css-animate {
animation: iosAutoScroll var(--anim-duration) linear infinite;
animation-play-state: var(--play-state, running);
}
@keyframes iosAutoScroll {