|
@@ -12,7 +12,7 @@
|
|
</view> -->
|
|
</view> -->
|
|
|
|
|
|
<u-cell-group class="toptemplate">
|
|
<u-cell-group class="toptemplate">
|
|
- <u-cell :title="mytitle" @click="floorchange" :border="false">
|
|
|
|
|
|
+ <u-cell :title="mytitle" @click="floorchange" :border="false">
|
|
<u-icon slot="icon" size="40" color="#fff" name="map"></u-icon>
|
|
<u-icon slot="icon" size="40" color="#fff" name="map"></u-icon>
|
|
<u-icon slot="right-icon" size="40" color="#fff" name="search"></u-icon>
|
|
<u-icon slot="right-icon" size="40" color="#fff" name="search"></u-icon>
|
|
</u-cell>
|
|
</u-cell>
|
|
@@ -26,13 +26,13 @@
|
|
<u-icon name="arrow-down-fill" color="#666" size="16" class="inline"></u-icon>
|
|
<u-icon name="arrow-down-fill" color="#666" size="16" class="inline"></u-icon>
|
|
</picker>
|
|
</picker>
|
|
</view>
|
|
</view>
|
|
- <view class="drawdownMenu">
|
|
|
|
|
|
+ <!-- <view class="drawdownMenu">
|
|
<picker @change="(val)=>confirmHandle(val,'deviceStatus')" :value="deviceStatusIndex"
|
|
<picker @change="(val)=>confirmHandle(val,'deviceStatus')" :value="deviceStatusIndex"
|
|
:range="deviceStatusList" style="width:100%;height: 100%;" range-key="text">
|
|
:range="deviceStatusList" style="width:100%;height: 100%;" range-key="text">
|
|
<view class="uni-input">{{deviceStatusList[deviceStatusIndex].text}}</view>
|
|
<view class="uni-input">{{deviceStatusList[deviceStatusIndex].text}}</view>
|
|
<u-icon name="arrow-down-fill" color="#666" size="16" class="inline"></u-icon>
|
|
<u-icon name="arrow-down-fill" color="#666" size="16" class="inline"></u-icon>
|
|
</picker>
|
|
</picker>
|
|
- </view>
|
|
|
|
|
|
+ </view> -->
|
|
</view>
|
|
</view>
|
|
<view class="total">
|
|
<view class="total">
|
|
共有<text style="color: #f44;">{{total}}</text>条记录
|
|
共有<text style="color: #f44;">{{total}}</text>条记录
|
|
@@ -40,22 +40,24 @@
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<view class="list">
|
|
<view class="list">
|
|
<template v-if="deviceType == 'AirConditioner'">
|
|
<template v-if="deviceType == 'AirConditioner'">
|
|
- <view class="each c" v-for="(item,index) in dataList" :class="'bg'+(item.attributeList.length==0?'':item.attributeList[2].value)">
|
|
|
|
|
|
+ <view class="each c" v-for="(item,index) in dataList"
|
|
|
|
+ :class="'bg'+(item.attributeList.length==0?'':item.attributeList[2].value)">
|
|
<div class="top1">
|
|
<div class="top1">
|
|
<template v-if="item.attributeList.length!=0">
|
|
<template v-if="item.attributeList.length!=0">
|
|
- <image v-if="item.attributeList[2].value == '1'"
|
|
|
|
- src="../../../static/management/taiyang.png"></image>
|
|
|
|
- <image v-if="item.attributeList[2].value == '2'||item.attributeList[2].value == '0'"
|
|
|
|
- src="../../../static/management/zl.png"></image>
|
|
|
|
- <image v-if="item.attributeList[2].value == '4'"
|
|
|
|
- src="../../../static/management/auto.png"</image>
|
|
|
|
- <image v-if="item.attributeList[2].value == '8'"
|
|
|
|
- src="../../../static/management/cs.png"</image>
|
|
|
|
|
|
+ <image v-if="item.attributeList[2].value == '1'"
|
|
|
|
+ src="../../../static/management/taiyang.png"></image>
|
|
|
|
+ <image v-if="item.attributeList[2].value == '2'||item.attributeList[2].value == '0'"
|
|
|
|
+ src="../../../static/management/zl.png"></image>
|
|
|
|
+ <image v-if="item.attributeList[2].value == '4'" src="../../../static/management/auto.png"
|
|
|
|
+ </image>
|
|
|
|
+ <image v-if="item.attributeList[2].value == '8'" src="../../../static/management/cs.png"
|
|
|
|
+ </image>
|
|
</template>
|
|
</template>
|
|
<view class="l1">{{item.airConditionerName}}</view>
|
|
<view class="l1">{{item.airConditionerName}}</view>
|
|
<view class="l2">{{ item.installSite }}{{ item.roomNumbers }}</view>
|
|
<view class="l2">{{ item.installSite }}{{ item.roomNumbers }}</view>
|
|
<view class="l3">{{item.attributeList.length==0?'--':item.attributeList[5].value}}℃</view>
|
|
<view class="l3">{{item.attributeList.length==0?'--':item.attributeList[5].value}}℃</view>
|
|
- <view class="l4">室温:{{ item.attributeList.length==0?'--':item.attributeList[4].value }}℃</view>
|
|
|
|
|
|
+ <view class="l4">室温:{{ item.attributeList.length==0?'--':item.attributeList[4].value }}℃
|
|
|
|
+ </view>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<view class="operation" v-if="item.attributeList&&item.attributeList.length!=0">
|
|
<view class="operation" v-if="item.attributeList&&item.attributeList.length!=0">
|
|
@@ -96,8 +98,8 @@
|
|
</picker>
|
|
</picker>
|
|
</view>
|
|
</view>
|
|
<switch :checked="item.attributeList[3].value==1?true:false" v-if="item.attributeList.length!=0"
|
|
<switch :checked="item.attributeList[3].value==1?true:false" v-if="item.attributeList.length!=0"
|
|
- @change="(val)=>changeSwitch('AirConditioner', val, item.deviceId, index,item.attributeList[3].sensorAddress)"
|
|
|
|
- style="transform:scale(0.7)" class="switch" />
|
|
|
|
|
|
+ @click="(val)=>changeSwitch('AirConditioner', item.attributeList[3].value, item.deviceId, index,item.attributeList[3].sensorAddress)"
|
|
|
|
+ style="transform:scale(0.7)" class="switch" disabled />
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
<template v-if="deviceType == 'Relay'">
|
|
<template v-if="deviceType == 'Relay'">
|
|
@@ -155,7 +157,7 @@
|
|
dataForm: {
|
|
dataForm: {
|
|
page: 1,
|
|
page: 1,
|
|
limit: 10,
|
|
limit: 10,
|
|
- opStatus:'',
|
|
|
|
|
|
+ opStatus: '',
|
|
buildingId: "",
|
|
buildingId: "",
|
|
storeyId: "",
|
|
storeyId: "",
|
|
status: "",
|
|
status: "",
|
|
@@ -195,6 +197,9 @@
|
|
],
|
|
],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ onPullDownRefresh() {
|
|
|
|
+ this.onRefresh();
|
|
|
|
+ },
|
|
onReachBottom() {
|
|
onReachBottom() {
|
|
if (!this.finished) {
|
|
if (!this.finished) {
|
|
this.dataForm.page++;
|
|
this.dataForm.page++;
|
|
@@ -203,20 +208,24 @@
|
|
},
|
|
},
|
|
onLoad(v) {
|
|
onLoad(v) {
|
|
uni.setNavigationBarTitle({
|
|
uni.setNavigationBarTitle({
|
|
- title:v.type==1?'空调控制':'照明控制'
|
|
|
|
|
|
+ title: v.type == 1 ? '空调控制' : '照明控制'
|
|
})
|
|
})
|
|
- if(v.type==1){
|
|
|
|
- this.deviceType="AirConditioner";
|
|
|
|
- this.deviceTypeIndex=0;
|
|
|
|
- }else{
|
|
|
|
- this.deviceType='Relay';
|
|
|
|
- this.deviceTypeIndex=1;
|
|
|
|
|
|
+ if (v.type == 1) {
|
|
|
|
+ this.deviceType = "AirConditioner";
|
|
|
|
+ this.deviceTypeIndex = 0;
|
|
|
|
+ } else {
|
|
|
|
+ this.deviceType = 'Relay';
|
|
|
|
+ this.deviceTypeIndex = 1;
|
|
}
|
|
}
|
|
let getDictDataList = uni.getStorageSync('getDictDataList');
|
|
let getDictDataList = uni.getStorageSync('getDictDataList');
|
|
for (let i = 0; i < getDictDataList.length; i++) {
|
|
for (let i = 0; i < getDictDataList.length; i++) {
|
|
if (getDictDataList[i].dictType == 'ModeType') {
|
|
if (getDictDataList[i].dictType == 'ModeType') {
|
|
this.modeTypeList = getDictDataList[i].dataList
|
|
this.modeTypeList = getDictDataList[i].dataList
|
|
- this.modeTypeList.push({dictLabel: "制冷",dictTypeId: "1610183082852225025",dictValue: "0"})
|
|
|
|
|
|
+ this.modeTypeList.push({
|
|
|
|
+ dictLabel: "制冷",
|
|
|
|
+ dictTypeId: "1610183082852225025",
|
|
|
|
+ dictValue: "0"
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
if (getDictDataList[i].dictType == 'SpeedType') {
|
|
if (getDictDataList[i].dictType == 'SpeedType') {
|
|
@@ -348,7 +357,7 @@
|
|
Api.setControlElec(val).then((res) => {
|
|
Api.setControlElec(val).then((res) => {
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
- this.dataForm.page=1;
|
|
|
|
|
|
+ this.dataForm.page = 1;
|
|
this.getDataList();
|
|
this.getDataList();
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '操作成功'
|
|
title: '操作成功'
|
|
@@ -372,17 +381,18 @@
|
|
this.showfloor = true;
|
|
this.showfloor = true;
|
|
},
|
|
},
|
|
confirmfloor(e) {
|
|
confirmfloor(e) {
|
|
- let a="";let b="";
|
|
|
|
- if(e.value[0]){
|
|
|
|
- a=e.value[0].orgName=='全部'?'跨境电商':e.value[0].orgName;
|
|
|
|
|
|
+ let a = "";
|
|
|
|
+ let b = "";
|
|
|
|
+ if (e.value[0]) {
|
|
|
|
+ a = e.value[0].orgName == '全部' ? '跨境电商' : e.value[0].orgName;
|
|
this.dataForm.buildingId = e.value[0].orgId;
|
|
this.dataForm.buildingId = e.value[0].orgId;
|
|
- this.dataForm.storeyId="";
|
|
|
|
|
|
+ this.dataForm.storeyId = "";
|
|
}
|
|
}
|
|
- if(e.value[1]){
|
|
|
|
- b=e.value[1].orgName=='全部'?'':e.value[1].orgName;
|
|
|
|
- this.dataForm.storeyId = e.value[1].orgId?e.value[1].orgId:'';
|
|
|
|
|
|
+ if (e.value[1]) {
|
|
|
|
+ b = e.value[1].orgName == '全部' ? '' : e.value[1].orgName;
|
|
|
|
+ this.dataForm.storeyId = e.value[1].orgId ? e.value[1].orgId : '';
|
|
}
|
|
}
|
|
- this.mytitle = a+b;
|
|
|
|
|
|
+ this.mytitle = a + b;
|
|
this.showfloor = false;
|
|
this.showfloor = false;
|
|
this.dataList = []; // 清空数组
|
|
this.dataList = []; // 清空数组
|
|
this.dataForm.page = 1;
|
|
this.dataForm.page = 1;
|
|
@@ -427,7 +437,9 @@
|
|
json.concat(res.data.data[0].childrenList),
|
|
json.concat(res.data.data[0].childrenList),
|
|
[]
|
|
[]
|
|
]
|
|
]
|
|
- let allfloor = [[]];
|
|
|
|
|
|
+ let allfloor = [
|
|
|
|
+ []
|
|
|
|
+ ];
|
|
for (let i = 0; i < res.data.data[0].childrenList.length; i++) {
|
|
for (let i = 0; i < res.data.data[0].childrenList.length; i++) {
|
|
allfloor.push(json.concat(res.data.data[0].childrenList[i].childrenList));
|
|
allfloor.push(json.concat(res.data.data[0].childrenList[i].childrenList));
|
|
}
|
|
}
|
|
@@ -459,7 +471,7 @@
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
- this.dataForm.page=1;
|
|
|
|
|
|
+ this.dataForm.page = 1;
|
|
that.getDataList();
|
|
that.getDataList();
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
title: "操作成功",
|
|
title: "操作成功",
|
|
@@ -506,14 +518,14 @@
|
|
this.onRefresh();
|
|
this.onRefresh();
|
|
}
|
|
}
|
|
if (type == "modeType" || type == "speedType" || type == "temp") {
|
|
if (type == "modeType" || type == "speedType" || type == "temp") {
|
|
- let data="";
|
|
|
|
- if(type=='modeType'){
|
|
|
|
|
|
+ let data = "";
|
|
|
|
+ if (type == 'modeType') {
|
|
data = this.modeTypeList[e.detail.value].dictValue;
|
|
data = this.modeTypeList[e.detail.value].dictValue;
|
|
}
|
|
}
|
|
- if(type=='speedType'){
|
|
|
|
- data =this.speedTypeList[e.detail.value].dictValue;
|
|
|
|
|
|
+ if (type == 'speedType') {
|
|
|
|
+ data = this.speedTypeList[e.detail.value].dictValue;
|
|
}
|
|
}
|
|
- if(type=='temp'){
|
|
|
|
|
|
+ if (type == 'temp') {
|
|
data = this.temperatureList[e.detail.value];
|
|
data = this.temperatureList[e.detail.value];
|
|
}
|
|
}
|
|
this.onConfirmMode(data, deviceId, identifier);
|
|
this.onConfirmMode(data, deviceId, identifier);
|
|
@@ -567,6 +579,7 @@
|
|
getAircond() {
|
|
getAircond() {
|
|
this.dataForm.status = "";
|
|
this.dataForm.status = "";
|
|
Api.airconditioner(this.dataForm).then((res) => {
|
|
Api.airconditioner(this.dataForm).then((res) => {
|
|
|
|
+ uni.stopPullDownRefresh();//停止刷新
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
if (res.data.data) {
|
|
if (res.data.data) {
|
|
if (res.data.data.list.length == 0) {
|
|
if (res.data.data.list.length == 0) {
|
|
@@ -578,11 +591,11 @@
|
|
if (this.dataForm.page == 1) {
|
|
if (this.dataForm.page == 1) {
|
|
this.dataList = res.data.data.list;
|
|
this.dataList = res.data.data.list;
|
|
} else {
|
|
} else {
|
|
- this.dataList.push(...res.data.data.list); // 将数据放入list中
|
|
|
|
|
|
+ this.dataList.push(...res.data.data.list); // 将数据放入list中
|
|
}
|
|
}
|
|
this.loading = false; // 加载状态结束
|
|
this.loading = false; // 加载状态结束
|
|
this.total = res.data.data.total;
|
|
this.total = res.data.data.total;
|
|
-
|
|
|
|
|
|
+
|
|
// 如果list长度大于等于总数据条数,数据全部加载完成
|
|
// 如果list长度大于等于总数据条数,数据全部加载完成
|
|
if (this.dataList.length >= res.data.data.total) {
|
|
if (this.dataList.length >= res.data.data.total) {
|
|
this.finished = true; // 结束加载状态
|
|
this.finished = true; // 结束加载状态
|
|
@@ -601,6 +614,7 @@
|
|
|
|
|
|
getElec() {
|
|
getElec() {
|
|
Api.getElec(this.dataForm).then((res) => {
|
|
Api.getElec(this.dataForm).then((res) => {
|
|
|
|
+ uni.stopPullDownRefresh();//停止刷新
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
if (res.data.data) {
|
|
if (res.data.data) {
|
|
if (res.data.data.list.length == 0) {
|
|
if (res.data.data.list.length == 0) {
|
|
@@ -633,8 +647,9 @@
|
|
},
|
|
},
|
|
//下发指令开关
|
|
//下发指令开关
|
|
changeSwitch(type, val, deviceId, index, identifier) {
|
|
changeSwitch(type, val, deviceId, index, identifier) {
|
|
|
|
+ console.log(val)
|
|
let msg = "";
|
|
let msg = "";
|
|
- if (val.detail.value) {
|
|
|
|
|
|
+ if (!val) {
|
|
msg = "开启";
|
|
msg = "开启";
|
|
} else {
|
|
} else {
|
|
msg = "关闭";
|
|
msg = "关闭";
|
|
@@ -758,7 +773,7 @@
|
|
display: flex;
|
|
display: flex;
|
|
text-align: center;
|
|
text-align: center;
|
|
min-width: 50%;
|
|
min-width: 50%;
|
|
- flex:1;
|
|
|
|
|
|
+ flex: 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -806,7 +821,7 @@
|
|
&.on2 {
|
|
&.on2 {
|
|
background: linear-gradient(to bottom,
|
|
background: linear-gradient(to bottom,
|
|
rgba(255, 155, 37, 0.25),
|
|
rgba(255, 155, 37, 0.25),
|
|
- rgba(255, 234, 200, 0.13),
|
|
|
|
|
|
+ rgba(255, 234, 200, 0.13),
|
|
rgba(255, 255, 255, 0.04));
|
|
rgba(255, 255, 255, 0.04));
|
|
|
|
|
|
}
|
|
}
|
|
@@ -818,28 +833,33 @@
|
|
.top1 {
|
|
.top1 {
|
|
padding: 16px 20px;
|
|
padding: 16px 20px;
|
|
border-bottom: 1px solid #E6E7EA;
|
|
border-bottom: 1px solid #E6E7EA;
|
|
- image{
|
|
|
|
|
|
+
|
|
|
|
+ image {
|
|
width: 54px;
|
|
width: 54px;
|
|
- height: 56px;
|
|
|
|
- position: absolute;
|
|
|
|
- left: 0;
|
|
|
|
- top: 0;
|
|
|
|
- z-index: 1;
|
|
|
|
|
|
+ height: 56px;
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 0;
|
|
|
|
+ top: 0;
|
|
|
|
+ z-index: 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- &.bg0,&.bg2{
|
|
|
|
- background: linear-gradient(to bottom,#D2F0FF,#FFFFFF)
|
|
|
|
|
|
+
|
|
|
|
+ &.bg0,
|
|
|
|
+ &.bg2 {
|
|
|
|
+ background: linear-gradient(to bottom, #D2F0FF, #FFFFFF)
|
|
}
|
|
}
|
|
- &.bg1{
|
|
|
|
- background: linear-gradient(to bottom,#FFE2DF,#FFFFFF)
|
|
|
|
|
|
+
|
|
|
|
+ &.bg1 {
|
|
|
|
+ background: linear-gradient(to bottom, #FFE2DF, #FFFFFF)
|
|
}
|
|
}
|
|
-
|
|
|
|
- &.bg4{
|
|
|
|
- background: linear-gradient(to bottom,#DDF8DC,#FFFFFF)
|
|
|
|
|
|
+
|
|
|
|
+ &.bg4 {
|
|
|
|
+ background: linear-gradient(to bottom, #DDF8DC, #FFFFFF)
|
|
}
|
|
}
|
|
- &.bg8{
|
|
|
|
- background: linear-gradient(to bottom,#DEE4FE,#FFFFFF)
|
|
|
|
|
|
+
|
|
|
|
+ &.bg8 {
|
|
|
|
+ background: linear-gradient(to bottom, #DEE4FE, #FFFFFF)
|
|
}
|
|
}
|
|
|
|
|
|
.top {
|
|
.top {
|
|
@@ -902,8 +922,9 @@
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
padding: 18px;
|
|
padding: 18px;
|
|
text-align: center;
|
|
text-align: center;
|
|
- box-sizing:border-box;
|
|
|
|
- .uni-input{
|
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+
|
|
|
|
+ .uni-input {
|
|
color: #2e69eb;
|
|
color: #2e69eb;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -943,4 +964,4 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+</style>
|