Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pic-reader
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
龙菲
pic-reader
Commits
52dccd32
提交
52dccd32
authored
6月 25, 2025
作者:
龙菲
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
删除touch事件
上级
72882efa
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
1 行增加
和
29 行删除
+1
-29
turn.js
src/assets/js/turn.js
+0
-0
components.d.ts
src/components.d.ts
+0
-1
index.vue
src/components/BookReader/index.vue
+1
-28
没有找到文件。
src/assets/js/turn.js
浏览文件 @
52dccd32
差异被折叠。
点击展开。
src/components.d.ts
浏览文件 @
52dccd32
...
@@ -17,7 +17,6 @@ declare module 'vue' {
...
@@ -17,7 +17,6 @@ declare module 'vue' {
ElRow
:
typeof
import
(
'element-plus/es'
)[
'ElRow'
]
ElRow
:
typeof
import
(
'element-plus/es'
)[
'ElRow'
]
ElTooltip
:
typeof
import
(
'element-plus/es'
)[
'ElTooltip'
]
ElTooltip
:
typeof
import
(
'element-plus/es'
)[
'ElTooltip'
]
FileUpload
:
typeof
import
(
'./components/FileUpload.vue'
)[
'default'
]
FileUpload
:
typeof
import
(
'./components/FileUpload.vue'
)[
'default'
]
FlipBook
:
typeof
import
(
'./components/FlipBook/index.vue'
)[
'default'
]
GuideMobile
:
typeof
import
(
'./components/GuideMobile/index.vue'
)[
'default'
]
GuideMobile
:
typeof
import
(
'./components/GuideMobile/index.vue'
)[
'default'
]
GuidePc
:
typeof
import
(
'./components/GuidePc/index.vue'
)[
'default'
]
GuidePc
:
typeof
import
(
'./components/GuidePc/index.vue'
)[
'default'
]
IconCommunity
:
typeof
import
(
'./components/icons/IconCommunity.vue'
)[
'default'
]
IconCommunity
:
typeof
import
(
'./components/icons/IconCommunity.vue'
)[
'default'
]
...
...
src/components/BookReader/index.vue
浏览文件 @
52dccd32
<
template
>
<
template
>
<div
<div
class=
"book-reader"
class=
"book-reader"
@
touchstart=
"handleTouchStart"
@
touchend=
"handleTouchEnd"
v-loading=
"loading && initialLoading"
v-loading=
"loading && initialLoading"
element-loading-text=
"正在加载图书..."
element-loading-text=
"正在加载图书..."
>
>
...
@@ -218,31 +216,6 @@ const checkMobile = () => {
...
@@ -218,31 +216,6 @@ const checkMobile = () => {
);
);
};
};
// 处理触摸事件
const
handleTouchStart
=
(
e
)
=>
{
if
(
!
isMobile
.
value
)
return
;
touchStartX
.
value
=
e
.
touches
[
0
].
clientX
;
touchStartY
.
value
=
e
.
touches
[
0
].
clientY
;
};
const
handleTouchEnd
=
throttle
((
e
)
=>
{
if
(
!
isMobile
.
value
)
return
;
const
touchEndX
=
e
.
changedTouches
[
0
].
clientX
;
const
touchEndY
=
e
.
changedTouches
[
0
].
clientY
;
const
deltaX
=
touchEndX
-
touchStartX
.
value
;
const
deltaY
=
touchEndY
-
touchStartY
.
value
;
// 这里与卷边的移动冲突,需要处理得更优雅
// 如果水平滑动距离大于垂直滑动距离,且大于50px,则触发翻页
// if (Math.abs(deltaX) > Math.abs(deltaY) && Math.abs(deltaX) > 50) {
// if (deltaX > 0) {
// previousPage();
// } else {
// nextPage();
// }
// }
});
// 修改处理页面的函数,只处理必要的属性
// 修改处理页面的函数,只处理必要的属性
const
processPages
=
(
pages
)
=>
{
const
processPages
=
(
pages
)
=>
{
return
pages
.
map
((
item
,
index
)
=>
({
return
pages
.
map
((
item
,
index
)
=>
({
...
@@ -424,7 +397,7 @@ const initBook = async () => {
...
@@ -424,7 +397,7 @@ const initBook = async () => {
acceleration
:
true
,
acceleration
:
true
,
gradients
:
true
,
gradients
:
true
,
elevation
:
80
,
elevation
:
80
,
duration
:
8
00
,
duration
:
2
00
,
autoCenter
:
true
,
autoCenter
:
true
,
turnCorners
:
"bl,br"
,
turnCorners
:
"bl,br"
,
page
:
1
,
page
:
1
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论