空调弹窗分区添加

This commit is contained in:
home孙 2025-04-21 16:29:14 +08:00
parent 0a561f167e
commit 956395985d

View File

@ -1423,7 +1423,7 @@
</u-popup> </u-popup>
<!-- 空调弹框 --> <!-- 空调弹框 -->
<u-popup v-model="airconditioningShow" mode="center" :mask-close-able='true' width="640rpx" height="454rpx" <u-popup v-model="airconditioningShow" mode="center" :mask-close-able='true' width="640rpx" height="954rpx"
:closeable='false'> :closeable='false'>
<view class="contentPop lishui-item"> <view class="contentPop lishui-item">
<view class="contentPop_box"> <view class="contentPop_box">
@ -1450,6 +1450,60 @@
</view> </view>
</view> </view>
</view> </view>
<view class="model-title" style="padding:30rpx 0 0 30rpx;">
手自动开启几区空调
</view>
<view class="airconditioning-grid">
<view class="btn" @click="changeIndexOpen2(0)" :class="actList2[0]=='1'?'btn-on':'btn-off'">
<span>1#</span>
</view>
<view class="btn" @click="changeIndexOpen2(1)" :class="actList2[1]=='1'?'btn-on':'btn-off'">
<span>2#</span>
</view>
<view class="btn" @click="changeIndexOpen2(2)" :class="actList2[2]=='1'?'btn-on':'btn-off'">
<span>3#</span>
</view>
<view class="btn" @click="changeIndexOpen2(3)" :class="actList2[3]=='1'?'btn-on':'btn-off'">
<span>4#</span>
</view>
<view class="btn" @click="changeIndexOpen2(4)" :class="actList2[4]=='1'?'btn-on':'btn-off'">
<span>5#</span>
</view>
<view class="btn" @click="changeIndexOpen2(5)" :class="actList2[5]=='1'?'btn-on':'btn-off'">
<span>6#</span>
</view>
<view class="btn" @click="changeIndexOpen2(6)" :class="actList2[6]=='1'?'btn-on':'btn-off'">
<span>7#</span>
</view>
<view class="btn" @click="changeIndexOpen2(7)" :class="actList2[7]=='1'?'btn-on':'btn-off'">
<span>8#</span>
</view>
<view class="btn" @click="changeIndexOpen2(8)" :class="actList2[8]=='1'?'btn-on':'btn-off'">
<span>9#</span>
</view>
<view class="btn" @click="changeIndexOpen2(9)" :class="actList2[9]=='1'?'btn-on':'btn-off'">
<span>10#</span>
</view>
<view class="btn" @click="changeIndexOpen2(10)" :class="actList2[10]=='1'?'btn-on':'btn-off'">
<span>11#</span>
</view>
<view class="btn" @click="changeIndexOpen2(11)" :class="actList2[11]=='1'?'btn-on':'btn-off'">
<span>12#</span>
</view>
<view class="btn" @click="changeIndexOpen2(12)" :class="actList2[12]=='1'?'btn-on':'btn-off'">
<span>13#</span>
</view>
<view class="btn" @click="changeIndexOpen2(13)" :class="actList2[13]=='1'?'btn-on':'btn-off'">
<span>14#</span>
</view>
<view class="btn" @click="changeIndexOpen2(14)" :class="actList2[14]=='1'?'btn-on':'btn-off'">
<span>15#</span>
</view>
<view class="btn" @click="changeIndexOpen2(15)" :class="actList2[15]=='1'?'btn-on':'btn-off'">
<span>16#</span>
</view>
</view>
<view class="changeMoreBtn" @click="toWebView('wetFan')"> <view class="changeMoreBtn" @click="toWebView('wetFan')">
<image src="../../static/changeMore.png" mode=""></image> <image src="../../static/changeMore.png" mode=""></image>
<text>修改更多参数</text> <text>修改更多参数</text>
@ -2410,6 +2464,8 @@
open: 0, open: 0,
open1: 0 open1: 0
}, },
actList2:[],
airconditioningInputData:{},
}; };
}, },
onReady() { onReady() {
@ -3049,6 +3105,31 @@
this.actList1.push(openListNew[openListNew.length - index - 1]) this.actList1.push(openListNew[openListNew.length - index - 1])
}) })
}, },
getAct22063() {
this.actList2 = []
var num = this.airconditioningInputData[22063]
var num1 = this.padString(num.toString(2), 16)
var openListNew = []
openListNew = num1.split("")
this.actList2 = openListNew.reverse();
},
changeIndexOpen2(active) {
if (this.actList2[active] == '1') {
this.actList2[active] = '0'
} else {
this.actList2[active] = '1'
}
this.$forceUpdate();
var revList = this.actList2.slice().reverse()
var num = revList.join("");
var dataNum = {
target: {
value: parseInt(num, 2),
},
};
this.changeBtn(22063, dataNum);
},
getControl_getState() { getControl_getState() {
var data = { var data = {
deviceId: this.deviceId deviceId: this.deviceId
@ -3452,6 +3533,8 @@
if (res.code == 200) { if (res.code == 200) {
uni.hideLoading(); uni.hideLoading();
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
this.airconditioningInputData=res.data
this.getAct22063()
this.airconditioningControlIndex = res.data[22040]; this.airconditioningControlIndex = res.data[22040];
} }
}) })
@ -3987,7 +4070,74 @@
border-radius: 20rpx; border-radius: 20rpx;
min-height: 150rpx; min-height: 150rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
.model-title {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
margin-bottom: 20rpx;
}
.airconditioning-grid{
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-row-gap: 30rpx; //
grid-column-gap: 24rpx; //
padding: 30rpx 10px 35rpx 10px;
.btn {
width: 130rpx;
height: 66rpx;
display: flex;
align-items: center;
justify-content: center;
>image {
width: 30rpx;
height: 30rpx;
&.fan-img {
animation: rotate 5s linear infinite;
/* 持续时间为 5 秒,线性缓动,无限循环 */
/* 定义旋转动画 */
}
@keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
}
span {
margin-left: 10rpx;
}
&.btn-on {
background: linear-gradient(0deg, #54CDA4, #27B584);
border-radius: 10rpx;
span {
color: #fff;
}
}
&.btn-off {
background: #EFFCF7;
border: 2px solid rgba(58, 187, 144, 0.25);
border-radius: 10rpx;
box-sizing: border-box;
span {
font-weight: bold;
color: #24B383;
}
}
}
}
.lishui-title { .lishui-title {
width: 100%; width: 100%;
padding: 0 20rpx 0 30rpx; padding: 0 20rpx 0 30rpx;