diff --git a/pages/018A/HBY018A.vue b/pages/018A/HBY018A.vue index bcb5419..3d5fb41 100644 --- a/pages/018A/HBY018A.vue +++ b/pages/018A/HBY018A.vue @@ -505,7 +505,11 @@ return; } if (res.deviceId == these.formData.deviceId) { - this.formData.bleStatu = false; + if(res.device){ + these.formData.bleStatu = 'connecting'; + }else{ + this.formData.bleStatu = false; + } setTimeout(() => { hideLoading(these, 1000); }); diff --git a/pages/100/HBY100.vue b/pages/100/HBY100.vue index 5e2d73b..ea99012 100644 --- a/pages/100/HBY100.vue +++ b/pages/100/HBY100.vue @@ -1196,7 +1196,11 @@ return; } if (res.deviceId == these.formData.deviceId) { - this.formData.bleStatu = false; + if(res.device){ + these.formData.bleStatu = 'connecting'; + }else{ + this.formData.bleStatu = false; + } setTimeout(() => { hideLoading(these, 1000); }); diff --git a/pages/102/HBY102.vue b/pages/102/HBY102.vue index d3fecf9..8a89368 100644 --- a/pages/102/HBY102.vue +++ b/pages/102/HBY102.vue @@ -979,7 +979,11 @@ return; } if (res.deviceId == these.formData.deviceId) { - this.formData.bleStatu = false; + if(res.device){ + these.formData.bleStatu = 'connecting'; + }else{ + this.formData.bleStatu = false; + } setTimeout(() => { hideLoading(these, 1000); }); diff --git a/pages/4877/BJQ4877.vue b/pages/4877/BJQ4877.vue index 981a12b..0b34338 100644 --- a/pages/4877/BJQ4877.vue +++ b/pages/4877/BJQ4877.vue @@ -1087,7 +1087,11 @@ return; } if (res.deviceId == these.formData.deviceId) { - this.formData.bleStatu = false; + if(res.device){ + these.formData.bleStatu = 'connecting'; + }else{ + this.formData.bleStatu = false; + } setTimeout(() => { hideLoading(these, 1000); }); diff --git a/pages/4877/BJQ4877V1.vue b/pages/4877/BJQ4877V1.vue index ee7108c..0c5d03a 100644 --- a/pages/4877/BJQ4877V1.vue +++ b/pages/4877/BJQ4877V1.vue @@ -603,7 +603,11 @@ import request, { baseURL } from '@/utils/request.js'; return; } if (res.deviceId == these.formData.deviceId) { - this.formData.bleStatu = false; + if(res.device){ + these.formData.bleStatu = 'connecting'; + }else{ + this.formData.bleStatu = false; + } setTimeout(() => { hideLoading(these, 1000); }); diff --git a/pages/6155/BJQ6155.vue b/pages/6155/BJQ6155.vue index df31088..96f0a41 100644 --- a/pages/6155/BJQ6155.vue +++ b/pages/6155/BJQ6155.vue @@ -585,7 +585,11 @@ return; } if (res.deviceId == these.formData.deviceId) { - this.formData.bleStatu = false; + if(res.device){ + these.formData.bleStatu = 'connecting'; + }else{ + this.formData.bleStatu = false; + } setTimeout(() => { hideLoading(these, 1000); }); diff --git a/pages/6155/deviceDetail.vue b/pages/6155/deviceDetail.vue index 7d9c257..2effd5a 100644 --- a/pages/6155/deviceDetail.vue +++ b/pages/6155/deviceDetail.vue @@ -566,7 +566,11 @@ return; } if (res.deviceId == these.formData.deviceId) { - this.formData.bleStatu = false; + if(res.device){ + these.formData.bleStatu = 'connecting'; + }else{ + this.formData.bleStatu = false; + } setTimeout(() => { hideLoading(these, 1000); }); diff --git a/pages/6331/BJQ6331.vue b/pages/6331/BJQ6331.vue index 2df7f36..acf8ad9 100644 --- a/pages/6331/BJQ6331.vue +++ b/pages/6331/BJQ6331.vue @@ -617,7 +617,11 @@ import request, { baseURL } from '@/utils/request.js'; return; } if (res.deviceId == these.formData.deviceId) { - this.formData.bleStatu = false; + if(res.device){ + these.formData.bleStatu = 'connecting'; + }else{ + this.formData.bleStatu = false; + } setTimeout(() => { hideLoading(these, 1000); }); diff --git a/pages/650/HBY650.vue b/pages/650/HBY650.vue index b2b0b4c..8f83a20 100644 --- a/pages/650/HBY650.vue +++ b/pages/650/HBY650.vue @@ -514,7 +514,11 @@ import request, { baseURL } from '@/utils/request.js'; return; } if (res.deviceId == these.formData.deviceId) { - this.formData.bleStatu = false; + if(res.device){ + these.formData.bleStatu = 'connecting'; + }else{ + this.formData.bleStatu = false; + } setTimeout(() => { hideLoading(these, 1000); }); diff --git a/pages/670/HBY670.vue b/pages/670/HBY670.vue index 8ca7faa..6eb3bd0 100644 --- a/pages/670/HBY670.vue +++ b/pages/670/HBY670.vue @@ -634,7 +634,11 @@ return; } if (res.deviceId == these.formData.deviceId) { - this.formData.bleStatu = false; + if(res.device){ + these.formData.bleStatu = 'connecting'; + }else{ + this.formData.bleStatu = false; + } setTimeout(() => { hideLoading(these, 1000); }); diff --git a/pages/7305/BJQ7305.vue b/pages/7305/BJQ7305.vue index 65c8033..24d67ff 100644 --- a/pages/7305/BJQ7305.vue +++ b/pages/7305/BJQ7305.vue @@ -9,16 +9,16 @@ - + {{item.math>9?'9+':item.math}} - + - + - + @@ -182,7 +182,7 @@ updateLoading } from '@/utils/loading.js' import BleReceive from '@/utils/BleReceive'; -import Common from '@/utils/Common.js'; + import Common from '@/utils/Common.js'; var ble = null; var these = null; @@ -201,10 +201,10 @@ import Common from '@/utils/Common.js'; icons: [{ src: '/static/images/common/shape.png', callback: this.gotoShare, - apiType:'listA' + apiType: 'listA' }], title: 'BJQ6155' - + }, pageHide: false, Pop: { @@ -320,8 +320,8 @@ import Common from '@/utils/Common.js'; let device = data.data; these.device = device; -these.Status.apiType = data.apiType; - these.Status.navbar.title=device.deviceName; + these.Status.apiType = data.apiType; + these.Status.navbar.title = device.deviceName; if (data.apiType !== 'listA') { Common.getdeviceShareId(data.data.id).then(res => { if (res.code == 200) { @@ -378,21 +378,21 @@ these.Status.apiType = data.apiType; this.Status.pageHide = false; }, computed: { - getbleStatu(){ - if(this.formData.bleStatu===true){ - return '已连接'; - } - if(this.formData.bleStatu==='connecting'){ - return '连接中'; - } - if(this.formData.bleStatu==='dicconnect'){ - return '正在断开'; - } - if(this.formData.bleStatu==='err'){ - return '连接异常'; - } - return '未连接'; - }, + getbleStatu() { + if (this.formData.bleStatu === true) { + return '已连接'; + } + if (this.formData.bleStatu === 'connecting') { + return '连接中'; + } + if (this.formData.bleStatu === 'dicconnect') { + return '正在断开'; + } + if (this.formData.bleStatu === 'err') { + return '连接异常'; + } + return '未连接'; + }, getMode() { let txt = "关闭"; if (this.Status.BottomMenu.type == 'fu') { @@ -424,32 +424,32 @@ these.Status.apiType = data.apiType; } }, methods: { - bleStatuToggle(){ - let f=this.getDevice(); - if(!f){ - this.showBleUnConnect(); - return; - } - if(this.formData.bleStatu===true){ - this.formData.bleStatu='dicconnect'; - ble.disconnectDevice(f.deviceId).finally(r=>{ - this.formData.bleStatu=false; - }); - return; - } - - if(this.formData.bleStatu===false || this.formData.bleStatu==='err'){ - these.formData.bleStatu = 'connecting'; - ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { - these.formData.bleStatu = true; - }).catch(ex=>{ - these.formData.bleStatu = 'err'; - }); - return; - } - - - }, + bleStatuToggle() { + let f = this.getDevice(); + if (!f) { + this.showBleUnConnect(); + return; + } + if (this.formData.bleStatu === true) { + this.formData.bleStatu = 'dicconnect'; + ble.disconnectDevice(f.deviceId).finally(r => { + this.formData.bleStatu = false; + }); + return; + } + + if (this.formData.bleStatu === false || this.formData.bleStatu === 'err') { + these.formData.bleStatu = 'connecting'; + ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { + these.formData.bleStatu = true; + }).catch(ex => { + these.formData.bleStatu = 'err'; + }); + return; + } + + + }, handleRightClick(item, s) { if (item && item.callback) { item.callback(item, s); @@ -457,7 +457,7 @@ these.Status.apiType = data.apiType; uni.showModal({ content: '敬请期待' }) - + } }, navigatorBack() { @@ -502,7 +502,12 @@ these.Status.apiType = data.apiType; return; } if (res.deviceId == these.formData.deviceId) { - this.formData.bleStatu = false; + if (res.device) { + these.formData.bleStatu = 'connecting'; + } else { + this.formData.bleStatu = false; + } + // 断开连接时先将充电状态复位,避免保持旧值 this.formData.statu = '未充电'; this.setBleFormData(); @@ -580,9 +585,9 @@ these.Status.apiType = data.apiType; if (this.Status.pageHide) { return; } - + let json = recei.ReceiveData(receive, device, path, recArr); - console.log("收到消息:",receive.hexs); + console.log("收到消息:", receive.hexs); if (!json) { return; } @@ -913,7 +918,7 @@ these.Status.apiType = data.apiType; }, UploadOpenImg: function() { if (!this.permissions.includes('3') && this.Status.apiType !== 'listA') { - + this.showPop({ message: '无操作权限', iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png", @@ -924,7 +929,7 @@ these.Status.apiType = data.apiType; }) return; } - + //上传开机画面 this.Status.BottomMenu.menuItems = []; this.Status.BottomMenu.title = "上传开机画面"; @@ -932,7 +937,7 @@ these.Status.apiType = data.apiType; this.Status.BottomMenu.show = true; }, ModeSetting: function(type) { -if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') { + if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') { this.showPop({ message: '无操作权限', @@ -1177,7 +1182,7 @@ if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') { }, sendUsr() { if (!this.permissions.includes('4') && this.Status.apiType !== 'listA') { - + this.showPop({ message: '无操作权限', iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png", @@ -1392,7 +1397,7 @@ if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') { //给蓝牙设备发送信号更新亮度 BrighInteval = setTimeout(() => { if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') { - + this.showPop({ message: '无操作权限', iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png", @@ -1403,7 +1408,7 @@ if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') { }) return; } - + this.sendBrightness(); this.setBleFormData(); }, 100); @@ -1922,27 +1927,27 @@ if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') { left: -99999rpx; visibility: hidden; } - - + + .navbarRight { width: 40px; height: 100%; - + } - + .navbarRight .imgContent { width: 36rpx; height: 36rpx; position: relative; } - + .navbarRight .imgContent:first-child { - + width: 38rpx !important; height: 38rpx !important; margin-top: -2rpx; } - + .navbarRight .imgContent .baber { position: absolute; z-index: 100; @@ -1958,33 +1963,33 @@ if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') { font-style: Regular; font-size: 20rpx; font-weight: 400; - + text-align: center; overflow: hidden; white-space: nowrap; - + } - + .navbarRight .imgContent .img { width: 100%; height: 100%; - + box-sizing: border-box; position: relative; } - + .navbarRight .imgContent .img:last-child { padding: 1rpx; } - + .nvbar { top: 0px; } - + /deep/ .uni-navbar--fixed { top: 0px; } - + .uninavebartext { width: 100%; font-size: 32rpx;