diff --git a/supply.html b/supply.html index 0ad5348..6ef5243 100644 --- a/supply.html +++ b/supply.html @@ -6480,6 +6480,12 @@ previewImage.addEventListener('touchmove', handleTouchMove, { passive: false }); previewImage.addEventListener('touchend', handleTouchEnd); + // 为视频元素也添加触摸事件支持 + const previewVideo = document.getElementById('previewVideo'); + previewVideo.addEventListener('touchstart', handleTouchStart, { passive: false }); + previewVideo.addEventListener('touchmove', handleTouchMove, { passive: false }); + previewVideo.addEventListener('touchend', handleTouchEnd); + // 点击背景关闭预览 previewModal.addEventListener('click', function(e) { if (e.target === previewModal) { @@ -6631,9 +6637,9 @@ const swipeDistanceY = swipeEndY - swipeStartY; // 判断是否为有效滑动(水平滑动,距离足够,时间不太长) - const isHorizontalSwipe = Math.abs(swipeDistanceX) > Math.abs(swipeDistanceY) * 2; - const isSignificantSwipe = Math.abs(swipeDistanceX) > 50; - const isQuickSwipe = duration < 500; + const isHorizontalSwipe = Math.abs(swipeDistanceX) > Math.abs(swipeDistanceY) * 1.5; + const isSignificantSwipe = Math.abs(swipeDistanceX) > 30; // 降低滑动距离阈值,从50px改为30px + const isQuickSwipe = duration < 1000; // 放宽滑动时间限制,从500ms改为1000ms if (isHorizontalSwipe && isSignificantSwipe && isQuickSwipe) { if (swipeDistanceX > 0) {