|
@@ -215,18 +215,18 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import wepy from '@wepy/core';
|
|
|
+import wepy from '@wepy/core'
|
|
|
import { changeManualTempHttp, querySpaceConditioners, getSeasonType } from '../../../api/officehome.js'
|
|
|
-import config from '@/config';
|
|
|
-import { isWithinLocation } from '@/service/location';
|
|
|
-import moment from 'moment';
|
|
|
-import store from '@/store';
|
|
|
-import { mapState } from '@wepy/x';
|
|
|
+import config from '@/config'
|
|
|
+import { isWithinLocation } from '@/service/location'
|
|
|
+import moment from 'moment'
|
|
|
+import store from '@/store'
|
|
|
+import { mapState } from '@wepy/x'
|
|
|
import { checkSpaceControl } from '@/packagesEnv/pages/common.js'
|
|
|
|
|
|
-let infoTimer;
|
|
|
-let debounceTimer;
|
|
|
-const barWidth = 17;
|
|
|
+let infoTimer
|
|
|
+let debounceTimer
|
|
|
+const barWidth = 17
|
|
|
|
|
|
wepy.component({
|
|
|
props: {
|
|
@@ -330,16 +330,16 @@ wepy.component({
|
|
|
watch: {
|
|
|
hasAir(val) {
|
|
|
if (!val) {
|
|
|
- clearInterval(infoTimer);
|
|
|
- this.airData.isOpen = false;
|
|
|
+ clearInterval(infoTimer)
|
|
|
+ this.airData.isOpen = false
|
|
|
}
|
|
|
},
|
|
|
objectId(val) {
|
|
|
if (val) {
|
|
|
- this.doTimeout();
|
|
|
- this.getAirInfo();
|
|
|
+ this.doTimeout()
|
|
|
+ this.getAirInfo()
|
|
|
} else {
|
|
|
- this.airData.isOpen = false;
|
|
|
+ this.airData.isOpen = false
|
|
|
}
|
|
|
}
|
|
|
// allDevices: {
|
|
@@ -352,190 +352,190 @@ wepy.component({
|
|
|
computed: {
|
|
|
...mapState({ isNowTime: state => state.officehome.isNowTime }),
|
|
|
airRunImg() {
|
|
|
- let imgStr = '';
|
|
|
+ let imgStr = ''
|
|
|
switch (this.airData.icon) {
|
|
|
case 1:
|
|
|
- imgStr = 'temp-keep.png';
|
|
|
- break;
|
|
|
+ imgStr = 'temp-keep.png'
|
|
|
+ break
|
|
|
case 2:
|
|
|
- imgStr = 'temp_cold.svg';
|
|
|
- break;
|
|
|
+ imgStr = 'temp_cold.svg'
|
|
|
+ break
|
|
|
case 3:
|
|
|
- imgStr = 'temp_sun.png';
|
|
|
- break;
|
|
|
+ imgStr = 'temp_sun.png'
|
|
|
+ break
|
|
|
default:
|
|
|
- imgStr = '';
|
|
|
- break;
|
|
|
+ imgStr = ''
|
|
|
+ break
|
|
|
}
|
|
|
- return imgStr;
|
|
|
+ return imgStr
|
|
|
},
|
|
|
devicesOpenNum() {
|
|
|
- var openArr = this.allDevices.filter((item) => { return item.open });
|
|
|
- return openArr.length;
|
|
|
+ var openArr = this.allDevices.filter((item) => { return item.open })
|
|
|
+ return openArr.length
|
|
|
}
|
|
|
},
|
|
|
ready() {
|
|
|
- this.querySeasonType();
|
|
|
- var _this = this;
|
|
|
+ this.querySeasonType()
|
|
|
+ var _this = this
|
|
|
},
|
|
|
detached() {
|
|
|
- this.airData.isOpen = false;
|
|
|
- clearInterval(infoTimer);
|
|
|
+ this.airData.isOpen = false
|
|
|
+ clearInterval(infoTimer)
|
|
|
},
|
|
|
methods: {
|
|
|
doTimeout() {
|
|
|
- clearInterval(infoTimer); // 定时器先清理 再设定
|
|
|
+ clearInterval(infoTimer) // 定时器先清理 再设定
|
|
|
infoTimer = setInterval(() => {
|
|
|
- this.getAirInfo();
|
|
|
- }, 15000);
|
|
|
+ this.getAirInfo()
|
|
|
+ }, 15000)
|
|
|
},
|
|
|
doTransX: function (newVal) {
|
|
|
- var tempNum = (this.endTemp - this.startTemp) * 2;
|
|
|
- var eachUnit = this.tempBarWidth / tempNum;// 0.5度的长度
|
|
|
- var moveNum = Math.floor(newVal / eachUnit);
|
|
|
- this.nowTemp = moveNum * 0.5 + this.startTemp;
|
|
|
+ var tempNum = (this.endTemp - this.startTemp) * 2
|
|
|
+ var eachUnit = this.tempBarWidth / tempNum// 0.5度的长度
|
|
|
+ var moveNum = Math.floor(newVal / eachUnit)
|
|
|
+ this.nowTemp = moveNum * 0.5 + this.startTemp
|
|
|
if (typeof this.nowTemp === 'number' && this.nowTemp % 1 === 0) {
|
|
|
// this.vibrateShort();
|
|
|
}
|
|
|
},
|
|
|
doTemp(newVal) { // 处理温度
|
|
|
- var _this = this;
|
|
|
- let maxSelecotr = this.$wx.createSelectorQuery();
|
|
|
+ var _this = this
|
|
|
+ let maxSelecotr = this.$wx.createSelectorQuery()
|
|
|
maxSelecotr
|
|
|
.select('#tempBar')
|
|
|
.boundingClientRect()
|
|
|
.exec(res => {
|
|
|
// console.log('res', res);
|
|
|
- _this.tempBarWidth = (res[0] && res[0].width) ? (res[0].width - barWidth) : _this.tempBarWidth;
|
|
|
+ _this.tempBarWidth = (res[0] && res[0].width) ? (res[0].width - barWidth) : _this.tempBarWidth
|
|
|
|
|
|
- var tempNum = (_this.endTemp - _this.startTemp) * 2;
|
|
|
+ var tempNum = (_this.endTemp - _this.startTemp) * 2
|
|
|
// console.log("_this.tempBarWidth", _this.tempBarWidth, newVal);
|
|
|
- var eachUnit = _this.tempBarWidth / tempNum;// 0.5度的长度
|
|
|
- var changeNum = (newVal - _this.startTemp) * 2;
|
|
|
+ var eachUnit = _this.tempBarWidth / tempNum// 0.5度的长度
|
|
|
+ var changeNum = (newVal - _this.startTemp) * 2
|
|
|
|
|
|
- var transX = eachUnit * changeNum;
|
|
|
+ var transX = eachUnit * changeNum
|
|
|
if (transX < 0) { // transX只能是正的
|
|
|
- transX = 0;
|
|
|
+ transX = 0
|
|
|
}
|
|
|
if (transX > _this.tempBarWidth) {
|
|
|
- transX = _this.tempBarWidth;
|
|
|
+ transX = _this.tempBarWidth
|
|
|
}
|
|
|
- _this.transX = transX;
|
|
|
- });
|
|
|
+ _this.transX = transX
|
|
|
+ })
|
|
|
},
|
|
|
allAirClick() {
|
|
|
- if (!checkSpaceControl(this.isControl)) return;
|
|
|
- this.getAirInfo();
|
|
|
- this.allAirShow = !this.allAirShow;
|
|
|
+ if (!checkSpaceControl(this.isControl)) return
|
|
|
+ this.getAirInfo()
|
|
|
+ this.allAirShow = !this.allAirShow
|
|
|
},
|
|
|
ctouchstart: function (e) {
|
|
|
- if (!this.airData.isOpen) return;
|
|
|
- var pageX = e.touches[0].pageX;
|
|
|
- var _this = this;
|
|
|
- this.startX = pageX;
|
|
|
- _this.movesign = true;
|
|
|
- this.$emit('setCanScroll', false);
|
|
|
+ if (!this.airData.isOpen) return
|
|
|
+ var pageX = e.touches[0].pageX
|
|
|
+ var _this = this
|
|
|
+ this.startX = pageX
|
|
|
+ _this.movesign = true
|
|
|
+ this.$emit('setCanScroll', false)
|
|
|
},
|
|
|
ctouchmove: function (e) {
|
|
|
- if (!this.airData.isOpen || !this.movesign) return;
|
|
|
- var _this = this;
|
|
|
+ if (!this.airData.isOpen || !this.movesign) return
|
|
|
+ var _this = this
|
|
|
|
|
|
- var touch = e.touches[0];
|
|
|
- var pageX = Number(touch.pageX); // 页面触点Y坐标
|
|
|
+ var touch = e.touches[0]
|
|
|
+ var pageX = Number(touch.pageX) // 页面触点Y坐标
|
|
|
|
|
|
- var moveX = pageX - this.startX;
|
|
|
- this.startX = pageX;
|
|
|
+ var moveX = pageX - this.startX
|
|
|
+ this.startX = pageX
|
|
|
|
|
|
- var transX = this.transX + moveX;
|
|
|
+ var transX = this.transX + moveX
|
|
|
|
|
|
if (transX < 0) { // transX只能是正的
|
|
|
- transX = 0;
|
|
|
+ transX = 0
|
|
|
}
|
|
|
if (transX > this.tempBarWidth) {
|
|
|
- transX = this.tempBarWidth;
|
|
|
+ transX = this.tempBarWidth
|
|
|
}
|
|
|
|
|
|
- console.log('touchmove', this.startX, transX, this.tempBarWidth);
|
|
|
- this.transX = transX;
|
|
|
- this.doTransX(transX);
|
|
|
+ console.log('touchmove', this.startX, transX, this.tempBarWidth)
|
|
|
+ this.transX = transX
|
|
|
+ this.doTransX(transX)
|
|
|
},
|
|
|
ctouchend: function (e) {
|
|
|
- if (!this.airData.isOpen) return;
|
|
|
+ if (!this.airData.isOpen) return
|
|
|
// 挪动到一定区域 则可以自己到固定位置
|
|
|
- var _this = this;
|
|
|
- _this.movesign = false;
|
|
|
- _this.changeZongAir('temp');
|
|
|
- this.$emit('setCanScroll', true);
|
|
|
+ var _this = this
|
|
|
+ _this.movesign = false
|
|
|
+ _this.changeZongAir('temp')
|
|
|
+ this.$emit('setCanScroll', true)
|
|
|
},
|
|
|
eachAirOpen(aindex) {
|
|
|
- if (!checkSpaceControl(this.isControl)) return;
|
|
|
- this.allDevices[aindex].open = !this.allDevices[aindex].open;
|
|
|
- var value = this.allDevices[aindex].open ? 1 : 0;
|
|
|
- this.changeOneAir(this.allDevices[aindex].id, this.allDevices[aindex].switchCode, value);// todo
|
|
|
+ if (!checkSpaceControl(this.isControl)) return
|
|
|
+ this.allDevices[aindex].open = !this.allDevices[aindex].open
|
|
|
+ var value = this.allDevices[aindex].open ? 1 : 0
|
|
|
+ this.changeOneAir(this.allDevices[aindex].id, this.allDevices[aindex].switchCode, value)// todo
|
|
|
},
|
|
|
arrowDownClick(aindex, mindex, sel) {
|
|
|
// console.log('sel', sel);
|
|
|
- if (!checkSpaceControl(this.isControl)) return;
|
|
|
- var nowDevice = this.allDevices[aindex];
|
|
|
- var nowModel = this.allDevices[aindex].allModel[mindex];
|
|
|
- if (!nowDevice.open) return;
|
|
|
- if (sel == 0) return;
|
|
|
+ if (!checkSpaceControl(this.isControl)) return
|
|
|
+ var nowDevice = this.allDevices[aindex]
|
|
|
+ var nowModel = this.allDevices[aindex].allModel[mindex]
|
|
|
+ if (!nowDevice.open) return
|
|
|
+ if (sel == 0) return
|
|
|
|
|
|
- if (nowModel.id == 'gear' && sel == 1) return;
|
|
|
+ if (nowModel.id == 'gear' && sel == 1) return
|
|
|
if (sel < 0) {
|
|
|
- nowModel.sel = 0;
|
|
|
+ nowModel.sel = 0
|
|
|
} else {
|
|
|
- nowModel.sel--;
|
|
|
+ nowModel.sel--
|
|
|
}
|
|
|
|
|
|
if (nowModel.id == 'mode') {
|
|
|
- var value = nowModel.refer[nowModel.sel].mid;
|
|
|
+ var value = nowModel.refer[nowModel.sel].mid
|
|
|
console.log('nowModel.refer', nowModel.refer, nowModel.refer[nowModel.sel].mid)
|
|
|
} else if (nowModel.id == 'gear') {
|
|
|
- var selval = nowModel.selectArr[nowModel.sel];
|
|
|
- var value = selval == 'AUTO' ? 4 : selval;
|
|
|
+ var selval = nowModel.selectArr[nowModel.sel]
|
|
|
+ var value = selval == 'AUTO' ? 4 : selval
|
|
|
console.log('nowModel.refer2', selval, value)
|
|
|
} else {
|
|
|
- var value = nowModel.selectArr[nowModel.sel];
|
|
|
+ var value = nowModel.selectArr[nowModel.sel]
|
|
|
console.log('nowModel.refer3', value)
|
|
|
}
|
|
|
- this.debounce(nowDevice.id, nowModel.code, value);
|
|
|
+ this.debounce(nowDevice.id, nowModel.code, value)
|
|
|
|
|
|
// console.log("arrowup", aindex, mindex, sel)
|
|
|
},
|
|
|
debounce(id, code, value) {
|
|
|
- clearTimeout(debounceTimer);
|
|
|
- var _this = this;
|
|
|
+ clearTimeout(debounceTimer)
|
|
|
+ var _this = this
|
|
|
debounceTimer = setTimeout(function () {
|
|
|
- _this.changeOneAir(id, code, value);
|
|
|
- }, 500);
|
|
|
+ _this.changeOneAir(id, code, value)
|
|
|
+ }, 500)
|
|
|
},
|
|
|
arrowUpClick(aindex, mindex, sel) {
|
|
|
- if (!checkSpaceControl(this.isControl)) return;
|
|
|
- var nowDevice = this.allDevices[aindex];
|
|
|
- var nowModel = this.allDevices[aindex].allModel[mindex];
|
|
|
+ if (!checkSpaceControl(this.isControl)) return
|
|
|
+ var nowDevice = this.allDevices[aindex]
|
|
|
+ var nowModel = this.allDevices[aindex].allModel[mindex]
|
|
|
|
|
|
- if (!nowDevice.open) return;
|
|
|
- var selectArr = nowModel.selectArr;
|
|
|
- if (sel == selectArr.length - 1) return;
|
|
|
+ if (!nowDevice.open) return
|
|
|
+ var selectArr = nowModel.selectArr
|
|
|
+ if (sel == selectArr.length - 1) return
|
|
|
// console.log('sel', sel);
|
|
|
if (sel > selectArr.length - 1) {
|
|
|
- nowModel.sel = selectArr.length - 1;
|
|
|
+ nowModel.sel = selectArr.length - 1
|
|
|
} else {
|
|
|
- nowModel.sel++;
|
|
|
+ nowModel.sel++
|
|
|
}
|
|
|
|
|
|
if (nowModel.id == 'mode') {
|
|
|
- var value = nowModel.refer[nowModel.sel].mid;
|
|
|
+ var value = nowModel.refer[nowModel.sel].mid
|
|
|
console.log('nowModel.refer', nowModel.refer, nowModel.refer[nowModel.sel].mid)
|
|
|
} else if (nowModel.id == 'gear') {
|
|
|
- var selval = nowModel.selectArr[nowModel.sel];
|
|
|
- var value = selval == 'AUTO' ? 4 : selval;
|
|
|
+ var selval = nowModel.selectArr[nowModel.sel]
|
|
|
+ var value = selval == 'AUTO' ? 4 : selval
|
|
|
} else {
|
|
|
- var value = nowModel.selectArr[nowModel.sel];
|
|
|
+ var value = nowModel.selectArr[nowModel.sel]
|
|
|
}
|
|
|
|
|
|
- this.debounce(nowDevice.id, nowModel.code, value);
|
|
|
+ this.debounce(nowDevice.id, nowModel.code, value)
|
|
|
// this.changeOneAir(nowDevice.id, nowModel.code, value);
|
|
|
},
|
|
|
querySeasonType() {
|
|
@@ -545,14 +545,14 @@ wepy.component({
|
|
|
}
|
|
|
if (!this.seasonType) {
|
|
|
getSeasonType(params).then(res => {
|
|
|
- this.seasonType = res.data || '';
|
|
|
+ this.seasonType = res.data || ''
|
|
|
}).catch(() => {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
showDetail(funcid) {
|
|
|
- this.$emit('showDetail', { funcid: funcid });
|
|
|
- wx.uma.trackEvent('officeHome_changeAir_temperature', { key: 'roomTemperature' });
|
|
|
+ this.$emit('showDetail', { funcid: funcid })
|
|
|
+ wx.uma.trackEvent('officeHome_changeAir_temperature', { key: 'roomTemperature' })
|
|
|
},
|
|
|
// async getInfo() {
|
|
|
// await this.getAirInfo();
|
|
@@ -564,128 +564,128 @@ wepy.component({
|
|
|
projectId: this.projectId, // 'Pj1101080255'
|
|
|
spaceId: this.objectId // 'Sp110108025564f438d7fef64eea8202a6462f1bbcce' 空间id
|
|
|
}
|
|
|
- var _this = this;
|
|
|
+ var _this = this
|
|
|
// wx.showLoading();
|
|
|
querySpaceConditioners(paramObj).then(res => {
|
|
|
- var data = res.data || {};
|
|
|
+ var data = res.data || {}
|
|
|
// console.log('_this.baseMode[0]', data);
|
|
|
|
|
|
- _this.airTemp = data.tempSet;
|
|
|
- _this.nowTemp = data.tempSet;
|
|
|
+ _this.airTemp = data.tempSet
|
|
|
+ _this.nowTemp = data.tempSet
|
|
|
|
|
|
- _this.airMode = data.workMode;// 1=cold;2=hot;3=wind
|
|
|
- _this.airGear = data.gear || 0;// 总的档位
|
|
|
- _this.isAutoGear = data.isAutoGear;// 总的档位
|
|
|
- _this.airData.isOpen = !!data.runStatus;
|
|
|
- var maxTempSet = data.maxTempSet;
|
|
|
- _this.endTemp = data.maxTempSet;
|
|
|
- var minTempSet = data.minTempSet;
|
|
|
- _this.startTemp = data.minTempSet;
|
|
|
+ _this.airMode = data.workMode// 1=cold;2=hot;3=wind
|
|
|
+ _this.airGear = data.gear || 0// 总的档位
|
|
|
+ _this.isAutoGear = data.isAutoGear// 总的档位
|
|
|
+ _this.airData.isOpen = !!data.runStatus
|
|
|
+ var maxTempSet = data.maxTempSet
|
|
|
+ _this.endTemp = data.maxTempSet
|
|
|
+ var minTempSet = data.minTempSet
|
|
|
+ _this.startTemp = data.minTempSet
|
|
|
var tempArr = []
|
|
|
for (var i = minTempSet; i <= maxTempSet; i = i + 0.5) {
|
|
|
- tempArr.push(i);
|
|
|
+ tempArr.push(i)
|
|
|
}
|
|
|
|
|
|
- _this.baseMode[0].selectArr = tempArr;
|
|
|
- _this.doTemp(data.tempSet);
|
|
|
+ _this.baseMode[0].selectArr = tempArr
|
|
|
+ _this.doTemp(data.tempSet)
|
|
|
var deviceArr = [];
|
|
|
(data.equipList || []).forEach((eitem) => {
|
|
|
- var deviceObj = {};
|
|
|
- deviceObj.id = eitem.id;
|
|
|
- deviceObj.name = eitem.localName;
|
|
|
- deviceObj.open = eitem.runStatus == 1;
|
|
|
- deviceObj.switchCode = eitem.switchCode;
|
|
|
+ var deviceObj = {}
|
|
|
+ deviceObj.id = eitem.id
|
|
|
+ deviceObj.name = eitem.localName
|
|
|
+ deviceObj.open = eitem.runStatus == 1
|
|
|
+ deviceObj.switchCode = eitem.switchCode
|
|
|
|
|
|
- var allModel = JSON.parse(JSON.stringify(_this.baseMode));
|
|
|
+ var allModel = JSON.parse(JSON.stringify(_this.baseMode))
|
|
|
// console.log('allModel', allModel);
|
|
|
allModel.forEach((mitem) => {
|
|
|
if (mitem.id == 'temp') {
|
|
|
- mitem.code = eitem.tempSetCode;
|
|
|
+ mitem.code = eitem.tempSetCode
|
|
|
// mitem.value = eitem.tempSet;
|
|
|
var index = mitem.selectArr.findIndex((ele) => {
|
|
|
- return ele == eitem.tempSet;
|
|
|
- });
|
|
|
+ return ele == eitem.tempSet
|
|
|
+ })
|
|
|
// console.log('index1', index, eitem.tempSet);
|
|
|
- mitem.sel = index == -1 ? 0 : index;
|
|
|
+ mitem.sel = index == -1 ? 0 : index
|
|
|
}
|
|
|
if (mitem.id == 'gear') {
|
|
|
- mitem.code = eitem.gearCode;
|
|
|
+ mitem.code = eitem.gearCode
|
|
|
// mitem.value = eitem.gear;
|
|
|
var index = mitem.selectArr.findIndex((ele) => {
|
|
|
if (eitem.isAutoGear == 1) {
|
|
|
- return ele == 'AUTO';
|
|
|
+ return ele == 'AUTO'
|
|
|
} else {
|
|
|
- return ele == eitem.gear;
|
|
|
+ return ele == eitem.gear
|
|
|
}
|
|
|
- });
|
|
|
- mitem.sel = index == -1 ? 0 : index;
|
|
|
+ })
|
|
|
+ mitem.sel = index == -1 ? 0 : index
|
|
|
// console.log('index2', eitem.gear);isAutoGear
|
|
|
}
|
|
|
if (mitem.id == 'mode') {
|
|
|
- mitem.code = eitem.modeSetCode;
|
|
|
+ mitem.code = eitem.modeSetCode
|
|
|
// mitem.value = eitem.workMode;
|
|
|
var filterObj = mitem.refer.find((ele) => {
|
|
|
- return ele.mid == eitem.workMode;
|
|
|
- });
|
|
|
- mitem.sel = (filterObj || {}).sindex || 0;
|
|
|
+ return ele.mid == eitem.workMode
|
|
|
+ })
|
|
|
+ mitem.sel = (filterObj || {}).sindex || 0
|
|
|
// console.log('index3', filterObj, eitem.workMode);
|
|
|
}
|
|
|
- });
|
|
|
- deviceObj.allModel = allModel;
|
|
|
- deviceArr.push(deviceObj);
|
|
|
- });
|
|
|
+ })
|
|
|
+ deviceObj.allModel = allModel
|
|
|
+ deviceArr.push(deviceObj)
|
|
|
+ })
|
|
|
|
|
|
- _this.allDevices = deviceArr;
|
|
|
+ _this.allDevices = deviceArr
|
|
|
}).catch(() => {
|
|
|
// wx.hideLoading();
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
vibrateLong() {
|
|
|
if (wx.canIUse('vibrateLong')) {
|
|
|
- wx.vibrateLong();
|
|
|
+ wx.vibrateLong()
|
|
|
} else {
|
|
|
- wx.vibrateShort();
|
|
|
+ wx.vibrateShort()
|
|
|
}
|
|
|
},
|
|
|
vibrateShort() {
|
|
|
if (wx.canIUse('vibrateShort')) {
|
|
|
- wx.vibrateShort();
|
|
|
+ wx.vibrateShort()
|
|
|
} else {
|
|
|
- wx.vibrateLong();
|
|
|
+ wx.vibrateLong()
|
|
|
}
|
|
|
},
|
|
|
// 手动模式下设备是否可控
|
|
|
checkControlMode(id) {
|
|
|
- let flag = false;
|
|
|
+ let flag = false
|
|
|
if (!this.controlMode) {
|
|
|
return flag
|
|
|
}
|
|
|
|
|
|
// 总开关
|
|
|
if (id === 'air') {
|
|
|
- let canOpen = true;
|
|
|
+ let canOpen = true
|
|
|
for (let i = 0; i < this.equipConfig.length; i++) {
|
|
|
- const ele = this.equipConfig[i];
|
|
|
+ const ele = this.equipConfig[i]
|
|
|
for (let j = 0; j < this.lampList.length; j++) {
|
|
|
- const jele = this.lampList[j];
|
|
|
+ const jele = this.lampList[j]
|
|
|
// 有可控设备
|
|
|
if (ele.equipmentId === jele.id && ele.isExeSpaceTime) {
|
|
|
- canOpen = false;
|
|
|
- return;
|
|
|
+ canOpen = false
|
|
|
+ return
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- flag = canOpen;
|
|
|
+ flag = canOpen
|
|
|
} else {
|
|
|
this.equipConfig.map(item => {
|
|
|
// 设备不受控制 可直接开灯
|
|
|
if (item.equipmentId === id && !item.isExeSpaceTime) {
|
|
|
- flag = true;
|
|
|
+ flag = true
|
|
|
}
|
|
|
// 设备受控 且有当前工作时间 可直接开灯
|
|
|
if (item.equipmentId === id && this.isNowTime && item.isExeSpaceTime) {
|
|
|
- flag = true;
|
|
|
+ flag = true
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -695,50 +695,50 @@ wepy.component({
|
|
|
checkAirCanOpen(id, value) { // 判断空调是否能开启
|
|
|
if (value) { // 12表示开空调
|
|
|
// 手动模式下设备是否可控
|
|
|
- let canControl = this.checkControlMode(id);
|
|
|
+ let canControl = this.checkControlMode(id)
|
|
|
if (this.roomHasScene && !this.isNowTime && !canControl) {
|
|
|
- this.$emit('component-open-workTimePop', true);
|
|
|
- this.$emit('component-EquipType-workTimePop', id);
|
|
|
- return false;
|
|
|
+ this.$emit('component-open-workTimePop', true)
|
|
|
+ this.$emit('component-EquipType-workTimePop', id)
|
|
|
+ return false
|
|
|
}
|
|
|
}
|
|
|
- return true;
|
|
|
+ return true
|
|
|
},
|
|
|
changeZongAir(btnType, value) {
|
|
|
- if (!checkSpaceControl(this.isControl)) return;
|
|
|
- if (!this.airData.isOpen && btnType != 'sw') return;
|
|
|
+ if (!checkSpaceControl(this.isControl)) return
|
|
|
+ if (!this.airData.isOpen && btnType != 'sw') return
|
|
|
isWithinLocation().then(() => {
|
|
|
if (this.roomType === '开放') {
|
|
|
- this.showWorkTime = this.checkAirCanOpen('air', !this.airData.isOpen);
|
|
|
+ this.showWorkTime = this.checkAirCanOpen('air', !this.airData.isOpen)
|
|
|
if (!this.showWorkTime) {
|
|
|
return
|
|
|
};
|
|
|
}
|
|
|
- var _this = this;
|
|
|
+ var _this = this
|
|
|
if (btnType == 'gear' && value == 'windLow') { // 降挡
|
|
|
if (this.airGear > 1) {
|
|
|
- this.airGear--;
|
|
|
- this.isAutoGear = 0;
|
|
|
+ this.airGear--
|
|
|
+ this.isAutoGear = 0
|
|
|
} else {
|
|
|
- return;
|
|
|
+ return
|
|
|
}
|
|
|
}
|
|
|
if (btnType == 'gear' && value == 'windUp') { // 升档
|
|
|
if (this.airGear < 3) {
|
|
|
- this.airGear++;
|
|
|
- this.isAutoGear = 0;
|
|
|
+ this.airGear++
|
|
|
+ this.isAutoGear = 0
|
|
|
} else {
|
|
|
- return;
|
|
|
+ return
|
|
|
}
|
|
|
}
|
|
|
if (btnType == 'gear' && value == 'auto') {
|
|
|
- this.isAutoGear = this.isAutoGear == 1 ? 0 : 1;
|
|
|
+ this.isAutoGear = this.isAutoGear == 1 ? 0 : 1
|
|
|
}
|
|
|
if (btnType == 'mode') {
|
|
|
- this.airMode = value;
|
|
|
+ this.airMode = value
|
|
|
}
|
|
|
if (btnType == 'sw') {
|
|
|
- this.airData.isOpen = !this.airData.isOpen;
|
|
|
+ this.airData.isOpen = !this.airData.isOpen
|
|
|
}
|
|
|
// console.log('btnType,value', btnType, value);
|
|
|
// console.log('airData.isOpen', this.airData.isOpen);
|
|
@@ -746,7 +746,7 @@ wepy.component({
|
|
|
// console.log('this.airMode', this.airMode);
|
|
|
// console.log('this.nowTemp', this.nowTemp);
|
|
|
|
|
|
- let paramArr = [];
|
|
|
+ let paramArr = []
|
|
|
this.allDevices.forEach(dele => {
|
|
|
if (btnType == 'sw') {
|
|
|
let paramObj = {
|
|
@@ -754,16 +754,16 @@ wepy.component({
|
|
|
code: dele.switchCode,
|
|
|
value: _this.airData.isOpen ? 1 : 0
|
|
|
}
|
|
|
- paramArr.push(paramObj);
|
|
|
+ paramArr.push(paramObj)
|
|
|
}
|
|
|
|
|
|
dele.allModel.forEach((mele) => {
|
|
|
if (mele.id == 'temp') {
|
|
|
- var value = _this.nowTemp;
|
|
|
+ var value = _this.nowTemp
|
|
|
} else if (mele.id == 'gear') {
|
|
|
- var value = _this.isAutoGear == 1 ? 4 : _this.airGear;
|
|
|
+ var value = _this.isAutoGear == 1 ? 4 : _this.airGear
|
|
|
} else if (mele.id == 'mode') {
|
|
|
- var value = _this.airMode;
|
|
|
+ var value = _this.airMode
|
|
|
}
|
|
|
if (mele.id == btnType) {
|
|
|
let paramObj = {
|
|
@@ -771,32 +771,32 @@ wepy.component({
|
|
|
code: mele.code,
|
|
|
value: value
|
|
|
}
|
|
|
- paramArr.push(paramObj);
|
|
|
+ paramArr.push(paramObj)
|
|
|
}
|
|
|
- });
|
|
|
- });
|
|
|
+ })
|
|
|
+ })
|
|
|
// console.log('this.nowTemp222', this.nowTemp);
|
|
|
- this.vibrateShort();
|
|
|
- wx.showLoading();
|
|
|
+ this.vibrateShort()
|
|
|
+ wx.showLoading()
|
|
|
|
|
|
// 下达指令
|
|
|
changeManualTempHttp(paramArr).then(res => {
|
|
|
if (btnType == 'temp') {
|
|
|
- _this.airTemp = _this.nowTemp;
|
|
|
+ _this.airTemp = _this.nowTemp
|
|
|
}
|
|
|
- _this.doTimeout();
|
|
|
+ _this.doTimeout()
|
|
|
}).catch(() => {
|
|
|
- wx.hideLoading();
|
|
|
- });
|
|
|
+ wx.hideLoading()
|
|
|
+ })
|
|
|
}).catch(() => {
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
changeOneAir(id, code, value) {
|
|
|
- var _this = this;
|
|
|
+ var _this = this
|
|
|
isWithinLocation().then(() => {
|
|
|
- this.vibrateShort();
|
|
|
+ this.vibrateShort()
|
|
|
if (this.roomType === '开放') {
|
|
|
- this.showWorkTime = this.checkAirCanOpen(id, value);
|
|
|
+ this.showWorkTime = this.checkAirCanOpen(id, value)
|
|
|
if (!this.showWorkTime) {
|
|
|
return
|
|
|
};
|
|
@@ -805,16 +805,16 @@ wepy.component({
|
|
|
id: id,
|
|
|
code: code,
|
|
|
value: value
|
|
|
- }];
|
|
|
- wx.showLoading();
|
|
|
+ }]
|
|
|
+ wx.showLoading()
|
|
|
// 下达指令
|
|
|
changeManualTempHttp(paramArr).then(res => {
|
|
|
- _this.doTimeout();
|
|
|
+ _this.doTimeout()
|
|
|
}).catch(() => {
|
|
|
- wx.hideLoading();
|
|
|
- });
|
|
|
+ wx.hideLoading()
|
|
|
+ })
|
|
|
}).catch(() => {
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -874,7 +874,7 @@ wepy.component({
|
|
|
}
|
|
|
&.open {
|
|
|
.openBack {
|
|
|
- background: #ffe823;
|
|
|
+ background: rgba(61, 203, 204, 0.3);
|
|
|
}
|
|
|
.openCircle {
|
|
|
left: 18px;
|
|
@@ -1199,7 +1199,7 @@ wepy.component({
|
|
|
height: 40rpx;
|
|
|
}
|
|
|
&.yell {
|
|
|
- background: #ffe823;
|
|
|
+ background: rgba(61, 203, 204, 0.3);
|
|
|
}
|
|
|
}
|
|
|
}
|