Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
36bbb136
U
uni-app
项目概览
DCloud
/
uni-app
4 个月 前同步成功
通知
726
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,发现更多精彩内容 >>
提交
36bbb136
编写于
3月 20, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://github.com/dcloudio/uni-app
into alpha
上级
2cb99fe2
fcd27352
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
64 addition
and
54 deletion
+64
-54
packages/uni-cli-shared/template/common/__uniapppicker.js
packages/uni-cli-shared/template/common/__uniapppicker.js
+1
-1
packages/vue-cli-plugin-hbuilderx/index.js
packages/vue-cli-plugin-hbuilderx/index.js
+17
-5
src/platforms/app-plus/service/api/device/bluetooth.js
src/platforms/app-plus/service/api/device/bluetooth.js
+5
-26
src/platforms/h5/view/components/picker/index.vue
src/platforms/h5/view/components/picker/index.vue
+41
-22
未找到文件。
packages/uni-cli-shared/template/common/__uniapppicker.js
浏览文件 @
36bbb136
此差异已折叠。
点击以展开。
packages/vue-cli-plugin-hbuilderx/index.js
浏览文件 @
36bbb136
...
...
@@ -6,19 +6,31 @@ process.env.UNI_CLI_CONTEXT = path.resolve(__dirname, '../../../')
process
.
env
.
UNI_HBUILDERX_PLUGINS
=
process
.
env
.
UNI_HBUILDERX_PLUGINS
||
path
.
resolve
(
__dirname
,
'
../../../../
'
)
require
(
'
./module-alias
'
)
const
{
devtoolModuleFilenameTemplate
}
=
require
(
'
@dcloudio/uni-cli-shared
'
)
}
=
require
(
'
@dcloudio/uni-cli-shared
'
)
module
.
exports
=
(
api
,
options
)
=>
{
// 仅处理 app-plus 相关逻辑
if
(
process
.
env
.
UNI_PLATFORM
!==
'
app-plus
'
)
{
return
}
if
(
!
fs
.
existsSync
(
path
.
resolve
(
process
.
env
.
UNI_HBUILDERX_PLUGINS
,
'
weapp-tools/lib/index.js
'
)))
{
console
.
error
(
'
请使用 HBuilderX 编译运行至 app-plus 平台
'
)
process
.
exit
(
0
)
if
(
(
!
process
.
env
.
UNI_USING_V3
&&
!
process
.
env
.
UNI_USING_NATIVE
&&
!
process
.
env
.
UNI_USING_V3_NATIVE
)
||
(
process
.
env
.
UNI_USING_NATIVE
&&
!
process
.
env
.
UNI_USING_NVUE_COMPILER
)
)
{
if
(
!
fs
.
existsSync
(
path
.
resolve
(
process
.
env
.
UNI_HBUILDERX_PLUGINS
,
'
weapp-tools/lib/index.js
'
)))
{
console
.
error
(
'
请使用 HBuilderX 编译运行至 app-plus 平台
'
)
process
.
exit
(
0
)
}
}
const
plugins
=
[]
...
...
src/platforms/app-plus/service/api/device/bluetooth.js
浏览文件 @
36bbb136
import
{
invoke
,
publish
,
arrayBufferToBase64
,
base64ToArrayBuffer
publish
}
from
'
../../bridge
'
/**
...
...
@@ -53,16 +51,6 @@ function bluetoothOn (method, beforeSuccess) {
return
true
}
function
checkDevices
(
data
)
{
data
.
devices
=
data
.
devices
.
map
(
device
=>
{
var
advertisData
=
device
.
advertisData
if
(
advertisData
&&
typeof
advertisData
!==
'
string
'
)
{
device
.
advertisData
=
arrayBufferToBase64
(
advertisData
)
}
return
device
})
}
var
onBluetoothAdapterStateChange
var
onBluetoothDeviceFound
var
onBLEConnectionStateChange
...
...
@@ -83,7 +71,7 @@ export function getBluetoothAdapterState (data, callbackId) {
}
export
function
startBluetoothDevicesDiscovery
(
data
,
callbackId
)
{
onBluetoothDeviceFound
=
onBluetoothDeviceFound
||
bluetoothOn
(
'
onBluetoothDeviceFound
'
,
checkDevices
)
onBluetoothDeviceFound
=
onBluetoothDeviceFound
||
bluetoothOn
(
'
onBluetoothDeviceFound
'
)
bluetoothExec
(
'
startBluetoothDevicesDiscovery
'
,
callbackId
,
data
)
}
...
...
@@ -92,7 +80,7 @@ export function stopBluetoothDevicesDiscovery (data, callbackId) {
}
export
function
getBluetoothDevices
(
data
,
callbackId
)
{
bluetoothExec
(
'
getBluetoothDevices
'
,
callbackId
,
{}
,
checkDevices
)
bluetoothExec
(
'
getBluetoothDevices
'
,
callbackId
,
{})
}
export
function
getConnectedBluetoothDevices
(
data
,
callbackId
)
{
...
...
@@ -118,18 +106,12 @@ export function getBLEDeviceCharacteristics (data, callbackId) {
}
export
function
notifyBLECharacteristicValueChange
(
data
,
callbackId
)
{
onBLECharacteristicValueChange
=
onBLECharacteristicValueChange
||
bluetoothOn
(
'
onBLECharacteristicValueChange
'
,
data
=>
{
data
.
value
=
arrayBufferToBase64
(
data
.
value
)
})
onBLECharacteristicValueChange
=
onBLECharacteristicValueChange
||
bluetoothOn
(
'
onBLECharacteristicValueChange
'
)
bluetoothExec
(
'
notifyBLECharacteristicValueChange
'
,
callbackId
,
data
)
}
export
function
notifyBLECharacteristicValueChanged
(
data
,
callbackId
)
{
onBLECharacteristicValueChange
=
onBLECharacteristicValueChange
||
bluetoothOn
(
'
onBLECharacteristicValueChange
'
,
data
=>
{
data
.
value
=
arrayBufferToBase64
(
data
.
value
)
})
onBLECharacteristicValueChange
=
onBLECharacteristicValueChange
||
bluetoothOn
(
'
onBLECharacteristicValueChange
'
)
bluetoothExec
(
'
notifyBLECharacteristicValueChanged
'
,
callbackId
,
data
)
}
...
...
@@ -139,8 +121,5 @@ export function readBLECharacteristicValue (data, callbackId) {
}
export
function
writeBLECharacteristicValue
(
data
,
callbackId
)
{
if
(
typeof
data
.
value
===
'
string
'
)
{
data
.
value
=
base64ToArrayBuffer
(
data
.
value
)
}
bluetoothExec
(
'
writeBLECharacteristicValue
'
,
callbackId
,
data
)
}
src/platforms/h5/view/components/picker/index.vue
浏览文件 @
36bbb136
...
...
@@ -156,7 +156,7 @@ export default {
},
data
()
{
return
{
valueSync
:
this
.
value
||
0
,
valueSync
:
null
,
visible
:
false
,
valueChangeSource
:
''
,
timeArray
:
[],
...
...
@@ -207,20 +207,17 @@ export default {
}
},
watch
:
{
value
(
val
)
{
if
(
Array
.
isArray
(
val
))
{
if
(
!
Array
.
isArray
(
this
.
valueSync
))
{
this
.
valueSync
=
[]
}
this
.
valueSync
.
length
=
val
.
length
val
.
forEach
((
val
,
index
)
=>
{
if
(
val
!==
this
.
valueSync
[
index
])
{
this
.
$set
(
this
.
valueSync
,
index
,
val
)
}
})
}
else
if
(
typeof
val
!==
'
object
'
)
{
this
.
valueSync
=
val
}
value
()
{
this
.
_setValueSync
()
},
mode
()
{
this
.
_setValueSync
()
},
range
()
{
this
.
_setValueSync
()
},
valueSync
()
{
this
.
_setValueArray
()
},
valueArray
(
val
)
{
if
(
this
.
mode
===
mode
.
TIME
||
this
.
mode
===
mode
.
DATE
)
{
...
...
@@ -269,8 +266,7 @@ export default {
})
this
.
_createTime
()
this
.
_createDate
()
this
.
$watch
(
'
valueSync
'
,
this
.
_setValue
)
this
.
$watch
(
'
mode
'
,
this
.
_setValue
)
this
.
_setValueSync
()
},
beforeDestroy
()
{
this
.
$refs
.
picker
.
remove
()
...
...
@@ -285,7 +281,6 @@ export default {
return
}
this
.
valueChangeSource
=
''
this
.
_setValue
()
var
$picker
=
this
.
$refs
.
picker
$picker
.
remove
();
(
document
.
querySelector
(
'
uni-app
'
)
||
document
.
body
).
appendChild
(
$picker
)
...
...
@@ -346,13 +341,34 @@ export default {
val1
[
i
]
=
val2
[
i
]
}
},
_setValue
()
{
_setValueSync
()
{
let
val
=
this
.
value
switch
(
this
.
mode
)
{
case
mode
.
MULTISELECTOR
:
if
(
!
Array
.
isArray
(
val
))
{
val
=
[]
}
if
(
!
Array
.
isArray
(
this
.
valueSync
))
{
this
.
valueSync
=
[]
}
const
length
=
this
.
valueSync
.
length
=
Math
.
max
(
val
.
length
,
this
.
range
.
length
)
for
(
let
index
=
0
;
index
<
length
;
index
++
)
{
this
.
valueSync
.
splice
(
index
,
1
,
Number
(
val
[
index
])
||
Number
(
this
.
valueSync
[
index
])
||
0
)
}
break
case
mode
.
TIME
:
case
mode
.
DATE
:
this
.
valueSync
=
String
(
val
)
break
default
:
this
.
valueSync
=
Number
(
val
)
||
0
break
}
},
_setValueArray
()
{
var
val
=
this
.
valueSync
var
valueArray
switch
(
this
.
mode
)
{
case
mode
.
SELECTOR
:
valueArray
=
[
val
]
break
case
mode
.
MULTISELECTOR
:
valueArray
=
[...
val
]
break
...
...
@@ -366,6 +382,9 @@ export default {
mode
:
mode
.
DATE
}))
break
default
:
valueArray
=
[
val
]
break
}
this
.
oldValueArray
=
[...
valueArray
]
this
.
valueArray
=
[...
valueArray
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录