|
|
@ -6480,6 +6480,12 @@ |
|
|
previewImage.addEventListener('touchmove', handleTouchMove, { passive: false }); |
|
|
previewImage.addEventListener('touchmove', handleTouchMove, { passive: false }); |
|
|
previewImage.addEventListener('touchend', handleTouchEnd); |
|
|
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) { |
|
|
previewModal.addEventListener('click', function(e) { |
|
|
if (e.target === previewModal) { |
|
|
if (e.target === previewModal) { |
|
|
@ -6631,9 +6637,9 @@ |
|
|
const swipeDistanceY = swipeEndY - swipeStartY; |
|
|
const swipeDistanceY = swipeEndY - swipeStartY; |
|
|
|
|
|
|
|
|
// 判断是否为有效滑动(水平滑动,距离足够,时间不太长) |
|
|
// 判断是否为有效滑动(水平滑动,距离足够,时间不太长) |
|
|
const isHorizontalSwipe = Math.abs(swipeDistanceX) > Math.abs(swipeDistanceY) * 2; |
|
|
const isHorizontalSwipe = Math.abs(swipeDistanceX) > Math.abs(swipeDistanceY) * 1.5; |
|
|
const isSignificantSwipe = Math.abs(swipeDistanceX) > 50; |
|
|
const isSignificantSwipe = Math.abs(swipeDistanceX) > 30; // 降低滑动距离阈值,从50px改为30px |
|
|
const isQuickSwipe = duration < 500; |
|
|
const isQuickSwipe = duration < 1000; // 放宽滑动时间限制,从500ms改为1000ms |
|
|
|
|
|
|
|
|
if (isHorizontalSwipe && isSignificantSwipe && isQuickSwipe) { |
|
|
if (isHorizontalSwipe && isSignificantSwipe && isQuickSwipe) { |
|
|
if (swipeDistanceX > 0) { |
|
|
if (swipeDistanceX > 0) { |
|
|
|