Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
e26586eb
U
uni-app
项目概览
DCloud
/
uni-app
2 个月 前同步成功
通知
717
Star
38705
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e26586eb
编写于
8月 01, 2019
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'nvue-dev' of github.com:dcloudio/uni-app into nvue-dev
上级
5c22e914
8323c9a1
变更
12
展开全部
隐藏空白更改
内联
并排
Showing
12 changed file
with
1653 addition
and
940 deletion
+1653
-940
build/manifest.js
build/manifest.js
+2
-1
build/rollup.config.app.js
build/rollup.config.app.js
+5
-3
lib/apis.js
lib/apis.js
+0
-1
lib/modules.json
lib/modules.json
+208
-0
packages/uni-app-plus-nvue/dist/index.js
packages/uni-app-plus-nvue/dist/index.js
+1335
-844
packages/uni-app-plus-nvue/dist/index.legacy.js
packages/uni-app-plus-nvue/dist/index.legacy.js
+7
-11
packages/uni-h5/dist/index.umd.min.js
packages/uni-h5/dist/index.umd.min.js
+1
-1
packages/uni-h5/manifest.json
packages/uni-h5/manifest.json
+16
-0
src/core/service/api/media/recorder.js
src/core/service/api/media/recorder.js
+75
-75
src/platforms/app-plus-nvue/service/api/route/switch-tab.js
src/platforms/app-plus-nvue/service/api/route/switch-tab.js
+0
-2
src/platforms/app-plus/service/framework/app.js
src/platforms/app-plus/service/framework/app.js
+3
-1
src/platforms/app-plus/service/framework/plus-message.js
src/platforms/app-plus/service/framework/plus-message.js
+1
-1
未找到文件。
build/manifest.js
浏览文件 @
e26586eb
...
...
@@ -76,7 +76,8 @@ function parseApiManifestDeps (manifest, protocol) {
if
(
manifest
[
dep
[
1
]])
{
dep
[
0
]
=
manifest
[
dep
[
1
]][
0
]
}
else
{
console
.
error
(
`依赖模块[
${
dep
[
1
]}
]不存在`
)
console
.
error
(
`依赖模块[
${
dep
[
1
]}
]不存在,删除
${
name
}
接口\n`
)
delete
manifest
[
name
]
}
})
}
...
...
build/rollup.config.app.js
浏览文件 @
e26586eb
...
...
@@ -23,10 +23,12 @@ if (process.env.UNI_SERVICE === 'legacy') {
output
.
format
=
'
iife
'
output
.
name
=
'
serviceContext
'
output
.
banner
=
`export function createServiceContext(Vue, weex, plus, __uniConfig, __uniRoutes, UniServiceJSBridge){
`export function createServiceContext(Vue, weex, plus, __uniConfig, __uniRoutes, UniServiceJSBridge
,instanceContext
){
var localStorage = plus.storage
var setTimeout = global.setTimeout
var clearTimeout = global.clearTimeout
var setTimeout = instanceContext.setTimeout
var clearTimeout = instanceContext.clearTimeout
var setInterval = instanceContext.setInterval
var clearInterval = instanceContext.clearInterval
`
output
.
footer
=
`
...
...
lib/apis.js
浏览文件 @
e26586eb
...
...
@@ -52,7 +52,6 @@ const media = [
'
getImageInfo
'
,
'
saveImageToPhotosAlbum
'
,
'
compressImage
'
,
'
chooseMessageFile
'
,
'
getRecorderManager
'
,
'
getBackgroundAudioManager
'
,
'
createInnerAudioContext
'
,
...
...
lib/modules.json
0 → 100644
浏览文件 @
e26586eb
[{
"name"
:
"base"
,
"title"
:
"基础"
,
"apiList"
:
{
"uni.getSystemInfo"
:
true
,
"uni.getSystemInfoSync"
:
true
,
"uni.canIUse"
:
true
,
"uni.upx2px"
:
true
,
"uni.navigateTo"
:
true
,
"uni.redirectTo"
:
true
,
"uni.switchTab"
:
true
,
"uni.reLaunch"
:
true
,
"uni.navigateBack"
:
true
}
},
{
"name"
:
"network"
,
"title"
:
"网络"
,
"apiList"
:
{
"uni.request"
:
true
,
"uni.connectSocket"
:
true
,
"uni.sendSocketMessage"
:
true
,
"uni.closeSocket"
:
true
,
"uni.onSocketOpen"
:
true
,
"uni.onSocketError"
:
true
,
"uni.onSocketMessage"
:
true
,
"uni.onSocketClose"
:
true
,
"uni.downloadFile"
:
true
,
"uni.uploadFile"
:
true
}
},
{
"name"
:
"storage"
,
"title"
:
"数据缓存"
,
"apiList"
:
{
"uni.setStorage"
:
true
,
"uni.setStorageSync"
:
true
,
"uni.getStorage"
:
true
,
"uni.getStorageSync"
:
true
,
"uni.removeStorage"
:
true
,
"uni.removeStorageSync"
:
true
,
"uni.clearStorage"
:
true
,
"uni.clearStorageSync"
:
true
,
"uni.getStorageInfo"
:
true
,
"uni.getStorageInfoSync"
:
true
}
},
{
"name"
:
"location"
,
"title"
:
"位置"
,
"apiList"
:
{
"uni.getLocation"
:
true
,
"uni.openLocation"
:
true
,
"uni.chooseLocation"
:
true
}
},
{
"name"
:
"media"
,
"title"
:
"媒体"
,
"apiList"
:
{
"uni.chooseImage"
:
true
,
"uni.previewImage"
:
true
,
"uni.getImageInfo"
:
true
,
"uni.saveImageToPhotosAlbum"
:
true
,
"uni.compressImage"
:
true
,
"uni.getRecorderManager"
:
true
,
"uni.getBackgroundAudioManager"
:
true
,
"uni.createInnerAudioContext"
:
true
,
"uni.chooseVideo"
:
true
,
"uni.saveVideoToPhotosAlbum"
:
true
,
"uni.createVideoContext"
:
true
,
"uni.createCameraContext"
:
true
,
"uni.createLivePlayerContext"
:
true
}
},
{
"name"
:
"device"
,
"title"
:
"设备"
,
"apiList"
:
{
"uni.onMemoryWarning"
:
true
,
"uni.getNetworkType"
:
true
,
"uni.onNetworkStatusChange"
:
true
,
"uni.onAccelerometerChange"
:
true
,
"uni.startAccelerometer"
:
true
,
"uni.stopAccelerometer"
:
true
,
"uni.onCompassChange"
:
true
,
"uni.startCompass"
:
true
,
"uni.stopCompass"
:
true
,
"uni.onGyroscopeChange"
:
true
,
"uni.startGyroscope"
:
true
,
"uni.stopGyroscope"
:
true
,
"uni.makePhoneCall"
:
true
,
"uni.scanCode"
:
true
,
"uni.setClipboardData"
:
true
,
"uni.getClipboardData"
:
true
,
"uni.setScreenBrightness"
:
true
,
"uni.getScreenBrightness"
:
true
,
"uni.setKeepScreenOn"
:
true
,
"uni.onUserCaptureScreen"
:
true
,
"uni.vibrateLong"
:
true
,
"uni.vibrateShort"
:
true
,
"uni.addPhoneContact"
:
true
,
"uni.openBluetoothAdapter"
:
true
,
"uni.startBluetoothDevicesDiscovery"
:
true
,
"uni.onBluetoothDeviceFound"
:
true
,
"uni.stopBluetoothDevicesDiscovery"
:
true
,
"uni.onBluetoothAdapterStateChange"
:
true
,
"uni.getConnectedBluetoothDevices"
:
true
,
"uni.getBluetoothDevices"
:
true
,
"uni.getBluetoothAdapterState"
:
true
,
"uni.closeBluetoothAdapter"
:
true
,
"uni.writeBLECharacteristicValue"
:
true
,
"uni.readBLECharacteristicValue"
:
true
,
"uni.onBLEConnectionStateChange"
:
true
,
"uni.onBLECharacteristicValueChange"
:
true
,
"uni.notifyBLECharacteristicValueChange"
:
true
,
"uni.getBLEDeviceServices"
:
true
,
"uni.getBLEDeviceCharacteristics"
:
true
,
"uni.createBLEConnection"
:
true
,
"uni.closeBLEConnection"
:
true
,
"uni.onBeaconServiceChange"
:
true
,
"uni.onBeaconUpdate"
:
true
,
"uni.getBeacons"
:
true
,
"uni.startBeaconDiscovery"
:
true
,
"uni.stopBeaconDiscovery"
:
true
}
},
{
"name"
:
"ui"
,
"title"
:
"界面"
,
"apiList"
:
{
"uni.showToast"
:
true
,
"uni.hideToast"
:
true
,
"uni.showLoading"
:
true
,
"uni.hideLoading"
:
true
,
"uni.showModal"
:
true
,
"uni.showActionSheet"
:
true
,
"uni.setNavigationBarTitle"
:
true
,
"uni.setNavigationBarColor"
:
true
,
"uni.showNavigationBarLoading"
:
true
,
"uni.hideNavigationBarLoading"
:
true
,
"uni.setTabBarItem"
:
true
,
"uni.setTabBarStyle"
:
true
,
"uni.hideTabBar"
:
true
,
"uni.showTabBar"
:
true
,
"uni.setTabBarBadge"
:
true
,
"uni.removeTabBarBadge"
:
true
,
"uni.showTabBarRedDot"
:
true
,
"uni.hideTabBarRedDot"
:
true
,
"uni.setBackgroundColor"
:
true
,
"uni.setBackgroundTextStyle"
:
true
,
"uni.createAnimation"
:
true
,
"uni.pageScrollTo"
:
true
,
"uni.onWindowResize"
:
true
,
"uni.offWindowResize"
:
true
,
"uni.loadFontFace"
:
true
,
"uni.startPullDownRefresh"
:
true
,
"uni.stopPullDownRefresh"
:
true
,
"uni.createSelectorQuery"
:
true
,
"uni.createIntersectionObserver"
:
true
,
"uni.hideKeyboard"
:
true
}
},
{
"name"
:
"event"
,
"title"
:
"页面通讯"
,
"apiList"
:
{
"uni.$emit"
:
true
,
"uni.$on"
:
true
,
"uni.$once"
:
true
,
"uni.$off"
:
true
}
},
{
"name"
:
"file"
,
"title"
:
"文件"
,
"apiList"
:
{
"uni.saveFile"
:
true
,
"uni.getSavedFileList"
:
true
,
"uni.getSavedFileInfo"
:
true
,
"uni.removeSavedFile"
:
true
,
"uni.getFileInfo"
:
true
,
"uni.openDocument"
:
true
,
"uni.getFileSystemManager"
:
true
}
},
{
"name"
:
"canvas"
,
"title"
:
"绘画"
,
"apiList"
:
{
"uni.createOffscreenCanvas"
:
true
,
"uni.createCanvasContext"
:
true
,
"uni.canvasToTempFilePath"
:
true
,
"uni.canvasPutImageData"
:
true
,
"uni.canvasGetImageData"
:
true
}
},
{
"name"
:
"third"
,
"title"
:
"第三方服务"
,
"apiList"
:
{
"uni.getProvider"
:
true
,
"uni.login"
:
true
,
"uni.checkSession"
:
true
,
"uni.getUserInfo"
:
true
,
"uni.share"
:
true
,
"uni.showShareMenu"
:
true
,
"uni.hideShareMenu"
:
true
,
"uni.requestPayment"
:
true
,
"uni.subscribePush"
:
true
,
"uni.unsubscribePush"
:
true
,
"uni.onPush"
:
true
,
"uni.offPush"
:
true
,
"uni.requireNativePlugin"
:
true
,
"uni.base64ToArrayBuffer"
:
true
,
"uni.arrayBufferToBase64"
:
true
}
}]
packages/uni-app-plus-nvue/dist/index.js
浏览文件 @
e26586eb
此差异已折叠。
点击以展开。
packages/uni-app-plus-nvue/dist/index.legacy.js
浏览文件 @
e26586eb
...
...
@@ -429,26 +429,22 @@ function invokeVmMethod (vm, method, args, extras) {
}
function
findElmById
(
id
,
vm
)
{
return
find
ElmByVNode
(
id
,
vm
.
_vnode
)
return
find
RefByElm
(
id
,
vm
.
$el
)
}
function
find
ElmByVNode
(
id
,
vnode
)
{
if
(
!
id
||
!
vnode
)
{
function
find
RefByElm
(
id
,
elm
)
{
if
(
!
id
||
!
elm
)
{
return
}
if
(
vnode
.
data
&&
vnode
.
data
.
attrs
&&
vnode
.
data
.
attrs
.
id
===
id
)
{
return
vnode
.
elm
if
(
elm
.
attr
.
id
===
id
)
{
return
elm
}
const
children
=
vnode
.
children
;
const
children
=
elm
.
children
;
if
(
!
children
)
{
return
}
for
(
let
i
=
0
,
len
=
children
.
length
;
i
<
len
;
i
++
)
{
const
elm
=
find
ElmByVNode
(
id
,
children
[
i
]);
const
elm
=
find
RefByElm
(
id
,
children
[
i
]);
if
(
elm
)
{
return
elm
}
...
...
packages/uni-h5/dist/index.umd.min.js
浏览文件 @
e26586eb
此差异已折叠。
点击以展开。
packages/uni-h5/manifest.json
浏览文件 @
e26586eb
...
...
@@ -406,6 +406,22 @@
"/platforms/h5/service/api/device/vibrate.js"
,
[]
],
"onBluetoothDeviceFound"
:
[
"/core/service/api/device/bluetooth.js"
,
[]
],
"onBluetoothAdapterStateChange"
:
[
"/core/service/api/device/bluetooth.js"
,
[]
],
"onBLEConnectionStateChange"
:
[
"/core/service/api/device/bluetooth.js"
,
[]
],
"onBLECharacteristicValueChange"
:
[
"/core/service/api/device/bluetooth.js"
,
[]
],
"hideKeyboard"
:
[
"/platforms/h5/service/api/device/hide-keyboard.js"
,
[]
...
...
src/core/service/api/media/recorder.js
浏览文件 @
e26586eb
import
{
onMethod
,
invokeMethod
}
from
'
../../platform
'
const
callbacks
=
{
pause
:
[],
resume
:
[],
start
:
[],
stop
:
[]
}
class
RecorderManager
{
constructor
()
{
onMethod
(
'
onRecorderStateChange
'
,
res
=>
{
const
state
=
res
.
state
delete
res
.
state
delete
res
.
errMsg
callbacks
[
state
].
forEach
(
callback
=>
{
if
(
typeof
callback
===
'
function
'
)
{
callback
(
res
)
}
})
})
}
onError
(
callback
)
{
callbacks
.
error
.
push
(
callback
)
}
onFrameRecorded
(
callback
)
{
}
onInterruptionBegin
(
callback
)
{
}
onInterruptionEnd
(
callback
)
{
}
onPause
(
callback
)
{
callbacks
.
pause
.
push
(
callback
)
}
onResume
(
callback
)
{
callbacks
.
resume
.
push
(
callback
)
}
onStart
(
callback
)
{
callbacks
.
start
.
push
(
callback
)
}
onStop
(
callback
)
{
callbacks
.
stop
.
push
(
callback
)
}
pause
()
{
invokeMethod
(
'
operateRecorder
'
,
{
operationType
:
'
pause
'
})
}
resume
()
{
invokeMethod
(
'
operateRecorder
'
,
{
operationType
:
'
resume
'
})
}
start
(
options
)
{
invokeMethod
(
'
operateRecorder
'
,
Object
.
assign
({},
options
,
{
operationType
:
'
start
'
}))
}
stop
()
{
invokeMethod
(
'
operateRecorder
'
,
{
operationType
:
'
stop
'
})
}
}
let
recorderManager
export
function
getRecorderManager
()
{
return
recorderManager
||
(
recorderManager
=
new
RecorderManager
())
import
{
onMethod
,
invokeMethod
}
from
'
../../platform
'
const
callbacks
=
{
pause
:
[],
resume
:
[],
start
:
[],
stop
:
[]
}
class
RecorderManager
{
constructor
()
{
onMethod
(
'
onRecorderStateChange
'
,
res
=>
{
const
state
=
res
.
state
delete
res
.
state
delete
res
.
errMsg
callbacks
[
state
].
forEach
(
callback
=>
{
if
(
typeof
callback
===
'
function
'
)
{
callback
(
res
)
}
})
})
}
onError
(
callback
)
{
callbacks
.
error
.
push
(
callback
)
}
onFrameRecorded
(
callback
)
{
}
onInterruptionBegin
(
callback
)
{
}
onInterruptionEnd
(
callback
)
{
}
onPause
(
callback
)
{
callbacks
.
pause
.
push
(
callback
)
}
onResume
(
callback
)
{
callbacks
.
resume
.
push
(
callback
)
}
onStart
(
callback
)
{
callbacks
.
start
.
push
(
callback
)
}
onStop
(
callback
)
{
callbacks
.
stop
.
push
(
callback
)
}
pause
()
{
invokeMethod
(
'
operateRecorder
'
,
{
operationType
:
'
pause
'
})
}
resume
()
{
invokeMethod
(
'
operateRecorder
'
,
{
operationType
:
'
resume
'
})
}
start
(
options
)
{
invokeMethod
(
'
operateRecorder
'
,
Object
.
assign
({},
options
,
{
operationType
:
'
start
'
}))
}
stop
()
{
invokeMethod
(
'
operateRecorder
'
,
{
operationType
:
'
stop
'
})
}
}
let
recorderManager
export
function
getRecorderManager
()
{
return
recorderManager
||
(
recorderManager
=
new
RecorderManager
())
}
src/platforms/app-plus-nvue/service/api/route/switch-tab.js
浏览文件 @
e26586eb
...
...
@@ -37,8 +37,6 @@ export function switchTab ({
currentPage
.
$getAppWebview
().
close
(
'
auto
'
)
}
}
else
{
// TODO 客户端 Bug
currentPage
.
$getAppWebview
().
hide
(
'
none
'
)
// 前一个 tabBar 触发 onHide
currentPage
.
$vm
.
__call_hook
(
'
onHide
'
)
}
...
...
src/platforms/app-plus/service/framework/app.js
浏览文件 @
e26586eb
...
...
@@ -115,7 +115,9 @@ export function registerApp (appVm) {
console
.
log
(
`[uni-app] registerApp`
)
}
appCtx
=
appVm
appCtx
=
appVm
appCtx
.
globalData
=
appVm
.
$options
.
globalData
||
{}
initOn
(
UniServiceJSBridge
.
on
,
{
getApp
,
...
...
src/platforms/app-plus/service/framework/plus-message.js
浏览文件 @
e26586eb
...
...
@@ -29,7 +29,7 @@ export function consumePlusMessage (type, args) {
*/
export
function
registerPlusMessage
(
type
,
callback
,
keepAlive
=
true
)
{
if
(
callbacks
[
type
])
{
throw
new
Error
(
`
${
type
}
已注册:`
+
(
callbacks
[
type
].
toString
()))
return
console
.
warn
(
`
${
type
}
已注册:`
+
(
callbacks
[
type
].
toString
()))
}
callback
.
keepAlive
=
!!
keepAlive
callbacks
[
type
]
=
callback
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录