Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦里逆天
uni-app
提交
e7258b37
U
uni-app
项目概览
梦里逆天
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
22
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
e7258b37
编写于
6月 24, 2020
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build v3
上级
4867dd9d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
46 addition
and
58 deletion
+46
-58
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+46
-58
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
e7258b37
...
...
@@ -8486,7 +8486,9 @@ var serviceContext = (function () {
return
}
uni
.
hideToast
();
// 后退时,关闭 toast,loading
// 后退时,关闭 toast,loading
uni
.
hideToast
();
uni
.
hideLoading
();
if
(
currentPage
.
$page
.
meta
.
isQuit
)
{
quit
();
...
...
@@ -9322,17 +9324,16 @@ var serviceContext = (function () {
}
}
let
waiting
;
let
waitingTimeout
;
let
toast
=
false
;
let
toastTimeout
;
let
toast
;
let
toastType
;
let
timeout
;
function
showLoading$1
(
args
)
{
return
callApiSync
(
showToast$1
,
args
,
'
showToast
'
,
'
showLoading
'
)
return
callApiSync
(
showToast$1
,
Object
.
assign
({},
args
,
{
type
:
'
loading
'
})
,
'
showToast
'
,
'
showLoading
'
)
}
function
hideLoading
()
{
return
callApiSync
(
hide
Toast
,
Object
.
create
(
null
),
'
hideToast
'
,
'
hideLoading
'
)
return
callApiSync
(
hide
,
'
loading
'
,
'
hide
'
,
'
hideLoading
'
)
}
function
showToast$1
({
...
...
@@ -9341,41 +9342,18 @@ var serviceContext = (function () {
image
=
''
,
duration
=
1500
,
mask
=
false
,
position
=
''
position
=
''
,
type
=
'
toast
'
}
=
{})
{
if
(
position
)
{
if
(
toast
)
{
toastTimeout
&&
clearTimeout
(
toastTimeout
);
plus
.
nativeUI
.
closeToast
();
}
if
(
waiting
)
{
waitingTimeout
&&
clearTimeout
(
waitingTimeout
);
waiting
.
close
();
}
if
(
~
[
'
top
'
,
'
center
'
,
'
bottom
'
].
indexOf
(
position
))
{
plus
.
nativeUI
.
toast
(
title
,
{
verticalAlign
:
position
});
toast
=
true
;
toastTimeout
=
setTimeout
(()
=>
{
hideToast
();
},
2000
);
return
{
errMsg
:
'
showToast:ok
'
}
}
console
.
warn
(
'
uni.showToast 传入的 "position" 值 "
'
+
position
+
'
" 无效
'
);
}
if
(
duration
)
{
if
(
waiting
)
{
waitingTimeout
&&
clearTimeout
(
waitingTimeout
);
waiting
.
close
();
}
if
(
toast
)
{
toastTimeout
&&
clearTimeout
(
toastTimeout
);
plus
.
nativeUI
.
closeToast
();
}
hide
(
null
);
toastType
=
type
;
if
([
'
top
'
,
'
center
'
,
'
bottom
'
].
includes
(
position
))
{
// 仅可以关闭 richtext 类型,但 iOS 部分情况换行显示有问题
plus
.
nativeUI
.
toast
(
title
,
{
verticalAlign
:
position
});
toast
=
true
;
}
else
{
if
(
icon
&&
!~
[
'
success
'
,
'
loading
'
,
'
none
'
].
indexOf
(
icon
))
{
icon
=
'
success
'
;
}
...
...
@@ -9409,35 +9387,42 @@ var serviceContext = (function () {
height
:
'
55px
'
,
icon
:
'
__uniappsuccess.png
'
,
interval
:
duration
};
}
}
waiting
=
plus
.
nativeUI
.
showWaiting
(
title
,
waitingOptions
);
waitingTimeout
=
setTimeout
(()
=>
{
hideToast
();
},
duration
);
toast
=
plus
.
nativeUI
.
showWaiting
(
title
,
waitingOptions
);
}
timeout
=
setTimeout
(()
=>
{
hide
(
null
);
},
duration
);
return
{
errMsg
:
'
showToast:ok
'
}
}
function
hideToast
()
{
if
(
toast
)
{
toastTimeout
&&
clearTimeout
(
toastTimeout
);
plus
.
nativeUI
.
closeToast
();
toast
=
false
;
return
callApiSync
(
hide
,
'
toast
'
,
'
hide
'
,
'
hideToast
'
)
}
function
hide
(
type
=
'
toast
'
)
{
if
(
type
&&
type
!==
toastType
)
{
return
}
if
(
timeout
)
{
clearTimeout
(
timeout
);
timeout
=
null
;
}
if
(
waiting
)
{
waitingTimeout
&&
clearTimeout
(
waitingTimeout
);
waiting
.
close
();
waiting
=
null
;
waitingTimeout
=
null
;
if
(
toast
===
true
)
{
plus
.
nativeUI
.
closeToast
();
}
else
if
(
toast
&&
toast
.
close
)
{
toast
.
close
();
}
toast
=
null
;
toastType
=
null
;
return
{
errMsg
:
'
hide
Toast
:ok
'
errMsg
:
'
hide:ok
'
}
}
function
showModal$1
({
...
...
@@ -9979,6 +9964,7 @@ var serviceContext = (function () {
hideLoading
:
hideLoading
,
showToast
:
showToast$1
,
hideToast
:
hideToast
,
hide
:
hide
,
showModal
:
showModal$1
,
showActionSheet
:
showActionSheet$1
,
setTabBarBadge
:
setTabBarBadge$2
,
...
...
@@ -14015,7 +14001,8 @@ var serviceContext = (function () {
'
onLaunch
'
,
'
onShow
'
,
'
onHide
'
,
'
onUniNViewMessage
'
,
'
onUniNViewMessage
'
,
'
onPageNotFound
'
,
'
onError
'
,
// Page
'
onLoad
'
,
...
...
@@ -14223,7 +14210,8 @@ var serviceContext = (function () {
globalEvent
.
addEventListener
(
'
launchApp
'
,
()
=>
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
'
[uni-app] launchApp
'
);
}
}
plus
.
updateConfigInfo
&&
plus
.
updateConfigInfo
();
registerApp
(
this
);
oldMount
.
call
(
this
,
el
,
hydrating
);
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录