提交 72882efa authored 作者: gzcnkilys_admin's avatar gzcnkilys_admin

1、分析翻页导致的异常,实际为vue主动翻页与原始逻辑冲突。

上级 d455186f
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -156,8 +156,7 @@ ...@@ -156,8 +156,7 @@
<script setup> <script setup>
import $ from "jquery"; import $ from "jquery";
import "turn.js"; import turn from "@/assets/js/turn.js";
// import turn from "@/assets/js/turn.js";
import { ref, onMounted, onUnmounted, watch, nextTick, computed } from "vue"; import { ref, onMounted, onUnmounted, watch, nextTick, computed } from "vue";
import VueEasyLightbox from "vue-easy-lightbox"; import VueEasyLightbox from "vue-easy-lightbox";
import GuideMobile from "../GuideMobile/index.vue"; import GuideMobile from "../GuideMobile/index.vue";
...@@ -233,14 +232,15 @@ const handleTouchEnd = throttle((e) => { ...@@ -233,14 +232,15 @@ const handleTouchEnd = throttle((e) => {
const deltaX = touchEndX - touchStartX.value; const deltaX = touchEndX - touchStartX.value;
const deltaY = touchEndY - touchStartY.value; const deltaY = touchEndY - touchStartY.value;
// 这里与卷边的移动冲突,需要处理得更优雅
// 如果水平滑动距离大于垂直滑动距离,且大于50px,则触发翻页 // 如果水平滑动距离大于垂直滑动距离,且大于50px,则触发翻页
if (Math.abs(deltaX) > Math.abs(deltaY) && Math.abs(deltaX) > 50) { // if (Math.abs(deltaX) > Math.abs(deltaY) && Math.abs(deltaX) > 50) {
if (deltaX > 0) { // if (deltaX > 0) {
previousPage(); // previousPage();
} else { // } else {
nextPage(); // nextPage();
} // }
} // }
}); });
// 修改处理页面的函数,只处理必要的属性 // 修改处理页面的函数,只处理必要的属性
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论