修复102时间加减异常

This commit is contained in:
liub
2026-03-24 12:00:27 +08:00
parent 5163491ea3
commit c286660a10
7 changed files with 234 additions and 48 deletions

View File

@ -60,12 +60,12 @@
</view>
<view class="item" @click.top="bleStatuToggle">
<text class="lbl">蓝牙状态</text>
<text class="value" :class="formData.bleStatu?'green':'red'">{{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>
<text class="value green" @click.stop="ShowChannelEdit()">修改</text>
</view>
<!-- <view class="item">
<text class="lbl">设备状态</text>
<text class="value">{{formData.sta_charge?dic.sta_charge[formData.sta_charge]:"" }}</text>
</view> -->
</view>
<view class="warnnig" v-for="item,index in warnDevices">
@ -177,7 +177,14 @@
: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" />
: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" />
</view>
</MessagePopup>
<!-- 下方菜单 -->
@ -221,6 +228,7 @@
curr: 0,
total: 0,
pageHide: false,
ShowEditChannel: false,
Pop: {
showPop: false, //是否显示弹窗
popType: 'custom',
@ -325,8 +333,8 @@
warnTime: '',
sta_sosadd: "",
sta_sosName: '',
sta_IntrusTime: ''
sta_IntrusTime: '',
ins_Channel:23
},
dic: {
sta_LightType: [
@ -519,7 +527,7 @@
});
}
this.getLinkedCnt();
// this.getLinkedCnt();
},
computed: {
Distance: function() {
@ -561,6 +569,73 @@
}
},
methods: {
onChannelChanging() {
let f = this.getDevice();
// #ifdef APP-PLUS
if (!f) {
this.showBleUnConnect();
return;
}
// #endif
let regex = /^([1-9]|[1-7][0-9]|80)$/;
if (!regex.test(this.formData.ins_Channel)) {
uni.showModal({
title: '提示',
content: '只能输入1-80整数'
});
return;
}
var buffer = {
ins_Channel: this.formData.ins_Channel
}
ble.sendString(f.deviceId, buffer);
},
ShowChannelEdit() {
if (!this.permissions.includes('55') && this.Status.apiType !== 'listA') {
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
return;
}
this.Status.ShowEditChannel = true;
this.showPop({
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: () => {
this.onChannelChanging();
this.Status.ShowEditChannel = false;
},
showSlot: true,
buttonCancelText: '取消',
showCancel: true,
cancelCallback: () => {
this.Status.ShowEditChannel = false;
}
});
},
getLinkedCnt() { //获取在线设备的数量
let f = this.getDevice();
@ -2266,4 +2341,30 @@
/deep/ .uni-navbar--fixed {
top: 0px;
}
.popup-prompt-input {
width: 100%;
height: 60rpx;
line-height: 60rpx;
color: rgba(255, 255, 255, 0.87);
box-sizing: border-box;
border-bottom: 2rpx solid rgba(255, 255, 255, 0.4);
font-size: 28rpx;
font-weight: 400;
letter-spacing: 0.14px;
}
.popup-prompt-input-placeHolder {
color: rgba(255, 255, 255, 0.4);
font-family: PingFang SC;
font-size: 28rpx;
font-weight: 400;
letter-spacing: 0.14px;
text-align: center;
}
</style>