Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
20岁爱吃必胜客
uni-app
提交
19a0fe58
U
uni-app
项目概览
20岁爱吃必胜客
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
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,发现更多精彩内容 >>
提交
19a0fe58
编写于
7月 23, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add warn
上级
e5551fd7
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
320 addition
and
26 deletion
+320
-26
build/rollup.config.app.js
build/rollup.config.app.js
+1
-1
packages/uni-app-plus-nvue/dist/index.legacy.js
packages/uni-app-plus-nvue/dist/index.legacy.js
+6
-6
packages/uni-app-plus-nvue/dist/uni.js
packages/uni-app-plus-nvue/dist/uni.js
+303
-9
src/core/helpers/api.js
src/core/helpers/api.js
+1
-1
src/platforms/app-plus-nvue/service/api.js
src/platforms/app-plus-nvue/service/api.js
+1
-1
src/platforms/app-plus-nvue/service/api/context/live-pusher.js
...latforms/app-plus-nvue/service/api/context/live-pusher.js
+2
-2
src/platforms/app-plus-nvue/service/api/context/map.js
src/platforms/app-plus-nvue/service/api/context/map.js
+2
-2
src/platforms/app-plus-nvue/service/api/context/video.js
src/platforms/app-plus-nvue/service/api/context/video.js
+2
-2
src/platforms/app-plus/service/api/device/scan-code.js
src/platforms/app-plus/service/api/device/scan-code.js
+2
-2
未找到文件。
build/rollup.config.app.js
浏览文件 @
19a0fe58
...
...
@@ -38,7 +38,7 @@ module.exports = {
requireContext
(),
alias
({
'
uni-core
'
:
path
.
resolve
(
__dirname
,
'
../src/core
'
),
'
uni-platform
'
:
path
.
resolve
(
__dirname
,
'
../src/platforms/
app-plus
'
),
'
uni-platform
'
:
path
.
resolve
(
__dirname
,
'
../src/platforms/
'
+
process
.
env
.
UNI_PLATFORM
),
'
uni-platforms
'
:
path
.
resolve
(
__dirname
,
'
../src/platforms
'
),
'
uni-shared
'
:
path
.
resolve
(
__dirname
,
'
../src/shared/util.js
'
),
'
uni-helpers
'
:
path
.
resolve
(
__dirname
,
'
../src/core/helpers
'
)
...
...
packages/uni-app-plus-nvue/dist/index.legacy.js
浏览文件 @
19a0fe58
...
...
@@ -518,11 +518,11 @@ class MapContext {
function
createMapContext
(
id
,
vm
)
{
if
(
!
vm
)
{
return
global
.
nativeLog
(
'
uni.createMapContext 必须传入第二个参数,即当前 vm 对象(this)
'
,
'
__WARN
'
)
return
console
.
warn
(
'
uni.createMapContext 必须传入第二个参数,即当前 vm 对象(this)
'
)
}
const
elm
=
findElmById
(
id
,
vm
);
if
(
!
elm
)
{
return
global
.
nativeLog
(
'
Can not find `
'
+
id
+
'
`
'
,
'
__WARN
'
)
return
console
.
warn
(
'
Can not find `
'
+
id
+
'
`
'
)
}
return
new
MapContext
(
id
,
elm
)
}
...
...
@@ -576,11 +576,11 @@ class VideoContext {
function
createVideoContext
(
id
,
vm
)
{
if
(
!
vm
)
{
return
global
.
nativeLog
(
'
uni.createVideoContext 必须传入第二个参数,即当前 vm 对象(this)
'
,
'
__WARN
'
)
return
console
.
warn
(
'
uni.createVideoContext 必须传入第二个参数,即当前 vm 对象(this)
'
)
}
const
elm
=
findElmById
(
id
,
vm
);
if
(
!
elm
)
{
return
global
.
nativeLog
(
'
Can not find `
'
+
id
+
'
`
'
,
'
__WARN
'
)
return
console
.
warn
(
'
Can not find `
'
+
id
+
'
`
'
)
}
return
new
VideoContext
(
id
,
elm
)
}
...
...
@@ -650,11 +650,11 @@ class LivePusherContext {
function
createLivePusherContext
(
id
,
vm
)
{
if
(
!
vm
)
{
return
global
.
nativeLog
(
'
uni.createLivePusherContext 必须传入第二个参数,即当前 vm 对象(this)
'
,
'
__WARN
'
)
return
console
.
warn
(
'
uni.createLivePusherContext 必须传入第二个参数,即当前 vm 对象(this)
'
)
}
const
elm
=
findElmById
(
id
,
vm
);
if
(
!
elm
)
{
return
global
.
nativeLog
(
'
Can not find `
'
+
id
+
'
`
'
,
'
__WARN
'
)
return
console
.
warn
(
'
Can not find `
'
+
id
+
'
`
'
)
}
return
new
LivePusherContext
(
id
,
elm
)
}
...
...
packages/uni-app-plus-nvue/dist/uni.js
浏览文件 @
19a0fe58
...
...
@@ -1816,7 +1816,7 @@ function invokeCallbackHandler (invokeCallbackId, res) {
}
function
wrapperUnimplemented
(
name
)
{
return
function
(
args
)
{
return
function
unimplemented
(
args
)
{
console
.
error
(
'
API `
'
+
name
+
'
` is not yet implemented
'
);
}
}
...
...
@@ -6415,7 +6415,7 @@ function showTabBar$2 ({
var
ap
i$1
=
/*#__PURE__*/
Object
.
freeze
({
var
ap
pApi
=
/*#__PURE__*/
Object
.
freeze
({
startPullDownRefresh
:
startPullDownRefresh$1
,
stopPullDownRefresh
:
stopPullDownRefresh$1
,
chooseImage
:
chooseImage$1
,
...
...
@@ -6454,8 +6454,6 @@ var api$1 = /*#__PURE__*/Object.freeze({
startBeaconDiscovery
:
startBeaconDiscovery
,
stopBeaconDiscovery
:
stopBeaconDiscovery
,
makePhoneCall
:
makePhoneCall$1
,
SCAN_ID
:
SCAN_ID
,
SCAN_PATH
:
SCAN_PATH
,
scanCode
:
scanCode
,
getSystemInfo
:
getSystemInfo
,
vibrateLong
:
vibrateLong
,
...
...
@@ -6522,16 +6520,312 @@ var api$1 = /*#__PURE__*/Object.freeze({
showTabBar
:
showTabBar$2
});
const
api$2
=
Object
.
create
(
null
);
const
SUCCESS
=
'
success
'
;
const
FAIL
=
'
fail
'
;
const
COMPLETE
=
'
complete
'
;
const
CALLBACKS
=
[
SUCCESS
,
FAIL
,
COMPLETE
];
Object
.
assign
(
api$2
,
api
);
Object
.
assign
(
api$2
,
api$1
);
/**
* 调用无参数,或仅一个参数且为 callback 的 API
* @param {Object} vm
* @param {Object} method
* @param {Object} args
* @param {Object} extras
*/
function
invokeVmMethodWithoutArgs
(
vm
,
method
,
args
,
extras
)
{
if
(
!
vm
)
{
return
}
if
(
typeof
args
===
'
undefined
'
)
{
return
vm
[
method
]()
}
const
[,
callbacks
]
=
normalizeArgs
(
args
,
extras
);
if
(
!
Object
.
keys
(
callbacks
).
length
)
{
return
vm
[
method
]()
}
return
vm
[
method
](
normalizeCallback
(
method
,
callbacks
))
}
/**
* 调用两个参数(第一个入参为普通参数,第二个入参为 callback) API
* @param {Object} vm
* @param {Object} method
* @param {Object} args
* @param {Object} extras
*/
function
invokeVmMethod
(
vm
,
method
,
args
,
extras
)
{
if
(
!
vm
)
{
return
}
const
[
pureArgs
,
callbacks
]
=
normalizeArgs
(
args
,
extras
);
if
(
!
Object
.
keys
(
callbacks
).
length
)
{
return
vm
[
method
](
pureArgs
)
}
return
vm
[
method
](
pureArgs
,
normalizeCallback
(
method
,
callbacks
))
}
function
findElmById
(
id
,
vm
)
{
return
findElmByVNode
(
id
,
vm
.
_vnode
)
}
function
findElmByVNode
(
id
,
vnode
)
{
if
(
!
id
||
!
vnode
)
{
return
}
if
(
vnode
.
data
&&
vnode
.
data
.
attrs
&&
vnode
.
data
.
attrs
.
id
===
id
)
{
return
vnode
.
elm
}
const
children
=
vnode
.
children
;
if
(
!
children
)
{
return
}
for
(
let
i
=
0
,
len
=
children
.
length
;
i
<
len
;
i
++
)
{
const
elm
=
findElmByVNode
(
id
,
children
[
i
]);
if
(
elm
)
{
return
elm
}
}
}
function
normalizeArgs
(
args
=
{},
extras
)
{
const
callbacks
=
Object
.
create
(
null
);
const
iterator
=
function
iterator
(
name
)
{
const
callback
=
args
[
name
];
if
(
isFn
(
callback
))
{
callbacks
[
name
]
=
callback
;
delete
args
[
name
];
}
};
CALLBACKS
.
forEach
(
iterator
);
extras
&&
extras
.
forEach
(
iterator
);
return
[
args
,
callbacks
]
}
function
normalizeCallback
(
method
,
callbacks
)
{
return
function
weexCallback
(
ret
)
{
const
type
=
ret
.
type
;
delete
ret
.
type
;
const
callback
=
callbacks
[
type
];
if
(
type
===
SUCCESS
)
{
ret
.
errMsg
=
`
${
method
}
:ok`
;
}
else
if
(
type
===
FAIL
)
{
ret
.
errMsg
=
method
+
'
:fail
'
+
(
ret
.
msg
?
(
'
'
+
ret
.
msg
)
:
''
);
}
delete
ret
.
code
;
delete
ret
.
msg
;
isFn
(
callback
)
&&
callback
(
ret
);
if
(
type
===
SUCCESS
||
type
===
FAIL
)
{
const
complete
=
callbacks
[
'
complete
'
];
isFn
(
complete
)
&&
complete
(
ret
);
}
}
}
class
LivePusherContext
{
constructor
(
id
,
ctx
)
{
this
.
id
=
id
;
this
.
ctx
=
ctx
;
}
start
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
start
'
,
cbs
)
}
stop
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
stop
'
,
cbs
)
}
pause
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
pause
'
,
cbs
)
}
resume
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
resume
'
,
cbs
)
}
switchCamera
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
switchCamera
'
,
cbs
)
}
snapshot
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
snapshot
'
,
cbs
)
}
toggleTorch
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
toggleTorch
'
,
cbs
)
}
playBGM
(
args
)
{
return
invokeVmMethod
(
this
.
ctx
,
'
playBGM
'
,
args
)
}
stopBGM
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
stopBGM
'
,
cbs
)
}
pauseBGM
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
pauseBGM
'
,
cbs
)
}
resumeBGM
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
resumeBGM
'
,
cbs
)
}
setBGMVolume
(
cbs
)
{
return
invokeVmMethod
(
this
.
ctx
,
'
setBGMVolume
'
,
cbs
)
}
startPreview
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
startPreview
'
,
cbs
)
}
stopPreview
(
args
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
stopPreview
'
,
args
)
}
}
function
createLivePusherContext
(
id
,
vm
)
{
if
(
!
vm
)
{
return
console
.
warn
(
'
uni.createLivePusherContext 必须传入第二个参数,即当前 vm 对象(this)
'
)
}
const
elm
=
findElmById
(
id
,
vm
);
if
(
!
elm
)
{
return
console
.
warn
(
'
Can not find `
'
+
id
+
'
`
'
)
}
return
new
LivePusherContext
(
id
,
elm
)
}
class
MapContext
{
constructor
(
id
,
ctx
)
{
this
.
id
=
id
;
this
.
ctx
=
ctx
;
}
getCenterLocation
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
getCenterLocation
'
,
cbs
)
}
moveToLocation
()
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
moveToLocation
'
)
}
translateMarker
(
args
)
{
return
invokeVmMethod
(
this
.
ctx
,
'
translateMarker
'
,
args
,
[
'
animationEnd
'
])
}
includePoints
(
args
)
{
return
invokeVmMethod
(
this
.
ctx
,
'
includePoints
'
,
args
)
}
getRegion
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
getRegion
'
,
cbs
)
}
getScale
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
getScale
'
,
cbs
)
}
}
function
createMapContext$1
(
id
,
vm
)
{
if
(
!
vm
)
{
return
console
.
warn
(
'
uni.createMapContext 必须传入第二个参数,即当前 vm 对象(this)
'
)
}
const
elm
=
findElmById
(
id
,
vm
);
if
(
!
elm
)
{
return
console
.
warn
(
'
Can not find `
'
+
id
+
'
`
'
)
}
return
new
MapContext
(
id
,
elm
)
}
class
VideoContext
{
constructor
(
id
,
ctx
)
{
this
.
id
=
id
;
this
.
ctx
=
ctx
;
}
play
()
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
play
'
)
}
pause
()
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
pause
'
)
}
seek
(
args
)
{
return
invokeVmMethod
(
this
.
ctx
,
'
seek
'
,
args
)
}
stop
()
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
stop
'
)
}
sendDanmu
(
args
)
{
return
invokeVmMethod
(
this
.
ctx
,
'
sendDanmu
'
,
args
)
}
playbackRate
(
args
)
{
return
invokeVmMethod
(
this
.
ctx
,
'
playbackRate
'
,
args
)
}
requestFullScreen
(
args
)
{
return
invokeVmMethod
(
this
.
ctx
,
'
requestFullScreen
'
,
args
)
}
exitFullScreen
()
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
exitFullScreen
'
)
}
showStatusBar
()
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
showStatusBar
'
)
}
hideStatusBar
()
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
hideStatusBar
'
)
}
}
function
createVideoContext$1
(
id
,
vm
)
{
if
(
!
vm
)
{
return
console
.
warn
(
'
uni.createVideoContext 必须传入第二个参数,即当前 vm 对象(this)
'
)
}
const
elm
=
findElmById
(
id
,
vm
);
if
(
!
elm
)
{
return
console
.
warn
(
'
Can not find `
'
+
id
+
'
`
'
)
}
return
new
VideoContext
(
id
,
elm
)
}
var
nvueApi
=
/*#__PURE__*/
Object
.
freeze
({
createLivePusherContext
:
createLivePusherContext
,
createMapContext
:
createMapContext$1
,
createVideoContext
:
createVideoContext$1
});
var
platformApi
=
Object
.
assign
({},
appApi
,
nvueApi
);
const
api$1
=
Object
.
create
(
null
);
Object
.
assign
(
api$1
,
api
);
Object
.
assign
(
api$1
,
platformApi
);
const
uni$1
=
Object
.
create
(
null
);
apis
.
forEach
(
name
=>
{
if
(
api$
2
[
name
])
{
uni$1
[
name
]
=
promisify
(
name
,
wrapper
(
name
,
api$
2
[
name
]));
if
(
api$
1
[
name
])
{
uni$1
[
name
]
=
promisify
(
name
,
wrapper
(
name
,
api$
1
[
name
]));
}
else
{
uni$1
[
name
]
=
wrapperUnimplemented
(
name
);
}
...
...
src/core/helpers/api.js
浏览文件 @
19a0fe58
...
...
@@ -234,7 +234,7 @@ export function invokeCallbackHandler (invokeCallbackId, res) {
}
export
function
wrapperUnimplemented
(
name
)
{
return
function
(
args
)
{
return
function
unimplemented
(
args
)
{
console
.
error
(
'
API `
'
+
name
+
'
` is not yet implemented
'
)
}
}
...
...
src/platforms/app-plus-nvue/service/api.js
浏览文件 @
19a0fe58
import
*
as
appApi
from
'
../../app-plus/service/api/index
'
import
*
as
nvueApi
from
'
./api/index
'
export
default
Object
.
assign
(
appApi
,
nvueApi
)
export
default
Object
.
assign
(
{},
appApi
,
nvueApi
)
src/platforms/app-plus-nvue/service/api/context/live-pusher.js
浏览文件 @
19a0fe58
...
...
@@ -69,11 +69,11 @@ class LivePusherContext {
export
function
createLivePusherContext
(
id
,
vm
)
{
if
(
!
vm
)
{
return
global
.
nativeLog
(
'
uni.createLivePusherContext 必须传入第二个参数,即当前 vm 对象(this)
'
,
'
__WARN
'
)
return
console
.
warn
(
'
uni.createLivePusherContext 必须传入第二个参数,即当前 vm 对象(this)
'
)
}
const
elm
=
findElmById
(
id
,
vm
)
if
(
!
elm
)
{
return
global
.
nativeLog
(
'
Can not find `
'
+
id
+
'
`
'
,
'
__WARN
'
)
return
console
.
warn
(
'
Can not find `
'
+
id
+
'
`
'
)
}
return
new
LivePusherContext
(
id
,
elm
)
}
src/platforms/app-plus-nvue/service/api/context/map.js
浏览文件 @
19a0fe58
...
...
@@ -37,11 +37,11 @@ class MapContext {
export
function
createMapContext
(
id
,
vm
)
{
if
(
!
vm
)
{
return
global
.
nativeLog
(
'
uni.createMapContext 必须传入第二个参数,即当前 vm 对象(this)
'
,
'
__WARN
'
)
return
console
.
warn
(
'
uni.createMapContext 必须传入第二个参数,即当前 vm 对象(this)
'
)
}
const
elm
=
findElmById
(
id
,
vm
)
if
(
!
elm
)
{
return
global
.
nativeLog
(
'
Can not find `
'
+
id
+
'
`
'
,
'
__WARN
'
)
return
console
.
warn
(
'
Can not find `
'
+
id
+
'
`
'
)
}
return
new
MapContext
(
id
,
elm
)
}
src/platforms/app-plus-nvue/service/api/context/video.js
浏览文件 @
19a0fe58
...
...
@@ -53,11 +53,11 @@ class VideoContext {
export
function
createVideoContext
(
id
,
vm
)
{
if
(
!
vm
)
{
return
global
.
nativeLog
(
'
uni.createVideoContext 必须传入第二个参数,即当前 vm 对象(this)
'
,
'
__WARN
'
)
return
console
.
warn
(
'
uni.createVideoContext 必须传入第二个参数,即当前 vm 对象(this)
'
)
}
const
elm
=
findElmById
(
id
,
vm
)
if
(
!
elm
)
{
return
global
.
nativeLog
(
'
Can not find `
'
+
id
+
'
`
'
,
'
__WARN
'
)
return
console
.
warn
(
'
Can not find `
'
+
id
+
'
`
'
)
}
return
new
VideoContext
(
id
,
elm
)
}
src/platforms/app-plus/service/api/device/scan-code.js
浏览文件 @
19a0fe58
...
...
@@ -15,8 +15,8 @@ import {
registerPlusMessage
}
from
'
../../framework/plus-message
'
export
const
SCAN_ID
=
'
__UNIAPP_SCAN
'
export
const
SCAN_PATH
=
'
_www/__uniappscan.html
'
const
SCAN_ID
=
'
__UNIAPP_SCAN
'
const
SCAN_PATH
=
'
_www/__uniappscan.html
'
const
MESSAGE_TYPE
=
'
scanCode
'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录