Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wychl
uni-app
提交
f7ce3bf8
U
uni-app
项目概览
wychl
/
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,发现更多精彩内容 >>
提交
f7ce3bf8
编写于
7月 23, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format
上级
c73a82c1
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
65 addition
and
55 deletion
+65
-55
package.json
package.json
+0
-1
src/platforms/app-plus-nvue/services/api/context/live-pusher.js
...atforms/app-plus-nvue/services/api/context/live-pusher.js
+16
-16
src/platforms/app-plus-nvue/services/api/context/map.js
src/platforms/app-plus-nvue/services/api/context/map.js
+8
-8
src/platforms/app-plus-nvue/services/api/context/video.js
src/platforms/app-plus-nvue/services/api/context/video.js
+12
-12
src/platforms/app-plus-nvue/services/api/util.js
src/platforms/app-plus-nvue/services/api/util.js
+9
-9
src/platforms/app-plus/service/api/device/clipboard.js
src/platforms/app-plus/service/api/device/clipboard.js
+5
-4
src/platforms/app-plus/service/api/network/socket.js
src/platforms/app-plus/service/api/network/socket.js
+6
-4
src/platforms/app-plus/service/bridge.js
src/platforms/app-plus/service/bridge.js
+9
-1
未找到文件。
package.json
浏览文件 @
f7ce3bf8
...
...
@@ -83,7 +83,6 @@
"wx"
:
true
,
"my"
:
true
,
"swan"
:
true
,
"weex"
:
true
,
"__id__"
:
true
,
"__uniConfig"
:
true
,
"__uniRoutes"
:
true
,
...
...
src/platforms/app-plus-nvue/services/api/context/live-pusher.js
浏览文件 @
f7ce3bf8
...
...
@@ -5,69 +5,69 @@ import {
}
from
'
../util
'
class
LivePusherContext
{
constructor
(
id
,
ctx
)
{
constructor
(
id
,
ctx
)
{
this
.
id
=
id
this
.
ctx
=
ctx
}
start
(
cbs
)
{
start
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
start
'
,
cbs
)
}
stop
(
cbs
)
{
stop
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
stop
'
,
cbs
)
}
pause
(
cbs
)
{
pause
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
pause
'
,
cbs
)
}
resume
(
cbs
)
{
resume
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
resume
'
,
cbs
)
}
switchCamera
(
cbs
)
{
switchCamera
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
switchCamera
'
,
cbs
)
}
snapshot
(
cbs
)
{
snapshot
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
snapshot
'
,
cbs
)
}
toggleTorch
(
cbs
)
{
toggleTorch
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
toggleTorch
'
,
cbs
)
}
playBGM
(
args
)
{
playBGM
(
args
)
{
return
invokeVmMethod
(
this
.
ctx
,
'
playBGM
'
,
args
)
}
stopBGM
(
cbs
)
{
stopBGM
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
stopBGM
'
,
cbs
)
}
pauseBGM
(
cbs
)
{
pauseBGM
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
pauseBGM
'
,
cbs
)
}
resumeBGM
(
cbs
)
{
resumeBGM
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
resumeBGM
'
,
cbs
)
}
setBGMVolume
(
cbs
)
{
setBGMVolume
(
cbs
)
{
return
invokeVmMethod
(
this
.
ctx
,
'
setBGMVolume
'
,
cbs
)
}
startPreview
(
cbs
)
{
startPreview
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
startPreview
'
,
cbs
)
}
stopPreview
(
args
)
{
stopPreview
(
args
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
stopPreview
'
,
args
)
}
}
export
function
createLivePusherContext
(
id
,
vm
)
{
export
function
createLivePusherContext
(
id
,
vm
)
{
if
(
!
vm
)
{
global
.
nativeLog
(
'
uni.createLivePusherContext 必须传入第二个参数,即当前 vm 对象(this)
'
,
'
__WARN
'
)
}
...
...
src/platforms/app-plus-nvue/services/api/context/map.js
浏览文件 @
f7ce3bf8
...
...
@@ -5,37 +5,37 @@ import {
}
from
'
../util
'
class
MapContext
{
constructor
(
id
,
ctx
)
{
constructor
(
id
,
ctx
)
{
this
.
id
=
id
this
.
ctx
=
ctx
}
getCenterLocation
(
cbs
)
{
getCenterLocation
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
getCenterLocation
'
,
cbs
)
}
moveToLocation
()
{
moveToLocation
()
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
moveToLocation
'
)
}
translateMarker
(
args
)
{
translateMarker
(
args
)
{
return
invokeVmMethod
(
this
.
ctx
,
'
translateMarker
'
,
args
,
[
'
animationEnd
'
])
}
includePoints
(
args
)
{
includePoints
(
args
)
{
return
invokeVmMethod
(
this
.
ctx
,
'
includePoints
'
,
args
)
}
getRegion
(
cbs
)
{
getRegion
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
getRegion
'
,
cbs
)
}
getScale
(
cbs
)
{
getScale
(
cbs
)
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
getScale
'
,
cbs
)
}
}
export
function
createMapContext
(
id
,
vm
)
{
export
function
createMapContext
(
id
,
vm
)
{
if
(
!
vm
)
{
global
.
nativeLog
(
'
uni.createMapContext 必须传入第二个参数,即当前 vm 对象(this)
'
,
'
__WARN
'
)
}
...
...
src/platforms/app-plus-nvue/services/api/context/video.js
浏览文件 @
f7ce3bf8
...
...
@@ -5,53 +5,53 @@ import {
}
from
'
../util
'
class
VideoContext
{
constructor
(
id
,
ctx
)
{
constructor
(
id
,
ctx
)
{
this
.
id
=
id
this
.
ctx
=
ctx
}
play
()
{
play
()
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
play
'
)
}
pause
()
{
pause
()
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
pause
'
)
}
seek
(
args
)
{
seek
(
args
)
{
return
invokeVmMethod
(
this
.
ctx
,
'
seek
'
,
args
)
}
stop
()
{
stop
()
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
stop
'
)
}
sendDanmu
(
args
)
{
sendDanmu
(
args
)
{
return
invokeVmMethod
(
this
.
ctx
,
'
sendDanmu
'
,
args
)
}
playbackRate
(
args
)
{
playbackRate
(
args
)
{
return
invokeVmMethod
(
this
.
ctx
,
'
playbackRate
'
,
args
)
}
requestFullScreen
(
args
)
{
requestFullScreen
(
args
)
{
return
invokeVmMethod
(
this
.
ctx
,
'
requestFullScreen
'
,
args
)
}
exitFullScreen
()
{
exitFullScreen
()
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
exitFullScreen
'
)
}
showStatusBar
()
{
showStatusBar
()
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
showStatusBar
'
)
}
hideStatusBar
()
{
hideStatusBar
()
{
return
invokeVmMethodWithoutArgs
(
this
.
ctx
,
'
hideStatusBar
'
)
}
}
export
function
createVideoContext
(
id
,
vm
)
{
export
function
createVideoContext
(
id
,
vm
)
{
if
(
!
vm
)
{
global
.
nativeLog
(
'
uni.createVideoContext 必须传入第二个参数,即当前 vm 对象(this)
'
,
'
__WARN
'
)
}
...
...
src/platforms/app-plus-nvue/services/api/util.js
浏览文件 @
f7ce3bf8
...
...
@@ -9,7 +9,7 @@ const CALLBACKS = [SUCCESS, FAIL, COMPLETE]
export
const
UNIAPP_SERVICE_NVUE_ID
=
'
__uniapp__service
'
export
function
noop
()
{
export
function
noop
()
{
}
/**
...
...
@@ -19,7 +19,7 @@ export function noop() {
* @param {Object} args
* @param {Object} extras
*/
export
function
invokeVmMethodWithoutArgs
(
vm
,
method
,
args
,
extras
)
{
export
function
invokeVmMethodWithoutArgs
(
vm
,
method
,
args
,
extras
)
{
if
(
!
vm
)
{
return
}
...
...
@@ -39,7 +39,7 @@ export function invokeVmMethodWithoutArgs(vm, method, args, extras) {
* @param {Object} args
* @param {Object} extras
*/
export
function
invokeVmMethod
(
vm
,
method
,
args
,
extras
)
{
export
function
invokeVmMethod
(
vm
,
method
,
args
,
extras
)
{
if
(
!
vm
)
{
return
}
...
...
@@ -50,11 +50,11 @@ export function invokeVmMethod(vm, method, args, extras) {
return
vm
[
method
](
pureArgs
,
normalizeCallback
(
method
,
callbacks
))
}
export
function
findElmById
(
id
,
vm
)
{
export
function
findElmById
(
id
,
vm
)
{
return
findElmByVNode
(
id
,
vm
.
_vnode
)
}
function
findElmByVNode
(
id
,
vnode
)
{
function
findElmByVNode
(
id
,
vnode
)
{
if
(
!
id
||
!
vnode
)
{
return
}
...
...
@@ -77,10 +77,10 @@ function findElmByVNode(id, vnode) {
}
}
function
normalizeArgs
(
args
=
{},
extras
)
{
function
normalizeArgs
(
args
=
{},
extras
)
{
const
callbacks
=
Object
.
create
(
null
)
const
iterator
=
function
iterator
(
name
)
{
const
iterator
=
function
iterator
(
name
)
{
const
callback
=
args
[
name
]
if
(
isFn
(
callback
))
{
callbacks
[
name
]
=
callback
...
...
@@ -95,8 +95,8 @@ function normalizeArgs(args = {}, extras) {
return
[
args
,
callbacks
]
}
function
normalizeCallback
(
method
,
callbacks
)
{
return
function
weexCallback
(
ret
)
{
function
normalizeCallback
(
method
,
callbacks
)
{
return
function
weexCallback
(
ret
)
{
const
type
=
ret
.
type
delete
ret
.
type
const
callback
=
callbacks
[
type
]
...
...
src/platforms/app-plus/service/api/device/clipboard.js
浏览文件 @
f7ce3bf8
import
{
invoke
invoke
,
requireNativePlugin
}
from
'
../../bridge
'
export
function
getClipboardData
(
options
,
callbackId
)
{
const
clipboard
=
weex
.
requireModule
(
'
clipboard
'
)
const
clipboard
=
requireNativePlugin
(
'
clipboard
'
)
clipboard
.
getString
(
ret
=>
{
if
(
ret
.
result
===
'
success
'
)
{
invoke
(
callbackId
,
{
...
...
@@ -22,7 +23,7 @@ export function getClipboardData (options, callbackId) {
export
function
setClipboardData
({
data
})
{
const
clipboard
=
weex
.
requireModule
(
'
clipboard
'
)
const
clipboard
=
requireNativePlugin
(
'
clipboard
'
)
clipboard
.
setString
(
data
)
return
{
errMsg
:
'
setClipboardData:ok
'
...
...
src/platforms/app-plus/service/api/network/socket.js
浏览文件 @
f7ce3bf8
import
{
publish
unpack
,
publish
,
requireNativePlugin
}
from
'
../../bridge
'
let
socketTaskId
=
0
...
...
@@ -17,7 +19,7 @@ const createSocketTaskById = function (socketTaskId, {
protocols
}
=
{})
{
// fixed by hxy 需要测试是否支持 arraybuffer
const
socket
=
weex
.
requireModule
(
'
webSocket
'
)
const
socket
=
requireNativePlugin
(
'
webSocket
'
)
socket
.
WebSocket
(
url
,
Array
.
isArray
(
protocols
)
?
protocols
.
join
(
'
,
'
)
:
protocols
)
// socket.binaryType = 'arraybuffer'
socketTasks
[
socketTaskId
]
=
socket
...
...
@@ -65,7 +67,7 @@ export function operateSocketTask (args) {
code
,
data
,
socketTaskId
}
=
PlusNativeBuffer
.
unpack
(
args
)
}
=
unpack
(
args
)
const
socket
=
socketTasks
[
socketTaskId
]
if
(
!
socket
)
{
return
{
...
...
src/platforms/app-plus/service/bridge.js
浏览文件 @
f7ce3bf8
export
function
requireNativePlugin
(
name
)
{
return
uni
.
requireNativePlugin
(
name
)
}
export
function
unpack
(
args
)
{
return
args
}
export
function
invoke
(...
args
)
{
return
UniServiceJSBridge
.
invoke
(...
args
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录