Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
cce3cf15
U
uni-app
项目概览
DCloud
/
uni-app
3 个月 前同步成功
通知
725
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,发现更多精彩内容 >>
提交
cce3cf15
编写于
10月 16, 2020
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
上级
969deb11
c9936553
变更
16
展开全部
隐藏空白更改
内联
并排
Showing
16 changed file
with
167 addition
and
43 deletion
+167
-43
lib/apis.js
lib/apis.js
+2
-1
lib/modules.json
lib/modules.json
+2
-1
packages/uni-app-plus/template/common/__uniappscan.js
packages/uni-app-plus/template/common/__uniappscan.js
+1
-1
packages/uni-cli-shared/template/common/__uniappscan.js
packages/uni-cli-shared/template/common/__uniappscan.js
+1
-1
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
+1
-1
src/core/view/components/canvas/index.vue
src/core/view/components/canvas/index.vue
+8
-1
src/platforms/app-plus/service/api/ad/full-screen-video-ad.js
...platforms/app-plus/service/api/ad/full-screen-video-ad.js
+102
-0
src/platforms/app-plus/service/api/device/bluetooth.js
src/platforms/app-plus/service/api/device/bluetooth.js
+20
-20
src/platforms/app-plus/service/api/device/ibeacon.js
src/platforms/app-plus/service/api/device/ibeacon.js
+5
-5
src/platforms/app-plus/service/api/device/scan-code-webview.js
...latforms/app-plus/service/api/device/scan-code-webview.js
+7
-1
src/platforms/app-plus/service/api/file/file.js
src/platforms/app-plus/service/api/file/file.js
+1
-1
src/platforms/app-plus/service/api/index.js
src/platforms/app-plus/service/api/index.js
+1
-0
src/platforms/app-plus/service/api/media/choose-image.js
src/platforms/app-plus/service/api/media/choose-image.js
+2
-1
src/platforms/app-plus/service/api/media/choose-video.js
src/platforms/app-plus/service/api/media/choose-video.js
+2
-1
src/platforms/app-plus/service/api/media/get-image-info.js
src/platforms/app-plus/service/api/media/get-image-info.js
+1
-1
src/platforms/app-plus/service/api/util.js
src/platforms/app-plus/service/api/util.js
+11
-7
未找到文件。
lib/apis.js
浏览文件 @
cce3cf15
...
...
@@ -224,7 +224,8 @@ const third = [
]
const
ad
=
[
'
createRewardedVideoAd
'
'
createRewardedVideoAd
'
,
'
createFullScreenVideoAd
'
]
const
apis
=
[
...
...
lib/modules.json
浏览文件 @
cce3cf15
...
...
@@ -216,6 +216,7 @@
"name"
:
"ad"
,
"title"
:
"广告"
,
"apiList"
:
{
"uni.createRewardedVideoAd"
:
true
"uni.createRewardedVideoAd"
:
true
,
"uni.createFullScreenVideoAd"
:
true
}
}]
packages/uni-app-plus/template/common/__uniappscan.js
浏览文件 @
cce3cf15
此差异已折叠。
点击以展开。
packages/uni-cli-shared/template/common/__uniappscan.js
浏览文件 @
cce3cf15
此差异已折叠。
点击以展开。
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
浏览文件 @
cce3cf15
此差异已折叠。
点击以展开。
src/core/view/components/canvas/index.vue
浏览文件 @
cce3cf15
...
...
@@ -309,7 +309,14 @@ export default {
*/
function
loadFile
(
path
)
{
function
onError
()
{
image
.
src
=
src
const
bitmap
=
new
plus
.
nativeObj
.
Bitmap
(
`bitmap_
${
Date
.
now
()}
_
${
Math
.
random
()}
}`
)
bitmap
.
load
(
path
,
function
()
{
image
.
src
=
bitmap
.
toBase64Data
()
bitmap
.
clear
()
},
function
()
{
bitmap
.
clear
()
image
.
src
=
src
})
}
plus
.
io
.
resolveLocalFileSystemURL
(
path
,
function
(
entry
)
{
entry
.
file
(
function
(
file
)
{
...
...
src/platforms/app-plus/service/api/ad/full-screen-video-ad.js
0 → 100644
浏览文件 @
cce3cf15
const
eventNames
=
[
'
load
'
,
'
close
'
,
'
error
'
]
class
FullScreenVideoAd
{
constructor
(
options
=
{})
{
const
_callbacks
=
this
.
_callbacks
=
{}
eventNames
.
forEach
(
item
=>
{
_callbacks
[
item
]
=
[]
const
name
=
item
[
0
].
toUpperCase
()
+
item
.
substr
(
1
)
this
[
`on
${
name
}
`
]
=
function
(
callback
)
{
_callbacks
[
item
].
push
(
callback
)
}
})
this
.
_isLoad
=
false
this
.
_adError
=
''
this
.
_loadPromiseResolve
=
null
this
.
_loadPromiseReject
=
null
this
.
_lastLoadTime
=
0
const
ad
=
this
.
_ad
=
plus
.
ad
.
createFullScreenVideoAd
(
options
)
ad
.
onLoad
((
e
)
=>
{
this
.
_isLoad
=
true
this
.
_lastLoadTime
=
Date
.
now
()
this
.
_dispatchEvent
(
'
load
'
,
{})
if
(
this
.
_loadPromiseResolve
!=
null
)
{
this
.
_loadPromiseResolve
()
this
.
_loadPromiseResolve
=
null
}
})
ad
.
onClose
((
e
)
=>
{
this
.
_isLoad
=
false
this
.
_dispatchEvent
(
'
close
'
,
{
isEnded
:
e
.
isEnded
})
})
ad
.
onError
((
e
)
=>
{
const
{
code
,
message
}
=
e
const
data
=
{
code
:
code
,
errMsg
:
message
}
this
.
_adError
=
message
if
(
code
===
-
5008
)
{
this
.
_isLoad
=
false
}
this
.
_dispatchEvent
(
'
error
'
,
data
)
if
(
this
.
_loadPromiseReject
!=
null
)
{
this
.
_loadPromiseReject
(
data
)
this
.
_loadPromiseReject
=
null
}
})
}
load
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
this
.
_isLoad
)
{
resolve
()
return
}
this
.
_loadPromiseResolve
=
resolve
this
.
_loadPromiseReject
=
reject
this
.
_loadAd
()
})
}
show
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
this
.
_isLoad
)
{
this
.
_ad
.
show
()
resolve
()
}
else
{
reject
(
new
Error
(
this
.
_adError
))
}
})
}
getProvider
()
{
return
this
.
_ad
.
getProvider
()
}
destroy
()
{
this
.
_ad
.
destroy
()
}
_loadAd
()
{
this
.
_isLoad
=
false
this
.
_ad
.
load
()
}
_dispatchEvent
(
name
,
data
)
{
this
.
_callbacks
[
name
].
forEach
(
callback
=>
{
if
(
typeof
callback
===
'
function
'
)
{
callback
(
data
||
{})
}
})
}
}
export
function
createFullScreenVideoAd
(
options
)
{
return
new
FullScreenVideoAd
(
options
)
}
src/platforms/app-plus/service/api/device/bluetooth.js
浏览文件 @
cce3cf15
...
...
@@ -3,10 +3,10 @@ import {
warpPlusMethod
}
from
'
../util
'
export
const
onBluetoothDeviceFound
=
warpPlusEvent
(
plus
.
bluetooth
,
'
onBluetoothDeviceFound
'
)
export
const
onBluetoothAdapterStateChange
=
warpPlusEvent
(
plus
.
bluetooth
,
'
onBluetoothAdapterStateChange
'
)
export
const
onBLEConnectionStateChange
=
warpPlusEvent
(
plus
.
bluetooth
,
'
onBLEConnectionStateChange
'
)
export
const
onBLECharacteristicValueChange
=
warpPlusEvent
(
plus
.
bluetooth
,
'
onBLECharacteristicValueChange
'
)
export
const
onBluetoothDeviceFound
=
warpPlusEvent
(
'
bluetooth
'
,
'
onBluetoothDeviceFound
'
)
export
const
onBluetoothAdapterStateChange
=
warpPlusEvent
(
'
bluetooth
'
,
'
onBluetoothAdapterStateChange
'
)
export
const
onBLEConnectionStateChange
=
warpPlusEvent
(
'
bluetooth
'
,
'
onBLEConnectionStateChange
'
)
export
const
onBLECharacteristicValueChange
=
warpPlusEvent
(
'
bluetooth
'
,
'
onBLECharacteristicValueChange
'
)
function
toUpperCase
(
options
=
{})
{
const
deviceId
=
options
.
deviceId
...
...
@@ -20,19 +20,19 @@ function toUpperCase (options = {}) {
return
options
}
export
const
openBluetoothAdapter
=
warpPlusMethod
(
plus
.
bluetooth
,
'
openBluetoothAdapter
'
)
export
const
closeBluetoothAdapter
=
warpPlusMethod
(
plus
.
bluetooth
,
'
closeBluetoothAdapter
'
)
export
const
getBluetoothAdapterState
=
warpPlusMethod
(
plus
.
bluetooth
,
'
getBluetoothAdapterState
'
)
export
const
startBluetoothDevicesDiscovery
=
warpPlusMethod
(
plus
.
bluetooth
,
'
startBluetoothDevicesDiscovery
'
,
toUpperCase
)
export
const
stopBluetoothDevicesDiscovery
=
warpPlusMethod
(
plus
.
bluetooth
,
'
stopBluetoothDevicesDiscovery
'
)
export
const
getBluetoothDevices
=
warpPlusMethod
(
plus
.
bluetooth
,
'
getBluetoothDevices
'
)
export
const
getConnectedBluetoothDevices
=
warpPlusMethod
(
plus
.
bluetooth
,
'
getConnectedBluetoothDevices
'
,
toUpperCase
)
export
const
createBLEConnection
=
warpPlusMethod
(
plus
.
bluetooth
,
'
createBLEConnection
'
,
toUpperCase
)
export
const
closeBLEConnection
=
warpPlusMethod
(
plus
.
bluetooth
,
'
closeBLEConnection
'
,
toUpperCase
)
export
const
getBLEDeviceServices
=
warpPlusMethod
(
plus
.
bluetooth
,
'
getBLEDeviceServices
'
,
toUpperCase
)
export
const
getBLEDeviceCharacteristics
=
warpPlusMethod
(
plus
.
bluetooth
,
'
getBLEDeviceCharacteristics
'
,
toUpperCase
)
export
const
notifyBLECharacteristicValueChange
=
warpPlusMethod
(
plus
.
bluetooth
,
'
notifyBLECharacteristicValueChange
'
,
toUpperCase
)
export
const
readBLECharacteristicValue
=
warpPlusMethod
(
plus
.
bluetooth
,
'
readBLECharacteristicValue
'
,
toUpperCase
)
export
const
writeBLECharacteristicValue
=
warpPlusMethod
(
plus
.
bluetooth
,
'
writeBLECharacteristicValue
'
,
toUpperCase
)
export
const
setBLEMTU
=
warpPlusMethod
(
plus
.
bluetooth
,
'
setBLEMTU
'
,
toUpperCase
)
export
const
getBLEDeviceRSSI
=
warpPlusMethod
(
plus
.
bluetooth
,
'
getBLEDeviceRSSI
'
,
toUpperCase
)
export
const
openBluetoothAdapter
=
warpPlusMethod
(
'
bluetooth
'
,
'
openBluetoothAdapter
'
)
export
const
closeBluetoothAdapter
=
warpPlusMethod
(
'
bluetooth
'
,
'
closeBluetoothAdapter
'
)
export
const
getBluetoothAdapterState
=
warpPlusMethod
(
'
bluetooth
'
,
'
getBluetoothAdapterState
'
)
export
const
startBluetoothDevicesDiscovery
=
warpPlusMethod
(
'
bluetooth
'
,
'
startBluetoothDevicesDiscovery
'
,
toUpperCase
)
export
const
stopBluetoothDevicesDiscovery
=
warpPlusMethod
(
'
bluetooth
'
,
'
stopBluetoothDevicesDiscovery
'
)
export
const
getBluetoothDevices
=
warpPlusMethod
(
'
bluetooth
'
,
'
getBluetoothDevices
'
)
export
const
getConnectedBluetoothDevices
=
warpPlusMethod
(
'
bluetooth
'
,
'
getConnectedBluetoothDevices
'
,
toUpperCase
)
export
const
createBLEConnection
=
warpPlusMethod
(
'
bluetooth
'
,
'
createBLEConnection
'
,
toUpperCase
)
export
const
closeBLEConnection
=
warpPlusMethod
(
'
bluetooth
'
,
'
closeBLEConnection
'
,
toUpperCase
)
export
const
getBLEDeviceServices
=
warpPlusMethod
(
'
bluetooth
'
,
'
getBLEDeviceServices
'
,
toUpperCase
)
export
const
getBLEDeviceCharacteristics
=
warpPlusMethod
(
'
bluetooth
'
,
'
getBLEDeviceCharacteristics
'
,
toUpperCase
)
export
const
notifyBLECharacteristicValueChange
=
warpPlusMethod
(
'
bluetooth
'
,
'
notifyBLECharacteristicValueChange
'
,
toUpperCase
)
export
const
readBLECharacteristicValue
=
warpPlusMethod
(
'
bluetooth
'
,
'
readBLECharacteristicValue
'
,
toUpperCase
)
export
const
writeBLECharacteristicValue
=
warpPlusMethod
(
'
bluetooth
'
,
'
writeBLECharacteristicValue
'
,
toUpperCase
)
export
const
setBLEMTU
=
warpPlusMethod
(
'
bluetooth
'
,
'
setBLEMTU
'
,
toUpperCase
)
export
const
getBLEDeviceRSSI
=
warpPlusMethod
(
'
bluetooth
'
,
'
getBLEDeviceRSSI
'
,
toUpperCase
)
src/platforms/app-plus/service/api/device/ibeacon.js
浏览文件 @
cce3cf15
...
...
@@ -3,9 +3,9 @@ import {
warpPlusMethod
}
from
'
../util
'
export
const
onBeaconUpdate
=
warpPlusEvent
(
plus
.
ibeacon
,
'
onBeaconUpdate
'
)
export
const
onBeaconServiceChange
=
warpPlusEvent
(
plus
.
ibeacon
,
'
onBeaconServiceChange
'
)
export
const
onBeaconUpdate
=
warpPlusEvent
(
'
ibeacon
'
,
'
onBeaconUpdate
'
)
export
const
onBeaconServiceChange
=
warpPlusEvent
(
'
ibeacon
'
,
'
onBeaconServiceChange
'
)
export
const
getBeacons
=
warpPlusMethod
(
plus
.
ibeacon
,
'
getBeacons
'
)
export
const
startBeaconDiscovery
=
warpPlusMethod
(
plus
.
ibeacon
,
'
startBeaconDiscovery
'
)
export
const
stopBeaconDiscovery
=
warpPlusMethod
(
plus
.
ibeacon
,
'
stopBeaconDiscovery
'
)
export
const
getBeacons
=
warpPlusMethod
(
'
ibeacon
'
,
'
getBeacons
'
)
export
const
startBeaconDiscovery
=
warpPlusMethod
(
'
ibeacon
'
,
'
startBeaconDiscovery
'
)
export
const
stopBeaconDiscovery
=
warpPlusMethod
(
'
ibeacon
'
,
'
stopBeaconDiscovery
'
)
src/platforms/app-plus/service/api/device/scan-code-webview.js
浏览文件 @
cce3cf15
import
{
TEMP_PATH
}
from
'
../constants
'
import
{
getStatusBarStyle
}
from
'
../util
'
...
...
@@ -115,7 +119,9 @@ export function scanCode ({
}
},
{
multiple
:
false
,
system
:
false
system
:
false
,
filename
:
TEMP_PATH
+
'
/gallery/
'
,
permissionAlert
:
true
})
}
})
...
...
src/platforms/app-plus/service/api/file/file.js
浏览文件 @
cce3cf15
...
...
@@ -74,7 +74,7 @@ export function getSavedFileList (options, callbackId) {
},
errorCallback
)
}
export
const
getFileInfo
=
warpPlusMethod
(
plus
.
io
,
'
getFileInfo
'
)
export
const
getFileInfo
=
warpPlusMethod
(
'
io
'
,
'
getFileInfo
'
)
export
function
getSavedFileInfo
({
filePath
...
...
src/platforms/app-plus/service/api/index.js
浏览文件 @
cce3cf15
...
...
@@ -77,3 +77,4 @@ export * from './ui/tab-bar'
export
*
from
'
./ui/request-component-info
'
export
*
from
'
./ad/rewarded-video-ad
'
export
*
from
'
./ad/full-screen-video-ad
'
src/platforms/app-plus/service/api/media/choose-image.js
浏览文件 @
cce3cf15
...
...
@@ -98,7 +98,8 @@ export function chooseImage ({
maximum
:
count
,
multiple
:
true
,
system
:
false
,
filename
:
TEMP_PATH
+
'
/gallery/
'
filename
:
TEMP_PATH
+
'
/gallery/
'
,
permissionAlert
:
true
})
}
...
...
src/platforms/app-plus/service/api/media/choose-video.js
浏览文件 @
cce3cf15
...
...
@@ -39,7 +39,8 @@ export function chooseVideo ({
plus
.
gallery
.
pick
(
successCallback
,
errorCallback
,
{
filter
:
'
video
'
,
system
:
false
,
filename
:
TEMP_PATH
+
'
/gallery/
'
filename
:
TEMP_PATH
+
'
/gallery/
'
,
permissionAlert
:
true
})
}
...
...
src/platforms/app-plus/service/api/media/get-image-info.js
浏览文件 @
cce3cf15
...
...
@@ -2,4 +2,4 @@ import {
warpPlusMethod
}
from
'
../util
'
export
const
getImageInfo
=
warpPlusMethod
(
plus
.
io
,
'
getImageInfo
'
)
export
const
getImageInfo
=
warpPlusMethod
(
'
io
'
,
'
getImageInfo
'
)
src/platforms/app-plus/service/api/util.js
浏览文件 @
cce3cf15
...
...
@@ -4,7 +4,8 @@ import {
export
{
isTabBarPage
}
from
'
../bridge
'
}
from
'
../bridge
'
export
function
callApiSync
(
api
,
args
,
name
,
alias
)
{
const
ret
=
api
(
args
)
...
...
@@ -155,16 +156,19 @@ const outOfChina = function (lng, lat) {
}
export
function
getScreenInfo
()
{
const
{
resolutionWidth
,
resolutionHeight
}
=
plus
.
screen
.
getCurrentSize
()
const
{
resolutionWidth
,
resolutionHeight
}
=
plus
.
screen
.
getCurrentSize
()
return
{
screenWidth
:
Math
.
round
(
resolutionWidth
),
screenHeight
:
Math
.
round
(
resolutionHeight
)
}
}
export
function
warpPlusEvent
(
origin
,
name
)
{
export
function
warpPlusEvent
(
module
,
name
)
{
return
function
(
callbackId
)
{
origin
[
name
](
function
(
data
)
{
plus
[
module
]
[
name
](
function
(
data
)
{
if
(
data
)
{
delete
data
.
code
delete
data
.
message
...
...
@@ -184,12 +188,12 @@ export function warpPlusErrorCallback (callbackId, neme, errMsg) {
}
}
export
function
warpPlusMethod
(
origin
,
name
,
before
)
{
export
function
warpPlusMethod
(
module
,
name
,
before
)
{
return
function
(
options
,
callbackId
)
{
if
(
typeof
before
===
'
function
'
)
{
options
=
before
(
options
)
}
origin
[
name
](
Object
.
assign
(
options
,
{
plus
[
module
]
[
name
](
Object
.
assign
(
options
,
{
success
(
data
=
{})
{
delete
data
.
code
delete
data
.
message
...
...
@@ -210,4 +214,4 @@ export function getFileName (path) {
export
function
getExtName
(
path
)
{
const
array
=
path
.
split
(
'
.
'
)
return
array
.
length
>
1
?
'
.
'
+
array
[
array
.
length
-
1
]
:
''
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录