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

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" :class="{'visibilityHidden':Status.apiType!=item.apiType}"
@click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons">
@click.stop="handleRightClick(item,index)" 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>
@ -33,12 +33,12 @@
</view>
</view>
<!-- <view class="row">
<image class="img" src="/static/images/common/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.xuhang}}</view>
<view class="smallTxt">续航时间</view>
</view>
</view> -->
<image class="img" src="/static/images/common/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.xuhang}}</view>
<view class="smallTxt">续航时间</view>
</view>
</view> -->
</view>
</view>
<view class="eqinfo">
@ -72,17 +72,17 @@
</view>
<!-- <view class="lamp">
<view class="title">
<text>信道设置</text>
<text>{{formData.sta_Channel}}</text>
</view>
<view class="title">
<text>信道设置</text>
<text>{{formData.sta_Channel}}</text>
</view>
</view>
<view class="lampMode">
<slider min="1" max="125" step="1" :disabled="false" :value="formData.sta_Channel" activeColor="#bbe600"
backgroundColor="#686767" block-size="20" block-color="#ffffffde" @change="onChannelChanging"
@changing="onChannelChanging" class="custom-slider" />
</view> -->
<view class="lampMode">
<slider min="1" max="125" step="1" :disabled="false" :value="formData.sta_Channel" activeColor="#bbe600"
backgroundColor="#686767" block-size="20" block-color="#ffffffde" @change="onChannelChanging"
@changing="onChannelChanging" class="custom-slider" />
</view> -->
<view class="lamp">
<view class="title">
@ -95,13 +95,13 @@
<view class="lampMode">
<view class="mode fleft " v-for="item,index in dic.SOS"
:class="{active:formData.sta_SOSType===item.val,marginLeft:index%2==1}"
v-on:click.stop="sosSetting(item,index)">
:class="{active:formData.sta_SOSType===item.val,marginLeft:index%2==1}"
v-on:click.stop="sosSetting(item,index)">
<view class="leftImg">
<image class="img" :class="(formData.sta_SOSType!==item.val || !item.activeImg)?'':'displayNone'"
:src="item.img" mode="aspectFit"></image>
:src="item.img" mode="aspectFit"></image>
<image class="img" :class="(formData.sta_SOSType===item.val && item.activeImg)?'':'displayNone'"
:src="item.activeImg" mode="aspectFit"></image>
:src="item.activeImg" mode="aspectFit"></image>
</view>
<view class="rightTxt">
<text class="bigTxt">{{item['text']}}</text>
@ -128,8 +128,8 @@
<view class="lampMode">
<view class="colorContent">
<view v-for="item,index in formData.groups" class="item"
:class="{active:item.id==formData.sta_GroupType,marginNoLeft:index%3===0}"
@click.stop="groupSetting(item,index)">
:class="{active:item.id==formData.sta_GroupType,marginNoLeft:index%3===0}"
@click.stop="groupSetting(item,index)">
<view class="polygon" :style="{backgroundColor:item.hex}">
@ -153,7 +153,7 @@
<view class="modeSetting">
<view class="arrow" @click.stop="ArrowModeSet('right_off')"
:class="formData.sta_ArrowMode=='right_off'?'active':''">
:class="formData.sta_ArrowMode=='right_off'?'active':''">
<view class="outCircle">
<view class="item">
<image class="img nomal" src="/static/images/4877/arrow.png" mode="aspectFit"></image>
@ -164,13 +164,13 @@
<view class="text">朝左</view>
</view>
<view class="arrow" @click.stop="ArrowModeSet('right_on')"
:class="formData.sta_ArrowMode=='right_on'?'active':''">
:class="formData.sta_ArrowMode=='right_on'?'active':''">
<view class="outCircle">
<view class="item">
<image class="img nomal translate" src="/static/images/4877/arrow.png" mode="aspectFit">
</image>
<image class="img activity translate" src="/static/images/4877/arrowActive.png"
mode="aspectFit"></image>
mode="aspectFit"></image>
</view>
</view>
<view class="text">朝右</view>
@ -185,7 +185,7 @@
<view class="modeSetting">
<view class="arrow" @click.stop="ArrowSet('red_front')"
:class="formData.sta_ArrowType=='red_front'?'redactive':''">
:class="formData.sta_ArrowType=='red_front'?'redactive':''">
<view class="outCircle">
<view class="item">
<view class="text">红色</view>
@ -194,7 +194,7 @@
</view>
<view class="arrow" @click.stop="ArrowSet('green_back')"
:class="formData.sta_ArrowType=='green_back'?'greenactive':''">
:class="formData.sta_ArrowType=='green_back'?'greenactive':''">
<view class="outCircle">
<view class="item">
<view class="text">绿色</view>
@ -217,7 +217,7 @@
<view class="modeSetting">
<view class="arrow" @click.stop="ArrowSet('red_all')"
:class="formData.sta_ArrowType=='red_all'?'active':''">
:class="formData.sta_ArrowType=='red_all'?'active':''">
<view class="outCircle">
<view class="item">
<image class="img nomal" src="/static/images/4877/arrowLR.png" mode="aspectFit"></image>
@ -228,13 +228,13 @@
<view class="text">红色双向</view>
</view>
<view class="arrow" @click.stop="ArrowSet('green_all')"
:class="formData.sta_ArrowType=='green_all'?'active':''">
:class="formData.sta_ArrowType=='green_all'?'active':''">
<view class="outCircle">
<view class="item">
<image class="img nomal translate" src="/static/images/4877/arrowLR.png" mode="aspectFit">
</image>
<image class="img activity translate" src="/static/images/4877/arrowLRActive.png"
mode="aspectFit"></image>
mode="aspectFit"></image>
</view>
</view>
<view class="text">绿色双向</view>
@ -266,22 +266,22 @@
<!-- 弹窗通知 -->
<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.sta_Channel" />
placeholder-class="popup-prompt-input-placeHolder" v-model="formData.sta_Channel" />
</view>
</MessagePopup>
<MsgBox ref="msgPop" />
<global-loading ref="loading" />
</view>
</template>
@ -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);
}
}
}