体验优化添加失败时的提醒

This commit is contained in:
liub
2026-04-03 08:48:00 +08:00
parent 222c578f2c
commit aef68d5968
19 changed files with 851 additions and 1046 deletions

View File

@ -10,7 +10,7 @@
<view slot="right">
<view class="navbarRight center">
<view class="imgContent" @click.stop="handleRightClick(item,index)"
v-for="item,index in Status.navbar.icons">
v-for="item,index in Status.navbar.icons">
<image class="img" :src="item.src" mode="aspectFit"></image>
<view class="baber" v-if="item.math">{{item.math>9?'9+':item.math}}</view>
</view>
@ -37,7 +37,8 @@
<view class="row">
<image class="img" src="/static/images/common/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.sta_charge?dic.sta_charge[formData.sta_charge+'']:"未充电" }}
<view class="bigTxt">
{{formData.sta_charge?dic.sta_charge[formData.sta_charge+'']:"未充电" }}
</view>
<view class="smallTxt">设备状态</view>
</view>
@ -60,7 +61,7 @@
</view>
<view class="item" @click.top="bleStatuToggle">
<text class="lbl">蓝牙状态</text>
<text class="value" :class="(!formData.bleStatu || formData.bleStatu==='err')?'red':'green'">{{getbleStatu}}</text>
<text class="value" :class="(!formData.bleStatu || formData.bleStatu==='err')?'red':'green'">{{getbleStatu}}</text>
</view>
<view class="item">
<text class="lbl">信道:{{formData.sta_Channel}}</text>
@ -79,7 +80,7 @@
<view class="lampMode">
<view class="sosContent">
<view class="btnSos openSos center" :class="{active:formData.sta_LedType==='led_alarm'}"
@click="sosSetting(dic.sta_LightType[6],6)">
@click="sosSetting(dic.sta_LightType[6],6)">
{{formData.sta_LedType==='led_alarm'?'报警中':'强制报警'}}
</view>
<view class="btnSos closeSos center" @click="sosSetting(dic.sta_LightType[5],5)">解除</view>
@ -97,7 +98,7 @@
<view class="lampMode">
<view class="mode fleft " v-for="item,index in dic.sta_LightType.filter(v=>{return v.group=='sta_LedType'})"
:class="{'active':formData[item.group]===item.key,
:class="{'active':formData[item.group]===item.key,
'marginLeft':index%2===1,
'displayNone':!item.show
}" v-on:click.stop="actionSett(item,index)">
@ -125,7 +126,7 @@
</view>
<view class="lampMode">
<view class="mode fleft "
v-for="item,index in dic.sta_LightType.filter(v=>{return v.group!=='sta_LedType'})" :class="{'active':formData[item.group]===item.key,
v-for="item,index in dic.sta_LightType.filter(v=>{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 @@
</view>
<!-- 弹窗通知 -->
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
: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">
: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">
<view v-if="Status.ShowEditChannel" class="popup-prompt">
<text class="popup-prompt-title">修改信道</text>
<input class="popup-prompt-input" type="number" placeholder="1-125的整数"
placeholder-class="popup-prompt-input-placeHolder" v-model="formData.ins_Channel" />
placeholder-class="popup-prompt-input-placeHolder" v-model="formData.ins_Channel" />
</view>
</MessagePopup>
@ -194,6 +195,7 @@
<BottomSlideMenuPlus :config="Status.BottomMenu" @itemClick="btnClick" @close="closeActionSheet">
</BottomSlideMenuPlus>
<MsgBox ref="msgPop" />
</view>
</template>
@ -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;
}
}
}
</script>