Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lzb_79
uni-app
提交
982b3853
U
uni-app
项目概览
lzb_79
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
982b3853
编写于
5月 14, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: ImagePreview, LocationView use preventScroll
上级
0f49ca95
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
31 addition
and
0 deletion
+31
-0
packages/uni-h5/src/helpers/usePreventScroll.ts
packages/uni-h5/src/helpers/usePreventScroll.ts
+24
-0
packages/uni-h5/src/service/api/location/openLocation/LocationView.tsx
...h5/src/service/api/location/openLocation/LocationView.tsx
+2
-0
packages/uni-h5/src/service/api/media/previewImage/ImagePreview.tsx
...ni-h5/src/service/api/media/previewImage/ImagePreview.tsx
+3
-0
packages/uni-h5/src/service/api/media/previewImage/ImageView.tsx
...s/uni-h5/src/service/api/media/previewImage/ImageView.tsx
+2
-0
未找到文件。
packages/uni-h5/src/helpers/usePreventScroll.ts
0 → 100644
浏览文件 @
982b3853
import
{
onMounted
,
onUnmounted
}
from
'
vue
'
let
index
=
0
let
overflow
=
''
export
function
preventScroll
(
prevent
:
boolean
)
{
let
before
=
index
index
+=
prevent
?
1
:
-
1
index
=
Math
.
max
(
0
,
index
)
if
(
index
>
0
)
{
if
(
before
===
0
)
{
overflow
=
document
.
body
.
style
.
overflow
document
.
body
.
style
.
overflow
=
'
hidden
'
}
}
else
{
document
.
body
.
style
.
overflow
=
overflow
overflow
=
''
}
}
export
function
usePreventScroll
()
{
onMounted
(()
=>
preventScroll
(
true
))
onUnmounted
(()
=>
preventScroll
(
false
))
}
packages/uni-h5/src/service/api/location/openLocation/LocationView.tsx
浏览文件 @
982b3853
...
@@ -7,6 +7,7 @@ import {
...
@@ -7,6 +7,7 @@ import {
computed
,
computed
,
}
from
'
vue
'
}
from
'
vue
'
import
{
createSvgIconVNode
,
ICON_PATH_BACK
}
from
'
@dcloudio/uni-core
'
import
{
createSvgIconVNode
,
ICON_PATH_BACK
}
from
'
@dcloudio/uni-core
'
import
{
usePreventScroll
}
from
'
../../../../helpers/usePreventScroll
'
const
props
=
{
const
props
=
{
latitude
:
{
latitude
:
{
...
@@ -36,6 +37,7 @@ export default /*#__PURE__*/ defineComponent({
...
@@ -36,6 +37,7 @@ export default /*#__PURE__*/ defineComponent({
props
,
props
,
emits
:
[
'
close
'
],
emits
:
[
'
close
'
],
setup
(
props
,
{
emit
})
{
setup
(
props
,
{
emit
})
{
usePreventScroll
()
const
mapRef
:
Ref
<
HTMLIFrameElement
|
null
>
=
ref
(
null
)
const
mapRef
:
Ref
<
HTMLIFrameElement
|
null
>
=
ref
(
null
)
const
key
=
__uniConfig
.
qqMapKey
const
key
=
__uniConfig
.
qqMapKey
const
referer
=
'
uniapp
'
const
referer
=
'
uniapp
'
...
...
packages/uni-h5/src/service/api/media/previewImage/ImagePreview.tsx
浏览文件 @
982b3853
...
@@ -9,6 +9,7 @@ import {
...
@@ -9,6 +9,7 @@ import {
nextTick
,
nextTick
,
}
from
'
vue
'
}
from
'
vue
'
import
{
Swiper
,
SwiperItem
}
from
'
@dcloudio/uni-components
'
import
{
Swiper
,
SwiperItem
}
from
'
@dcloudio/uni-components
'
import
{
usePreventScroll
}
from
'
../../../../helpers/usePreventScroll
'
import
ImageView
from
'
./ImageView
'
import
ImageView
from
'
./ImageView
'
const
props
=
{
const
props
=
{
...
@@ -40,6 +41,7 @@ export default /*#__PURE__*/ defineComponent({
...
@@ -40,6 +41,7 @@ export default /*#__PURE__*/ defineComponent({
props
,
props
,
emits
:
[
'
close
'
],
emits
:
[
'
close
'
],
setup
(
props
,
{
emit
})
{
setup
(
props
,
{
emit
})
{
usePreventScroll
()
const
rootRef
:
Ref
<
HTMLElement
|
null
>
=
ref
(
null
)
const
rootRef
:
Ref
<
HTMLElement
|
null
>
=
ref
(
null
)
const
indexRef
=
ref
(
getIndex
(
props
))
const
indexRef
=
ref
(
getIndex
(
props
))
watch
(
watch
(
...
@@ -98,6 +100,7 @@ export default /*#__PURE__*/ defineComponent({
...
@@ -98,6 +100,7 @@ export default /*#__PURE__*/ defineComponent({
>
>
<
Swiper
<
Swiper
current
=
{
indexRef
.
value
}
current
=
{
indexRef
.
value
}
// @ts-ignore
onChange
=
{
onChange
}
onChange
=
{
onChange
}
indicator
-
dots
=
{
false
}
indicator
-
dots
=
{
false
}
autoplay
=
{
false
}
autoplay
=
{
false
}
...
...
packages/uni-h5/src/service/api/media/previewImage/ImageView.tsx
浏览文件 @
982b3853
...
@@ -71,6 +71,7 @@ export default /*#__PURE__*/ defineComponent({
...
@@ -71,6 +71,7 @@ export default /*#__PURE__*/ defineComponent({
return
(
return
(
<
MovableArea
<
MovableArea
style
=
{
viewStyle
}
style
=
{
viewStyle
}
// @ts-ignore
onTouchstart
=
{
withWebEvent
(
onTouchStart
)
}
onTouchstart
=
{
withWebEvent
(
onTouchStart
)
}
onTouchmove
=
{
withWebEvent
(
checkDirection
)
}
onTouchmove
=
{
withWebEvent
(
checkDirection
)
}
onTouchend
=
{
withWebEvent
(
onTouchEnd
)
}
onTouchend
=
{
withWebEvent
(
onTouchEnd
)
}
...
@@ -82,6 +83,7 @@ export default /*#__PURE__*/ defineComponent({
...
@@ -82,6 +83,7 @@ export default /*#__PURE__*/ defineComponent({
scale
scale
scale
-
min
=
"1"
scale
-
min
=
"1"
scale
-
max
=
"4"
scale
-
max
=
"4"
// @ts-ignore
onScale
=
{
onScale
}
onScale
=
{
onScale
}
>
>
<
img
<
img
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录