Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
4024f429
U
uni-app
项目概览
DCloud
/
uni-app
4 个月 前同步成功
通知
730
Star
38706
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看板
提交
4024f429
编写于
11月 28, 2019
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: v3-app 支持 windowBottom
上级
b257c342
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
39 addition
and
22 deletion
+39
-22
packages/uni-cli-shared/lib/platform.js
packages/uni-cli-shared/lib/platform.js
+8
-9
src/platforms/app-plus/service/api/device/system.js
src/platforms/app-plus/service/api/device/system.js
+3
-2
src/platforms/app-plus/service/framework/plugins/lifecycle.js
...platforms/app-plus/service/framework/plugins/lifecycle.js
+4
-2
src/platforms/app-plus/service/framework/safe-area-insets.js
src/platforms/app-plus/service/framework/safe-area-insets.js
+0
-0
src/platforms/app-plus/service/framework/tab-bar.js
src/platforms/app-plus/service/framework/tab-bar.js
+24
-9
未找到文件。
packages/uni-cli-shared/lib/platform.js
浏览文件 @
4024f429
...
@@ -125,15 +125,14 @@ const PLATFORMS = {
...
@@ -125,15 +125,14 @@ const PLATFORMS = {
filterTag
:
'
wxs
'
,
filterTag
:
'
wxs
'
,
subPackages
:
false
,
subPackages
:
false
,
cssVars
:
{
cssVars
:
{
'
--window-top
'
:
'
0px
'
,
'
--window-top
'
:
'
0px
'
'
--window-bottom
'
:
'
0px
'
},
},
copyWebpackOptions
({
copyWebpackOptions
({
assetsDir
,
assetsDir
,
vueOptions
vueOptions
})
{
})
{
if
(
if
(
vueOptions
&&
vueOptions
&&
vueOptions
.
pluginOptions
&&
vueOptions
.
pluginOptions
&&
vueOptions
.
pluginOptions
[
'
uni-app-plus
'
]
&&
vueOptions
.
pluginOptions
[
'
uni-app-plus
'
]
&&
vueOptions
.
pluginOptions
[
'
uni-app-plus
'
][
'
view
'
]
vueOptions
.
pluginOptions
[
'
uni-app-plus
'
][
'
view
'
]
...
@@ -155,9 +154,9 @@ const PLATFORMS = {
...
@@ -155,9 +154,9 @@ const PLATFORMS = {
require
.
resolve
(
'
@dcloudio/uni-app-plus/dist/view.css
'
),
require
.
resolve
(
'
@dcloudio/uni-app-plus/dist/view.css
'
),
require
.
resolve
(
'
@dcloudio/uni-app-plus/dist/view.umd.min.js
'
)
require
.
resolve
(
'
@dcloudio/uni-app-plus/dist/view.umd.min.js
'
)
])
])
template
=
[
template
=
[
...
getCopyOptions
([
path
.
resolve
(
__dirname
,
'
../template/common
'
)]),
...
getCopyOptions
([
path
.
resolve
(
__dirname
,
'
../template/common
'
)]),
...
getCopyOptions
([
path
.
resolve
(
__dirname
,
'
../template/v3
'
)])
...
getCopyOptions
([
path
.
resolve
(
__dirname
,
'
../template/v3
'
)])
]
]
}
}
return
[
return
[
...
@@ -558,4 +557,4 @@ module.exports = {
...
@@ -558,4 +557,4 @@ module.exports = {
getPlatformSass
()
{
getPlatformSass
()
{
return
SASS
return
SASS
}
}
}
}
src/platforms/app-plus/service/api/device/system.js
浏览文件 @
4024f429
...
@@ -48,8 +48,9 @@ export function getSystemInfo () {
...
@@ -48,8 +48,9 @@ export function getSystemInfo () {
}
else
{
}
else
{
safeAreaInsets
=
ios
?
plus
.
navigator
.
getSafeAreaInsets
()
:
getSafeAreaInsets
()
safeAreaInsets
=
ios
?
plus
.
navigator
.
getSafeAreaInsets
()
:
getSafeAreaInsets
()
}
}
var
windowBottom
=
isTabBarPage
()
&&
tabBar
.
visible
&&
tabBar
.
cover
?
tabBar
.
height
:
0
var
windowHeight
=
Math
.
min
(
screenHeight
-
(
titleNView
?
(
statusBarHeight
+
TITLEBAR_HEIGHT
)
var
windowHeight
=
Math
.
min
(
screenHeight
-
(
titleNView
?
(
statusBarHeight
+
TITLEBAR_HEIGHT
)
:
0
)
-
(
isTabBarPage
()
&&
tabBar
.
visible
?
tabBar
.
height
:
0
)
,
screenHeight
)
:
0
)
-
windowBottom
,
screenHeight
)
var
windowWidth
=
screenWidth
var
windowWidth
=
screenWidth
var
safeArea
=
{
var
safeArea
=
{
left
:
safeAreaInsets
.
left
,
left
:
safeAreaInsets
.
left
,
...
@@ -77,7 +78,7 @@ export function getSystemInfo () {
...
@@ -77,7 +78,7 @@ export function getSystemInfo () {
platform
,
platform
,
SDKVersion
:
''
,
SDKVersion
:
''
,
windowTop
:
0
,
windowTop
:
0
,
windowBottom
:
0
,
windowBottom
,
safeArea
safeArea
}
}
}
}
src/platforms/app-plus/service/framework/plugins/lifecycle.js
浏览文件 @
4024f429
...
@@ -20,6 +20,8 @@ import {
...
@@ -20,6 +20,8 @@ import {
}
}
from
'
../../constants
'
from
'
../../constants
'
import
tabBar
from
'
../tab-bar
'
function
parsePageCreateOptions
(
vm
,
route
)
{
function
parsePageCreateOptions
(
vm
,
route
)
{
const
pagePath
=
'
/
'
+
route
const
pagePath
=
'
/
'
+
route
const
routeOptions
=
__uniRoutes
.
find
(
route
=>
route
.
path
===
pagePath
)
const
routeOptions
=
__uniRoutes
.
find
(
route
=>
route
.
path
===
pagePath
)
...
@@ -39,7 +41,7 @@ function parsePageCreateOptions (vm, route) {
...
@@ -39,7 +41,7 @@ function parsePageCreateOptions (vm, route) {
onPageReachBottom
,
onPageReachBottom
,
onReachBottomDistance
,
onReachBottomDistance
,
windowTop
:
0
,
// TODO
windowTop
:
0
,
// TODO
windowBottom
:
0
// TODO
windowBottom
:
(
tabBar
.
indexOf
(
route
)
>=
0
&&
tabBar
.
cover
)
?
tabBar
.
height
:
0
}
}
}
}
...
@@ -76,4 +78,4 @@ export function initLifecycle (Vue) {
...
@@ -76,4 +78,4 @@ export function initLifecycle (Vue) {
}
}
}
}
})
})
}
}
src/platforms/app-plus/service/framework/safe-area.js
→
src/platforms/app-plus/service/framework/safe-area
-insets
.js
浏览文件 @
4024f429
文件已移动
src/platforms/app-plus/service/framework/tab-bar.js
浏览文件 @
4024f429
...
@@ -7,8 +7,10 @@ import {
...
@@ -7,8 +7,10 @@ import {
requireNativePlugin
requireNativePlugin
}
from
'
../bridge
'
}
from
'
../bridge
'
const
TABBAR_HEIGHT
=
50
import
safeAreaInsets
from
'
./safe-area-insets
'
const
TABBAR_HEIGHT
=
50
const
isIOS
=
plus
.
os
.
name
===
'
iOS
'
let
config
let
config
/**
/**
...
@@ -73,7 +75,7 @@ function setTabBarStyle (style) {
...
@@ -73,7 +75,7 @@ function setTabBarStyle (style) {
}
}
/**
/**
* 隐藏 tabBar
* 隐藏 tabBar
* @param {boolean} animation 是否需要动画效果
暂未支持
* @param {boolean} animation 是否需要动画效果
*/
*/
function
hideTabBar
(
animation
)
{
function
hideTabBar
(
animation
)
{
visible
=
false
visible
=
false
...
@@ -83,7 +85,7 @@ function hideTabBar (animation) {
...
@@ -83,7 +85,7 @@ function hideTabBar (animation) {
}
}
/**
/**
* 显示 tabBar
* 显示 tabBar
* @param {boolean} animation 是否需要动画效果
暂未支持
* @param {boolean} animation 是否需要动画效果
*/
*/
function
showTabBar
(
animation
)
{
function
showTabBar
(
animation
)
{
visible
=
true
visible
=
true
...
@@ -110,7 +112,7 @@ export default {
...
@@ -110,7 +112,7 @@ export default {
publish
(
'
onTabBarMidButtonTap
'
,
{})
publish
(
'
onTabBarMidButtonTap
'
,
{})
})
})
},
},
switchTab
(
page
)
{
indexOf
(
page
)
{
const
itemLength
=
config
.
list
.
length
const
itemLength
=
config
.
list
.
length
if
(
itemLength
)
{
if
(
itemLength
)
{
for
(
let
i
=
0
;
i
<
itemLength
;
i
++
)
{
for
(
let
i
=
0
;
i
<
itemLength
;
i
++
)
{
...
@@ -118,13 +120,20 @@ export default {
...
@@ -118,13 +120,20 @@ export default {
config
.
list
[
i
].
pagePath
===
page
||
config
.
list
[
i
].
pagePath
===
page
||
config
.
list
[
i
].
pagePath
===
`
${
page
}
.html`
config
.
list
[
i
].
pagePath
===
`
${
page
}
.html`
)
{
)
{
tabBar
&&
tabBar
.
switchSelect
({
return
i
index
:
i
})
return
true
}
}
}
}
}
}
return
-
1
},
switchTab
(
page
)
{
const
index
=
this
.
indexOf
(
page
)
if
(
index
>=
0
)
{
tabBar
&&
tabBar
.
switchSelect
({
index
})
return
true
}
return
false
return
false
},
},
setTabBarBadge
,
setTabBarBadge
,
...
@@ -148,7 +157,13 @@ export default {
...
@@ -148,7 +157,13 @@ export default {
return
visible
return
visible
},
},
get
height
()
{
get
height
()
{
return
config
&&
config
.
height
?
parseFloat
(
config
.
height
)
:
TABBAR_HEIGHT
return
(
config
&&
config
.
height
?
parseFloat
(
config
.
height
)
:
TABBAR_HEIGHT
)
+
safeAreaInsets
.
bottom
},
// tabBar是否遮挡内容区域
get
cover
()
{
const
array
=
[
'
extralight
'
,
'
light
'
,
'
dark
'
]
// 设置背景颜色会失效
return
isIOS
&&
array
.
indexOf
(
config
.
blurEffect
)
>=
0
&&
!
config
.
backgroundColor
},
},
setStyle
({
mask
})
{
setStyle
({
mask
})
{
tabBar
.
setMask
({
tabBar
.
setMask
({
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录