Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
味无味_
uni-app
提交
6b0f3ff0
U
uni-app
项目概览
味无味_
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6b0f3ff0
编写于
11月 28, 2019
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build v3
上级
963f4940
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
84 addition
and
23 deletion
+84
-23
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+84
-23
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
6b0f3ff0
...
...
@@ -4640,8 +4640,18 @@ var serviceContext = (function () {
}
}
var
safeAreaInsets
=
{
get
bottom
()
{
if
(
plus
.
os
.
name
===
'
iOS
'
)
{
const
safeArea
=
plus
.
navigator
.
getSafeAreaInsets
();
return
safeArea
?
safeArea
.
bottom
:
0
}
return
0
}
};
const
TABBAR_HEIGHT
=
50
;
const
isIOS$1
=
plus
.
os
.
name
===
'
iOS
'
;
let
config
;
/**
...
...
@@ -4706,7 +4716,7 @@ var serviceContext = (function () {
}
/**
* 隐藏 tabBar
* @param {boolean} animation 是否需要动画效果
暂未支持
* @param {boolean} animation 是否需要动画效果
*/
function
hideTabBar$1
(
animation
)
{
visible
=
false
;
...
...
@@ -4716,7 +4726,7 @@ var serviceContext = (function () {
}
/**
* 显示 tabBar
* @param {boolean} animation 是否需要动画效果
暂未支持
* @param {boolean} animation 是否需要动画效果
*/
function
showTabBar$1
(
animation
)
{
visible
=
true
;
...
...
@@ -4743,7 +4753,7 @@ var serviceContext = (function () {
publish
(
'
onTabBarMidButtonTap
'
,
{});
});
},
switchTab
(
page
)
{
indexOf
(
page
)
{
const
itemLength
=
config
.
list
.
length
;
if
(
itemLength
)
{
for
(
let
i
=
0
;
i
<
itemLength
;
i
++
)
{
...
...
@@ -4751,13 +4761,20 @@ var serviceContext = (function () {
config
.
list
[
i
].
pagePath
===
page
||
config
.
list
[
i
].
pagePath
===
`
${
page
}
.html`
)
{
tabBar
&&
tabBar
.
switchSelect
({
index
:
i
});
return
true
return
i
}
}
}
return
-
1
},
switchTab
(
page
)
{
const
index
=
this
.
indexOf
(
page
);
if
(
index
>=
0
)
{
tabBar
&&
tabBar
.
switchSelect
({
index
});
return
true
}
return
false
},
setTabBarBadge
:
setTabBarBadge$1
,
...
...
@@ -4781,7 +4798,13 @@ var serviceContext = (function () {
return
visible
},
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$1
&&
array
.
indexOf
(
config
.
blurEffect
)
>=
0
&&
!
config
.
backgroundColor
},
setStyle
({
mask
})
{
tabBar
.
setMask
({
...
...
@@ -4831,8 +4854,9 @@ var serviceContext = (function () {
}
else
{
safeAreaInsets
=
ios
?
plus
.
navigator
.
getSafeAreaInsets
()
:
getSafeAreaInsets
();
}
var
windowBottom
=
isTabBarPage
()
&&
tabBar$1
.
visible
&&
tabBar$1
.
cover
?
tabBar$1
.
height
:
0
;
var
windowHeight
=
Math
.
min
(
screenHeight
-
(
titleNView
?
(
statusBarHeight
+
TITLEBAR_HEIGHT
)
:
0
)
-
(
isTabBarPage
()
&&
tabBar$1
.
visible
?
tabBar$1
.
height
:
0
)
,
screenHeight
);
:
0
)
-
windowBottom
,
screenHeight
);
var
windowWidth
=
screenWidth
;
var
safeArea
=
{
left
:
safeAreaInsets
.
left
,
...
...
@@ -4860,7 +4884,7 @@ var serviceContext = (function () {
platform
,
SDKVersion
:
''
,
windowTop
:
0
,
windowBottom
:
0
,
windowBottom
,
safeArea
}
}
...
...
@@ -6023,6 +6047,16 @@ var serviceContext = (function () {
if
(
!
hasContentType
&&
name
.
toLowerCase
()
===
'
content-type
'
)
{
hasContentType
=
true
;
headers
[
'
Content-Type
'
]
=
header
[
name
];
// TODO 需要重构
if
(
method
===
'
POST
'
&&
header
[
name
].
indexOf
(
'
application/x-www-form-urlencoded
'
)
===
0
)
{
let
bodyArray
=
[];
for
(
let
key
in
data
)
{
if
(
data
.
hasOwnProperty
(
key
))
{
bodyArray
.
push
(
encodeURIComponent
(
key
)
+
'
=
'
+
encodeURIComponent
(
data
[
key
]));
}
}
data
=
bodyArray
.
join
(
'
&
'
);
}
}
else
{
headers
[
name
]
=
header
[
name
];
}
...
...
@@ -6934,9 +6968,6 @@ var serviceContext = (function () {
}
function
backWebview
(
webview
,
callback
)
{
if
(
!
webview
.
__uniapp_webview
)
{
return
callback
()
}
const
children
=
webview
.
children
();
if
(
!
children
||
!
children
.
length
)
{
// 有子 webview
return
callback
()
...
...
@@ -6965,14 +6996,14 @@ var serviceContext = (function () {
});
}
backWebview
(
currentPage
,
()
=>
{
const
backPage
=
function
(
webview
)
{
if
(
animationType
)
{
currentPage
.
$getAppWebview
()
.
close
(
animationType
,
animationDuration
||
ANI_DURATION
);
webview
.
close
(
animationType
,
animationDuration
||
ANI_DURATION
);
}
else
{
if
(
currentPage
.
$page
.
openType
===
'
redirect
'
)
{
// 如果是 redirectTo 跳转的,需要制定 back 动画
currentPage
.
$getAppWebview
()
.
close
(
ANI_CLOSE
,
ANI_DURATION
);
webview
.
close
(
ANI_CLOSE
,
ANI_DURATION
);
}
currentPage
.
$getAppWebview
()
.
close
(
'
auto
'
);
webview
.
close
(
'
auto
'
);
}
pages
.
slice
(
len
-
delta
,
len
).
forEach
(
page
=>
page
.
$remove
());
...
...
@@ -6982,6 +7013,14 @@ var serviceContext = (function () {
UniServiceJSBridge
.
emit
(
'
onAppRoute
'
,
{
type
:
'
navigateBack
'
});
};
const
webview
=
currentPage
.
$getAppWebview
();
if
(
!
currentPage
.
__uniapp_webview
)
{
return
backPage
(
webview
)
}
backWebview
(
webview
,
()
=>
{
backPage
(
webview
);
});
}
...
...
@@ -7043,7 +7082,8 @@ var serviceContext = (function () {
function
parseTitleNView
(
routeOptions
)
{
const
windowOptions
=
routeOptions
.
window
;
const
titleNView
=
windowOptions
.
titleNView
;
const
titleNView
=
windowOptions
.
titleNView
;
routeOptions
.
meta
.
statusBarStyle
=
windowOptions
.
navigationBarTextStyle
===
'
black
'
?
'
dark
'
:
'
light
'
;
if
(
// 无头
titleNView
===
false
||
titleNView
===
'
false
'
||
...
...
@@ -7081,8 +7121,6 @@ var serviceContext = (function () {
}]
};
routeOptions
.
meta
.
statusBarStyle
=
windowOptions
.
navigationBarTextStyle
===
'
black
'
?
'
dark
'
:
'
light
'
;
if
(
isPlainObject
(
titleNView
))
{
return
Object
.
assign
(
ret
,
parseTitleNViewButtons
(
titleNView
))
}
...
...
@@ -7396,6 +7434,8 @@ var serviceContext = (function () {
const
VD_SYNC_CALLBACK
=
'
vdSyncCallback
'
;
const
INVOKE_API
=
'
invokeApi
'
;
const
WEB_INVOKE_APPSERVICE$1
=
'
WEB_INVOKE_APPSERVICE
'
;
const
WEBVIEW_INSERTED
=
'
webviewInserted
'
;
const
WEBVIEW_REMOVED
=
'
webviewRemoved
'
;
function
onWebviewRecovery
(
webview
,
routeOptions
)
{
const
{
...
...
@@ -7980,6 +8020,7 @@ var serviceContext = (function () {
query
:
{},
openType
:
'
switchTab
'
}),
'
none
'
,
0
,
()
=>
{
setStatusBarStyle
();
invoke
(
callbackId
,
{
errMsg
:
'
switchTab:ok
'
});
...
...
@@ -11470,6 +11511,23 @@ var serviceContext = (function () {
vm
[
method
]
&&
vm
[
method
](
args
);
}
function
findPage
(
pageId
)
{
pageId
=
parseInt
(
pageId
);
const
page
=
getCurrentPages
(
true
).
find
(
page
=>
page
.
$page
.
id
===
pageId
);
if
(
!
page
)
{
return
console
.
error
(
`Page[
${
pageId
}
] not found`
)
}
return
page
}
function
onWebviewInserted
(
data
,
pageId
)
{
const
page
=
findPage
(
pageId
);
page
&&
(
page
.
__uniapp_webview
=
true
);
}
function
onWebviewRemoved
(
data
,
pageId
)
{
const
page
=
findPage
(
pageId
);
page
&&
(
delete
page
.
__uniapp_webview
);
}
function
initSubscribeHandlers
()
{
const
{
on
,
...
...
@@ -11508,7 +11566,10 @@ var serviceContext = (function () {
subscribe
(
VD_SYNC
,
onVdSync
);
subscribe
(
VD_SYNC_CALLBACK
,
onVdSyncCallback
);
subscribe
(
INVOKE_API
,
onInvokeApi
);
subscribe
(
INVOKE_API
,
onInvokeApi
);
subscribe
(
WEBVIEW_INSERTED
,
onWebviewInserted
);
subscribe
(
WEBVIEW_REMOVED
,
onWebviewRemoved
);
}
let
appCtx
;
...
...
@@ -12219,7 +12280,7 @@ var serviceContext = (function () {
onPageReachBottom
,
onReachBottomDistance
,
windowTop
:
0
,
// TODO
windowBottom
:
0
// TODO
windowBottom
:
(
tabBar$1
.
indexOf
(
route
)
>=
0
&&
tabBar$1
.
cover
)
?
tabBar$1
.
height
:
0
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录