Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
anyefeiyu
uni-app
提交
29d27d3b
U
uni-app
项目概览
anyefeiyu
/
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,发现更多精彩内容 >>
提交
29d27d3b
编写于
7月 20, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix invoke
上级
adea1aeb
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
1871 addition
and
1489 deletion
+1871
-1489
packages/uni-app-plus-nvue/dist/uni.js
packages/uni-app-plus-nvue/dist/uni.js
+1662
-1470
src/core/service/api.js
src/core/service/api.js
+13
-0
src/platforms/app-plus/service/api.js
src/platforms/app-plus/service/api.js
+13
-0
src/platforms/app-plus/service/api/popup.js
src/platforms/app-plus/service/api/popup.js
+172
-0
src/platforms/app-plus/service/polyfill.js
src/platforms/app-plus/service/polyfill.js
+0
-0
src/platforms/app-plus/service/uni.js
src/platforms/app-plus/service/uni.js
+11
-19
未找到文件。
packages/uni-app-plus-nvue/dist/uni.js
浏览文件 @
29d27d3b
此差异已折叠。
点击以展开。
src/core/service/api.js
0 → 100644
浏览文件 @
29d27d3b
const
api
=
Object
.
create
(
null
)
const
modules
=
require
.
context
(
'
./api
'
,
true
,
/
\.
js$/
)
modules
.
keys
().
forEach
(
function
(
key
)
{
Object
.
assign
(
api
,
modules
(
key
))
})
export
default
api
src/platforms/app-plus/service/api.js
0 → 100644
浏览文件 @
29d27d3b
const
api
=
Object
.
create
(
null
)
const
modules
=
require
.
context
(
'
./api
'
,
true
,
/
\.
js$/
)
modules
.
keys
().
forEach
(
function
(
key
)
{
Object
.
assign
(
api
,
modules
(
key
))
})
export
default
api
src/platforms/app-plus/service/api/popup.js
0 → 100644
浏览文件 @
29d27d3b
const
{
invokeCallbackHandler
:
invoke
}
=
UniServiceJSBridge
let
waiting
let
waitingTimeout
let
toast
=
false
let
toastTimeout
export
function
showToast
({
title
=
''
,
icon
=
'
success
'
,
image
=
''
,
duration
=
1500
,
mask
=
false
,
position
=
''
}
=
{})
{
if
(
position
)
{
if
(
toast
)
{
toastTimeout
&&
clearTimeout
(
toastTimeout
)
plus
.
nativeUI
.
closeToast
()
}
if
(
waiting
)
{
waitingTimeout
&&
clearTimeout
(
waitingTimeout
)
waiting
.
close
()
}
if
(
~
[
'
top
'
,
'
center
'
,
'
bottom
'
].
indexOf
(
position
))
{
let
richText
=
`<span>
${
title
}
</span>`
plus
.
nativeUI
.
toast
(
richText
,
{
verticalAlign
:
position
,
type
:
'
richtext
'
})
toast
=
true
toastTimeout
=
setTimeout
(()
=>
{
hideToast
()
},
2000
)
return
}
console
.
warn
(
'
uni.showToast 传入的 "position" 值 "
'
+
position
+
'
" 无效
'
)
}
if
(
duration
)
{
if
(
waiting
)
{
waitingTimeout
&&
clearTimeout
(
waitingTimeout
)
waiting
.
close
()
}
if
(
toast
)
{
toastTimeout
&&
clearTimeout
(
toastTimeout
)
plus
.
nativeUI
.
closeToast
()
}
if
(
icon
&&
!~
[
'
success
'
,
'
loading
'
,
'
none
'
].
indexOf
(
icon
))
{
icon
=
'
success
'
}
const
waitingOptions
=
{
modal
:
mask
,
back
:
'
transmit
'
,
padding
:
'
10px
'
,
size
:
'
16px
'
// 固定字体大小
}
if
(
!
image
&&
(
!
icon
||
icon
===
'
none
'
))
{
// 无图
// waitingOptions.width = '120px'
// waitingOptions.height = '40px'
waitingOptions
.
loading
=
{
display
:
'
none
'
}
}
else
{
// 有图
waitingOptions
.
width
=
'
140px
'
waitingOptions
.
height
=
'
112px
'
}
if
(
image
)
{
waitingOptions
.
loading
=
{
display
:
'
block
'
,
height
:
'
55px
'
,
icon
:
image
,
interval
:
duration
}
}
else
{
if
(
icon
===
'
success
'
)
{
waitingOptions
.
loading
=
{
display
:
'
block
'
,
height
:
'
55px
'
,
icon
:
'
__uniappsuccess.png
'
,
interval
:
duration
}
}
}
waiting
=
plus
.
nativeUI
.
showWaiting
(
title
,
waitingOptions
)
waitingTimeout
=
setTimeout
(()
=>
{
hideToast
()
},
duration
)
}
return
{
errMsg
:
'
showToast:ok
'
}
}
export
function
hideToast
()
{
if
(
toast
)
{
toastTimeout
&&
clearTimeout
(
toastTimeout
)
plus
.
nativeUI
.
closeToast
()
toast
=
false
}
if
(
waiting
)
{
waitingTimeout
&&
clearTimeout
(
waitingTimeout
)
waiting
.
close
()
waiting
=
null
waitingTimeout
=
null
}
return
{
errMsg
:
'
hideToast:ok
'
}
}
export
function
showModal
({
title
=
''
,
content
=
''
,
showCancel
=
true
,
cancelText
=
'
取消
'
,
cancelColor
=
'
#000000
'
,
confirmText
=
'
确定
'
,
confirmColor
=
'
#3CC51F
'
}
=
{},
callbackId
)
{
plus
.
nativeUI
.
confirm
(
content
,
(
e
)
=>
{
if
(
showCancel
)
{
invoke
(
callbackId
,
{
errMsg
:
'
showModal:ok
'
,
confirm
:
e
.
index
===
1
,
cancel
:
e
.
index
===
0
||
e
.
index
===
-
1
})
}
else
{
invoke
(
callbackId
,
{
errMsg
:
'
showModal:ok
'
,
confirm
:
e
.
index
===
0
,
cancel
:
false
})
}
},
title
,
showCancel
?
[
cancelText
,
confirmText
]
:
[
confirmText
])
}
export
function
showActionSheet
({
itemList
=
[],
itemColor
=
'
#000000
'
,
title
=
''
},
callbackId
)
{
const
options
=
{
buttons
:
itemList
.
map
(
item
=>
({
title
:
item
}))
}
if
(
title
)
{
options
.
title
=
title
}
if
(
plus
.
os
.
name
===
'
iOS
'
)
{
options
.
cancel
=
'
取消
'
}
plus
.
nativeUI
.
actionSheet
(
options
,
(
e
)
=>
{
if
(
e
.
index
>
0
)
{
invoke
(
callbackId
,
{
errMsg
:
'
showActionSheet:ok
'
,
tapIndex
:
e
.
index
-
1
})
}
else
{
invoke
(
callbackId
,
{
errMsg
:
'
showActionSheet:fail cancel
'
})
}
})
}
src/platforms/app-plus/service/
framework/
polyfill.js
→
src/platforms/app-plus/service/polyfill.js
浏览文件 @
29d27d3b
文件已移动
src/platforms/app-plus/service/uni.js
浏览文件 @
29d27d3b
import
'
./polyfill
'
import
apis
from
'
uni-helpers/apis
'
import
{
wrapper
,
wrapperUnimplemented
}
from
'
uni-helpers/api
'
import
{
promisify
}
from
'
uni-helpers/promise
'
import
baseApi
from
'
uni-core/service/api
'
import
platformApi
from
'
./api
'
const
api
=
Object
.
create
(
null
)
const
uni
=
Object
.
create
(
null
)
Object
.
assign
(
api
,
baseApi
)
Object
.
assign
(
api
,
platformApi
)
const
baseApis
=
require
.
context
(
'
../../../core/service/api
'
,
true
,
/
\.
js$/
)
baseApis
.
keys
().
forEach
(
function
(
key
)
{
Object
.
assign
(
api
,
baseApis
(
key
))
})
const
platformApis
=
require
.
context
(
'
./api
'
,
true
,
/
\.
js$/
)
platformApis
.
keys
().
forEach
(
function
(
key
)
{
Object
.
assign
(
api
,
platformApis
(
key
))
})
const
uni
=
Object
.
create
(
null
)
apis
.
forEach
(
name
=>
{
if
(
api
[
name
])
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录