diff --git a/pages/008A/HBY008A.vue b/pages/008A/HBY008A.vue index 6293c63..2dd2dc4 100644 --- a/pages/008A/HBY008A.vue +++ b/pages/008A/HBY008A.vue @@ -325,6 +325,9 @@ 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'; + MsgError("连接错误:" + ex.msg, "确定", these); }); }); @@ -351,6 +354,7 @@ these.formData.bleStatu = true; }).catch(ex => { these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); }); return; } @@ -480,6 +484,8 @@ updateLoading(these, { text: ex.msg }) + these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); }).finally(() => { setTimeout(() => { hideLoading(these); diff --git a/pages/018A/HBY018A.vue b/pages/018A/HBY018A.vue index 8be3957..a8a5ae1 100644 --- a/pages/018A/HBY018A.vue +++ b/pages/018A/HBY018A.vue @@ -16,7 +16,8 @@ - {{formData.sta_charge?dic.sta_charge[formData.sta_charge+'']:"未充电" }} + + {{formData.sta_charge?dic.sta_charge[formData.sta_charge+'']:"未充电" }} 设备状态 @@ -54,7 +55,7 @@ + @click="sosSetting(dic.sta_LightType[4],4)"> {{formData.sta_LedType==='led_alarm'?'报警中':'声光报警'}} 解除 @@ -72,7 +73,7 @@ @@ -118,21 +119,13 @@ - - - + - + @@ -144,7 +137,15 @@ showLoading, hideLoading, updateLoading - } from '@/utils/loading.js' + } from '@/utils/loading.js'; + import { + MsgSuccess, + MsgError, + MsgClose, + MsgWarning, + showPop, + MsgInfo + } from '@/utils/MsgPops.js' import request, { baseURL } from '@/utils/request.js' @@ -167,26 +168,7 @@ curr: 0, total: 0, pageHide: false, - Pop: { - showPop: false, //是否显示弹窗 - popType: 'custom', - bgColor: '#383934bd', - borderColor: '#BBE600', - textColor: '#ffffffde', - buttonBgColor: '#BBE600', - buttonTextColor: '#232323DE', - iconUrl: '', - message: '您确定要这样做吗?', - buttonText: '确定', - clickEvt: '', - visiblePrompt: false, - promptTitle: '设备名称', - modelValue: '', - visibleClose: false, - okCallback: null, - buttonCancelText: '', - showCancel: false, - }, + usrToggle: false, }, @@ -340,7 +322,10 @@ these.formData.deviceId = f.deviceId; ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { these.formData.bleStatu = true; - }); + }).catch(ex => { + these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; these.formData.sta_IntrusTime = 0; these.formData.sta_sosadd = ""; these.setBleFormData(); @@ -362,7 +347,10 @@ ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { console.log("连接成功") these.formData.bleStatu = true; - }); + }).catch(ex => { + these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; } }, computed: { @@ -401,7 +389,7 @@ these.setBleFormData(); }).catch(ex => { - this.showMsg(ex.msg); + MsgError(ex.msg,'',these); }); }, @@ -443,7 +431,7 @@ these.setBleFormData(); resolve(); }).catch(ex => { - this.showMsg(ex.msg); + MsgError(ex.msg,'',these); reject(ex); }); }); @@ -451,7 +439,7 @@ } if (item.key == 'led_alarm') { - this.showPop({ + showPop({ message: '确定开启声光报警?', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", @@ -462,10 +450,10 @@ buttonText: "开启", showCancel: true, buttonCancelText: '取消' - }); + },these); } else { if (this.formData.sta_LedType == 'led_alarm') { - this.showPop({ + showPop({ message: '确定解除声光报警模式?', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", @@ -482,7 +470,7 @@ showCancel: true, buttonCancelText: '取消' - }); + },these); } else { task(item.key); } @@ -559,7 +547,8 @@ }).catch(ex => { updateLoading(these, { text: ex.msg - }) + }); + these.formData.bleStatu = 'err'; }).finally(() => { setTimeout(() => { hideLoading(these); @@ -620,7 +609,7 @@ if (msg.length > 0) { - this.showMsg(msg.join(',')); + MsgError(msg.join(','),'',these); } these.setBleFormData(); @@ -655,7 +644,7 @@ }, showBleUnConnect() { - this.showPop({ + showPop({ message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备", iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", @@ -683,7 +672,7 @@ } }) } - }); + },these); }, proParam: function() { @@ -714,90 +703,10 @@ - closePop: function() { - this.Status.Pop.showPop = false; - - if (this.Status.Pop.cancelCallback) { - this.Status.Pop.cancelCallback(); - } - }, - HidePop: function() { - if (this.Status.Pop.clickEvt == 'SendUsr') { - - } - - - this.Status.Pop.showPop = false; - if (this.Status.Pop.okCallback) { - this.Status.Pop.okCallback(); - } - }, - showPop: function(option) { - // hideLoading(this); - let def = { - showPop: true, //是否显示弹窗 - popType: 'custom', - bgColor: '#383934bd', - borderColor: '#BBE600', - textColor: '#ffffffde', - buttonBgColor: '#BBE600', - buttonTextColor: '#232323DE', - iconUrl: '', - message: '', - buttonText: '确定', - clickEvt: '', - visiblePrompt: false, - promptTitle: '', - modelValue: '', - visibleClose: false, - okCallback: null, - showSlot: false, - buttonCancelText: '', - showCancel: false, - } - - let keys = Object.keys(def); - - for (let i = 0; i < keys.length; i++) { - let key = keys[i]; - if (key in option) { - continue; - } - this.Status.Pop[key] = def[key]; - } - if (option) { - keys = Object.keys(option); - for (let i = 0; i < keys.length; i++) { - let key = keys[i]; - - this.Status.Pop[key] = option[key]; - } - } - - if (!option.borderColor) { - option.borderColor = '#BBE600'; - option.buttonBgColor = '#BBE600'; - } - these.Status.Pop.showPop = true; - }, - showMsg(msg, isSucc) { - let icoUrl = '/static/images/common/uploadErr.png'; - let borderColor = "#e034344d"; - let buttonBgColor = "#E03434"; - if (isSucc) { - icoUrl = '/static/images/common/success.png'; - borderColor = "#BBE600"; - buttonBgColor = "#BBE600"; - } - this.showPop({ - message: msg, - iconUrl: icoUrl, - borderColor: borderColor, - buttonBgColor: buttonBgColor, - buttonText: '确定', - okCallback: null - }); - } + + + + } } diff --git a/pages/100/HBY100.vue b/pages/100/HBY100.vue index edc6b87..a07fe3c 100644 --- a/pages/100/HBY100.vue +++ b/pages/100/HBY100.vue @@ -10,7 +10,7 @@ + @click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons"> {{item.math>9?'9+':item.math}} @@ -62,9 +62,9 @@ {{getbleStatu}} + 设备状态 + {{formData.sta_system?dic.sta_system[formData.sta_system]:"" }} + --> @@ -96,9 +96,10 @@ + v-for="item,index in dic.sta_VoiceType" :class="{'active':formData.sta_VoiceType===item.key, + 'displayNone' :!Status.usrToggle && index> + 3 + }"> {{item.name}} @@ -121,12 +122,12 @@ + :class="{'active':formData.sta_VoiceType==='8'}"> + src="/static/images/common/play.png" mode="aspectFit"> + src="/static/images/common/pauseActive.png" mode="aspectFit"> 播放语音 @@ -163,9 +164,9 @@ }" v-on:click.stop="lightTypeSet(item,index)"> + src="/static/images/100/light.png" mode="aspectFit"> + src="/static/images/100/lightActive.png" mode="aspectFit"> @@ -193,8 +194,8 @@ + activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde" + @change="onBrightnessChanged" @changing="onBrightnessChanging" class="custom-slider" /> @@ -205,8 +206,8 @@ + activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde" + @change="onFreqChanged" @changing="onFreqChanging" class="custom-slider" /> @@ -217,8 +218,8 @@ + activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde" + @change="onVolumeChanged" @changing="onVolumeChanging" class="custom-slider" /> @@ -246,27 +247,9 @@ - - - - - + + @@ -279,7 +262,15 @@ showLoading, hideLoading, updateLoading - } from '@/utils/loading.js' + } from '@/utils/loading.js'; + import { + MsgSuccess, + MsgError, + MsgClose, + MsgWarning, + showPop, + MsgInfo + } from '@/utils/MsgPops.js'; import request, { baseURL } from '@/utils/request.js'; @@ -311,26 +302,7 @@ curr: 0, total: 0, pageHide: false, - Pop: { - showPop: false, //是否显示弹窗 - popType: 'custom', - bgColor: '#383934bd', - borderColor: '#BBE600', - textColor: '#ffffffde', - buttonBgColor: '#BBE600', - buttonTextColor: '#232323DE', - iconUrl: '', - message: '您确定要这样做吗?', - buttonText: '确定', - clickEvt: '', - visiblePrompt: false, - promptTitle: '设备名称', - modelValue: '', - visibleClose: false, - okCallback: null, - buttonCancelText: '', - showCancel: false, - }, + BottomMenu: { show: false, showHeader: true, @@ -520,7 +492,7 @@ this.$watch("formData.sta_battery", (newVal, oldVal) => { if (newVal <= 20 && this.formData.sta_system == 2) { - this.showMsg("设备电量低"); + MsgError("设备电量低",'',these); } }); @@ -582,6 +554,7 @@ these.formData.bleStatu = true; }).catch(ex => { these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); }); these.setBleFormData(); @@ -602,7 +575,10 @@ ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { console.log("连接成功") these.formData.bleStatu = true; - }); + }).catch(ex => { + these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; } }, computed: { @@ -656,14 +632,14 @@ audioManager() { if (!this.permissions.includes('52') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } uni.navigateTo({ @@ -846,7 +822,7 @@ text: "握手成功,等待设备响应" }); }).catch(ex => { - this.showMsg(ex.msg); + MsgError(ex.msg,'',these); }); }, @@ -991,14 +967,14 @@ onFreqChanging(e){ if (!this.permissions.includes('51') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } let f = this.getDevice(); @@ -1043,14 +1019,14 @@ onFreqChanging(e){ if (!this.permissions.includes('50') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } @@ -1083,12 +1059,12 @@ onFreqChanging(e){ this.formData.sta_VoiceType = val; these.setBleFormData(); }).catch(ex => { - this.showMsg(ex.msg); + MsgError(ex.msg,'',these); }); }, showUnWarn(val) { - this.showPop({ + showPop({ message: '确定解除声光报警模式?', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", @@ -1102,20 +1078,20 @@ onFreqChanging(e){ showCancel: true, buttonCancelText: '取消' - }); + },these); }, sosSetting(item, isOk) { if (!this.permissions.includes('50') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } @@ -1164,7 +1140,7 @@ onFreqChanging(e){ }) .catch(ex => { - this.showMsg(ex.msg); + MsgError(ex.msg,'',these); }); } @@ -1173,7 +1149,7 @@ onFreqChanging(e){ this.showUnWarn(0); } else { - this.showPop({ + showPop({ message: '确定开启强制报警?', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", @@ -1182,7 +1158,7 @@ onFreqChanging(e){ buttonText: "开启", showCancel: true, buttonCancelText: '取消' - }); + },these); } @@ -1371,6 +1347,7 @@ onFreqChanging(e){ these.formData.bleStatu = true; }).catch(ex => { these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); }); return; } @@ -1393,7 +1370,7 @@ onFreqChanging(e){ }, showBleUnConnect() { - this.showPop({ + showPop({ message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备", iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", @@ -1421,7 +1398,7 @@ onFreqChanging(e){ } }) } - }); + },these); }, proParam: function() { @@ -1452,93 +1429,8 @@ onFreqChanging(e){ - closePop: function() { - this.Status.Pop.showPop = false; - - if (this.Status.Pop.cancelCallback) { - this.Status.Pop.cancelCallback(); - } - }, - HidePop: function() { - if (this.Status.Pop.clickEvt == 'SendUsr') { - - } - - - this.Status.Pop.showPop = false; - if (this.Status.Pop.okCallback) { - this.Status.Pop.okCallback(); - } - }, - showPop: function(option) { - // hideLoading(this); - let def = { - showPop: true, //是否显示弹窗 - popType: 'custom', - bgColor: '#383934bd', - borderColor: '#BBE600', - textColor: '#ffffffde', - buttonBgColor: '#BBE600', - buttonTextColor: '#232323DE', - iconUrl: '', - message: '', - buttonText: '确定', - clickEvt: '', - visiblePrompt: false, - promptTitle: '', - modelValue: '', - visibleClose: false, - okCallback: null, - showSlot: false, - buttonCancelText: '', - showCancel: false, - } - - let keys = Object.keys(def); - - for (let i = 0; i < keys.length; i++) { - let key = keys[i]; - if (key in option) { - continue; - } - this.Status.Pop[key] = def[key]; - } - if (option) { - keys = Object.keys(option); - for (let i = 0; i < keys.length; i++) { - let key = keys[i]; - - this.Status.Pop[key] = option[key]; - } - } - - if (!option.borderColor) { - option.borderColor = '#BBE600'; - option.buttonBgColor = '#BBE600'; - } - these.Status.Pop.showPop = true; - }, - showMsg(msg, isSucc) { - let icoUrl = '/static/images/common/uploadErr.png'; - let borderColor = "#e034344d"; - let buttonBgColor = "#E03434"; - if (isSucc) { - icoUrl = '/static/images/common/success.png'; - borderColor = "#BBE600"; - buttonBgColor = "#BBE600"; - } - this.showPop({ - message: msg, - iconUrl: icoUrl, - borderColor: borderColor, - buttonBgColor: buttonBgColor, - buttonText: '确定', - okCallback: null - }); - }, - btnClick() { - - } + + } } diff --git a/pages/102/HBY102.vue b/pages/102/HBY102.vue index 1ab809c..57d147c 100644 --- a/pages/102/HBY102.vue +++ b/pages/102/HBY102.vue @@ -10,7 +10,7 @@ + v-for="item,index in Status.navbar.icons"> {{item.math>9?'9+':item.math}} @@ -37,7 +37,8 @@ - {{formData.sta_charge?dic.sta_charge[formData.sta_charge+'']:"未充电" }} + + {{formData.sta_charge?dic.sta_charge[formData.sta_charge+'']:"未充电" }} 设备状态 @@ -60,7 +61,7 @@ 蓝牙状态 - {{getbleStatu}} + {{getbleStatu}} 信道:{{formData.sta_Channel}} @@ -79,7 +80,7 @@ + @click="sosSetting(dic.sta_LightType[6],6)"> {{formData.sta_LedType==='led_alarm'?'报警中':'强制报警'}} 解除 @@ -97,7 +98,7 @@ @@ -125,7 +126,7 @@ {return v.group!=='sta_LedType'})" :class="{'active':formData[item.group]===item.key, 'marginLeft':index%2===1, 'displayNone':!item.show }" v-on:click.stop="actionSett(item,index)"> @@ -172,16 +173,16 @@ + :borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor" + :buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor" + :iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText" + @buttonClick="HidePop" :visiblePrompt="Status.Pop.visiblePrompt" :promptTitle="Status.Pop.promptTitle" + v-model="Status.Pop.modelValue" @closePop="closePop" :buttonCancelText="Status.Pop.buttonCancelText" + :showCancel="Status.Pop.showCancel" @cancelPop="closePop" :showSlot="Status.Pop.showSlot"> 修改信道 + placeholder-class="popup-prompt-input-placeHolder" v-model="formData.ins_Channel" /> @@ -194,6 +195,7 @@ + @@ -211,6 +213,14 @@ } from '@/utils/request.js' import Common from '@/utils/Common.js' + import { + MsgSuccess, + MsgError, + MsgClose, + MsgWarning, + showPop, + MsgInfo + } from '@/utils/MsgPops.js' const pagePath = "/pages/102/HBY102"; var ble = null; @@ -502,6 +512,7 @@ these.formData.bleStatu = true; }).catch(ex => { these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); }); these.formData.sta_IntrusTime = 0; these.formData.sta_sosadd = ""; @@ -524,7 +535,10 @@ ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { console.log("连接成功") these.formData.bleStatu = true; - }); + }).catch(ex => { + these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; } this.getWarns(); // this.getLinkedCnt(); @@ -596,14 +610,14 @@ if (!this.permissions.includes('55') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } @@ -772,14 +786,14 @@ if (!this.permissions.includes(item.permission) && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } @@ -840,7 +854,7 @@ if (val === 'E49_on') { - this.showPop({ + showPop({ message: '确定开启联机模式?', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", @@ -852,7 +866,7 @@ showCancel: true, buttonCancelText: '取消' - }); + },these); } else { task(); } @@ -922,7 +936,7 @@ } if (val == 'status_off') { - this.showPop({ + showPop({ message: '确定关闭物体感应功能?', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", @@ -934,7 +948,7 @@ showCancel: true, buttonCancelText: '取消' - }); + },these); } else { task(); } @@ -945,17 +959,16 @@ sosSetting(item, isOk) { -debugger; if (!this.permissions.includes('46') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } @@ -993,7 +1006,7 @@ debugger; these.setBleFormData(); resolve(); }).catch(ex => { - this.showMsg(ex.msg); + MsgError(ex.msg,null,these); reject(ex); }); }); @@ -1001,7 +1014,7 @@ debugger; } if (item.key == 'led_alarm') { - this.showPop({ + showPop({ message: '确定开启强制报警?', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", @@ -1012,10 +1025,10 @@ debugger; buttonText: "开启", showCancel: true, buttonCancelText: '取消' - }); + },these); } else { if (this.formData.sta_LedType == 'led_alarm') { - this.showPop({ + showPop({ message: '确定解除声光报警模式?', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", @@ -1032,7 +1045,7 @@ debugger; showCancel: true, buttonCancelText: '取消' - }); + },these); } else { let newval=this.formData.sta_LedType===item.key?'led_off':item.key; task(newval); @@ -1202,7 +1215,7 @@ debugger; name: deviceName }); } - this.showMsg(msg.join(',')); + MsgError(msg.join(','),'',these); }); return; // clearInterval(instrusionTime); @@ -1222,7 +1235,7 @@ debugger; // this.formData.sta_IntrusTime = 0; } if (msg.length > 0) { - this.showMsg(msg.join(',')); + MsgError(msg.join(','),'',these); } @@ -1346,6 +1359,7 @@ debugger; these.formData.bleStatu = true; }).catch(ex => { these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); }); return; } @@ -1367,7 +1381,7 @@ debugger; }, showBleUnConnect() { - this.showPop({ + showPop({ message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备", iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", @@ -1395,7 +1409,7 @@ debugger; } }) } - }); + },these); }, proParam: function() { @@ -1423,93 +1437,76 @@ debugger; } }); }, - - - closePop: function() { - this.Status.Pop.showPop = false; + this.Status.Pop.showPop = false; - if (this.Status.Pop.cancelCallback) { - this.Status.Pop.cancelCallback(); - } - }, - HidePop: function() { - if (this.Status.Pop.clickEvt == 'SendUsr') { + if (this.Status.Pop.cancelCallback) { + this.Status.Pop.cancelCallback(); + } +}, +HidePop: function() { + if (this.Status.Pop.clickEvt == 'SendUsr') { - } + } - this.Status.Pop.showPop = false; - if (this.Status.Pop.okCallback) { - this.Status.Pop.okCallback(); - } - }, - showPop: function(option) { - // hideLoading(this); - let def = { - showPop: true, //是否显示弹窗 - popType: 'custom', - bgColor: '#383934bd', - borderColor: '#BBE600', - textColor: '#ffffffde', - buttonBgColor: '#BBE600', - buttonTextColor: '#232323DE', - iconUrl: '', - message: '', - buttonText: '确定', - clickEvt: '', - visiblePrompt: false, - promptTitle: '', - modelValue: '', - visibleClose: false, - okCallback: null, - showSlot: false, - buttonCancelText: '', - showCancel: false, - } + this.Status.Pop.showPop = false; + if (this.Status.Pop.okCallback) { + this.Status.Pop.okCallback(); + } +}, +showPop: function(option) { + hideLoading(this); + let def = { + showPop: true, //是否显示弹窗 + popType: 'custom', + bgColor: '#383934bd', + borderColor: '#BBE600', + textColor: '#ffffffde', + buttonBgColor: '#BBE600', + buttonTextColor: '#232323DE', + iconUrl: '', + message: '', + buttonText: '确定', + clickEvt: '', + visiblePrompt: false, + promptTitle: '', + modelValue: '', + visibleClose: false, + okCallback: null, + showSlot: false, + buttonCancelText: '', + showCancel: false, + } - let keys = Object.keys(def); + let keys = Object.keys(def); - for (let i = 0; i < keys.length; i++) { - let key = keys[i]; - if (key in option) { - continue; - } - this.Status.Pop[key] = def[key]; - } - if (option) { - keys = Object.keys(option); - for (let i = 0; i < keys.length; i++) { - let key = keys[i]; + for (let i = 0; i < keys.length; i++) { + let key = keys[i]; + if (key in option) { + continue; + } + this.Status.Pop[key] = def[key]; + } + if (option) { + keys = Object.keys(option); + for (let i = 0; i < keys.length; i++) { + let key = keys[i]; - this.Status.Pop[key] = option[key]; - } - } + this.Status.Pop[key] = option[key]; + } + } - if (!option.borderColor) { - option.borderColor = '#BBE600'; - option.buttonBgColor = '#BBE600'; - } - these.Status.Pop.showPop = true; - }, - showMsg(msg, isSucc) { - let icoUrl = '/static/images/common/uploadErr.png'; - let borderColor = "#e034344d"; - let buttonBgColor = "#E03434"; - if (isSucc) { - icoUrl = '/static/images/common/success.png'; - borderColor = "#BBE600"; - buttonBgColor = "#BBE600"; - } - this.showPop({ - message: msg, - iconUrl: icoUrl, - borderColor: borderColor, - buttonBgColor: buttonBgColor, - buttonText: '确定', - okCallback: null - }); - } + if (!option.borderColor) { + option.borderColor = '#BBE600'; + option.buttonBgColor = '#BBE600'; + } + these.Status.Pop.showPop = true; +} + + + + } } diff --git a/pages/4877/BJQ4877.vue b/pages/4877/BJQ4877.vue index a6da37e..3691fab 100644 --- a/pages/4877/BJQ4877.vue +++ b/pages/4877/BJQ4877.vue @@ -10,7 +10,7 @@ + @click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons"> {{item.math>9?'9+':item.math}} @@ -33,12 +33,12 @@ + + + {{formData.xuhang}} + 续航时间 + + --> @@ -72,17 +72,17 @@ + + + --> @@ -95,13 +95,13 @@ + :class="{active:formData.sta_SOSType===item.val,marginLeft:index%2==1}" + v-on:click.stop="sosSetting(item,index)"> + :src="item.img" mode="aspectFit"> + :src="item.activeImg" mode="aspectFit"> {{item['text']}} @@ -128,8 +128,8 @@ + :class="{active:item.id==formData.sta_GroupType,marginNoLeft:index%3===0}" + @click.stop="groupSetting(item,index)"> @@ -153,7 +153,7 @@ + :class="formData.sta_ArrowMode=='right_off'?'active':''"> @@ -164,13 +164,13 @@ 朝左 + :class="formData.sta_ArrowMode=='right_on'?'active':''"> + mode="aspectFit"> 朝右 @@ -185,7 +185,7 @@ + :class="formData.sta_ArrowType=='red_front'?'redactive':''"> 红色 @@ -194,7 +194,7 @@ + :class="formData.sta_ArrowType=='green_back'?'greenactive':''"> 绿色 @@ -217,7 +217,7 @@ + :class="formData.sta_ArrowType=='red_all'?'active':''"> @@ -228,13 +228,13 @@ 红色双向 + :class="formData.sta_ArrowType=='green_all'?'active':''"> + mode="aspectFit"> 绿色双向 @@ -266,22 +266,22 @@ + :borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor" + :buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor" + :iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText" + @buttonClick="HidePop" :visiblePrompt="Status.Pop.visiblePrompt" :promptTitle="Status.Pop.promptTitle" + v-model="Status.Pop.modelValue" @closePop="closePop" :buttonCancelText="Status.Pop.buttonCancelText" + :showCancel="Status.Pop.showCancel" @cancelPop="closePop" :showSlot="Status.Pop.showSlot"> 修改信道 + placeholder-class="popup-prompt-input-placeHolder" v-model="formData.sta_Channel" /> - + @@ -304,7 +304,14 @@ } from '@/api/4877/BJQ4877.js'; import MqTool from '@/utils/MqHelper.js' - + import { + MsgSuccess, + MsgError, + MsgClose, + MsgWarning, + showPop, + MsgInfo + } from '@/utils/MsgPops.js' const pagePath = "/pages/4877/BJQ4877"; var ble = null; @@ -711,14 +718,14 @@ if (!this.permissions.includes('55') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } @@ -749,7 +756,7 @@ cancelCallback: () => { this.Status.ShowEditChannel = false; } - }); + },these); }, onChannelChanging() { let regex = /^(0|([1-9]\d?)|1[01]\d|12[0-5])$/; @@ -792,14 +799,14 @@ if (!this.permissions.includes('53') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } @@ -855,14 +862,14 @@ groupCheck() { if (!this.permissions.includes('54') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } uni.navigateTo({ @@ -916,7 +923,7 @@ showUnWarn(val) { - // this.showPop({ + // showPop({ // message: '确定解除声光报警模式?', // iconUrl: "/static/images/common/uploadErr.png", // borderColor: "#e034344d", @@ -938,14 +945,14 @@ if (!this.permissions.includes('54') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } @@ -997,14 +1004,14 @@ sosSetting(item, index) { if (!this.permissions.includes('42') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } let f = this.getDevice(); @@ -1037,7 +1044,7 @@ let confirmTask = () => { - this.showPop({ + showPop({ message: '确定' + (this.formData.sta_SOSType === 'sos' ? '关闭' : '开启') + '声光报警模式?', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", @@ -1046,7 +1053,7 @@ buttonText: (this.formData.sta_SOSType === 'sos' ? '关闭' : '开启'), showCancel: true, buttonCancelText: '取消' - }); + },these); } if (item.val === 'sos') { confirmTask(); @@ -1258,7 +1265,7 @@ }, showBleUnConnect() { - this.showPop({ + showPop({ message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备", iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", @@ -1286,7 +1293,7 @@ } }) } - }); + },these); }, proParam: function() { @@ -1335,54 +1342,56 @@ this.Status.Pop.okCallback(); } }, - showPop: function(option) { - hideLoading(this); - let def = { - showPop: true, //是否显示弹窗 - popType: 'custom', - bgColor: '#383934bd', - borderColor: '#BBE600', - textColor: '#ffffffde', - buttonBgColor: '#BBE600', - buttonTextColor: '#232323DE', - iconUrl: '', - message: '', - buttonText: '确定', - clickEvt: '', - visiblePrompt: false, - promptTitle: '', - modelValue: '', - visibleClose: false, - okCallback: null, - showSlot: false, - buttonCancelText: '', - showCancel: false, - } + showPop: function (option) { + hideLoading(this); + let def = { + showPop: true, //是否显示弹窗 + popType: 'custom', + bgColor: '#383934bd', + borderColor: '#BBE600', + textColor: '#ffffffde', + buttonBgColor: '#BBE600', + buttonTextColor: '#232323DE', + iconUrl: '', + message: '', + buttonText: '确定', + clickEvt: '', + visiblePrompt: false, + promptTitle: '', + modelValue: '', + visibleClose: false, + okCallback: null, + showSlot: false, + buttonCancelText: '', + showCancel: false, + } - let keys = Object.keys(def); + let keys = Object.keys(def); - for (let i = 0; i < keys.length; i++) { - let key = keys[i]; - if (key in option) { - continue; - } - this.Status.Pop[key] = def[key]; - } - if (option) { - keys = Object.keys(option); - for (let i = 0; i < keys.length; i++) { - let key = keys[i]; + for (let i = 0; i < keys.length; i++) { + let key = keys[i]; + if (key in option) { + continue; + } + this.Status.Pop[key] = def[key]; + } + if (option) { + keys = Object.keys(option); + for (let i = 0; i < keys.length; i++) { + let key = keys[i]; - this.Status.Pop[key] = option[key]; - } - } + this.Status.Pop[key] = option[key]; + } + } - if (!option.borderColor) { - option.borderColor = '#BBE600'; - option.buttonBgColor = '#BBE600'; - } - these.Status.Pop.showPop = true; - }, + if (!option.borderColor) { + option.borderColor = '#BBE600'; + option.buttonBgColor = '#BBE600'; + } + these.Status.Pop.showPop = true; + }, + + showMsg(msg, isSucc) { let icoUrl = '/static/images/common/uploadErr.png'; let borderColor = "#e034344d"; @@ -1392,17 +1401,14 @@ borderColor = "#BBE600"; buttonBgColor = "#BBE600"; } - this.showPop({ + showPop({ message: msg, iconUrl: icoUrl, borderColor: borderColor, buttonBgColor: buttonBgColor, buttonText: '确定', okCallback: null - }); - }, - btnClick() { - + },this); } } } diff --git a/pages/6075J/BJQ6075J.vue b/pages/6075J/BJQ6075J.vue index 9017abb..487ea35 100644 --- a/pages/6075J/BJQ6075J.vue +++ b/pages/6075J/BJQ6075J.vue @@ -501,7 +501,10 @@ ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { console.log("连接成功") these.formData.bleStatu = true; - }); + }).catch(ex => { + these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; } }, onHide: function() { @@ -569,7 +572,10 @@ 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'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; }); @@ -2074,7 +2080,8 @@ }).catch(ex => { updateLoading(these, { text: ex.msg - }) + }); + these.formData.bleStatu = 'err'; }).finally(() => { setTimeout(() => { hideLoading(these); @@ -2102,6 +2109,7 @@ these.formData.bleStatu = true; }).catch(ex => { these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); }); return; } diff --git a/pages/6107/BJQ6107.vue b/pages/6107/BJQ6107.vue index 84fb5db..750fc1b 100644 --- a/pages/6107/BJQ6107.vue +++ b/pages/6107/BJQ6107.vue @@ -16,7 +16,8 @@ - {{formData.sta_charge?dic.sta_charge[formData.sta_charge+'']:"未充电" }} + + {{formData.sta_charge?dic.sta_charge[formData.sta_charge+'']:"未充电" }} 设备状态 @@ -74,12 +75,12 @@ + :class="{'active':formData.sta_highSpeed && formData.sta_LedType===item.key}"> 强光 + :class="{'active':formData.sta_highSpeed===false && formData.sta_LedType===item.key}"> 工作光 @@ -93,7 +94,7 @@ + mode="aspectFit"> @@ -114,9 +115,9 @@ + mode="aspectFit"> + src="/static/images/common/playingActive.png" mode="aspectFit"> {{formData.isPlay?'正在播放':'播放语音'}} @@ -183,7 +184,7 @@ - + @@ -208,11 +209,11 @@ + :borderColor="item.borderColor" :textColor="item.textColor" :buttonBgColor="item.buttonBgColor" + :buttonTextColor="item.buttonTextColor" :iconUrl="item.iconUrl" :message="item.message" + :buttonText="item.buttonText" @buttonClick="item.okCallback(item)" :visiblePrompt="item.visiblePrompt" + :promptTitle="item.promptTitle" v-model="item.modelValue" @closePop="closePop(item)" + :buttonCancelText="item.buttonCancelText" :showCancel="item.showCancel" @cancelPop="closePop(item)" /> @@ -226,7 +227,7 @@ + color="#FFFFFFde"> @@ -239,8 +240,8 @@ + backgroundColor="#686767" block-size="20" block-color="#ffffffde" @change="volumechange" + @changing="volumechange" class="custom-slider" /> @@ -248,7 +249,7 @@ - + @@ -265,7 +266,16 @@ baseURL } from '@/utils/request.js' - import Common from '@/utils/Common.js' + import Common from '@/utils/Common.js'; + import { + MsgSuccess, + MsgError, + MsgClose, + MsgWarning, + showPop, + MsgInfo + } from '@/utils/MsgPops.js' + const pagePath = "/pages/018A/HBY018A"; var ble = null; @@ -419,7 +429,10 @@ these.formData.deviceId = f.deviceId; ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { these.formData.bleStatu = true; - }); + }).catch(ex => { + these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; these.setBleFormData(); @@ -439,7 +452,10 @@ ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { console.log("连接成功") these.formData.bleStatu = true; - }); + }).catch(ex => { + these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; } }, computed: { @@ -551,7 +567,7 @@ this.closePop(item); } if (msg) { - this.showPop({ + showPop({ key: Common.guid(), message: msg, iconUrl: "/static/images/common/playingActive.png", @@ -561,7 +577,7 @@ buttonText: '确定', buttonCancelText: '取消', showCancel: true - }); + },these); } else { exec(); } @@ -667,7 +683,7 @@ // },500) } - this.showPop({ + showPop({ key: key, message: msg, iconUrl: "/static/images/common/uploadErr.png", @@ -677,7 +693,7 @@ buttonText: '确定', buttonCancelText: '取消', showCancel: true - }); + },these); }, deviceRecovry(res) { @@ -742,7 +758,8 @@ }).catch(ex => { updateLoading(these, { text: ex.msg - }) + }); + these.formData.bleStatu = 'err'; }).finally(() => { setTimeout(() => { hideLoading(these); @@ -838,7 +855,7 @@ }, showBleUnConnect() { - this.showPop({ + showPop({ key: Common.guid(), message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备", iconUrl: "/static/images/common/uploadErr.png", @@ -867,7 +884,7 @@ } }) } - }); + },these); }, proParam: function() { @@ -918,58 +935,7 @@ } }, - //根据传入的配置,自定义一个弹窗 - showPop: function(option) { - let def = { - key: '', - showPop: true, //是否显示弹窗 - popType: 'custom', - bgColor: '#383934bd', - borderColor: '#BBE600', - textColor: '#ffffffde', - buttonBgColor: '#BBE600', - buttonTextColor: '#232323DE', - iconUrl: '', - message: '', - buttonText: '确定', - clickEvt: '', - visiblePrompt: false, - promptTitle: '', - modelValue: '', - visibleClose: false, - okCallback: null, - showSlot: false, - buttonCancelText: '', - showCancel: false, - cancelCallback: null - } - let json = {}; - let keys = Object.keys(def); - - for (let i = 0; i < keys.length; i++) { - let key = keys[i]; - - json[key] = def[key]; - } - if (option) { - keys = Object.keys(option); - for (let i = 0; i < keys.length; i++) { - let key = keys[i]; - - json[key] = option[key]; - } - } - - if (!json.borderColor) { - json.borderColor = '#BBE600'; - json.buttonBgColor = '#BBE600'; - } - json.showPop = true; - if (!('key' in json)) { - json.key = Common.guid(); - } - this.Msgboxs.push(json); - }, + showMsg(msg, type) { let cfg = { @@ -1008,7 +974,7 @@ buttonText: '确定', okCallback: this.closePop }; - this.showPop(options); + showPop(options,these); } } } diff --git a/pages/6155/BJQ6155.vue b/pages/6155/BJQ6155.vue index 65de89b..fecfa8c 100644 --- a/pages/6155/BJQ6155.vue +++ b/pages/6155/BJQ6155.vue @@ -10,7 +10,7 @@ + @click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons"> {{item.math>9?'9+':item.math}} @@ -74,8 +74,8 @@ + backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange" @changing="sliderChanging" + class="custom-slider" /> @@ -124,23 +124,23 @@ 发送 + :color="'#000000'" :fontSize="16" /> 单位: + placeholder-class="usrplace" /> 部门: + placeholder-class="usrplace" /> 姓名: + placeholder-class="usrplace" /> @@ -162,17 +162,11 @@ - - + + @btnClick="btnClick"> @@ -182,6 +176,7 @@ + @@ -201,6 +196,14 @@ } from '@/utils/request.js'; var pagePath = "/pages/6155/BJQ6155"; + import { + MsgSuccess, + MsgError, + MsgClose, + MsgWarning, + showPop, + MsgInfo + } from '@/utils/MsgPops.js' var ble = null; var these = null; @@ -413,7 +416,10 @@ 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'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; these.setBleFormData(); these.getDetail(); @@ -433,7 +439,10 @@ ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { console.log("连接成功") these.formData.bleStatu = true; - }); + }).catch(ex => { + these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; } }, onBackPress(e) { @@ -480,6 +489,7 @@ these.formData.bleStatu = true; }).catch(ex => { these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); }); return; } @@ -640,7 +650,8 @@ }).catch(ex => { updateLoading(these, { text: ex.msg - }) + }); + MsgError("连接错误:" + ex.msg, "确定", these); }).finally(() => { setTimeout(() => { hideLoading(these); @@ -769,11 +780,11 @@ return; } let os = plus.os.name; + // 分包发送图片数据 var sendImagePackets = function(ReSendNo) { return new Promise((resolve, reject) => { - // 总数据包数 let totalPackets = os=='Android'?52:200; let currentPacket = 1; @@ -808,11 +819,7 @@ // 计算当前包的数据 let packetSize = os == 'Android' ? 250 : 64; - // if (currentPacket <= 51) { - // packetSize = 250; // 前51个包每个500字节 - // } else { - // packetSize = 50; // 最后一个包100字节 - // } + // 创建数据包 let startIndex = (currentPacket - 1) * packetSize; @@ -824,7 +831,7 @@ let packetData = these.rgb565Data.slice(startIndex, endIndex); // 构建数据包 - let bufferSize = os ==packetSize.length*2+5; // 5 + packetData.length * 2; // 头部5字节 + 数据部分 + let bufferSize = packetData.length * 2+5; // 头部5字节 + 数据部分 let buffer = new ArrayBuffer(bufferSize); let dataView = new DataView(buffer); @@ -833,12 +840,12 @@ dataView.setUint8(1, 0x02); // 帧类型:开机画面 dataView.setUint8(2, currentPacket); // 包序号 dataView.setUint16(3, packetData.length*2,false); - + // 填充数据(每个RGB565值占2字节) for (let i = 0; i < packetData.length; i++) { dataView.setUint16(5 + i * 2, packetData[i], false); // 大端字节序 } - + //发送数据包 ble.sendData(f.deviceId, buffer, f.writeServiceId, f.wirteCharactId, 10).then(() => { @@ -911,8 +918,9 @@ console.log("data=", data); these.Status.BottomMenu.show = false; these.rgb565Data = Common.convertToRGB565(data.piexls); - +console.log("1111111111") setTimeout(function() { + console.log("1111111111") sendImagePackets().catch(() => { }); @@ -1540,6 +1548,7 @@ option.buttonBgColor = '#BBE600'; } these.Status.Pop.showPop = true; + showPop(option, these); }, sendUsr() { if (!this.permissions.includes('4') && this.Status.apiType !== 'listA') { diff --git a/pages/6155/deviceDetail.vue b/pages/6155/deviceDetail.vue index 2420b44..2ae3d7b 100644 --- a/pages/6155/deviceDetail.vue +++ b/pages/6155/deviceDetail.vue @@ -11,7 +11,7 @@ + @click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons"> {{item.math>9?'9+':item.math}} @@ -75,8 +75,8 @@ + backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange" + @changing="sliderChange" class="custom-slider" /> @@ -125,23 +125,23 @@ 发送 + :color="'#000000'" :fontSize="14" /> 单位: + placeholder-class="usrplace" /> 部门: + placeholder-class="usrplace" /> 姓名: + placeholder-class="usrplace" /> @@ -163,17 +163,11 @@ - - + + @btnClick="btnClick"> @@ -183,6 +177,7 @@ + @@ -202,6 +197,14 @@ } from '@/utils/request.js'; var pagePath = "/pages/6155/deviceDetail"; + import { + MsgSuccess, + MsgError, + MsgClose, + MsgWarning, + showPop, + MsgInfo + } from '@/utils/MsgPops.js' var ble = null; var these = null; @@ -383,7 +386,10 @@ 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'; + MsgError("连接错误:" + ex.msg, "确定", these); + }); these.setBleFormData(); these.getDetail(); @@ -403,7 +409,10 @@ ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { console.log("连接成功") these.formData.bleStatu = true; - }); + }).catch(ex => { + these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; } }, onBackPress(e) { @@ -450,6 +459,7 @@ these.formData.bleStatu = true; }).catch(ex => { these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); }); return; } @@ -621,7 +631,8 @@ }).catch(ex => { updateLoading(these, { text: ex.msg - }) + }); + these.formData.bleStatu = 'err'; }).finally(() => { setTimeout(() => { hideLoading(these); @@ -1625,6 +1636,7 @@ option.buttonBgColor = '#BBE600'; } these.Status.Pop.showPop = true; + showPop(option,this); }, sendUsr() { diff --git a/pages/6170/deviceControl/index.vue b/pages/6170/deviceControl/index.vue index 49e0c3c..61d2b63 100644 --- a/pages/6170/deviceControl/index.vue +++ b/pages/6170/deviceControl/index.vue @@ -471,6 +471,7 @@ these.formData.bleStatu = true; }).catch(ex => { these.formData.bleStatu = 'err'; + MsgError("连接错误:"+ex.msg,"确定",these); }); return; } @@ -583,6 +584,8 @@ updateLoading(these, { text: ex.msg }) + these.formData.bleStatu = 'err'; + MsgError("连接错误:"+ex.msg,"确定",these); }).finally(() => { setTimeout(() => { hideLoading(these); @@ -2023,6 +2026,9 @@ ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then( res => { these.formData.bleStatu = true; + }).catch(ex=>{ + these.formData.bleStatu = 'err'; + MsgError("连接错误:"+ex.msg,"确定",these); }); } } @@ -2043,6 +2049,8 @@ ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { console.log("连接成功") this.formData.bleStatu = true; + }).catch(ex=>{ + MsgError("连接错误:"+ex.msg,"确定",these); }); } }, diff --git a/pages/6331/BJQ6331.vue b/pages/6331/BJQ6331.vue index 0c21335..fe6ed7c 100644 --- a/pages/6331/BJQ6331.vue +++ b/pages/6331/BJQ6331.vue @@ -22,19 +22,19 @@ - + 设备名称 {{device.deviceName}} - Mac地址 - {{device.deviceMac}} - + Mac地址 + {{device.deviceMac}} + 蓝牙名称 {{device.bluetoothName}} - + 蓝牙状态 {{formData.bleStatu?'已连接':'未连接'}} @@ -45,34 +45,34 @@ 照明模式 亮度 + :class="formData.lightCurr=='shuxie'?'active':'noActive'">亮度 + :class="formData.lightCurr=='shuxie'?'active':''"> + :src="formData.lightCurr=='shuxie'?'/static/images/6331/shuxieActive.png':'/static/images/6331/shuXie.png'" + mode="aspectFit"> 书写 + :src="formData.lightCurr=='work'?'/static/images/6331/workActive.png':'/static/images/6331/work.png'" + mode="aspectFit"> 工作光 + :src="formData.lightCurr=='jieN'?'/static/images/lightImg/jieNActive.png':'/static/images/lightImg/jieN.png'" + mode="aspectFit"> 节能光 @@ -130,7 +130,7 @@ + v-on:click.stop="audioManage()"> @@ -173,11 +173,11 @@ + :borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor" + :buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor" + :iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText" + @buttonClick="HidePop" :visiblePrompt="Status.Pop.visiblePrompt" :promptTitle="Status.Pop.promptTitle" + v-model="Status.Pop.modelValue" @closePop="closePop" :showSlot="Status.Pop.showSlot"> @@ -186,8 +186,8 @@ + backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange" + @changing="sliderChange" class="custom-slider" /> @@ -199,8 +199,8 @@ + backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange" + @changing="sliderChange" class="custom-slider" /> @@ -209,7 +209,7 @@ + @btnClick="btnClick"> @@ -221,7 +221,7 @@ - + @@ -236,7 +236,15 @@ } from '@/utils/loading.js' import request, { baseURL } from '@/utils/request.js'; - import usrApi from '@/api/670/HBY670.js' + import usrApi from '@/api/670/HBY670.js'; + import { + MsgSuccess, + MsgError, + MsgClose, + MsgWarning, + showPop, + MsgInfo + } from '@/utils/MsgPops.js' const pagePath = "pages/6331/BJQ6331"; var ble = null; @@ -401,7 +409,10 @@ import request, { baseURL } from '@/utils/request.js'; these.formData.deviceId = f.deviceId; ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { these.formData.bleStatu = true; - }); + }).catch(ex => { + these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; these.setBleFormData(); these.getDetail(); @@ -420,7 +431,10 @@ import request, { baseURL } from '@/utils/request.js'; ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { console.log("连接成功") these.formData.bleStatu = true; - }); + }).catch(ex => { + these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; } }, computed: { @@ -452,7 +466,7 @@ import request, { baseURL } from '@/utils/request.js'; let play = () => { alert('正在播放中'); } - this.showPop({ + showPop({ showPop: true, //是否显示弹窗 popType: 'custom', bgColor: '#383934bd', @@ -469,7 +483,7 @@ import request, { baseURL } from '@/utils/request.js'; modelValue: '', visibleClose: true, okCallback: play - }); + },these); }, audioManage() { //语音管理 uni.navigateTo({ @@ -594,12 +608,12 @@ import request, { baseURL } from '@/utils/request.js'; ble.sendHexs(f.deviceId, array, f.writeServiceId, f.wirteCharactId, 100).catch(ex => { - these.showPop({ + showPop({ message: "发送失败," + ex.msg, iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); }); }, @@ -670,7 +684,8 @@ import request, { baseURL } from '@/utils/request.js'; }).catch(ex => { updateLoading(these, { text: ex.msg - }) + }); + these.formData.bleStatu = 'err'; }).finally(() => { setTimeout(() => { hideLoading(these); @@ -734,7 +749,7 @@ import request, { baseURL } from '@/utils/request.js'; showBleUnConnect() { - this.showPop({ + showPop({ message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备", iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", @@ -762,7 +777,7 @@ import request, { baseURL } from '@/utils/request.js'; } }) } - }); + },these); diff --git a/pages/650/HBY650.vue b/pages/650/HBY650.vue index 25866bc..5ed064b 100644 --- a/pages/650/HBY650.vue +++ b/pages/650/HBY650.vue @@ -10,17 +10,17 @@ + @click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons"> {{item.math>9?'9+':item.math}} - + - + - + - + @@ -78,19 +78,19 @@ + @click="MainModeSetting('smalllow','staticBattery')"> 前置 + @click="MainModeSetting('low','staticBattery')"> 低档 + @click="MainModeSetting('center','staticBattery')"> 中档 + @click="MainModeSetting('hight','staticBattery')"> 高档 @@ -98,9 +98,9 @@ + @click="MainModeSetting('close','staticBattery')"> + 关闭 + --> @@ -114,7 +114,7 @@ + v-on:click.stop="ShowUpload()"> @@ -177,17 +177,11 @@ - - + + @btnClick="btnClick"> @@ -198,6 +192,7 @@ + @@ -213,7 +208,15 @@ } from '@/utils/loading.js' import request, { baseURL } from '@/utils/request.js'; - import usrApi from '@/api/670/HBY670.js' + import usrApi from '@/api/670/HBY670.js'; + import { + MsgSuccess, + MsgError, + MsgClose, + MsgWarning, + showPop, + MsgInfo + } from '@/utils/MsgPops.js' const pagePath = "/pages/650/HBY650"; var ble = null; @@ -234,24 +237,7 @@ import request, { baseURL } from '@/utils/request.js'; }, pageHide: false, - Pop: { - showPop: false, //是否显示弹窗 - popType: 'custom', - bgColor: '#383934bd', - borderColor: '#BBE600', - textColor: '#ffffffde', - buttonBgColor: '#BBE600', - buttonTextColor: '#232323DE', - iconUrl: '', - message: '您确定要这样做吗?', - buttonText: '确定', - clickEvt: '', - visiblePrompt: false, - promptTitle: '设备名称', - modelValue: '', - visibleClose: false, - okCallback: null - }, + BottomMenu: { show: false, showHeader: true, @@ -404,7 +390,10 @@ import request, { baseURL } from '@/utils/request.js'; 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'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; these.setBleFormData(); console.error("222222"); these.getDetail(); @@ -425,7 +414,10 @@ import request, { baseURL } from '@/utils/request.js'; ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { console.log("连接成功") these.formData.bleStatu = true; - }); + }).catch(ex => { + these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; } }, computed: { @@ -466,6 +458,7 @@ import request, { baseURL } from '@/utils/request.js'; these.formData.bleStatu = true; }).catch(ex=>{ these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); }); return; } @@ -569,7 +562,8 @@ import request, { baseURL } from '@/utils/request.js'; }).catch(ex => { updateLoading(these, { text: ex.msg - }) + }); + MsgError("连接错误:" + ex.msg, "确定", these); }).finally(() => { setTimeout(() => { hideLoading(these); @@ -655,12 +649,12 @@ import request, { baseURL } from '@/utils/request.js'; } if (these.formData.iswarn) { - these.showPop({ + showPop({ message: "环境存在漏电电源", iconUrl: "/static/images/6155/DeviceDetail/warnning.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); } these.setBleFormData(); @@ -733,14 +727,14 @@ import request, { baseURL } from '@/utils/request.js'; if (!this.permissions.includes('41') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } @@ -813,12 +807,12 @@ import request, { baseURL } from '@/utils/request.js'; console.log("发送成功了"); }).catch((ex) => { - these.showPop({ + showPop({ message: ex.msg, iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); }).finally(() => { @@ -838,7 +832,7 @@ import request, { baseURL } from '@/utils/request.js'; }, showBleUnConnect() { - this.showPop({ + showPop({ message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备", iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", @@ -866,19 +860,19 @@ import request, { baseURL } from '@/utils/request.js'; } }) } - }); + },these); }, LampToggle: function() { if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } this.formData.cMode = !this.formData.cMode; @@ -932,11 +926,11 @@ import request, { baseURL } from '@/utils/request.js'; if (currentPacket > totalPackets) { hideLoading(these); these.Status.BottomMenu.show = false; - these.showPop({ + showPop({ showPop: true, message: "上传成功", iconUrl: "/static/images/6155/DeviceDetail/uploadSuccess.png", - }); + },these); if (!ReSendNo) { setTimeout(() => { these.HoldYouHand("transmit complete", 0, f @@ -1005,23 +999,23 @@ import request, { baseURL } from '@/utils/request.js'; }) currentPacket++; - setTimeout(sendNextPacket, 0); + setTimeout(sendNextPacket, 80); }).catch(err => { console.log("发送数据包失败了" + JSON.stringify(err)); if (err.code == '10007') { - setTimeout(sendNextPacket, 0); + setTimeout(sendNextPacket, 500); return; } these.Status.BottomMenu.show = false; - these.showPop({ + showPop({ message: err.msg, iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); hideLoading(these); reject(err); }); @@ -1037,12 +1031,12 @@ import request, { baseURL } from '@/utils/request.js'; sendNextPacket(); }).catch((err) => { console.log("握手没有成功"); - these.showPop({ + showPop({ message: err.msg, iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); hideLoading(these); reject(err); }); @@ -1114,11 +1108,11 @@ import request, { baseURL } from '@/utils/request.js'; } these.Status.BottomMenu.show = false; hideLoading(these); - these.showPop({ + showPop({ showPop: true, message: "上传成功", iconUrl: "/static/images/6155/DeviceDetail/uploadSuccess.png" - }); + },these); @@ -1188,14 +1182,14 @@ import request, { baseURL } from '@/utils/request.js'; these.Status.BottomMenu.show = false; hideLoading(these); - these.showPop({ + showPop({ showPop: true, message: err.msg + ",发送失败了", borderColor: "#e034344d", buttonBgColor: "#E03434", buttonText: "确定", iconUrl: "/static/images/common/uploadErr.png" - }); + },these); reject(err); return; } @@ -1290,23 +1284,23 @@ import request, { baseURL } from '@/utils/request.js'; console.log("服务器未返回正确的数据"); - these.showPop({ + showPop({ message: "与服务器连接出现异常,请检查网络设置", iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); } }).catch((ex) => { hideLoading(these); - these.showPop({ + showPop({ message: "出现异常," + ex.msg, iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); }) } let f = these.getDevice(); @@ -1373,14 +1367,14 @@ import request, { baseURL } from '@/utils/request.js'; if (!this.permissions.includes('3') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } //上传开机画面 @@ -1422,84 +1416,19 @@ import request, { baseURL } from '@/utils/request.js'; this.Status.BottomMenu.activeIndex = index; }, - closePop: function() { - this.Status.Pop.showPop = false; - - if (this.Status.Pop.cancelCallback) { - this.Status.Pop.cancelCallback(); - } - }, - HidePop: function() { - if (this.Status.Pop.clickEvt == 'SendUsr') { - - } - - - this.Status.Pop.showPop = false; - if (this.Status.Pop.okCallback) { - this.Status.Pop.okCallback(); - } - }, - showPop: function(option) { - hideLoading(this); - let def = { - showPop: true, //是否显示弹窗 - popType: 'custom', - bgColor: '#383934bd', - borderColor: '#BBE600', - textColor: '#ffffffde', - buttonBgColor: '#BBE600', - buttonTextColor: '#232323DE', - iconUrl: '', - message: '', - buttonText: '确定', - clickEvt: '', - visiblePrompt: false, - promptTitle: '', - modelValue: '', - visibleClose: false, - okCallback: null, - showSlot: false, - buttonCancelText: '', - showCancel: false, - } - - let keys = Object.keys(def); - - for (let i = 0; i < keys.length; i++) { - let key = keys[i]; - if (key in option) { - continue; - } - this.Status.Pop[key] = def[key]; - } - if (option) { - keys = Object.keys(option); - for (let i = 0; i < keys.length; i++) { - let key = keys[i]; - - this.Status.Pop[key] = option[key]; - } - } - - if (!option.borderColor) { - option.borderColor = '#BBE600'; - option.buttonBgColor = '#BBE600'; - } - these.Status.Pop.showPop = true; - }, + sendUsr: function(ReSendNo) { if (!this.permissions.includes('4') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } @@ -1543,7 +1472,7 @@ import request, { baseURL } from '@/utils/request.js'; } - these.showPop({ + showPop({ showPop: true, //是否显示弹窗 popType: 'custom', bgColor: '#383934bd', @@ -1559,7 +1488,7 @@ import request, { baseURL } from '@/utils/request.js'; promptTitle: '', modelValue: '', visibleClose: true - }); + },these); these.setBleFormData(); @@ -1617,12 +1546,12 @@ import request, { baseURL } from '@/utils/request.js'; setTimeout(sendNextPacket, 0); }).catch(err => { - these.showPop({ + showPop({ message: "文字发送失败," + err.msg, iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); }).finally(() => { hideLoading(these); }); @@ -1651,12 +1580,12 @@ import request, { baseURL } from '@/utils/request.js'; }).catch((ex) => { console.log("握手没有成功", ex); hideLoading(these); - these.showPop({ + showPop({ message: ex.msg, iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); }); }, 0); diff --git a/pages/670/HBY670.vue b/pages/670/HBY670.vue index 51c0e12..a38d9fa 100644 --- a/pages/670/HBY670.vue +++ b/pages/670/HBY670.vue @@ -1,22 +1,24 @@ @@ -306,7 +311,14 @@ } from '@/utils/loading.js' import request, { baseURL } from '@/utils/request.js'; import lnglatConvert from '@/utils/wgs84_to_gcj02.js'; - + import { + MsgSuccess, + MsgError, + MsgClose, + MsgWarning, + showPop, + MsgInfo + } from '@/utils/MsgPops.js' const pagePath = "/pages/670/HBY670"; var ble = null; var these = null; @@ -336,28 +348,28 @@ time: 0, inteval: null }, - Pop: { - showPop: false, //是否显示弹窗 + Pop: { + showPop: false, //是否显示弹窗 - popType: 'custom', - bgColor: '#383934bd', - borderColor: '#BBE600', - textColor: '#ffffffde', - buttonBgColor: '#BBE600', - buttonTextColor: '#232323DE', + popType: 'custom', + bgColor: '#383934bd', + borderColor: '#BBE600', + textColor: '#ffffffde', + buttonBgColor: '#BBE600', + buttonTextColor: '#232323DE', - iconUrl: '', - message: '您确定要这样做吗?', - buttonText: '确定', - showCancel: false, - buttonCancelText: '取消', - clickEvt: '', - visiblePrompt: false, - promptTitle: '设备名称', - modelValue: '', - visibleClose: false, - okCallback: null - }, + iconUrl: '', + message: '您确定要这样做吗?', + buttonText: '确定', + showCancel: false, + buttonCancelText: '取消', + clickEvt: '', + visiblePrompt: false, + promptTitle: '设备名称', + modelValue: '', + visibleClose: false, + okCallback: null + }, BottomMenu: { show: false, showHeader: true, @@ -490,8 +502,8 @@ recei = BleReceive.getBleReceive(); ble = BleTool.getBleTool(); this.$watch("formData.battary", (newVal, oldVal) => { - if (newVal <= 20 && this.formData.sta_system==2) { - this.showMsg("设备电量低"); + if (newVal <= 20 && this.formData.sta_system == 2) { + MsgError("设备电量低",'',these); } }); @@ -555,7 +567,10 @@ 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'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; }); }, @@ -568,7 +583,10 @@ ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { console.log("连接成功") these.formData.bleStatu = true; - }); + }).catch(ex => { + these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; } }, onHide: function() { @@ -615,6 +633,7 @@ these.formData.bleStatu = true; }).catch(ex=>{ these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); }); return; } @@ -693,7 +712,8 @@ }).catch(ex => { updateLoading(these, { text: ex.msg - }) + }); + these.formData.bleStatu = 'err'; }).finally(() => { setTimeout(() => { hideLoading(these); @@ -715,7 +735,7 @@ if (this.Status.bleLinkCnt > 3) { return; } - this.showPop({ + showPop({ message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备,取消" + (4 - this.Status.bleLinkCnt) + "次后不再提醒", iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", @@ -747,7 +767,7 @@ } }) } - }); + },these); }, gotoMap() { let promise = lnglatConvert.wgs84_to_gcj02(this.formData.Lon, this.formData.Lat); @@ -943,11 +963,11 @@ // } if (keys.indexOf('sta_BreakNews') > -1) { //紧急通知 if(json.sta_BreakNews=='I get it'){ - these.showPop({ + showPop({ showPop: true, message: "用户已确认收到紧急通知", iconUrl: "/static/images/6155/DeviceDetail/uploadSuccess.png" - }); + },these); } } @@ -1129,14 +1149,14 @@ msgs.push("设备静止报警中"); } if (msgs.length > 0) { - this.showPop({ + showPop({ message: msgs.join(";"), iconUrl: "/static/images/6155/DeviceDetail/warnning.png", borderColor: "#e034344d", buttonBgColor: "#E03434", buttonText: "确定", clickEvt: "staticWarn" - }); + },these); } @@ -1169,14 +1189,14 @@ lightSetting: function(type) { if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } if (this.formData.lightCurr == type) { @@ -1212,12 +1232,12 @@ console.log("4g发送成功"); }).catch((ex) => { console.log("ex=", ex); - these.showPop({ + showPop({ message: "通信异常,请检查手机或设备网络", iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); }).finally(() => { hideLoading(these); @@ -1260,9 +1280,10 @@ CloseWarn: function(ispop) { //解除强制报警 let closeEvt = () => { - these.Status.Pop.showPop = false; + these.formData.qzwarn = false; + these.Status.staticWarn.inteval=null clearInterval(these.Status.staticWarn.inteval); let requestCloseSOS = () => { @@ -1276,12 +1297,12 @@ }).catch((ex) => { console.log("ex=", ex); - these.showPop({ + showPop({ message: "通信异常,请检查手机或设备网络", iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); }).finally(() => { hideLoading(these); @@ -1352,20 +1373,20 @@ this.Status.Pop.okCallback = null; }, clickEvt: 'time' - }); + },these); }, sosSetting: function(type) { debugger; if (!this.permissions.includes('42') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } @@ -1374,9 +1395,7 @@ type = "close"; } - showLoading(this, { - text: "请稍候..." - }); + let task = () => { let dic = { @@ -1432,12 +1451,12 @@ } }).catch((ex) => { console.log("ex=", ex); - these.showPop({ + showPop({ message: "通信异常,请检查手机或设备网络", iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); }).finally(() => { hideLoading(these); @@ -1484,7 +1503,11 @@ } let OpenSOS = () => { + showLoading(this, { + text: "请稍候..." + }); let execSos = () => { + these.formData.qzwarn = true; //标记为强制报警了 these.Status.staticWarn.time = 180; @@ -1550,17 +1573,18 @@ } else if (type == 'sg') //强制报警 { - this.showPop({ + showPop({ message: '确定开启声光报警模式?', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: OpenSOS, buttonText: "开启" - }); + },these); return; } else if (type == 'close') { - + console.log("this.formData.SOS=",this.formData.SOS); + console.log("inteval=",this.Status.staticWarn.inteval); if (this.formData.SOS = 'sg' && this.Status.staticWarn.inteval) { //解除声光报警 this.CloseWarn(true); } else { @@ -1578,14 +1602,14 @@ GearSetting: function(type) { //档位设置 if (!this.permissions.includes('41') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } if (this.formData.modeCurr == type) { @@ -1620,12 +1644,12 @@ console.log("4g发送成功"); }).catch((ex) => { console.log("ex=", ex) - these.showPop({ + showPop({ message: "通信异常,请检查手机或设备网络", iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); }).finally(() => { hideLoading(these); @@ -1676,14 +1700,14 @@ proDetail: function(type) { if (!this.permissions.includes('41') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } uni.navigateTo({ @@ -1706,21 +1730,21 @@ deviceImei: these.device.deviceImei }).then((res) => { if (res.code == 200) { - these.showPop({ + showPop({ showPop: true, message: "上传成功", iconUrl: "/static/images/6155/DeviceDetail/uploadSuccess.png", - }); + },these); resolve(); return; } else { - these.showPop({ + showPop({ message: res.errMsg ? res.errMsg : "未知的原因上传失败了", iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); reject(res); } }).catch((ex) => { @@ -1752,11 +1776,11 @@ if (currentPacket > totalPackets) { hideLoading(these); these.Status.BottomMenu.show = false; - these.showPop({ + showPop({ showPop: true, message: "上传成功", iconUrl: "/static/images/6155/DeviceDetail/uploadSuccess.png", - }); + },these); if (!ReSendNo) { setTimeout(() => { these.HoldYouHand("transmit complete", 0, f @@ -1826,11 +1850,11 @@ }); currentPacket++; - setTimeout(sendNextPacket, 0); + setTimeout(sendNextPacket, 80); }).catch(err => { console.log("发送数据包失败了" + JSON.stringify(err)); if (err.code == '10007') { - setTimeout(sendNextPacket, 0); + setTimeout(sendNextPacket, 500); return; } else { updateLoading(these, { @@ -1839,7 +1863,7 @@ sendImgByRequest().then(resolve).catch(reject); } // these.Status.BottomMenu.show = false; - // these.showPop({ + // showPop({ // message: err.msg, // iconUrl: "/static/images/common/uploadErr.png", // borderColor: "#e034344d", @@ -1937,11 +1961,11 @@ } these.Status.BottomMenu.show = false; hideLoading(these); - these.showPop({ + showPop({ showPop: true, message: "上传成功", iconUrl: "/static/images/6155/DeviceDetail/uploadSuccess.png" - }); + },these); @@ -1989,7 +2013,7 @@ - let inteval = 30; + let inteval = 50; console.log("开始发送一段视频"); // ble.sendData(f.deviceId, buffer, f.writeServiceId, f .wirteCharactId, 10).then(() => { @@ -2013,14 +2037,14 @@ these.Status.BottomMenu.show = false; hideLoading(these); - these.showPop({ + showPop({ showPop: true, message: err.msg + ",发送失败了", borderColor: "#e034344d", buttonBgColor: "#E03434", buttonText: "确定", iconUrl: "/static/images/common/uploadErr.png" - }); + },these); reject(err); return; } @@ -2117,23 +2141,23 @@ console.log("服务器未返回正确的数据", arr); - these.showPop({ + showPop({ message: "与服务器连接出现异常,请检查网络设置", iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); } }).catch((ex) => { hideLoading(these); - these.showPop({ + showPop({ message: "出现异常," + ex.msg, iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); }) } @@ -2199,14 +2223,14 @@ ShowUpload: function() { if (!this.permissions.includes('3') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } //上传开机画面 @@ -2248,86 +2272,86 @@ this.Status.BottomMenu.activeIndex = index; }, - HidePop: function() { - if (this.Status.Pop.clickEvt == 'staticWarn') { - // this.Status.staticWarnTime=0; - // clearInterval(this.Status.staticWarn.inteval); - // this.formData.staticWarn=false; - } - if (this.Status.Pop.okCallback) { - console.log("执行点击按钮回调"); - this.Status.Pop.okCallback(); - } + HidePop: function () { + if (this.Status.Pop.clickEvt == 'staticWarn') { + // this.Status.staticWarnTime=0; + // clearInterval(this.Status.staticWarn.inteval); + // this.formData.staticWarn=false; + } + if (this.Status.Pop.okCallback) { + console.log("执行点击按钮回调"); + this.Status.Pop.okCallback(); + } - this.Status.Pop.showPop = false; - }, - closePop: function() { - this.Status.Pop.showPop = false; + this.Status.Pop.showPop = false; + }, + closePop: function () { + this.Status.Pop.showPop = false; - if (this.Status.Pop.cancelCallback) { - this.Status.Pop.cancelCallback(); - } - }, - showPop: function(option) { - hideLoading(this); - let def = { - showPop: true, //是否显示弹窗 - popType: 'custom', - bgColor: '#383934bd', - borderColor: '#BBE600', - textColor: '#ffffffde', - buttonBgColor: '#BBE600', - buttonTextColor: '#232323DE', - iconUrl: '', - message: '', - buttonText: '确定', - clickEvt: '', - visiblePrompt: false, - promptTitle: '', - modelValue: '', - visibleClose: false, - okCallback: null, - showSlot: false, - buttonCancelText: '', - showCancel: false, - } + if (this.Status.Pop.cancelCallback) { + this.Status.Pop.cancelCallback(); + } + }, + showPop: function (option) { + hideLoading(this); + let def = { + showPop: true, //是否显示弹窗 + popType: 'custom', + bgColor: '#383934bd', + borderColor: '#BBE600', + textColor: '#ffffffde', + buttonBgColor: '#BBE600', + buttonTextColor: '#232323DE', + iconUrl: '', + message: '', + buttonText: '确定', + clickEvt: '', + visiblePrompt: false, + promptTitle: '', + modelValue: '', + visibleClose: false, + okCallback: null, + showSlot: false, + buttonCancelText: '', + showCancel: false, + } - let keys = Object.keys(def); + let keys = Object.keys(def); - for (let i = 0; i < keys.length; i++) { - let key = keys[i]; - if (key in option) { - continue; - } - this.Status.Pop[key] = def[key]; - } - if (option) { - keys = Object.keys(option); - for (let i = 0; i < keys.length; i++) { - let key = keys[i]; + for (let i = 0; i < keys.length; i++) { + let key = keys[i]; + if (key in option) { + continue; + } + this.Status.Pop[key] = def[key]; + } + if (option) { + keys = Object.keys(option); + for (let i = 0; i < keys.length; i++) { + let key = keys[i]; - this.Status.Pop[key] = option[key]; - } - } + this.Status.Pop[key] = option[key]; + } + } - if (!option.borderColor) { - option.borderColor = '#BBE600'; - option.buttonBgColor = '#BBE600'; - } - these.Status.Pop.showPop = true; - }, + if (!option.borderColor) { + option.borderColor = '#BBE600'; + option.buttonBgColor = '#BBE600'; + } + these.Status.Pop.showPop = true; + }, sendUsr: function(ReSendNo) { if (!this.permissions.includes('4') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } @@ -2343,7 +2367,7 @@ code: this.formData.usrid }; api.sendUsr(json).then((res) => { - these.showPop({ + showPop({ showPop: true, //是否显示弹窗 popType: 'custom', bgColor: '#383934bd', @@ -2359,15 +2383,15 @@ promptTitle: '', modelValue: '', visibleClose: true - }); + },these); these.setBleFormData(); }).catch((ex) => { - these.showPop({ + showPop({ message: "文字发送失败," + ex.msg, iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); }).finally(() => { hideLoading(these); }); @@ -2415,7 +2439,7 @@ } - these.showPop({ + showPop({ showPop: true, //是否显示弹窗 popType: 'custom', bgColor: '#383934bd', @@ -2431,7 +2455,7 @@ promptTitle: '', modelValue: '', visibleClose: true - }); + },these); these.setBleFormData(); hideLoading(these); @@ -2522,7 +2546,7 @@ requestSend(); // console.log("握手没有成功", ex); // hideLoading(these); - // these.showPop({ + // showPop({ // message: ex.msg, // iconUrl: "/static/images/common/uploadErr.png", // borderColor: "#e034344d", @@ -2538,14 +2562,14 @@ if (!this.permissions.includes('5') && this.Status.apiType !== 'listA') { - this.showPop({ + showPop({ message: '无操作权限', iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", okCallback: null, buttonText: "确定" - }) + },these) return; } if (!this.formData.msgTxt) { @@ -2573,7 +2597,7 @@ }).then((res) => { console.log("res=", res) if (res.code == 200) { - these.showPop({ + showPop({ showPop: true, //是否显示弹窗 popType: 'custom', bgColor: '#383934bd', @@ -2589,7 +2613,7 @@ promptTitle: '', modelValue: '', visibleClose: true - }); + },these); // clearInterval(this.Status.msgOkIntval); @@ -2605,12 +2629,12 @@ } else { - these.showPop({ + showPop({ message: res.msg, iconUrl: "/static/images/common/uploadErr.png", borderColor: "#e034344d", buttonBgColor: "#E03434", - }); + },these); } }).finally(() => { hideLoading(this); diff --git a/pages/7305/BJQ7305.vue b/pages/7305/BJQ7305.vue index 32b4d38..f6d93d5 100644 --- a/pages/7305/BJQ7305.vue +++ b/pages/7305/BJQ7305.vue @@ -10,7 +10,7 @@ + @click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons"> {{item.math>9?'9+':item.math}} @@ -73,8 +73,8 @@ + backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange" + @changing="sliderChanging" class="custom-slider" /> @@ -89,14 +89,14 @@ + + + + + 辅灯模式 + 泛光模式 + + --> @@ -114,20 +114,20 @@ 发送 + :bgColor="'#FFFFFF'" :color="'#000000'" :fontSize="13" /> 单位: - + 部门: - + 姓名: - + @@ -149,17 +149,11 @@ - - + + @btnClick="btnClick"> @@ -169,6 +163,7 @@ + @@ -183,7 +178,14 @@ } from '@/utils/loading.js' import BleReceive from '@/utils/BleReceive'; import Common from '@/utils/Common.js'; - + import { + MsgSuccess, + MsgError, + MsgClose, + MsgWarning, + showPop, + MsgInfo + } from '@/utils/MsgPops.js' var ble = null; var these = null; var BrighInteval = null; @@ -363,7 +365,10 @@ ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { console.log("连接成功") these.formData.bleStatu = true; - }); + }).catch(ex => { + these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; these.setBleFormData(); these.getDetail(); @@ -384,7 +389,10 @@ ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => { console.log("连接成功") these.formData.bleStatu = true; - }); + }).catch(ex => { + these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); + });; } }, computed: { @@ -452,6 +460,7 @@ these.formData.bleStatu = true; }).catch(ex => { these.formData.bleStatu = 'err'; + MsgError("连接错误:" + ex.msg, "确定", these); }); return; } @@ -560,7 +569,8 @@ }).catch(ex => { updateLoading(these, { text: ex.msg - }) + }); + these.formData.bleStatu = 'err'; }).finally(() => { setTimeout(() => { hideLoading(these); @@ -1177,6 +1187,7 @@ debugger; option.buttonBgColor = '#BBE600'; } these.Status.Pop.showPop = true; + showPop(option,this); }, sendUsr() { if (!this.permissions.includes('4') && this.Status.apiType !== 'listA') { diff --git a/pages/common/addBLE/LinkBle.vue b/pages/common/addBLE/LinkBle.vue index c882392..6d7de22 100644 --- a/pages/common/addBLE/LinkBle.vue +++ b/pages/common/addBLE/LinkBle.vue @@ -281,9 +281,9 @@ return; } //无效的设备回调 - let deviceInvalid = () => { - - these.$set(these.device, "deviceName", ""); + let deviceInvalid = () => { + these.$set(these.device, "deviceName", ""); + } clearTimeout(this.Statu.timeInteval); diff --git a/pages/common/addBLE/addEquip.vue b/pages/common/addBLE/addEquip.vue index c21b672..18165c9 100644 --- a/pages/common/addBLE/addEquip.vue +++ b/pages/common/addBLE/addEquip.vue @@ -767,6 +767,9 @@ if (index == total) { console.log("连接了N次都没连上"); reject(ex); + updateLoading(this, { + text: ex.msg + }) return; } index++; diff --git a/pages/common/addDevice/addBle.vue b/pages/common/addDevice/addBle.vue index 6b76de8..d963791 100644 --- a/pages/common/addDevice/addBle.vue +++ b/pages/common/addDevice/addBle.vue @@ -886,8 +886,9 @@ ble.disconnectDevice().finally(dis => { ble.StopSearch().finally(res => { - - this.EquipMents = []; + + setTimeout(()=>{ + this.EquipMents = []; this.PairEquip = []; ble.StartSearch().then(result => { @@ -895,6 +896,8 @@ console.error("err=", err); MsgError("出现错误:" + err.msg, '', these); }); + },200); + }).catch(ex => { console.error("ex=", ex); MsgError("出现错误:" + ex.msg, '', these); @@ -1023,6 +1026,9 @@ }).catch((ex) => { if (index == total) { console.log("连接了N次都没连上"); + updateLoading(this, { + text: ex.msg + }); reject(ex); return; } diff --git a/pages/common/index/index.vue b/pages/common/index/index.vue index 87e4aeb..1fbee95 100644 --- a/pages/common/index/index.vue +++ b/pages/common/index/index.vue @@ -252,8 +252,12 @@ activeTabInfo: '', dic: { showMsgTypes: ['BJQ6170', 'HBY210', 'HBY670', 'BJQ6075', 'BJQ6075J'], //需要发送消息的类型 - showMapTypes: ['BJQ6170', 'HBY210', 'HBY670', 'BJQ6075', 'HBY018A', 'HBY100-J', 'BJQ6075J', 'HBY008A','HBY100-Y'], //需要显示地图的类型 - showCallPolice: ['BJQ6170', 'HBY210', 'HBY670', 'BJQ6075', 'HBY018A', 'HBY100-J', 'BJQ6075J','HBY008A', 'HBY100-Y'] //需要发送报警的类型 + showMapTypes: ['BJQ6170', 'HBY210', 'HBY670', 'BJQ6075', 'HBY018A', 'HBY100-J', 'BJQ6075J', 'HBY008A', + 'HBY100-Y' + ], //需要显示地图的类型 + showCallPolice: ['BJQ6170', 'HBY210', 'HBY670', 'BJQ6075', 'HBY018A', 'HBY100-J', 'BJQ6075J', + 'HBY008A', 'HBY100-Y' + ] //需要发送报警的类型 }, isPageShow: true } diff --git a/utils/BleHelper.js b/utils/BleHelper.js index 08be2b4..3d2b207 100644 --- a/utils/BleHelper.js +++ b/utils/BleHelper.js @@ -909,7 +909,7 @@ class BleHelper { this.updateCache(); } - }, 500); + }, 100); }); @@ -1157,7 +1157,7 @@ class BleHelper { //停止搜索 StopSearch() { if (this.data.platform == 'web' || !this.data.discovering) { - console.error("web平台或当前没有搜索,直接返回"); + console.error("web平台或当前没有搜索,直接返回",this.data.discovering); return Promise.resolve(); } let p1 = new Promise((resolve, reject) => {