diff --git a/App.vue b/App.vue index 4d86eee..35e20f9 100644 --- a/App.vue +++ b/App.vue @@ -53,6 +53,9 @@ }, onHide: function() { console.log('App Hide'); + }, + onError(ex) { + console.error("出现了未知的异常",ex); } } diff --git a/api/common/index.js b/api/common/index.js index 469ba65..dd8f26f 100644 --- a/api/common/index.js +++ b/api/common/index.js @@ -17,6 +17,13 @@ export function deviceTypeList(params) { }) } +export function typeAll(){ + return request({ + url: '/app/xinghan/device/typeAll', + method: 'get' + }); +} + // 删除设备列表接口 export function deviceUnbind(id) { return request({ diff --git a/components/TextToHex/TextToHexV1.vue b/components/TextToHex/TextToHexV1.vue index 36bfc99..d3237ad 100644 --- a/components/TextToHex/TextToHexV1.vue +++ b/components/TextToHex/TextToHexV1.vue @@ -229,12 +229,12 @@ let linePixls = []; let item = this.validTxts[i]; - console.log("item=",item); + for (var j = 0; j < item.length; j++) { let result = await drawTxt(item[j]); linePixls.push(convertCharToMatrix(result.pixelData)); } - console.log("hexs=",linePixls.join(",")); + // console.log("hexs=",linePixls.join(",")); arr.push(linePixls); } diff --git a/config/index.js b/config/index.js index e9edc18..6ec3377 100644 --- a/config/index.js +++ b/config/index.js @@ -2,7 +2,7 @@ const config = { // 开发环境 development: { - BASE_URL: 'http://139.224.253.23:8000', + BASE_URL: 'http://192.168.110.57:8000',//http://139.224.253.23:8000 API_PREFIX: '', // MQTT 配置 MQTT_HOST: 'www.cnxhyc.com', diff --git a/main.js b/main.js index 1a815db..5086650 100644 --- a/main.js +++ b/main.js @@ -6,13 +6,13 @@ import uView from 'vk-uview-ui'; // #ifndef VUE3 import Vue from 'vue' -import store from './store/store'; + import './uni.promisify.adaptor' Vue.config.productionTip = false App.mpType = 'app' const app = new Vue({ - store, + ...App }) Vue.use(uView) diff --git a/manifest.json b/manifest.json index 35807b5..6dadd96 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name" : "星汉物联", "appid" : "__UNI__A21EF43", "description" : "设备管控", - "versionName" : "1.0.8", + "versionName" : "1.0.12", "versionCode" : "100", "transformPx" : false, /* 5+App特有相关 */ @@ -99,23 +99,7 @@ }, "push" : { "unipush" : { - "version" : "2", - "offline" : true, - "hms" : {}, - "oppo" : {}, - "vivo" : {}, - "mi" : {}, - "meizu" : {}, - "honor" : {}, - "icons" : { - "small" : { - "xxhdpi" : "unpackage/res/icons/72x72.png", - "xhdpi" : "unpackage/res/icons/48x48.png", - "hdpi" : "unpackage/res/icons/36x36.png", - "mdpi" : "unpackage/res/icons/24x24.png", - "ldpi" : "unpackage/res/icons/18x18.png" - } - } + "offline" : false } } }, diff --git a/package.json b/package.json index a9f52da..c46cb0b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "dependencies": { "axios": "^1.9.0", "blueimp-md5": "^2.19.0", - "paho-mqtt": "^1.1.0", + "paho-mqtt": "^1.1.0", "vk-uview-ui": "^1.5.2" } } diff --git a/pages.json b/pages.json index 9e6f30d..acfd99c 100644 --- a/pages.json +++ b/pages.json @@ -339,6 +339,7 @@ "path" : "pages/102/HBY102", "style" : { + "navigationStyle": "custom", "navigationBarTitleText" : "HBY102" } }, @@ -362,6 +363,27 @@ { "navigationBarTitleText" : "HBY018A" } + }, + { + "path" : "pages/6107/BJQ6107", + "style" : + { + "navigationBarTitleText" : "BJQ6107" + } + }, + { + "path" : "pages/6155/BJQ6155", + "style" : + { + "navigationBarTitleText" : "BJQ6155" + } + }, + { + "path" : "pages/102/HBY102_History", + "style" : + { + "navigationStyle": "custom" + } } diff --git a/pages/100/HBY100.vue b/pages/100/HBY100.vue index af2d4d9..2d0e757 100644 --- a/pages/100/HBY100.vue +++ b/pages/100/HBY100.vue @@ -255,10 +255,7 @@ hideLoading, updateLoading } from '@/utils/loading.js' - import { - request, - baseURL - } from '../../utils/request'; +import request, { baseURL } from '@/utils/request.js'; import Common from '@/utils/Common.js' const pagePath = "/pages/100/HBY100"; diff --git a/pages/102/HBY102.vue b/pages/102/HBY102.vue index ff9220c..4379aef 100644 --- a/pages/102/HBY102.vue +++ b/pages/102/HBY102.vue @@ -1,5 +1,26 @@ @@ -223,30 +245,30 @@ show: false, showHeader: true, menuItems: [{ - text: '2M', - value:'status_2M', - icon: '' - }, - { - text: '4M', - value:'status_4M', - icon: '' - }, - { - text: '7M', - value:'status_7M', - icon: '' - }, - { - text: '10M', - value:'status_10M', - icon: '' - }, - { - text: '关闭', - value:'status_off', - icon: '' - } + text: '2M', + value: 'status_2M', + icon: '' + }, + { + text: '4M', + value: 'status_4M', + icon: '' + }, + { + text: '7M', + value: 'status_7M', + icon: '' + }, + { + text: '10M', + value: 'status_10M', + icon: '' + }, + { + text: '关闭', + value: 'status_off', + icon: '' + } ], activeIndex: -1, bgColor: '#2a2a2a', @@ -269,6 +291,21 @@ showClose: false }, usrToggle: false, + navbar: { + icons: [{ + src: '/static/images/common/history.png', + callback: this.gotoHistory, + math: 0 + }, + { + src: '/static/images/common/shape.png', + callback: this.gotoShare + } + ], + title: 'HBY102' + + }, + apiType: '' }, formData: { img: '/static/images/common/HBY102.png', @@ -281,13 +318,13 @@ statu: '', sta_address: '', bleStatu: false, - sta_charge:'', + sta_charge: '', sta_LedType: '', sta_RadarType: '', sta_Online: '', warnTime: '', sta_sosadd: "", - sta_sosName:'', + sta_sosName: '', sta_IntrusTime: '' }, @@ -300,7 +337,8 @@ show: true, img: '/static/images/100/light.png', activeImg: '/static/images/100/lightActive.png', - group: 'sta_LedType' + group: 'sta_LedType', + permission: '1' }, { key: 'led_low_flash', @@ -308,7 +346,8 @@ show: true, img: '/static/images/102/lowFlash.png', activeImg: '/static/images/102/lowFlashActive.png', - group: 'sta_LedType' + group: 'sta_LedType', + permission: '1' }, { key: 'led_steady', @@ -316,7 +355,8 @@ show: true, img: '/static/images/102/liting.png', activeImg: '/static/images/102/litingActive.png', - group: 'sta_LedType' + group: 'sta_LedType', + permission: '1' }, { key: 'status_on', @@ -324,7 +364,8 @@ show: true, img: '/static/images/102/redar.png', activeImg: '/static/images/102/redarActive.png', - group: 'sta_RadarType' + group: 'sta_RadarType', + permission: '48' }, { key: 'E49_on', @@ -332,7 +373,8 @@ show: true, img: '/static/images/102/line.png', activeImg: '/static/images/102/lineActive.png', - group: 'sta_Online' + group: 'sta_Online', + permission: '49' }, { key: 'led_off', @@ -377,7 +419,8 @@ showConfirm: false }, groupDevices: [], - warnDevices:[] + warnDevices: [], + permissions: [] } }, @@ -404,9 +447,20 @@ eventChannel.on('detailData', function(data) { - // console.log("收到父页面的参数:" + JSON.stringify(data)); + console.log("收到父页面的参数:" + JSON.stringify(data)); var device = data.data; + these.Status.apiType = data.apiType; + if (data.apiType !== 'listA') { + Common.getdeviceShareId(data.data.id).then(res => { + if (res.code == 200) { + if (res.data.permission) { + these.permissions = res.data.permission.split(','); + } + } + }); + } these.device = device; + these.getWarns(); let f = ble.data.LinkedList.find((v) => { if (v.macAddress == device.deviceMac) { // console.log("找到设备了", v); @@ -452,34 +506,181 @@ }, onShow() { this.Status.pageHide = false; + this.getLinkedCnt(); }, computed: { - Distance:function(){ - let f=this.Status.BottomMenu.menuItems.find((item,index)=>{ - - return item.value===this.formData.sta_RadarType; - - + Distance: function() { + let f = this.Status.BottomMenu.menuItems.find((item, index) => { + + return item.value === this.formData.sta_RadarType; + + }); - if(f){ + if (f) { return f.text; } return '关闭'; }, - activeIndex:function(){ - let active=4; - let f=this.Status.BottomMenu.menuItems.find((item,index)=>{ - - if(item.value===this.formData.sta_RadarType){ - active=index; + activeIndex: function() { + let active = 4; + let f = this.Status.BottomMenu.menuItems.find((item, index) => { + + if (item.value === this.formData.sta_RadarType) { + active = index; } }); return active; } }, methods: { + getLinkedCnt() {//获取在线设备的数量 + let f = this.getDevice(); + // #ifdef APP-PLUS + if (!f) { + return; + } + // #endif + // #ifdef H5 + f = { + deviceId: '12345' + } + // #endif + + + if (ble) { + let buffer = { + ins_Quantity: "query" + }; + ble.sendString(f.deviceId, buffer, f.writeServiceId, f.wirteCharactId, 30).then(res=>{ + setTimeout(()=>{ + this.getWarns(); + },1500); + }).catch(()=>{ + this.getWarns(); + }) + } + + + }, + getWarns() { + return new Promise((resolve, reject) => { + if (!these.device.id) { + return; + } + + let warnKey = "102_" + these.device.id + "_warning"; + let linkKey = "102_" + these.device.id + "_linked"; + let p1 = new Promise((succ, err) => { + uni.getStorage({ + key: warnKey, + success(res) { + let data = res.data; + let fs = data.filter(v => { + return !v.read + }); + succ(fs); + }, + fail(ex) { + err(null); + } + }); + }); + + let p2 = new Promise((succ, err) => { + uni.getStorage({ + key: linkKey, + success(res) { + console.error("获取到联机数据",res); + let data = res.data; + let fs = data.filter(v => { + return !v.read + }); + console.error("未读联机数据",fs); + succ(fs); + }, + fail(ex) { + err(null); + } + }); + }); + + Promise.allSettled([p1, p2]).then(results => { + let fs = []; + + if (results[0].status == 'fulfilled') { + fs=fs.concat(results[0].value); + } + if (results[1].status == 'fulfilled') { + fs=fs.concat(results[1].value); + } +console.error("获取到未读消息",fs); + these.$set(these.Status.navbar.icons[0], "math", fs.length); + }); + + + }); + + }, + + gotoHistory(item, s) { + + uni.navigateTo({ + url: '/pages/102/HBY102_History', + success: (res) => { + res.eventChannel.emit('detailData', { + data: these.device + }); + } + }); + + }, + gotoShare(item, s) { + uni.navigateTo({ + url: '/pages/common/share/index', + events: { + ack: function(data) {} + }, + success: (res) => { + let json = { + persissonType: '102' + }; + Object.assign(json, this.device); + res.eventChannel.emit('share', { + data: json + }); + } + }) + }, + handleRightClick(item, s) { + if (item && item.callback) { + item.callback(item, s); + } else { + uni.showModal({ + content: '敬请期待' + }) + + } + }, + navigatorBack() { + uni.navigateBack(); + }, actionSett(item, index) { + + if (!this.permissions.includes(item.permission) && this.Status.apiType !== 'listA') { + + this.showPop({ + message: '无操作权限', + iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png", + borderColor: "#e034344d", + buttonBgColor: "#E03434", + okCallback: null, + buttonText: "确定" + }) + return; + } + + if (item.group == 'sta_LedType') { this.sosSetting(item, index); return; @@ -488,7 +689,7 @@ if (item.group == 'sta_RadarType') { // this.toggleRedar(item, index); - this.showRedarSetting(item,index); + this.showRedarSetting(item, index); return; } @@ -555,24 +756,24 @@ }, - showRedarSetting(){ - this.Status.BottomMenu.show=true; - this.Status.BottomMenu.showBtn=false; - - this.Status.BottomMenu.title="感应距离设置"; - - this.Status.BottomMenu.textAlign="center"; - - this.Status.BottomMenu.showMask=true; - this.Status.BottomMenu.activeIndex=this.activeIndex; + showRedarSetting() { + this.Status.BottomMenu.show = true; + this.Status.BottomMenu.showBtn = false; + + this.Status.BottomMenu.title = "感应距离设置"; + + this.Status.BottomMenu.textAlign = "center"; + + this.Status.BottomMenu.showMask = true; + this.Status.BottomMenu.activeIndex = this.activeIndex; }, - btnClick(item,index){ - this.Status.BottomMenu.show=false; - console.log("选中的项:"+index+",值:"+JSON.stringify(item)); - this.toggleRedar(item,index); + btnClick(item, index) { + this.Status.BottomMenu.show = false; + console.log("选中的项:" + index + ",值:" + JSON.stringify(item)); + this.toggleRedar(item, index); }, - closeActionSheet(){ - this.Status.BottomMenu.show=false; + closeActionSheet() { + this.Status.BottomMenu.show = false; }, toggleRedar(item, index) { //雷达启停 let f = this.getDevice(); @@ -601,7 +802,7 @@ .then(res => { debugger; this.formData.sta_RadarType = val; - this.Status.BottomMenu.activeIndex=index; + this.Status.BottomMenu.activeIndex = index; these.setBleFormData(); resolve(); }) @@ -642,6 +843,19 @@ sosSetting(item, isOk) { + if (!this.permissions.includes('46') && this.Status.apiType !== 'listA') { + + this.showPop({ + message: '无操作权限', + iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png", + borderColor: "#e034344d", + buttonBgColor: "#E03434", + okCallback: null, + buttonText: "确定" + }) + return; + } + if (item.key == 'led_alarm' && this.formData.sta_LedType == 'led_alarm') { return; } @@ -817,59 +1031,66 @@ let json = recei.ReceiveData(receive, device, pagePath, recArr); console.log("json=", json) + setTimeout(()=>{ + this.getWarns(); + },500); - - - let active=-1; - let f=this.Status.BottomMenu.menuItems.find((item,index)=>{ - - if(item.value===json.sta_RadarType){ - active=index; + + let active = -1; + let f = this.Status.BottomMenu.menuItems.find((item, index) => { + + if (item.value === json.sta_RadarType) { + active = index; } }); - this.Status.BottomMenu.activeIndex=active; + this.Status.BottomMenu.activeIndex = active; let msg = []; - if (json.sta_PowerPercent <= 20 && (json.sta_charge===0 || json.sta_charge==='0')) { + if (json.sta_PowerPercent <= 20 && (json.sta_charge === 0 || json.sta_charge === '0')) { msg.push("设备电量低"); } - - if(json.sta_sosadd_off){//某个设备解除报警 - this.warnDevices.filter((d,index)=>{ - if(d.mac===json.sta_sosadd_off){ - this.warnDevices.splice(index,1); + + if (json.sta_sosadd_off) { //某个设备解除报警 + this.warnDevices.filter((d, index) => { + if (d.mac === json.sta_sosadd_off) { + this.warnDevices.splice(index, 1); } }); } - - + + let keys = Object.keys(json); - + keys.forEach(key => { if (key in this.formData) { // console.log("key=",key+",value=",json[key]); this.formData[key] = json[key]; } }); - - if (json.sta_sosadd) {//某个设备闯入报警 - console.log("查询设备中",json.sta_sosadd); + + if (json.sta_sosadd) { //某个设备闯入报警 + console.log("查询设备中", json.sta_sosadd); this.searchDevice(json.sta_sosadd).catch(ex => {}).then(dev => { console.log("dev=", dev); - let d=this.warnDevices.find(v=>{return v.mac===json.sta_sosadd}); - let deviceName=""; + let d = this.warnDevices.find(v => { + return v.mac === json.sta_sosadd + }); + let deviceName = ""; if (dev) { // this.formData.sta_sosName=dev.deviceName; msg.push('"' + dev.deviceName + '"闯入报警中'); - deviceName=dev.deviceName; - + deviceName = dev.deviceName; + } else { msg.push('闯入报警中'); // this.formData.sta_sosName=""; } - if(!d){ - this.warnDevices.push({mac:json.sta_sosadd,name:deviceName}); + if (!d) { + this.warnDevices.push({ + mac: json.sta_sosadd, + name: deviceName + }); } this.showMsg(msg.join(',')); }); @@ -898,7 +1119,7 @@ }, getWarDevice(macStr) { - console.log("macStr=",macStr); + console.log("macStr=", macStr); if (macStr) { if (!macStr.includes(':')) { @@ -1158,6 +1379,11 @@ \ No newline at end of file diff --git a/pages/102/HBY102_History.vue b/pages/102/HBY102_History.vue new file mode 100644 index 0000000..fc8fd88 --- /dev/null +++ b/pages/102/HBY102_History.vue @@ -0,0 +1,1327 @@ + + + + + + \ No newline at end of file diff --git a/pages/210/HBY210.vue b/pages/210/HBY210.vue index ad2cdb1..9e6f65f 100644 --- a/pages/210/HBY210.vue +++ b/pages/210/HBY210.vue @@ -228,7 +228,7 @@ :key="index" > @@ -356,9 +356,7 @@ laserModeSettings, //激光模式设置 mapReverseGeocoding //地图逆解析 } from '@/api/6170/deviceControl.js' - import { - getDeviceId - } from '../../store/BLETools'; + import { baseURL, getToken, diff --git a/pages/4877/BJQ4877.vue b/pages/4877/BJQ4877.vue index ac72311..d0fcd77 100644 --- a/pages/4877/BJQ4877.vue +++ b/pages/4877/BJQ4877.vue @@ -107,7 +107,7 @@ - @@ -125,15 +125,15 @@ 箭头模式 - 箭头朝向 + 朝向/颜色 - + @@ -141,10 +141,10 @@ - 红色朝前 + 朝左 - + @@ -153,10 +153,37 @@ mode="aspectFit"> - 绿色朝后 + 朝右 + + + + + + + + + + + 红色 + + + + + + + + 绿色 + + + + + + @@ -248,14 +275,11 @@ hideLoading, updateLoading } from '@/utils/loading.js' - import { - request, - baseURL - } from '../../utils/request'; +import request, { baseURL } from '@/utils/request.js'; import { colors as groupColors } from '@/api/4877/BJQ4877.js'; - + import MqTool from '@/utils/MqHelper.js' const pagePath = "/pages/4877/BJQ4877"; @@ -265,7 +289,7 @@ var recei = null; var interval = null; var slidTime = null; - var mq=null; + var mq = null; export default { data() { return { @@ -346,7 +370,11 @@ sta_GroupType: -1, //配组 sta_ArrowType: '', //箭头方向 warnTime: 0, - sta_Channel: 80 + sta_Channel: 31, + sta_ArrowMode:'', + groups: [ + + ] }, dic: { SOS: [{ @@ -361,10 +389,8 @@ img: '/static/images/4877/fan.png', activeImg: '/static/images/4877/fanActive.png' } - ], - groups: [ - ] + }, device: { id: "", @@ -391,19 +417,19 @@ onUnload() { console.log("页面卸载,释放资源"); ble.removeAllCallback(pagePath); - if(mq){ - mq.unSubscribes(); - mq.disconnect(); + if (mq) { + mq.unSubscribes(); + mq.disconnect(); } - ble=null; - mq=null; + ble = null; + mq = null; clearInterval(interval); }, onLoad: function() { these = this; recei = BleReceive.getBleReceive(); ble = BleTool.getBleTool(); - mq=MqTool.getMqTool(); + mq = MqTool.getMqTool(); this.dic.gropus = []; @@ -433,19 +459,28 @@ return false; }); - these.dic.groups = groups; + these.formData.groups = groups; } var device = data.data; these.device = device; - - let arr=[{topic:'C/4877_Groups_'+these.device.id,callback:these.getCheckedColors}]; - mq.init().then(res=>{ - mq.subscribes(arr).catch(ex=>{ - console.error("ex=",ex); + + let arr = [{ + topic: 'C/4877_Groups_' + these.device.id, + callback: these.getCheckedColors + } + // , + // { + // topic: 'C/4877_Channel_' + these.device.id, + // callback: these.getChannel + // } + ]; + mq.init().then(res => { + mq.subscribes(arr).catch(ex => { + console.error("ex=", ex); }); }) - + let f = ble.data.LinkedList.find((v) => { if (v.macAddress == device.deviceMac) { // console.log("找到设备了", v); @@ -474,8 +509,8 @@ these.formData.bleStatu = false; these.formData.deviceId = f.deviceId; - these.formData.warnTime=null; - these.formData.sta_SOSType='sos_off'; + these.formData.warnTime = null; + these.formData.sta_SOSType = 'sos_off'; ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { these.formData.bleStatu = true; }); @@ -496,38 +531,53 @@ }, methods: { - getCheckedColors(rec){ - console.error("收到MQ消息:",rec); - try{ - - let str=rec.receive.payloadString; - let arr=JSON.parse(str); - - - let groups = groupColors.filter((v,index) => { - if(arr[index]===1){ - return true; - } - return false; - }); - - these.dic.groups = groups; - - let checks = groups.map(item => { - return item.id - }); - - uni.setStorage({ - key: "4877CheckColor_" + this.device.id, - data: checks - }); - - - }catch(err){ - + getChannel(rec) { + console.error("收到MQ信道保留消息:", rec); + try { + + let str = rec.receive.payloadString; + let json = JSON.parse(str); + if('ins_channel' in json){ + this.formData.sta_Channel=json.ins_channel; + these.setBleFormData(); + } + + } catch (err) { + } - - + }, + getCheckedColors(rec) { + console.error("收到MQ消息:", rec); + try { + + let str = rec.receive.payloadString; + let arr = JSON.parse(str); + + + let groups = groupColors.filter((v, index) => { + if (arr[index] === 1) { + return true; + } + return false; + }); + + these.formData.groups = groups; + console.error("groups=",these.formData.groups); + let checks = groups.map(item => { + return item.id + }); + + uni.setStorage({ + key: "4877CheckColor_" + this.device.id, + data: checks + }); + + + } catch (err) { + + } + + }, ShowChannelEdit() { this.Status.ShowEditChannel = true; @@ -547,15 +597,15 @@ promptTitle: '', modelValue: '', visibleClose: false, - okCallback: ()=>{ + okCallback: () => { this.onChannelChanging(); - this.Status.ShowEditChannel=false; + this.Status.ShowEditChannel = false; }, showSlot: true, buttonCancelText: '取消', showCancel: true, - cancelCallback:()=>{ - this.Status.ShowEditChannel=false; + cancelCallback: () => { + this.Status.ShowEditChannel = false; } }); }, @@ -566,7 +616,7 @@ return; } let f = this.getDevice(); - + if (!f) { this.showBleUnConnect(); return; @@ -580,6 +630,14 @@ json = JSON.stringify(json); ble.sendString(f.deviceId, json, f.writeServiceId, f.wirteCharactId, 30).then(res => { console.log("发送成功"); + + // mq.sendData('C/4877_Channel_' + these.device.id, JSON.stringify(json), true).then( + // res => { + // console.log("发送成功,", res) + // }).catch(err => { + // console.error("err=", err); + // }); + this.setBleFormData(); }).catch(ex => { this.showMsg(ex.msg); @@ -587,6 +645,31 @@ }, 200) + }, + ArrowModeSet(val) { + if (this.formData.sta_SOSType === 'sos') { + this.showMsg("设备强制报警中,请先关闭报警") + return; + } + + let f = this.getDevice(); + if (!f) { + this.showBleUnConnect(); + return; + } + if (this.formData.sta_ArrowMode === val) { + return; + } + + var json = { + ins_right_side: val + } + json = JSON.stringify(json); + ble.sendString(f.deviceId, json, f.writeServiceId, f.wirteCharactId, 30).then(res => { + this.formData.sta_ArrowMode = val; + }).catch(ex => { + this.showMsg(ex.msg); + }); }, ArrowSet(val) { if (this.formData.sta_SOSType === 'sos') { @@ -631,7 +714,7 @@ return false; }); - these.dic.groups = arr; + these.formData.groups = arr; these.CheckGroupOver(data.allFlag); } }, @@ -648,17 +731,17 @@ return; } - mq.sendData('C/4877_Groups_'+these.device.id,JSON.stringify(arr),true).then(res=>{ - console.log("发送成功,",res) - }).catch(err=>{ - console.error("err=",err); + mq.sendData('C/4877_Groups_' + these.device.id, JSON.stringify(arr), true).then(res => { + console.log("发送成功,", res) + }).catch(err => { + console.error("err=", err); }); var json = { ins_GroupType: arr } json = JSON.stringify(json); ble.sendString(f.deviceId, json, f.writeServiceId, f.wirteCharactId, 30).then(res => { - + this.setBleFormData(); }).catch(ex => { this.showMsg(ex.msg); }); @@ -672,11 +755,11 @@ // borderColor: "#e034344d", // buttonBgColor: "#E03434", // okCallback: () => { - clearInterval(interval); + clearInterval(interval); - this.sosSetting({ - val: val - }); + this.sosSetting({ + val: val + }); // }, // buttonText: "解除", // showCancel: true, @@ -715,21 +798,21 @@ } groupSet(); }, - SOSEvt(){ + SOSEvt() { if (this.formData.sta_SOSType == 'sos') { - this.formData.sta_ArrowType='arrow_off'; + this.formData.sta_ArrowType = 'arrow_off'; this.formData.warnTime = 0; clearInterval(interval); interval = setInterval(() => { this.formData.warnTime += 1; }, 1000) - }else{ + } else { clearInterval(interval); - interval=null; + interval = null; this.formData.warnTime = 0; } }, - + sosSetting(item, index) { let f = this.getDevice(); @@ -750,7 +833,7 @@ ble.sendString(f.deviceId, json, f.writeServiceId, f.wirteCharactId, 30).then(res => { this.formData.sta_GroupType = -1; this.formData.sta_SOSType = json.ins_SOSType - + these.SOSEvt(); }) @@ -759,9 +842,9 @@ }); } - - - let confirmTask=()=>{ + + + let confirmTask = () => { this.showPop({ message: '确定' + (this.formData.sta_SOSType === 'sos' ? '关闭' : '开启') + '声光报警模式?', iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png", @@ -777,14 +860,14 @@ confirmTask(); } else if (item.val === 'sos_off') { - - if(this.formData.sta_SOSType === 'sos'){ + + if (this.formData.sta_SOSType === 'sos') { confirmTask(); - }else{ + } else { task(); } - - + + } else { if (this.formData.sta_SOSType === 'sos') { @@ -922,14 +1005,14 @@ this.formData[key] = data[key]; } }); - - + + let msg = []; if (data.sta_SOSType == 'sos') { msg.push("设备声光报警中"); - + } - if('sta_SOSType' in data){ + if ('sta_SOSType' in data) { these.SOSEvt(); } if (data.sta_PowerPercent <= 20) { @@ -1566,7 +1649,7 @@ border-radius: 16rpx; background: rgba(26, 26, 26, 1); width: 100%; - padding: 10rpx 0rpx; + padding: 20rpx 0rpx; } .modeSetting { @@ -1600,7 +1683,22 @@ letter-spacing: 0.14rpx; } + + + .modeSetting .arrow .outCircle .text { + margin-top:0rpx !important; + + + } + +.arrowContent .line { + width:calc(100% - 60rpx); + + height: 0rpx; + border-bottom:1px solid #ffffff30; + margin: 30rpx ; +} .modeSetting .arrow .outCircle { width: 120rpx; height: 120rpx; @@ -1632,6 +1730,8 @@ align-items: center; } + + .modeSetting .arrow.active .outCircle { border: 4rpx solid rgba(174, 214, 0, 1); padding: 4rpx; @@ -1642,6 +1742,35 @@ border-radius: 50%; } + + + .modeSetting .arrow.redactive .outCircle { + border: 4rpx solid #EC2A2A; + padding: 4rpx; + } + + .modeSetting .arrow.redactive .item { + background: #EC2A2A; + border-radius: 50%; + + } + + .modeSetting .arrow.greenactive .outCircle { + border: 4rpx solid #00BD00; + padding: 4rpx; + } + + .modeSetting .arrow.greenactive .item { + background: #00BD00; + border-radius: 50%; + + } + + .modeSetting .arrow.redactive .item .text, + .modeSetting .arrow.greenactive .item .text{ + color:#FFFFFFde !important; + } + .modeSetting .item .img { width: 52rpx; diff --git a/pages/4877/BJQ4877V1.vue b/pages/4877/BJQ4877V1.vue index 6b197bd..ee7108c 100644 --- a/pages/4877/BJQ4877V1.vue +++ b/pages/4877/BJQ4877V1.vue @@ -240,10 +240,7 @@ hideLoading, updateLoading } from '@/utils/loading.js' - import { - request, - baseURL - } from '../../utils/request'; +import request, { baseURL } from '@/utils/request.js'; import usrApi from '@/api/670/HBY670.js' const pagePath = "/pages/4877/BJQ4877"; diff --git a/pages/6107/BJQ6107.vue b/pages/6107/BJQ6107.vue new file mode 100644 index 0000000..609be9a --- /dev/null +++ b/pages/6107/BJQ6107.vue @@ -0,0 +1,1968 @@ + + + + + \ No newline at end of file diff --git a/pages/6155/BJQ6155.vue b/pages/6155/BJQ6155.vue new file mode 100644 index 0000000..b4ad2a2 --- /dev/null +++ b/pages/6155/BJQ6155.vue @@ -0,0 +1,2166 @@ + + + + + \ No newline at end of file diff --git a/pages/6155/ImgCrop.vue b/pages/6155/ImgCrop.vue index 048727f..c6209ea 100644 --- a/pages/6155/ImgCrop.vue +++ b/pages/6155/ImgCrop.vue @@ -4,7 +4,7 @@ + @crop="handleCrop" :areaScale="0.1" :minScale="0.1" :gpu="true"> diff --git a/pages/6331/BJQ6331.vue b/pages/6331/BJQ6331.vue index 300a0c4..2df7f36 100644 --- a/pages/6331/BJQ6331.vue +++ b/pages/6331/BJQ6331.vue @@ -234,10 +234,7 @@ hideLoading, updateLoading } from '@/utils/loading.js' - import { - request, - baseURL - } from '../../utils/request'; +import request, { baseURL } from '@/utils/request.js'; import usrApi from '@/api/670/HBY670.js' const pagePath = "pages/6331/BJQ6331"; diff --git a/pages/650/HBY650.vue b/pages/650/HBY650.vue index c5be0eb..6c63309 100644 --- a/pages/650/HBY650.vue +++ b/pages/650/HBY650.vue @@ -56,6 +56,10 @@ + + 前置 + 低档 @@ -68,10 +72,14 @@ @click="MainModeSetting('hight','staticBattery')"> 高档 - 关闭 - + --> @@ -181,10 +189,7 @@ hideLoading, updateLoading } from '@/utils/loading.js' - import { - request, - baseURL - } from '../../utils/request'; +import request, { baseURL } from '@/utils/request.js'; import usrApi from '@/api/670/HBY670.js' const pagePath = "/pages/650/HBY650"; @@ -335,6 +340,7 @@ these.showBleUnConnect(); + console.error("111111"); these.getDetail(); return; } @@ -348,13 +354,14 @@ } these.formData.blename = f.name ? f.name : "Unname"; these.formData.deviceName = device.deviceName; - + these.formData.bleStatu = false; these.formData.deviceId = f.deviceId; ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { these.formData.bleStatu = true; }); these.setBleFormData(); + console.error("222222"); these.getDetail(); @@ -566,7 +573,7 @@ getDetail() { var that = this; usrApi.getDetail(this.device.id).then(res => { - console.log("res=", res); + console.log("获取人员信息=", res); if (res && res.code == 200) { res = res.data; let personnelInfo = res.personnelInfo; @@ -575,8 +582,24 @@ that.formData.name = personnelInfo.name; that.formData.job = personnelInfo.position; that.formData.id = personnelInfo.code + return; } } + let phone = uni.getStorageSync('phone'); + if (phone === '17671332251') { + console.log("default=",that.device); + that.formData.company = '湖北消防总队'; + that.formData.name = '胡红军'; + that.formData.job = '中队长'; + let arr=that.device.bluetoothName.split('-'); + if(arr.length>1){ + that.formData.id =arr[arr.length-1]; + }else{ + that.formData.id =that.device.bluetoothName; + } + + } + }); }, @@ -594,16 +617,19 @@ }, MainModeSetting: function(type, byteType) { if (this.formData.modeCurr == type) { - return; + type = 'close'; } showLoading(this, { text: "请稍候..." }); let task = () => { - this.formData.modeCurr = type; + let dataValue = 0x00; let btype = 0x00; switch (type) { + case "smalllow": + dataValue = 0x68; + break; case "low": //低档 dataValue = 0x67; break; @@ -655,8 +681,7 @@ // 发送数据 ble.sendData(f.deviceId, buffer, f.writeServiceId, f.wirteCharactId, 10).then(() => { - - + this.formData.modeCurr = type; console.log("发送成功了"); }).catch((ex) => { @@ -1084,10 +1109,12 @@ hideLoading(these); return; } - + console.log("baseURL=", baseURL); + console.log("token", token); + console.log("clientID", clientid); uni.uploadFile({ // url: 'http://114.55.111.217/video/upload', - url: baseURL + "app/video/upload", + url: baseURL + "/app/video/upload", filePath: videoPath, name: 'file', header: { @@ -1115,6 +1142,7 @@ let res = arr[1]; res = JSON.parse(res.data); + if (res.data) { these.videoHexArray = res.data; updateLoading(these, { diff --git a/pages/670/HBY670.vue b/pages/670/HBY670.vue index 6c6f871..0142f06 100644 --- a/pages/670/HBY670.vue +++ b/pages/670/HBY670.vue @@ -1,10 +1,21 @@