完成102添加联机日志,报警日志
This commit is contained in:
@ -25,7 +25,7 @@
|
||||
<view class="Sendmessage" @click="handleSend">发送信息</view>
|
||||
</view>
|
||||
<!-- <scroll-view class="device-list" scroll-y @scrolltolower="onScrollToLower" :lower-threshold="100" style="height:80vh;"> -->
|
||||
<mescroll-uni class="device-list" @init="mescrollInit" @down="downCallback" @up="upCallback" :up="upOption"
|
||||
<mescroll-uni class="device-list" @init="mescrollInit" @down="downCallback" @up="upCallback" :up="upOption"
|
||||
:down="downOption" :fixed="false" :style="{ height: mescrollHeight + 'px' }">
|
||||
<view v-if="deviceList.length>0">
|
||||
<uni-swipe-action ref="swipeAction">
|
||||
@ -147,11 +147,12 @@
|
||||
} from '@/api/common/index.js'
|
||||
import bleTool from '@/utils/BleHelper.js';
|
||||
import MescrollUni from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-uni.vue'
|
||||
|
||||
import BleReceive from '@/utils/BleReceive';
|
||||
|
||||
var pagePath = 'pages/common/index';
|
||||
var ble = null;
|
||||
var timeout = null;
|
||||
var recei=null;
|
||||
export default {
|
||||
components: {
|
||||
MescrollUni
|
||||
@ -498,6 +499,9 @@
|
||||
case 'scan':
|
||||
// 扫一扫
|
||||
uni.scanCode({
|
||||
autoDecodeCharset:true,
|
||||
autoZoom:true,
|
||||
barCodeInput:true,
|
||||
success: (res) => {
|
||||
console.log('条码内容:', res);
|
||||
// 清除之前的数据
|
||||
@ -512,14 +516,19 @@
|
||||
if ('imei' in json) {
|
||||
url =
|
||||
`/pages/common/qrcode/qrcode?deviceId=${encodeURIComponent(json.imei)}`;
|
||||
} else if ('blue' in json) {
|
||||
if (!json.blue.includes(':')) {
|
||||
json.blue = json.blue.replace(
|
||||
/(.{2})/g, '$1:')
|
||||
.slice(0, -1)
|
||||
} else if ('blue' in json || 'ble' in json) {
|
||||
if(json.ble){
|
||||
json.blue=json.ble;
|
||||
}
|
||||
url =
|
||||
`/pages/common/addBLE/LinkBle?mac=${encodeURIComponent(json.blue)}`;
|
||||
if(json.blue){
|
||||
if (!json.blue.includes(':')) {
|
||||
json.blue = json.blue.replace(
|
||||
/(.{2})/g, '$1:')
|
||||
.slice(0, -1)
|
||||
}
|
||||
}
|
||||
|
||||
url =`/pages/common/addBLE/LinkBle?mac=${encodeURIComponent(json.blue)}`;
|
||||
}
|
||||
} catch (ex) {
|
||||
|
||||
@ -771,7 +780,7 @@
|
||||
this.downCallback();
|
||||
});
|
||||
ble = bleTool.getBleTool();
|
||||
|
||||
recei = BleReceive.getBleReceive();
|
||||
//蓝牙连接成功的回调
|
||||
ble.addRecoveryCallback((res) => {
|
||||
console.log("蓝牙连接成功的回调");
|
||||
@ -797,7 +806,9 @@
|
||||
}, pagePath);
|
||||
|
||||
//接收到消息的回调
|
||||
ble.addReceiveCallback((rec, f, path, arr) => {
|
||||
ble.addReceiveCallback((receive, device, path, recArr) => {
|
||||
console.error("首页收到消息了");
|
||||
recei.ReceiveData(receive, device, path, recArr);
|
||||
this.updateBleStatu();
|
||||
}, pagePath);
|
||||
|
||||
@ -809,7 +820,7 @@
|
||||
uni.$off('refreshDeviceList');
|
||||
},
|
||||
onUnload() {
|
||||
|
||||
console.log("onUnload...");
|
||||
uni.$off('deviceStatusUpdate');
|
||||
ble && ble.removeAllCallback(pagePath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user