Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
3384b90e
U
uni-app
项目概览
DCloud
/
uni-app
2 个月 前同步成功
通知
717
Star
38705
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3384b90e
编写于
10月 30, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(h5): topWindow with navigationBar
上级
99141340
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
9 addition
and
22 deletion
+9
-22
src/platforms/h5/components/app/layout.vue
src/platforms/h5/components/app/layout.vue
+5
-5
src/platforms/h5/components/page/index.vue
src/platforms/h5/components/page/index.vue
+1
-10
src/platforms/h5/components/page/pageHead.vue
src/platforms/h5/components/page/pageHead.vue
+0
-1
src/platforms/h5/helpers/get-window-offset.js
src/platforms/h5/helpers/get-window-offset.js
+2
-1
src/platforms/h5/view/bridge/subscribe/index.js
src/platforms/h5/view/bridge/subscribe/index.js
+1
-5
未找到文件。
src/platforms/h5/components/app/layout.vue
浏览文件 @
3384b90e
...
...
@@ -179,7 +179,7 @@ export default {
if
(
newVal
)
{
this
.
$nextTick
(
this
.
onTopWindowInit
)
}
else
{
updateCssVar
(
'
--
window-top
'
,
'
0px
'
)
updateCssVar
(
'
--
top-window-height
'
,
'
0px
'
)
}
},
showLeftWindow
(
newVal
,
val
)
{
...
...
@@ -198,7 +198,7 @@ export default {
}
},
beforeCreate
()
{
updateCssVar
(
'
--
window-top
'
,
'
0px
'
)
updateCssVar
(
'
--
top-window-height
'
,
'
0px
'
)
updateCssVar
(
'
--window-left
'
,
'
0px
'
)
updateCssVar
(
'
--window-right
'
,
'
0px
'
)
},
...
...
@@ -251,7 +251,7 @@ export default {
if
(
show
)
{
this
.
$nextTick
(
this
.
onTopWindowInit
)
}
else
{
updateCssVar
(
'
--
window-top
'
,
'
0px
'
)
updateCssVar
(
'
--
top-window-height
'
,
'
0px
'
)
}
}
}
...
...
@@ -296,7 +296,7 @@ export default {
windowTopHeight
=
this
.
$refs
.
top
.
$el
.
offsetHeight
+
'
px
'
}
this
.
topWindowHeight
=
windowTopHeight
updateCssVar
(
'
--
window-top
'
,
windowTopHeight
)
updateCssVar
(
'
--
top-window-height
'
,
windowTopHeight
)
},
onLeftWindowInit
()
{
if
(
!
(
this
.
responsive
&&
this
.
leftWindow
))
{
...
...
@@ -335,7 +335,7 @@ export default {
}
uni-top-window
+
uni-content
{
height
:
calc
(
100vh
-
var
(
--
window-top
));
height
:
calc
(
100vh
-
var
(
--
top-window-height
));
}
uni-left-window
{
...
...
src/platforms/h5/components/page/index.vue
浏览文件 @
3384b90e
<
template
>
<uni-page
:data-page=
"$route.meta.pagePath"
>
<page-head
v-if=
"
!showTopWindow &&
navigationBar.type!=='none'"
v-if=
"navigationBar.type!=='none'"
v-bind=
"navigationBar"
/>
<page-refresh
...
...
@@ -241,15 +241,6 @@ export default {
refreshOptions
}
},
computed
:
{
showTopWindow
()
{
try
{
const
appLayout
=
getApp
().
$children
[
0
].
$children
[
0
]
return
appLayout
&&
appLayout
.
showTopWindow
}
catch
(
e
)
{}
return
false
}
},
created
()
{
const
navigationBar
=
this
.
navigationBar
document
.
title
=
navigationBar
.
titleText
...
...
src/platforms/h5/components/page/pageHead.vue
浏览文件 @
3384b90e
...
...
@@ -118,7 +118,6 @@
position
:
fixed
;
left
:
var
(
--window-left
);
right
:
var
(
--window-right
);
top
:
0
;
height
:
44px
;
height
:
calc
(
44px
+
constant
(
safe-area-inset-top
));
height
:
calc
(
44px
+
env
(
safe-area-inset-top
));
...
...
src/platforms/h5/helpers/get-window-offset.js
浏览文件 @
3384b90e
...
...
@@ -11,8 +11,9 @@ export default function getWindowOffset () {
const
bottom
=
parseInt
((
style
.
getPropertyValue
(
'
--window-bottom
'
).
match
(
/
\d
+/
)
||
[
'
0
'
])[
0
])
const
left
=
parseInt
((
style
.
getPropertyValue
(
'
--window-left
'
).
match
(
/
\d
+/
)
||
[
'
0
'
])[
0
])
const
right
=
parseInt
((
style
.
getPropertyValue
(
'
--window-right
'
).
match
(
/
\d
+/
)
||
[
'
0
'
])[
0
])
const
topWindowHeight
=
parseInt
((
style
.
getPropertyValue
(
'
--top-window-height
'
).
match
(
/
\d
+/
)
||
[
'
0
'
])[
0
])
return
{
top
:
top
?
(
top
+
safeAreaInsets
.
top
)
:
0
,
top
:
(
top
?
(
top
+
safeAreaInsets
.
top
)
:
0
)
+
(
topWindowHeight
||
0
)
,
bottom
:
bottom
?
(
bottom
+
safeAreaInsets
.
bottom
)
:
0
,
left
:
left
?
(
left
+
safeAreaInsets
.
left
)
:
0
,
right
:
right
?
(
right
+
safeAreaInsets
.
right
)
:
0
...
...
src/platforms/h5/view/bridge/subscribe/index.js
浏览文件 @
3384b90e
import
Vue
from
'
vue
'
import
{
isPlainObject
,
supportsPassive
...
...
@@ -35,9 +33,7 @@ function updateCssVar (vm) {
const
windowBottom
=
windowBottomValue
&&
envMethod
?
`calc(
${
windowBottomValue
}
px +
${
envMethod
}
(safe-area-inset-bottom))`
:
`
${
windowBottomValue
}
px`
const
style
=
document
.
documentElement
.
style
if
(
!
Vue
.
component
(
'
VUniTopWindow
'
)
||
pageVm
.
topWindow
===
false
)
{
// TODO 目前简单处理,只要包含topWindow,则不再更新--window-top
style
.
setProperty
(
'
--window-top
'
,
windowTop
)
}
style
.
setProperty
(
'
--window-top
'
,
`calc(var(--top-window-height) +
${
windowTop
}
)`
)
style
.
setProperty
(
'
--window-bottom
'
,
windowBottom
)
console
.
debug
(
`
${
vm
.
$page
.
route
}
[
${
vm
.
$page
.
id
}
]:--window-top=
${
windowTop
}
`
)
console
.
debug
(
`
${
vm
.
$page
.
route
}
[
${
vm
.
$page
.
id
}
]:--window-bottom=
${
windowBottom
}
`
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录