Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lzb_79
uni-app
提交
eeeb2da4
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,发现更多精彩内容 >>
提交
eeeb2da4
编写于
7月 21, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(app): statusBarStyle
上级
650366d3
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
44 addition
and
35 deletion
+44
-35
packages/shims-uni-app.d.ts
packages/shims-uni-app.d.ts
+1
-1
packages/uni-app-plus/dist/uni-app-service.es.js
packages/uni-app-plus/dist/uni-app-service.es.js
+5
-5
packages/uni-app-plus/src/service/api/route/switchTab.ts
packages/uni-app-plus/src/service/api/route/switchTab.ts
+1
-1
packages/uni-app-plus/src/service/statusBar.ts
packages/uni-app-plus/src/service/statusBar.ts
+4
-4
packages/uni-app-vite/dist/plugin/build.js
packages/uni-app-vite/dist/plugin/build.js
+24
-21
packages/uni-app-vite/dist/plugin/index.js
packages/uni-app-vite/dist/plugin/index.js
+1
-1
packages/uni-cli-shared/src/json/pages.ts
packages/uni-cli-shared/src/json/pages.ts
+6
-2
packages/uni-core/src/helpers/page.ts
packages/uni-core/src/helpers/page.ts
+2
-0
未找到文件。
packages/shims-uni-app.d.ts
浏览文件 @
eeeb2da4
...
...
@@ -8,7 +8,7 @@ declare namespace Page {
options
:
Record
<
string
,
any
>
meta
:
UniApp
.
PageRouteMeta
openType
:
UniApp
.
OpenType
statusBarStyle
?:
string
statusBarStyle
?:
'
dark
'
|
'
light
'
}
}
}
...
...
packages/uni-app-plus/dist/uni-app-service.es.js
浏览文件 @
eeeb2da4
...
...
@@ -1704,6 +1704,7 @@ var serviceContext = (function (vue) {
options: pageQuery,
meta,
openType,
statusBarStyle: meta.navigationBar.titleColor === '#000000' ? 'dark' : 'light',
};
}
...
...
@@ -9014,12 +9015,11 @@ var serviceContext = (function (vue) {
plus.navigator.setStatusBarStyle = newSetStatusBarStyle;
function setStatusBarStyle(statusBarStyle) {
if (!statusBarStyle) {
const page
s = getCurrentPages
();
if (!page
s.length
) {
const page
= getCurrentPage
();
if (!page) {
return;
}
statusBarStyle = pages[pages.length - 1].$page
.statusBarStyle;
statusBarStyle = page.$page.statusBarStyle;
if (!statusBarStyle || statusBarStyle === lastStatusBarStyle) {
return;
}
...
...
@@ -10519,6 +10519,7 @@ var serviceContext = (function (vue) {
if (callOnShow && !webview.__preload__) {
invokeHook(tabBarPage, ON_SHOW);
}
setStatusBarStyle();
resolve(undefined);
}
else {
...
...
@@ -10532,7 +10533,6 @@ var serviceContext = (function (vue) {
resolve(undefined);
}, 70);
}
setStatusBarStyle();
});
}
...
...
packages/uni-app-plus/src/service/api/route/switchTab.ts
浏览文件 @
eeeb2da4
...
...
@@ -111,6 +111,7 @@ function _switchTab({
if
(
callOnShow
&&
!
(
webview
as
any
).
__preload__
)
{
invokeHook
(
tabBarPage
,
ON_SHOW
)
}
setStatusBarStyle
()
resolve
(
undefined
)
}
else
{
showWebview
(
...
...
@@ -129,6 +130,5 @@ function _switchTab({
70
)
}
setStatusBarStyle
()
})
}
packages/uni-app-plus/src/service/statusBar.ts
浏览文件 @
eeeb2da4
import
{
getCurrentPage
}
from
'
@dcloudio/uni-core
'
import
{
formatLog
}
from
'
@dcloudio/uni-shared
'
type
SetStatusBarStyle
=
typeof
plus
.
navigator
.
setStatusBarStyle
...
...
@@ -22,12 +23,11 @@ plus.navigator.setStatusBarStyle = newSetStatusBarStyle
export
function
setStatusBarStyle
(
statusBarStyle
?:
StatusBarStyle
)
{
if
(
!
statusBarStyle
)
{
const
page
s
=
getCurrentPages
()
if
(
!
page
s
.
length
)
{
const
page
=
getCurrentPage
()
if
(
!
page
)
{
return
}
statusBarStyle
=
pages
[
pages
.
length
-
1
].
$page
.
statusBarStyle
as
StatusBarStyle
statusBarStyle
=
page
.
$page
.
statusBarStyle
as
StatusBarStyle
if
(
!
statusBarStyle
||
statusBarStyle
===
lastStatusBarStyle
)
{
return
}
...
...
packages/uni-app-vite/dist/plugin/build.js
浏览文件 @
eeeb2da4
...
...
@@ -7,26 +7,29 @@ exports.buildOptions = void 0;
const
path_1
=
__importDefault
(
require
(
"
path
"
));
const
slash_1
=
__importDefault
(
require
(
"
slash
"
));
const
uni_cli_shared_1
=
require
(
"
@dcloudio/uni-cli-shared
"
);
exports
.
buildOptions
=
{
rollupOptions
:
{
input
:
uni_cli_shared_1
.
resolveMainPathOnce
(
process
.
env
.
UNI_INPUT_DIR
),
external
:
[
'
vue
'
],
output
:
{
name
:
'
AppService
'
,
format
:
process
.
env
.
UNI_APP_CODE_SPLITING
?
'
amd
'
:
'
iife
'
,
entryFileNames
:
'
app-service.js
'
,
manualChunks
:
{},
chunkFileNames
(
chunk
)
{
if
(
chunk
.
isDynamicEntry
&&
chunk
.
facadeModuleId
)
{
const
filepath
=
path_1
.
default
.
relative
(
process
.
env
.
UNI_INPUT_DIR
,
chunk
.
facadeModuleId
);
return
slash_1
.
default
(
filepath
.
replace
(
path_1
.
default
.
extname
(
filepath
),
'
.js
'
));
}
return
'
[name].js
'
;
},
assetFileNames
:
'
[name][extname]
'
,
globals
:
{
vue
:
'
Vue
'
,
function
buildOptions
()
{
return
{
rollupOptions
:
{
input
:
uni_cli_shared_1
.
resolveMainPathOnce
(
process
.
env
.
UNI_INPUT_DIR
),
external
:
[
'
vue
'
],
output
:
{
name
:
'
AppService
'
,
format
:
process
.
env
.
UNI_APP_CODE_SPLITING
?
'
amd
'
:
'
iife
'
,
entryFileNames
:
'
app-service.js
'
,
manualChunks
:
{},
chunkFileNames
(
chunk
)
{
if
(
chunk
.
isDynamicEntry
&&
chunk
.
facadeModuleId
)
{
const
filepath
=
path_1
.
default
.
relative
(
process
.
env
.
UNI_INPUT_DIR
,
chunk
.
facadeModuleId
);
return
slash_1
.
default
(
filepath
.
replace
(
path_1
.
default
.
extname
(
filepath
),
'
.js
'
));
}
return
'
[name].js
'
;
},
assetFileNames
:
'
[name][extname]
'
,
globals
:
{
vue
:
'
Vue
'
,
},
},
},
},
};
};
}
exports
.
buildOptions
=
buildOptions
;
packages/uni-app-vite/dist/plugin/index.js
浏览文件 @
eeeb2da4
...
...
@@ -10,7 +10,7 @@ exports.UniAppPlugin = {
uni
:
uni_1
.
uniOptions
,
config
()
{
return
{
build
:
build_1
.
buildOptions
,
build
:
build_1
.
buildOptions
()
,
};
},
configResolved
:
configResolved_1
.
configResolved
,
...
...
packages/uni-cli-shared/src/json/pages.ts
浏览文件 @
eeeb2da4
...
...
@@ -99,9 +99,13 @@ function normalizePageStyle(
)
{
if
(
pageStyle
)
{
if
(
platform
===
'
h5
'
)
{
extend
(
pageStyle
,
pageStyle
[
'
app
'
]
||
pageStyle
[
'
app-plus
'
]
||
{})
extend
(
pageStyle
,
pageStyle
[
'
app
'
]
||
pageStyle
[
'
app-plus
'
])
}
if
(
platform
===
'
app
'
)
{
extend
(
pageStyle
,
pageStyle
[
'
app
'
]
||
pageStyle
[
'
app-plus
'
])
}
else
{
extend
(
pageStyle
,
pageStyle
[
platform
])
}
extend
(
pageStyle
,
pageStyle
[
platform
]
||
{})
if
([
'
h5
'
,
'
app
'
].
includes
(
platform
))
{
pageStyle
.
navigationBar
=
normalizeNavigationBar
(
pageStyle
)
if
(
isEnablePullDownRefresh
(
pageStyle
))
{
...
...
packages/uni-core/src/helpers/page.ts
浏览文件 @
eeeb2da4
...
...
@@ -116,5 +116,7 @@ export function initPageInternalInstance(
options
:
pageQuery
,
meta
,
openType
,
statusBarStyle
:
meta
.
navigationBar
.
titleColor
===
'
#000000
'
?
'
dark
'
:
'
light
'
,
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录