Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ripplebb
uni-app
提交
a5a59936
U
uni-app
项目概览
ripplebb
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
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,发现更多精彩内容 >>
提交
a5a59936
编写于
10月 14, 2020
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build v3
上级
de4864cb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
86 addition
and
77 deletion
+86
-77
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+86
-77
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
a5a59936
...
...
@@ -3294,11 +3294,6 @@ var serviceContext = (function () {
return
(
lng
<
72.004
||
lng
>
137.8347
)
||
((
lat
<
0.8293
||
lat
>
55.8271
)
||
false
)
};
function
getStatusbarHeight
()
{
// 横屏时 iOS 获取的状态栏高度错误,进行纠正
return
plus
.
navigator
.
isImmersedStatusbar
()
?
Math
.
round
(
plus
.
os
.
name
===
'
iOS
'
?
plus
.
navigator
.
getSafeAreaInsets
().
top
:
plus
.
navigator
.
getStatusbarHeight
())
:
0
}
function
getScreenInfo
()
{
const
{
resolutionWidth
,
resolutionHeight
}
=
plus
.
screen
.
getCurrentSize
();
return
{
...
...
@@ -3350,6 +3345,11 @@ var serviceContext = (function () {
function
getFileName
(
path
)
{
const
array
=
path
.
split
(
'
/
'
);
return
array
[
array
.
length
-
1
]
}
function
getExtName
(
path
)
{
const
array
=
path
.
split
(
'
.
'
);
return
array
.
length
>
1
?
'
.
'
+
array
[
array
.
length
-
1
]
:
''
}
const
audios
=
{};
...
...
@@ -4401,8 +4401,6 @@ var serviceContext = (function () {
const
ANI_CLOSE
=
downgrade
?
'
slide-out-right
'
:
'
pop-out
'
;
const
TITLEBAR_HEIGHT
=
44
;
const
ON_REACH_BOTTOM_DISTANCE
=
50
;
const
VIEW_WEBVIEW_PATH
=
'
_www/__uniappview.html
'
;
...
...
@@ -5061,6 +5059,8 @@ var serviceContext = (function () {
}
}
const
NAVBAR_HEIGHT
=
44
;
const
TABBAR_HEIGHT
=
50
;
const
isIOS$1
=
plus
.
os
.
name
===
'
iOS
'
;
let
config
;
...
...
@@ -5237,6 +5237,11 @@ var serviceContext = (function () {
}
};
function
getStatusbarHeight
()
{
// 横屏时 iOS 获取的状态栏高度错误,进行纠正
return
plus
.
navigator
.
isImmersedStatusbar
()
?
Math
.
round
(
plus
.
os
.
name
===
'
iOS
'
?
plus
.
navigator
.
getSafeAreaInsets
().
top
:
plus
.
navigator
.
getStatusbarHeight
())
:
0
}
function
getSystemInfoSync
()
{
return
callApiSync
(
getSystemInfo
,
Object
.
create
(
null
),
'
getSystemInfo
'
,
'
getSystemInfoSync
'
)
}
...
...
@@ -5260,7 +5265,7 @@ var serviceContext = (function () {
let
style
=
webview
.
getStyle
();
style
=
style
&&
style
.
titleNView
;
if
(
style
&&
style
.
type
&&
style
.
type
!==
'
none
'
)
{
titleNView
.
height
=
style
.
type
===
'
transparent
'
?
0
:
(
statusBarHeight
+
TITLE
BAR_HEIGHT
);
titleNView
.
height
=
style
.
type
===
'
transparent
'
?
0
:
(
statusBarHeight
+
NAV
BAR_HEIGHT
);
titleNView
.
cover
=
style
.
type
===
'
transparent
'
||
style
.
type
===
'
float
'
;
}
safeAreaInsets
=
webview
.
getSafeAreaInsets
();
...
...
@@ -5357,8 +5362,7 @@ var serviceContext = (function () {
tempFilePath
}
=
{},
callbackId
)
{
const
errorCallback
=
warpPlusErrorCallback
(
callbackId
,
'
saveFile
'
);
let
fileName
=
getFileName
(
tempFilePath
);
fileName
=
`
${
Date
.
now
()}${
index
++
}
_
${
fileName
}
`
;
const
fileName
=
`
${
Date
.
now
()}${
index
++
}${
getExtName
(
tempFilePath
)}
`
;
plus
.
io
.
resolveLocalFileSystemURL
(
tempFilePath
,
entry
=>
{
// 读取临时文件 FileEntry
getSavedFileDir
(
dir
=>
{
...
...
@@ -7810,7 +7814,7 @@ var serviceContext = (function () {
style
.
dock
=
'
top
'
;
style
.
top
=
0
;
style
.
width
=
'
100%
'
;
style
.
height
=
TITLE
BAR_HEIGHT
+
getStatusbarHeight
();
style
.
height
=
NAV
BAR_HEIGHT
+
getStatusbarHeight
();
delete
style
.
left
;
delete
style
.
right
;
delete
style
.
bottom
;
...
...
@@ -8461,6 +8465,57 @@ var serviceContext = (function () {
return
pageVm
}
let
isInitEntryPage
=
false
;
function
initEntryPage
()
{
if
(
isInitEntryPage
)
{
return
}
isInitEntryPage
=
true
;
let
entryPagePath
;
let
entryPageQuery
;
const
weexPlus
=
weex
.
requireModule
(
'
plus
'
);
if
(
weexPlus
.
getRedirectInfo
)
{
const
info
=
weexPlus
.
getRedirectInfo
()
||
{};
entryPagePath
=
info
.
path
;
entryPageQuery
=
info
.
query
?
(
'
?
'
+
info
.
query
)
:
''
;
}
else
{
const
argsJsonStr
=
plus
.
runtime
.
arguments
;
if
(
!
argsJsonStr
)
{
return
}
try
{
const
args
=
JSON
.
parse
(
argsJsonStr
);
entryPagePath
=
args
.
path
||
args
.
pathName
;
entryPageQuery
=
args
.
query
?
(
'
?
'
+
args
.
query
)
:
''
;
}
catch
(
e
)
{}
}
if
(
!
entryPagePath
||
entryPagePath
===
__uniConfig
.
entryPagePath
)
{
return
}
const
entryRoute
=
'
/
'
+
entryPagePath
;
const
routeOptions
=
__uniRoutes
.
find
(
route
=>
route
.
path
===
entryRoute
);
if
(
!
routeOptions
)
{
return
}
if
(
!
routeOptions
.
meta
.
isTabBar
)
{
__uniConfig
.
realEntryPagePath
=
__uniConfig
.
realEntryPagePath
||
__uniConfig
.
entryPagePath
;
}
__uniConfig
.
entryPagePath
=
entryPagePath
;
__uniConfig
.
entryPageQuery
=
entryPageQuery
;
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
`[uni-app] entryPagePath(
${
entryPagePath
+
entryPageQuery
}
)`
);
}
}
const
pages
=
[];
function
getCurrentPages$1
(
returnAll
)
{
...
...
@@ -8527,6 +8582,9 @@ var serviceContext = (function () {
webview
,
eventChannel
})
{
// fast 模式,nvue 首页时,初始化下 entry page
webview
&&
initEntryPage
();
if
(
preloadWebviews
[
url
])
{
webview
=
preloadWebviews
[
url
];
if
(
webview
.
__page__
)
{
...
...
@@ -8581,6 +8639,8 @@ var serviceContext = (function () {
console
.
log
(
`[uni-app] registerPage(
${
path
}
,
${
webview
.
id
}
)`
);
}
const
isLaunchNVuePage
=
webview
.
id
===
'
1
'
&&
webview
.
nvue
;
initWebview
(
webview
,
routeOptions
,
path
,
query
);
const
route
=
path
.
slice
(
1
);
...
...
@@ -8632,7 +8692,7 @@ var serviceContext = (function () {
}
// 首页是 nvue 时,在 registerPage 时,执行路由堆栈
if
(
webview
.
id
===
'
1
'
&&
webview
.
nvu
e
)
{
if
(
isLaunchNVuePag
e
)
{
if
(
__uniConfig
.
splashscreen
&&
__uniConfig
.
splashscreen
.
autoclose
&&
...
...
@@ -10491,14 +10551,7 @@ var serviceContext = (function () {
{
const
webview
=
plus
.
webview
.
all
().
find
(
webview
=>
webview
.
getURL
().
endsWith
(
'
www/__uniappview.html
'
));
if
(
webview
)
{
for
(
let
index
=
0
;
index
<
5
;
index
++
)
{
width
=
Number
(
webview
.
evalJSSync
(
`(
${
measureText
.
toString
()}
)(
${
JSON
.
stringify
(
text
)}
,
${
JSON
.
stringify
(
font
)}
)`
));
// 安卓部分情况会计算失败,进行重试
if
(
!
isNaN
(
width
))
{
width
=
0
;
break
}
}
width
=
Number
(
webview
.
evalJSSync
(
`(
${
measureText
.
toString
()}
)(
${
JSON
.
stringify
(
text
)}
,
${
JSON
.
stringify
(
font
)}
)`
));
}
}
return
new
TextMetrics
(
width
)
...
...
@@ -13239,17 +13292,17 @@ var serviceContext = (function () {
});
});
globalEvent
.
addEventListener
(
'
uistylechange
'
,
function
(
event
)
{
const
args
=
{
theme
:
event
.
uistyle
};
callAppHook
(
appCtx
,
'
onThemeChange
'
,
args
);
publish
(
'
onThemeChange
'
,
args
);
// 兼容旧版本 API
publish
(
'
onUIStyleChange
'
,
{
style
:
event
.
uistyle
globalEvent
.
addEventListener
(
'
uistylechange
'
,
function
(
event
)
{
const
args
=
{
theme
:
event
.
uistyle
};
callAppHook
(
appCtx
,
'
onThemeChange
'
,
args
);
publish
(
'
onThemeChange
'
,
args
);
// 兼容旧版本 API
publish
(
'
onUIStyleChange
'
,
{
style
:
event
.
uistyle
});
});
...
...
@@ -13315,50 +13368,6 @@ var serviceContext = (function () {
}
}
function
initEntryPage
()
{
let
entryPagePath
;
let
entryPageQuery
;
const
weexPlus
=
weex
.
requireModule
(
'
plus
'
);
if
(
weexPlus
.
getRedirectInfo
)
{
const
info
=
weexPlus
.
getRedirectInfo
()
||
{};
entryPagePath
=
info
.
path
;
entryPageQuery
=
info
.
query
?
(
'
?
'
+
info
.
query
)
:
''
;
}
else
{
const
argsJsonStr
=
plus
.
runtime
.
arguments
;
if
(
!
argsJsonStr
)
{
return
}
try
{
const
args
=
JSON
.
parse
(
argsJsonStr
);
entryPagePath
=
args
.
path
||
args
.
pathName
;
entryPageQuery
=
args
.
query
?
(
'
?
'
+
args
.
query
)
:
''
;
}
catch
(
e
)
{}
}
if
(
!
entryPagePath
||
entryPagePath
===
__uniConfig
.
entryPagePath
)
{
return
}
const
entryRoute
=
'
/
'
+
entryPagePath
;
const
routeOptions
=
__uniRoutes
.
find
(
route
=>
route
.
path
===
entryRoute
);
if
(
!
routeOptions
)
{
return
}
if
(
!
routeOptions
.
meta
.
isTabBar
)
{
__uniConfig
.
realEntryPagePath
=
__uniConfig
.
realEntryPagePath
||
__uniConfig
.
entryPagePath
;
}
__uniConfig
.
entryPagePath
=
entryPagePath
;
__uniConfig
.
entryPageQuery
=
entryPageQuery
;
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
`[uni-app] entryPagePath(
${
entryPagePath
+
entryPageQuery
}
)`
);
}
}
function
clearTempFile
()
{
// 统一处理路径
function
getPath
(
path
)
{
...
...
@@ -14243,7 +14252,7 @@ var serviceContext = (function () {
onReachBottomDistance
,
statusbarHeight
,
windowTop
:
windowOptions
.
titleNView
&&
windowOptions
.
titleNView
.
type
===
'
float
'
?
(
statusbarHeight
+
TITLE
BAR_HEIGHT
)
:
0
,
NAV
BAR_HEIGHT
)
:
0
,
windowBottom
:
(
tabBar$1
.
indexOf
(
route
)
>=
0
&&
tabBar$1
.
cover
)
?
tabBar$1
.
height
:
0
}
}
...
...
@@ -14293,7 +14302,7 @@ var serviceContext = (function () {
},
mounted
()
{
if
(
this
.
mpType
===
'
page
'
)
{
callPageHook
(
this
.
$scope
,
'
onReady
'
);
callPageHook
(
this
.
$scope
,
'
onReady
'
);
preloadSubPackages
(
this
.
$scope
.
route
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录