Browse Source

feat 颜色更改

anxiaoxia 1 year ago
parent
commit
d54fb1f713

+ 68 - 66
src/packagesEnv/pages/officehome/Curtain/curtain-card.wpy

@@ -65,11 +65,13 @@
         background: #F1F4F6;
         border-radius: 50%;
         &.yell {
-            background: #ffe823;
+            background:  rgba(61, 203, 204, 0.3);
+;
+;
         }
     }
     .style-hover{
-        background: #ffe823;
+        background: rgba(61, 203, 204, 0.3);
     }
     .arrow-size {
         height: 32rpx;
@@ -234,10 +236,10 @@
     </div>
 </template>
 <script>
-import wepy from '@wepy/core';
-import config from '@/config';
+import wepy from '@wepy/core'
+import config from '@/config'
 import { changeManualTempHttp, getObjectDataEqpGroupHttp } from '@/packagesEnv/api/officehome.js'
-let prev = Date.now();
+let prev = Date.now()
 const initBtnArr = [
     { id: 0, show: false, type: 'all', setType: 'openPop', value: '', icon: 'curtain_icon_adjust_3.svg', size: '40', timeCount: '', text: '' },
     { id: 1, show: false, type: 'updown', setType: 'EquipOffSet', value: 0, icon: 'curtain_icon_down_3.svg', size: '32', timeCount: 0, text: '下降', timer: null },
@@ -246,8 +248,8 @@ const initBtnArr = [
     { id: 4, show: false, type: 'updown', setType: 'EquipOnSet', value: 1, icon: 'curtain_icon_up_3.svg', size: '32', timeCount: 0, text: '上升', timer: null },
     { id: 5, show: false, type: 'leftRit', setType: 'EquipOnSet', value: 1, icon: 'curtain_icon_open_3.svg', size: '32', timeCount: 0, text: '打开', timer: null }
 ]
-let setTotalTimer = null;
-let timerThree = null;
+let setTotalTimer = null
+let timerThree = null
 wepy.component({
   props: {
     projectId: String,
@@ -268,11 +270,11 @@ wepy.component({
   watch: {
     curtainVisible(val) {
       if (!val && this.spaceId) {
-        this.getData();
+        this.getData()
       }
     },
     spaceId() {
-      this.getData();
+      this.getData()
     }
   },
   computed: {
@@ -294,30 +296,30 @@ wepy.component({
         ]
       }
       getObjectDataEqpGroupHttp(params).then(res => {
-        let resData = res.count ? res.content : [];
-        this.btnArr = [];
+        let resData = res.count ? res.content : []
+        this.btnArr = []
         this.$emit('comments-curtain-len', resData.length)
-        if (!resData.length) return;
-        let type = '';
-        let isOpenSet = 0;
-        let stopSet = 0;
+        if (!resData.length) return
+        let type = ''
+        let isOpenSet = 0
+        let stopSet = 0
         resData.forEach((item, idx) => {
                         // equipmentType:1//开合方式:1-平开门式;2-左拉单开;3-右拉单开;4-上开;5-下开;99-其他
           if (item.equipmentType === 4 || item.equipmentType === 5 || item.equipmentType === 99) {
-            type = 'updown';
+            type = 'updown'
           } else {
-            type = 'leftRit';
+            type = 'leftRit'
           }
           type = 'leftRit'
-          item.childCountText = '';
-          item.btnArr = [];
-          isOpenSet = item.isOpenSet;
-          stopSet = item.stopSet;
-          this.itemBtn(item.btnArr, type, item.isOpenSet, item.stopSet);
+          item.childCountText = ''
+          item.btnArr = []
+          isOpenSet = item.isOpenSet
+          stopSet = item.stopSet
+          this.itemBtn(item.btnArr, type, item.isOpenSet, item.stopSet)
         })
-        this.itemBtn(this.btnArr, type, isOpenSet, stopSet);
-        this.initData = JSON.parse(JSON.stringify(resData));
-        this.showCurtainNum();
+        this.itemBtn(this.btnArr, type, isOpenSet, stopSet)
+        this.initData = JSON.parse(JSON.stringify(resData))
+        this.showCurtainNum()
       })
     },
     itemBtn(arr, type, isOpenSet, stopSet) {
@@ -329,7 +331,7 @@ wepy.component({
     },
     showCurtainNum() {
         // 一个或者多个设备
-      let arr = [];
+      let arr = []
       if (this.initData.length === 1) {
         arr.push(this.initData[0])
       } else {
@@ -337,57 +339,57 @@ wepy.component({
           arr.push(item)
         })
       }
-      this.curtainData = JSON.parse(JSON.stringify(arr));
+      this.curtainData = JSON.parse(JSON.stringify(arr))
     },
         // 参数
     setParams(arr, setType) {
       arr.forEach(item => {
-        item.equipmentCategory = 'CFSSES';
-        item.infoCode = setType;
-        item.value = 1;
-      });
-      return arr;
+        item.equipmentCategory = 'CFSSES'
+        item.infoCode = setType
+        item.value = 1
+      })
+      return arr
     },
         // 总开关
     handleTotal(setType, type, idx, btnArr, data, value) {
-      wx.uma.trackEvent(`officeHome_curtain_card_${setType}`, { key: setType === 'EquipOffSet' ? '卡片-下降' : '卡片-上升' });
+      wx.uma.trackEvent(`officeHome_curtain_card_${setType}`, { key: setType === 'EquipOffSet' ? '卡片-下降' : '卡片-上升' })
 
       if (setType === 'openPop') {
-        this.$emit('commponents-curtain-showPop', {btnArr, data, curtainName: '窗帘'});
-        return;
+        this.$emit('commponents-curtain-showPop', {btnArr, data, curtainName: '窗帘'})
+        return
       }
     //   let now = Date.now();
     //   if (now - prev <= 2000) return; // 请求间隔 2秒
     //   prev = Date.now();
 
-      this.setSwitchStatus(setType, idx);
+      this.setSwitchStatus(setType, idx)
       this.sendData(value, 'EquipSwitchSet', data)
     },
 
     setSwitchStatus(setType, idx) {
-      clearInterval(setTotalTimer);
+      clearInterval(setTotalTimer)
       setTotalTimer = null
       this.btnArr.map(item => {
         if (item.setType !== setType && item.timeCount) {
-          item.timeCount = 0;
+          item.timeCount = 0
         }
       })
       //  暂停按钮 点击显示一下下
       if (setType === 'EquipStop') {
-        this.btnArr[idx].timeCount = 1;
-        clearInterval(timerThree);
+        this.btnArr[idx].timeCount = 1
+        clearInterval(timerThree)
         timerThree = null
         timerThree = setTimeout(() => {
-          this.btnArr[idx].timeCount = 0;
-          clearInterval(timerThree);
+          this.btnArr[idx].timeCount = 0
+          clearInterval(timerThree)
           timerThree = null
-        }, 300);
+        }, 300)
       } else {
-        this.btnArr[idx].timeCount = 3;
+        this.btnArr[idx].timeCount = 3
         setTotalTimer = setInterval(() => {
-          this.btnArr[idx].timeCount--;
+          this.btnArr[idx].timeCount--
           if (this.btnArr[idx].timeCount === 0) {
-            clearInterval(setTotalTimer);
+            clearInterval(setTotalTimer)
             setTotalTimer = null
           }
         }, 1000)
@@ -398,47 +400,47 @@ wepy.component({
     handleChild(setType, id, index, btnIdx, btnArr, data) {
       const curtainName = this.curtainData[index].name
       if (setType === 'openPop') {
-        this.$emit('commponents-curtain-showPop', {btnArr, data, curtainName});
-        return;
+        this.$emit('commponents-curtain-showPop', {btnArr, data, curtainName})
+        return
       }
-      let currentBtnArr = this.curtainData[index].btnArr;
-      let childItem = this.curtainData[index].btnArr[btnIdx];
+      let currentBtnArr = this.curtainData[index].btnArr
+      let childItem = this.curtainData[index].btnArr[btnIdx]
       //   一组按钮只有一个显示倒计时
       currentBtnArr.map((item, idx) => {
         if (item.setType !== childItem.setType && item.timeCount) {
-          item.timeCount = 0;
-          clearInterval(item.timer);
-          item.timer = null;
+          item.timeCount = 0
+          clearInterval(item.timer)
+          item.timer = null
         }
       })
        //  暂停按钮 点击显示一下下
       if (setType === 'EquipStop') {
-        childItem.timeCount = 1;
-        clearInterval(timerThree);
+        childItem.timeCount = 1
+        clearInterval(timerThree)
         timerThree = null
         timerThree = setTimeout(() => {
-          childItem.timeCount = 0;
-          clearInterval(timerThree);
+          childItem.timeCount = 0
+          clearInterval(timerThree)
           timerThree = null
-        }, 300);
+        }, 300)
       } else {
-        childItem.timeCount = 3;
-        clearInterval(childItem.timer);
+        childItem.timeCount = 3
+        clearInterval(childItem.timer)
         childItem.timer = null
         childItem.timer = setInterval(() => {
-          childItem.timeCount--;
+          childItem.timeCount--
           if (childItem.timeCount === 0) {
-            clearInterval(childItem.timer);
+            clearInterval(childItem.timer)
             childItem.timer = null
           }
-        }, 1000);
+        }, 1000)
       }
 
       this.sendData(childItem.value, 'EquipSwitchSet', data)
     },
     sendData(value, sendType, data) {
-      const propData = JSON.parse(JSON.stringify(data));
-      let paramsArr = [];
+      const propData = JSON.parse(JSON.stringify(data))
+      let paramsArr = []
       if (Array.isArray(propData)) {
         propData.map(item => {
           const obj = {
@@ -461,7 +463,7 @@ wepy.component({
 
         // 总子设备切换
     handleSpread(val) {
-      this.showTotal = val;
+      this.showTotal = val
     }
   }
 })

+ 21 - 21
src/packagesEnv/pages/officehome/Curtain/curtainPop.wpy

@@ -54,7 +54,7 @@
     background: #c4c4c433;
     border-radius: 50%;
     &.yell {
-        background: #ffe823;
+        background: rgba(61, 203, 204, 0.3);
     }
 }
 .arrow-size {
@@ -126,10 +126,10 @@ image {
 
 </template>
 <script>
-import wepy from '@wepy/core';
-import config from '@/config';
+import wepy from '@wepy/core'
+import config from '@/config'
 import { changeManualTempHttp } from '@/packagesEnv/api/officehome.js'
-let timerThree = null;
+let timerThree = null
 wepy.component({
   props: {
     typeobj: Object,
@@ -161,15 +161,15 @@ wepy.component({
     typeobj: {
       handler(val) {
         if (val.btnArr.length) {
-          this.curtainName = val.curtainName;
-          const arr = JSON.parse(JSON.stringify(val.btnArr));
+          this.curtainName = val.curtainName
+          const arr = JSON.parse(JSON.stringify(val.btnArr))
           val.btnArr.map((item, idx) => {
-            item.timeCount = 0;
+            item.timeCount = 0
             if (item.setType === 'openPop') {
               arr.splice(idx, 1)
             }
           })
-          this.btnList = [...arr];
+          this.btnList = [...arr]
         }
       },
       deep: true
@@ -180,37 +180,37 @@ wepy.component({
             // 清掉其他正在倒计时的
       this.btnList.map(item => {
         if (item.timeCount !== 0 && item.id !== id) {
-          item.timeCount = 0;
+          item.timeCount = 0
         }
       })
       //  暂停按钮 点击显示一下下
       if (setType === 'EquipStop') {
         this.btnList[idx].timeCount = 1
-        clearInterval(timerThree);
+        clearInterval(timerThree)
         timerThree = null
         timerThree = setTimeout(() => {
-          this.btnArr[idx].timeCount = 0;
-          clearInterval(timerThree);
+          this.btnArr[idx].timeCount = 0
+          clearInterval(timerThree)
           timerThree = null
-        }, 300);
+        }, 300)
       } else {
         this.btnList[idx].timeCount = 3
-        clearInterval(this.timer);
-        this.timer = null;
+        clearInterval(this.timer)
+        this.timer = null
         this.timer = setInterval(() => {
           this.btnList[idx].timeCount--
           if (this.btnList[idx].timeCount === 0) {
-            clearInterval(this.timer);
-            this.timer = null;
+            clearInterval(this.timer)
+            this.timer = null
           }
-        }, 1000);
+        }, 1000)
       }
 
       this.sendData(value, 'EquipSwitchSet')
     },
     sendData(value, sendType) {
-      const propData = this.typeobj.data;
-      let paramsArr = [];
+      const propData = this.typeobj.data
+      let paramsArr = []
       if (Array.isArray(propData)) {
         propData.map(item => {
           const obj = {
@@ -235,7 +235,7 @@ wepy.component({
       this.sendData(this.percent, 'EquipOpeningSet')
     }
   }
-});
+})
 </script>
 <config>
     {

+ 11 - 11
src/packagesEnv/pages/officehome/Curtain/curtainSlider.wpy

@@ -25,7 +25,7 @@
     width: 335px;
     height: 32px;
     border-radius: 16px 0 0 16px;
-    background: #FFE823;
+    background: rgba(61, 203, 204, 0.3);
 }
 .btn {
     box-sizing: border-box;
@@ -116,7 +116,7 @@
 
 </template>
 <script>
-import wepy from '@wepy/core';
+import wepy from '@wepy/core'
 // import config from '@/config';
 const max = 335 - 38
 wepy.component({
@@ -141,20 +141,20 @@ wepy.component({
   },
   watch: {
     typeValue(val) {
-      this.buttonLeft = parseInt(val / 100 * this.max);
-      this.progress = this.buttonLeft;
-      this.precent = val;
+      this.buttonLeft = parseInt(val / 100 * this.max)
+      this.progress = this.buttonLeft
+      this.precent = val
     }
   },
   methods: {
     touchstart(ev) {
-      this.startPoint = ev.touches[0];
+      this.startPoint = ev.touches[0]
     },
     touchmove(e) {
       var endPoint = e.touches[e.touches.length - 1]
       var translateX = endPoint.clientX - this.startPoint.clientX
-      this.startPoint = endPoint;
-      var buttonLeft = this.buttonLeft + translateX;
+      this.startPoint = endPoint
+      var buttonLeft = this.buttonLeft + translateX
       if (buttonLeft > this.max) {
                 // 滑动位置大于进度条最大宽度的时候让它为最大宽度
         buttonLeft = this.max
@@ -163,9 +163,9 @@ wepy.component({
                 // 滑动位置小于进度条最大宽度的时候让它为最小宽度
         buttonLeft = this.min
       }
-      this.buttonLeft = buttonLeft;
-      this.progress = buttonLeft;
-      this.precent = parseInt((buttonLeft / this.max) * 100);
+      this.buttonLeft = buttonLeft
+      this.progress = buttonLeft
+      this.precent = parseInt((buttonLeft / this.max) * 100)
     //   this.$emit('silder-percent-value', {'value': this.precent, 'type': this.type})
     },
     touchend() {

+ 995 - 0
src/packagesEnv/pages/officehome/airHand/air-hand-card.wpy

@@ -0,0 +1,995 @@
+<template>
+    <div class="air-adjust office-card g-fl">
+        <div class="air-content">
+            <div class="air-adjust-env">
+                <div class="air-text">
+                    <span class="envname">空调</span>
+                    <div class="envnum">{{airTemp ? airTemp :'--'}}<span>℃</span></div>
+                </div>
+                <div class="air-show-all" v-if="allDevices.length>1&&hasAir && totalBoundPoint.tempSetBound">
+        
+                    <SwitchLR
+                        @commponent-SwitchLR-change="allAirClick"
+                    ></SwitchLR>
+
+                </div>
+            </div>
+            <div class="air-adjust-btn">
+                <image
+                :src="h5StaticPath+ (airData.isOpen?'openair2.png':'air_close2.png')"
+                    alt=""
+                    lazyload
+                />
+            </div>
+            <div
+                class="air-switch"
+                v-show="!allAirShow && totalBoundPoint.switchSetBound"
+            >
+                <switch
+                    v-if="hasAir && !isACATVA"
+                    :isACATFC="isACATFC"
+                    :seasonType="seasonType"
+                    :isHand="'hand'"
+                    :showWorkTime="showWorkTime"
+                    :checked="airData.isOpen"
+                    :eqTitle="eqTitle"
+                    @component-switch-change="changeZongAir('sw')"
+                ></switch>
+            </div>
+        </div>
+        <!-- 空调 调节 -->
+        <div class="air-control-wrap" v-show="!allAirShow&&hasAir&&airData.isOpen">
+            <div v-if="totalBoundPoint.tempSetBound" class="air-control-item" >
+            <CardSlider
+                :cardWidth="cardWidth"
+                :maxValue="endTemp"
+                :minValue="startTemp"
+                :onlyLine="false"
+                :typeValue="nowTemp"
+                type="air"
+                @silder-mouseEnd="ctouchend($event)"
+            ></CardSlider>
+            </div>
+            <div
+                class="air-control-item item-flex"
+                v-if="!isACATVA && totalBoundPoint.gearSetBound"
+            >
+                <div class="air-control-item-box">
+                    <div class="envnum-common air-envnum-comon">
+                        <span
+                            class="envnum-common-wind"
+                            v-for="(item,index) in windGearArr"
+                            :key="index"
+                            :class="{'windBlack': item == airGear}"
+                        >{{item}}</span>
+                    </div>
+                    <div class="air-common-text change-text">风量调节</div>
+                </div>
+                <div class="air-common-switch">
+                    <div
+                        class="switch"
+                        :class="{'disabled':airGear<=1||!airData.isOpen}"
+                        @click="changeZongAir('gear','windLow')"
+                    >
+                        <img src="{{h5StaticPath}}wind_small2.svg" />
+                    </div>
+                    <div
+                        class="switch"
+                        :class="{'disabled':airGear>=3||!airData.isOpen}"
+                        @click="changeZongAir('gear','windUp')"
+                    >
+                        <img src="{{h5StaticPath}}wind_big2.svg" />
+                    </div>
+                    <div
+                        class="switch"
+                        :class="{'yell': isAutoGear==1,'disabled':!airData.isOpen}"
+                        @click="changeZongAir('gear','auto')"
+                    >
+                      <img src="{{h5StaticPath}}wind_auto2.svg" />
+                    </div>
+                </div>
+            </div>
+            <div
+                class="air-control-item item-flex"
+                v-if="!isACATVA && totalBoundPoint.modeSetBound"
+            >
+                <div class="air-control-item-box">
+                    <div class="envnum-common air-envnum-comon">
+                        {{airMode==2?'制热':airMode==1?'制冷':'通风'}}
+                    </div>
+                    <div class="air-common-text change-text">模式设定</div>
+                </div>
+                <div class="air-common-switch">
+                   <div
+                        class="switch"
+                        :class="{'yell':  airMode==1,'disabled':!airData.isOpen}"
+                        @click="changeZongAir('mode',1)"
+                    >
+                        <img :src="h5StaticPath+'aircoldblack2.svg'" />
+                    </div>
+                    <div
+                        class="switch"
+                        :class="{'yell': airMode==2,'disabled':!airData.isOpen}"
+                        @click="changeZongAir('mode',2)"
+                    >
+                        <img :src="h5StaticPath+'airsunblack2.svg'" />
+                    </div>
+                    <div
+                        class="switch"
+                        :class="{'yell':  airMode==3,'disabled':!airData.isOpen}"
+                        @click="changeZongAir('mode',3)"
+                    >
+                        <img :src="h5StaticPath+'aircloudblack2.svg'" />
+                    </div>
+                </div>
+            </div>
+        </div>
+        <div
+            class="allAir"
+            v-show="allAirShow"
+        >
+        <div class="eachFeat"   @click="openFloorFeatPop(item)"
+        v-for="(item,aindex) in allDevices"
+                :key="aindex"
+            >
+                <div class="temp">
+                    <div style="display: flex;">{{item.tempSet2 ? item.tempSet2 : '--'}}<span class="unit">℃</span></div>
+                    <Switch
+                        v-if="item.boundPoint.switchSetBound"
+                        :checked="item.open"
+                        :height="32"
+                        :width="64"
+                        @component-switch-change="eachAirOpen(aindex)"
+                    ></Switch>
+                </div>
+                <div class="status">
+                  <img v-if="item.boundPoint.modeSetBound" :src="item.airMode2 == 1? h5StaticPath+'aircoldblack2.svg': item.airMode2 == 2? h5StaticPath+'airsunblack2.svg': h5StaticPath+'aircloudblack2.svg'" />
+                   <span v-if="item.boundPoint.modeSetBound">{{item.airMode2 == 2 ? '制热' : item.airMode2 == 1 ? '制冷' : '通风'}}</span> 
+                </div>
+                <div class="eqName">
+                    {{item.name}}
+                </div>
+                <img
+                    v-if="item.boundPoint.gearSetBound || item.boundPoint.modeSetBound ||item.boundPoint.tempSetBound"
+                    :style="{'opacity':(item.open ? '1' : '0.3')}"
+                    class="imgSt"
+                    src="{{h5StaticPath}}icon_adjust.svg"
+                />
+            </div>
+       
+        </div>
+    </div>
+</template>
+
+<script>
+import wepy from '@wepy/core'
+import {
+  changeManualTempHttp,
+  querySpaceConditioners
+} from '../../../api/officehome.js'
+import config from '@config'
+import { isWithinLocation } from '@/service/location'
+import store from '@/store'
+import { mapState } from '@wepy/x'
+import { checkSpaceControl } from '@/packagesEnv/pages/common.js'
+
+let infoTimer
+const barWidth = 17
+
+wepy.component({
+  props: {
+    isControl: Boolean, // 是否可控
+    roomType: String, // 房间类型
+    // hasBlowing: Boolean, // 有无变风量
+    roomHasScene: Boolean, // 加班场景
+    temperature: Number,
+    cardWidth: Number,
+    objectId: String,
+    hasAir: {
+      type: Boolean,
+      default: true
+    }, // 有无空调
+    equipConfig: Array, // 设备配置情况
+    projectId: String,
+    isACATVA: Boolean,
+    isACATFC: Boolean
+  },
+  store,
+  data: {
+    baseMode: [
+      {
+        name: '温度',
+        id: 'temp',
+        selectArr: []
+        // sel: 0,
+        // value: 25
+      },
+      {
+        name: '档位',
+        id: 'gear',
+        selectArr: [0, 1, 2, 3, 'AUTO']
+      },
+      {
+        name: '模式',
+        id: 'mode',
+        selectArr: ['制冷', '制热', '通风'],
+        refer: [
+          { mid: 1, value: '制冷', sindex: 0 },
+          { mid: 2, value: '制热', sindex: 1 },
+          { mid: 3, value: '通风', sindex: 2 }
+        ]
+      }
+    ],
+    allDevices: [],
+
+    showWorkTime: false, // 展示是否需要预约时间
+    h5StaticPath: config.h5StaticPath + '/page-officehome/',
+
+    eqTitle: '空调',
+
+    windGearArr: [0, 1, 2, 3], // 风量3/5个档位
+
+    nowTemp: 18,
+    airMode: 2, // 空调模式 总的  1=cold;2=hot 3=wind
+    airGear: 1, // 风量档位 总的
+    isAutoGear: 0,
+    airTemp: 18, // 总的 温度
+    airData: {
+      isOpen: true, // 空调开关 true 是开
+      spaceStatus: '' // 固定框文案展示
+    },
+    totalBoundPoint: {},
+    seasonType: '',
+    movesign: false,
+    startX: 0,
+    transX: 0,
+    tempBarWidth: 0,
+    startTemp: 18,
+    endTemp: 26,
+
+    allAirShow: false
+  },
+  watch: {
+    hasAir(val) {
+      if (!val) {
+        clearInterval(infoTimer)
+        this.airData.isOpen = false
+      }
+    },
+    objectId(val) {
+      if (val) {
+        this.doTimeout()
+        this.getAirInfo()
+      } else {
+        this.airData.isOpen = false
+      }
+    }
+  },
+  computed: {
+    ...mapState({ isNowTime: (state) => state.officehome.isNowTime })
+  },
+  ready() {
+    var _this = this
+  },
+  detached() {
+    this.airData.isOpen = false
+    clearInterval(infoTimer)
+  },
+  methods: {
+    doTimeout() {
+      clearInterval(infoTimer) // 定时器先清理 再设定
+      infoTimer = setInterval(() => {
+        this.getAirInfo()
+      }, 15000)
+    },
+    doTemp(newVal) {
+      // 处理温度
+      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
+
+          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 transX = eachUnit * changeNum
+          if (transX < 0) {
+            // transX只能是正的
+            transX = 0
+          }
+          if (transX > _this.tempBarWidth) {
+            transX = _this.tempBarWidth
+          }
+          _this.transX = transX
+        })
+    },
+    allAirClick(val) {
+      if (!checkSpaceControl(this.isControl)) return
+      this.getAirInfo()
+      this.allAirShow = !val
+    },
+    ctouchend: function(value) {
+      if (!this.airData.isOpen) return
+      // 挪动到一定区域 则可以自己到固定位置
+      var _this = this
+      _this.movesign = false
+      _this.changeZongAir('temp', value)
+      this.$emit('setCanScroll', true)
+    },
+    eachAirOpen(aindex) {
+      if (!checkSpaceControl(this.isControl)) return
+      isWithinLocation()
+        .then(() => {
+          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
+          )
+        })
+        .catch(() => {})
+    },
+    showDetail(funcid) {
+      this.$emit('showDetail', { funcid: funcid })
+      wx.uma.trackEvent('officeHome_changeAir_temperature', {
+        key: 'roomTemperature'
+      })
+    },
+
+    // 空调信息airTemp
+    getAirInfo() {
+      const paramObj = {
+        projectId: this.projectId, // 'Pj1101080255'
+        spaceId: this.objectId // 'Sp110108025564f438d7fef64eea8202a6462f1bbcce' 空间id
+      }
+      var _this = this
+      // wx.showLoading();
+      querySpaceConditioners(paramObj)
+        .then((res) => {
+          var data = res.data || {}
+          // console.log('_this.baseMode[0]', data);
+
+          _this.airTemp = data.tempSet
+
+          _this.airMode = data.workMode // 1=cold;2=hot;3=wind
+          _this.airGear = data.gear || 0 // 总的档位
+          _this.isAutoGear = data.isAutoGear // 总的档位
+          _this.totalBoundPoint = data.boundPoint // 空调可控点位
+          _this.airData.isOpen = !!data.runStatus
+          var maxTempSet = data.maxTempSet
+          _this.endTemp = data.maxTempSet
+          var minTempSet = data.minTempSet
+          _this.startTemp = data.minTempSet
+          //   获取的空调温度超出设置 上下限
+          _this.nowTemp = data.tempSet || data.minTempSet
+          if (data.tempSet < data.minTempSet) {
+            _this.nowTemp = data.minTempSet
+          }
+          if (data.tempSet > data.maxTempSet) {
+            _this.nowTemp = data.maxTempSet
+          }
+          var tempArr = []
+          for (var i = minTempSet; i <= maxTempSet; i = i + 0.5) {
+            tempArr.push(i)
+          }
+
+          _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
+            deviceObj.boundPoint = eitem.boundPoint
+            var allModel = JSON.parse(JSON.stringify(_this.baseMode))
+            allModel.forEach((mitem) => {
+              if (mitem.id == 'temp') {
+                mitem.code = eitem.tempSetCode
+                deviceObj.nowTemp2 = eitem.tempSet || _this.startTemp
+                if (eitem.tempSet > _this.endTemp) {
+                  deviceObj.nowTemp2 = _this.endTemp
+                }
+                if (deviceObj.nowTemp2 < _this.startTemp) {
+                  deviceObj.nowTemp2 = _this.startTemp
+                }
+                deviceObj.tempSet2 = eitem.tempSet
+              }
+              if (mitem.id == 'gear') {
+                mitem.code = eitem.gearCode
+                deviceObj.airGear2 = eitem.gear || 0
+                deviceObj.isAutoGear2 = eitem.isAutoGear
+              }
+              if (mitem.id == 'mode') {
+                mitem.code = eitem.modeSetCode
+                deviceObj.airMode2 = eitem.workMode
+              }
+            })
+            deviceObj.allModel = allModel
+            deviceArr.push(deviceObj)
+          })
+
+          _this.allDevices = deviceArr
+        })
+        .catch(() => {
+          // wx.hideLoading();
+        })
+    },
+
+    vibrateLong() {
+      if (wx.canIUse('vibrateLong')) {
+        wx.vibrateLong()
+      } else {
+        wx.vibrateShort()
+      }
+    },
+    vibrateShort() {
+      if (wx.canIUse('vibrateShort')) {
+        wx.vibrateShort()
+      } else {
+        wx.vibrateLong()
+      }
+    },
+    // 手动模式下设备是否可控
+    checkControlMode(id) {
+      let flag = false
+      if (!this.controlMode) {
+        return flag
+      }
+
+      //  总开关
+      if (id === 'air') {
+        let canOpen = true
+        for (let i = 0; i < this.equipConfig.length; i++) {
+          const ele = this.equipConfig[i]
+          for (let j = 0; j < this.lampList.length; j++) {
+            const jele = this.lampList[j]
+            // 有可控设备
+            if (ele.equipmentId === jele.id && ele.isExeSpaceTime) {
+              canOpen = false
+              return
+            }
+          }
+        }
+        flag = canOpen
+      } else {
+        this.equipConfig.map((item) => {
+          //  设备不受控制 可直接开灯
+          if (item.equipmentId === id && !item.isExeSpaceTime) {
+            flag = true
+          }
+          // 设备受控 且有当前工作时间 可直接开灯
+          if (
+            item.equipmentId === id &&
+            this.isNowTime &&
+            item.isExeSpaceTime
+          ) {
+            flag = true
+          }
+        })
+      }
+
+      return flag
+    },
+    checkAirCanOpen(id, value) {
+      // 判断空调是否能开启
+      if (value) {
+        // 12表示开空调
+        // 手动模式下设备是否可控
+        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
+        }
+      }
+      return true
+    },
+    changeZongAir(btnType, value) {
+      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
+            )
+            if (!this.showWorkTime) {
+              return
+            }
+          }
+          var _this = this
+          if (btnType == 'gear' && value == 'windLow') {
+            // 降挡
+            if (this.airGear > 1) {
+              this.airGear--
+              this.isAutoGear = 0
+            } else {
+              return
+            }
+          }
+          if (btnType == 'gear' && value == 'windUp') {
+            // 升档
+            if (this.airGear < 3) {
+              this.airGear++
+              this.isAutoGear = 0
+            } else {
+              return
+            }
+          }
+          if (btnType == 'gear' && value == 'auto') {
+            this.isAutoGear = this.isAutoGear == 1 ? 0 : 1
+          }
+          if (btnType == 'mode') {
+            this.airMode = value
+          }
+          if (btnType == 'sw') {
+            this.airData.isOpen = !this.airData.isOpen
+          }
+
+          let paramArr = []
+          this.allDevices.forEach((dele) => {
+            if (btnType == 'sw') {
+              let paramObj = {
+                id: dele.id,
+                code: dele.switchCode,
+                value: _this.airData.isOpen ? 1 : 0
+              }
+              paramArr.push(paramObj)
+            }
+            var pvalue
+            dele.allModel.forEach((mele) => {
+              if (mele.id == 'temp') {
+                pvalue = value
+              } else if (mele.id == 'gear') {
+                pvalue = _this.isAutoGear == 1 ? 4 : _this.airGear
+              } else if (mele.id == 'mode') {
+                pvalue = _this.airMode
+              }
+
+              if (mele.id == btnType) {
+                let paramObj = {
+                  id: dele.id,
+                  code: mele.code,
+                  value: pvalue
+                }
+                paramArr.push(paramObj)
+              }
+            })
+          })
+
+          this.vibrateShort()
+          wx.showLoading()
+
+          //  下达指令
+          changeManualTempHttp(paramArr, {
+            curTemp: _this.temperature,
+            equipType: 'airConditioner'
+          })
+            .then((res) => {
+              if (btnType == 'temp') {
+                _this.airTemp = value
+              }
+              _this.doTimeout()
+            })
+            .catch(() => {
+              wx.hideLoading()
+            })
+        })
+        .catch(() => {})
+    },
+    changeOneAir(id, code, value, deviceObjCopy) {
+      var _this = this
+      // isWithinLocation()
+      //   .then(() => {
+      this.vibrateShort()
+      if (this.roomType === '开放') {
+        this.showWorkTime = this.checkAirCanOpen(id, value)
+        if (!this.showWorkTime) {
+          return
+        }
+      }
+      const paramArr = [
+        {
+          id: id,
+          code: code,
+          value: value
+        }
+      ]
+      wx.showLoading()
+
+      if (deviceObjCopy) {
+        var allDevicesCopy = [..._this.allDevices]
+        var aindex = allDevicesCopy.findIndex((device) => {
+          return device.id == deviceObjCopy.id
+        })
+
+        allDevicesCopy[aindex] = deviceObjCopy
+        _this.allDevices = allDevicesCopy
+      }
+
+      //  下达指令
+      changeManualTempHttp(paramArr, {
+        curTemp: _this.temperature,
+        equipType: 'airConditioner'
+      })
+        .then((res) => {
+          _this.doTimeout()
+        })
+        .catch(() => {
+          wx.hideLoading()
+        })
+      // })
+      // .catch(() => {});
+    },
+    openFloorFeatPop(item) {
+      var _this = this
+      if (item.open) {
+        this.$emit('component-open-airHand-pop', item, {
+          maxValue: _this.endTemp,
+          minValue: _this.startTemp
+        })
+      }
+    }
+  }
+})
+</script>
+
+<style lang="less" scoped>
+.allAir {
+  display: flex;
+  box-sizing: border-box;
+  padding: 32rpx 10rpx 0rpx 10rpx;
+  border-top: 1px solid rgba(196, 196, 196, 0.4);
+  flex-wrap: wrap;
+  .eachFeat {
+    margin-bottom: 24rpx;
+    position: relative;
+    height: 232rpx;
+    width: 296rpx;
+    margin-left: 24rpx;
+    background: #f7f9fa;
+    border-radius: 32rpx;
+    padding-left: 32rpx;
+    box-sizing: border-box;
+    padding-top: 26rpx;
+    padding-bottom: 24rpx;
+    padding-right: 24rpx;
+    .temp {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      font-family: Montserrat;
+      font-size: 44rpx;
+      font-weight: 400;
+      line-height: 44rpx;
+      color: #1b144e;
+    }
+    .unit {
+      font-family: Mulish;
+      font-size: 24rpx;
+      font-weight: 400;
+      line-height: 30rpx;
+      color: #c4c4c4;
+    }
+    .status {
+      height: 96rpx;
+      box-sizing: border-box;
+      padding-top: 8rpx;
+      padding-bottom: 52rpx;
+      font-family: PingFang SC;
+      font-size: 24rpx;
+      font-weight: 400;
+      display: flex;
+      align-items: center;
+      color: #c4c9cf;
+      image {
+        margin-right: 8rpx;
+        width: 28rpx;
+        height: 28rpx;
+        opacity: 0.6;
+      }
+    }
+    .eqName {
+      font-family: PingFang SC;
+      font-size: 32rpx;
+      font-weight: 600;
+      line-height: 44rpx;
+      color: #4d5262;
+      width: calc(100% - 23px);
+      overflow: hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+    }
+    .imgSt {
+      position: absolute;
+      right: 28rpx;
+      bottom: 30rpx;
+      height: 40rpx;
+      width: 40rpx;
+    }
+  }
+}
+.air-common-text {
+  padding-top: 2rpx;
+  font-family: PingFang SC;
+  font-size: 24rpx;
+  font-weight: 400;
+  line-height: 30rpx;
+  color: rgba(196, 196, 196, 1);
+
+  &.change-text {
+    font-size: 24rpx;
+    line-height: 40rpx;
+  }
+}
+.office-card {
+  box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.07), 0px 4px 10px rgba(0, 0, 0, 0.05);
+  border-radius: 50rpx;
+  background: #ffffff;
+  margin-bottom: 30rpx;
+}
+
+.air-adjust {
+  position: relative;
+  // height: 280rpx;
+  .air-text {
+    padding-bottom: 60rpx;
+  }
+  .air-content {
+    padding: 48rpx 46rpx 32rpx 40rpx;
+    box-sizing: border-box;
+    position: relative;
+  }
+  .air-switch {
+    position: absolute;
+    bottom: 10rpx;
+    right: 46rpx;
+  }
+
+  .air-adjust-env {
+    .envname {
+      font-family: PingFang SC;
+      color: rgba(77, 82, 98, 1);
+      font-size: 32rpx;
+      font-weight: 600;
+      line-height: 44rpx;
+    }
+    .envnum {
+      font-family: Montserrat;
+      font-size: 64rpx;
+      font-weight: 400;
+      line-height: 64rpx;
+      padding-top: 10rpx;
+      color: #1b144e;
+      label {
+        font-family: Mulish;
+        font-weight: 800;
+        font-size: 24rpx;
+        margin-left: 6rpx;
+        line-height: 30rpx;
+        vertical-align: top;
+        color: #c4c4c4;
+      }
+    }
+  }
+  .air-adjust-btn {
+    position: absolute;
+    top: 34rpx;
+    right: 40rpx;
+    image {
+      width: 132px;
+      height: 76px;
+    }
+  }
+}
+
+.air-show-all {
+  height: 50rpx;
+  .text {
+    margin-right: 4px;
+  }
+  .air-arrow {
+    width: 50rpx;
+    height: 36rpx;
+  }
+  .showarrow {
+    color: #4d5262;
+  }
+  .arrow {
+    padding-top: 4px;
+  }
+}
+.air-show-all-cont {
+  font-family: PingFang SC;
+  font-size: 14px;
+  font-weight: 400;
+  line-height: 50rpx;
+  color: rgba(196, 196, 196, 1);
+  display: flex;
+  align-items: center;
+}
+.air-control-wrap {
+  border-top: 1px solid rgba(196, 196, 196, 0.4);
+  padding-top: 30rpx;
+}
+.air-control-item {
+  padding: 30rpx 40rpx 32rpx 40rpx;
+  box-sizing: border-box;
+
+  &.item-flex {
+    display: flex;
+    justify-content: space-between;
+  }
+  .temp-wrap {
+    display: flex;
+    padding-top: 26px;
+    padding-bottom: 5px;
+    height: 20px;
+    align-items: center;
+    .minVal {
+      color: #c4c4c4;
+      font-size: 22rpx;
+      flex-grow: 0;
+      margin-right: 8px;
+    }
+    .maxVal {
+      color: #c4c4c4;
+      font-size: 22rpx;
+      flex-grow: 0;
+      margin-left: 8px;
+    }
+    .tempBar {
+      //background: red;
+      height: 10px;
+      flex-grow: 1;
+      position: relative;
+      display: flex;
+      border-radius: 10px;
+      .circle {
+        position: absolute;
+        width: 19px;
+        height: 19px;
+        left: 0px;
+        top: -5px;
+        background: #ffffff;
+        box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.1),
+          0px 4px 10px rgba(0, 0, 0, 0.07);
+        border-radius: 21px;
+        z-index: 1;
+        .tvalue {
+          position: relative;
+          top: -26px;
+          text-align: center;
+          color: #1f2429;
+          font-size: 22rpx;
+        }
+        &.disable {
+          opacity: 0.6;
+        }
+      }
+      .eachBlock {
+        width: 20%;
+        background: red;
+        &:nth-child(1) {
+          background: #5e8bcf;
+          border-top-left-radius: 10px;
+          border-bottom-left-radius: 10px;
+        }
+        &:nth-child(2) {
+          background: #9fb7cd;
+        }
+        &:nth-child(3) {
+          background: #f3f3f3;
+        }
+        &:nth-child(4) {
+          background: #ff9882;
+        }
+        &:nth-child(5) {
+          background: #e5574f;
+          border-top-right-radius: 10px;
+          border-bottom-right-radius: 10px;
+        }
+      }
+    }
+  }
+  .air-control-item-box {
+    display: flex;
+    // align-items: center;
+    flex-direction: column;
+  }
+  .envnum-common {
+    font-family: Montserrat;
+    font-weight: 500;
+    line-height: 48rpx;
+    font-size: 28rpx;
+    color: rgba(77, 82, 98, 1);
+    &.air-envnum-comon {
+      display: flex;
+      align-items: center;
+    }
+    .envnum-common-wind {
+      font-family: Montserrat;
+      font-size: 24rpx;
+      font-weight: 500;
+      line-height: 30rpx;
+      margin-right: 14rpx;
+      color: rgba(196, 196, 196, 1);
+      &.windBlack {
+        font-size: 40rpx;
+        font-weight: 500;
+        line-height: 48rpx;
+        color: rgba(77, 82, 98, 1);
+      }
+    }
+    &.colorRed {
+      color: red;
+    }
+    &.colorBlue {
+      color: rgba(94, 139, 207, 1);
+    }
+    &.colorBlack {
+      color: rgba(77, 82, 98, 1);
+    }
+    label {
+      font-size: 11px;
+      line-height: 13px;
+      color: rgba(196, 196, 196, 1);
+      vertical-align: top;
+    }
+  }
+  .air-common-switch {
+    display: flex;
+  }
+  .switch:last-child {
+    margin-right: 0rpx;
+  }
+  .switch {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    height: 80rpx;
+    width: 80rpx;
+    font-size: 12px;
+    margin-right: 16rpx;
+    background: #f1f4f6;
+    border-radius: 50%;
+    image {
+      width: 40rpx;
+      height: 40rpx;
+    }
+    &.yell {
+      background: rgba(61, 203, 204, 0.3);
+    }
+  }
+}
+.disabled {
+  opacity: 0.5;
+}
+</style>
+
+<config>
+{
+    usingComponents: {
+        "switch": "../components/switch" ,
+        "van-icon": "module:@vant/weapp/dist/icon",
+        "van-loading": "module:@vant/weapp/dist/loading",
+        "CardSlider": "../comComponents/CardSlider" ,
+        "SwitchLR":   "../comComponents/SwitchLR",  
+        "Switch":     "../comComponents/Switch", 
+            }
+}
+</config>

+ 423 - 0
src/packagesEnv/pages/officehome/airHand/airHandPop.wpy

@@ -0,0 +1,423 @@
+
+<template>
+    <div>
+        <div class="title">{{ airHandItem.name}}</div>
+        <div v-if="airHandItem.boundPoint.tempSetBound" class="set-value">
+            <div class="text">温度设定</div>
+            <div class="dir"></div>
+            <div class="value">{{airHandItem.tempSet2}}℃</div>
+        </div>
+        <div  v-if="airHandItem.boundPoint.tempSetBound" class="silder-box">
+            <Floorfeat-Slider
+            :typeValue="airHandItem.nowTemp2"
+            :maxValue="maxValue"
+            :minValue="minValue"
+            @silder-mouseEnd="changeSwitch($event)"
+            ></Floorfeat-Slider>
+        </div>
+        <div
+                class="air-control-item"
+                v-if="!isACATVA && airHandItem.boundPoint.gearSetBound"
+            >
+                <div class="air-control-item-box">
+                  <div class="air-common-text change-text">风量调节</div>
+                    <div class="envnum-common air-envnum-comon">
+                        <span
+                            class="envnum-common-wind"
+                            v-for="(item,index) in windGearArr"
+                            :key="index"
+                            :class="{'windBlack': item == airHandItem.airGear2 }"
+                        >{{item}}</span>
+                    </div>
+                </div>
+                <div class="air-common-switch">
+                  <div>
+                    <div
+                        class="switch"
+                        :class="{'disabled':airHandItem.airGear2 <=1||!airHandItem.open}"
+                        @click="changeOneAir('gear','windLow')"
+                    >
+                        <image src="{{h5StaticPath}}wind_small2.svg" />
+                    </div>
+                    <div class="switchName">调小</div>
+                  </div>
+               <div>
+                <div
+                    class="switch"
+                    :class="{'disabled':airHandItem.airGear2 >=3||!airHandItem.open}"
+                    @click="changeOneAir('gear','windUp')"
+                    >
+                        <image src="{{h5StaticPath}}wind_big2.svg" />
+                    </div>
+                    <div class="switchName">调大</div>
+               </div>
+              <div>
+                <div
+                    class="switch"
+                    :class="{'yell': airHandItem.isAutoGear2==1,'disabled':!airHandItem.open}"
+                    @click="changeOneAir('gear','auto')"
+                    >
+                    <image src="{{h5StaticPath}}wind_auto2.svg" />
+                    </div>
+                    <div class="switchName">自动</div>
+              </div>
+                  
+                </div>
+            </div>
+            <div
+                class="air-control-item"
+                v-if="!isACATVA && airHandItem.boundPoint.modeSetBound"
+            >  
+                <div class="air-control-item-box">
+                  <div class="air-common-text change-text">模式设定</div>
+                    <div class="envnum-common air-envnum-comon">
+                        {{airHandItem.airMode2 ==2?'制热':airHandItem.airMode2 ==1?'制冷':'通风'}}
+                    </div>
+                </div>
+                <div class="air-common-switch">
+                  <div> 
+                    <div
+                        class="switch" :class="{'yell':  airHandItem.airMode2==1,'disabled':!airHandItem.open}"
+                        @click="changeOneAir('mode',1)"
+                    >
+                        <img :src="h5StaticPath+'aircoldblack2.svg'" />
+                    </div>
+                    <div class="switchName">制冷</div>
+                  </div>
+                  <div> 
+                    <div
+                        class="switch"
+                        :class="{'yell': airHandItem.airMode2==2,'disabled':!airHandItem.open}"
+                        @click="changeOneAir('mode',2)"
+                    >
+                        <img :src="h5StaticPath+'airsunblack2.svg'" />
+                    </div>
+                    <div class="switchName">制热</div>
+                  </div>
+                 <div> 
+                  <div
+                        class="switch"
+                        :class="{'yell':  airHandItem.airMode2==3,'disabled':!airHandItem.open}"
+                        @click="changeOneAir('mode',3)"
+                    >
+                        <img :src="h5StaticPath+'aircloudblack2.svg'" />
+                    </div>
+                    <div class="switchName">通风</div>
+                 </div>
+                </div>
+            </div>
+    </div>
+   
+</template>
+<script>
+import wepy from '@wepy/core'
+import { isWithinLocation } from '@/service/location'
+
+import config from '@config'
+wepy.component({
+  props: {
+    maxValue: Number,
+    minValue: Number,
+    airHandItem: Object,
+    roomType: String // 房间类型
+  },
+  data: {
+    defaultInactiveColor: 'rgba(196, 196, 196, 0.2)',
+    windGearArr: [0, 1, 2, 3], // 风量3/5个档位
+    h5StaticPath: config.h5StaticPath + '/page-officehome/',
+    showWorkTime: false // 展示是否需要预约时间
+  },
+  computed: {},
+  watch: {
+    // airHandItem(val) {
+    //   if (this.changeWatchVal) {
+    //     this.temp = val.tempSet || '--';
+    //   }
+    // },
+  },
+  methods: {
+    changeSwitch(value) {
+      this.airHandItem.tempSet2 = value
+      this.airHandItem.nowTemp2 = value
+      this.changeOneAir('temp', value)
+    },
+    changeOneAir(btnType, value) {
+      if (!this.airHandItem.open) return
+      isWithinLocation().then(() => {
+        var deviceObjCopy = { ...this.airHandItem }
+        var nowairGear = this.airHandItem.airGear2
+        var nowAutoGear = this.airHandItem.isAutoGear2
+        if (btnType == 'gear' && value == 'windLow') {
+          // 降挡
+          if (nowairGear > 1) {
+            nowairGear = nowairGear - 1
+            nowAutoGear = 0
+            deviceObjCopy.airGear2 = nowairGear
+            deviceObjCopy.isAutoGear2 = nowAutoGear
+          } else {
+            return
+          }
+        }
+        if (btnType == 'gear' && value == 'windUp') {
+          // 升档
+          if (nowairGear < 3) {
+            nowairGear = nowairGear + 1
+            nowAutoGear = 0
+            deviceObjCopy.airGear2 = nowairGear
+            deviceObjCopy.isAutoGear2 = nowAutoGear
+          } else {
+            return
+          }
+        }
+
+        if (btnType == 'gear' && value == 'auto') {
+          nowAutoGear = this.airHandItem.isAutoGear2 == 1 ? 0 : 1
+          deviceObjCopy.isAutoGear2 = nowAutoGear
+        }
+        var rval
+        if (btnType == 'mode') {
+          deviceObjCopy.airMode2 = value
+          rval = value
+        }
+        if (btnType == 'gear') {
+          rval = nowAutoGear == 1 ? 4 : nowairGear
+        }
+        if (btnType == 'temp') {
+          rval = value
+        }
+        var nowModel = this.airHandItem.allModel.find((item) => {
+          return item.id == btnType
+        })
+
+        this.$emit(
+          'change-airHand-order',
+          {
+            id: this.airHandItem.id,
+            code: nowModel.code,
+            value: rval
+          },
+          deviceObjCopy
+        )
+      }).catch(() => {})
+    }
+  }
+})
+</script>
+<config>
+    {
+        usingComponents: {
+            "Floorfeat-Slider": "../comComponents/FloorfeatSlider"    
+        }
+    
+    }
+</config>
+<style lang="less" scoped>
+.title {
+  padding-top: 40rpx;
+  font-family: PingFang SC;
+  font-size: 44rpx;
+  font-weight: 500;
+  line-height: 62rpx;
+  color: #000000;
+}
+.text {
+  font-family: PingFang SC;
+  font-size: 32rpx;
+  font-weight: 600;
+  line-height: 44rpx;
+  color: #1b2129;
+}
+.dir {
+  border-right: 1px solid #e1e5eb;
+  height: 30rpx;
+  margin-left: 24rpx;
+  margin-right: 24rpx;
+}
+.set-value {
+  display: flex;
+  align-items: center;
+  padding-top: 96rpx;
+  padding-bottom: 34rpx;
+}
+.value {
+  font-family: Montserrat;
+  font-size: 32rpx;
+  font-weight: 400;
+  line-height: 38rpx;
+  color: #1b2129;
+}
+.silder-box {
+  margin-bottom: 90rpx;
+}
+
+.air-control-item {
+  // padding: 23rpx 28rpx 32rpx 43rpx;
+  margin-bottom: 90rpx;
+  box-sizing: border-box;
+
+  &.item-flex {
+    display: flex;
+    justify-content: space-between;
+  }
+  .temp-wrap {
+    display: flex;
+    padding-top: 26px;
+    padding-bottom: 5px;
+    height: 20px;
+    align-items: center;
+    .minVal {
+      color: #c4c4c4;
+      font-size: 22rpx;
+      flex-grow: 0;
+      margin-right: 8px;
+    }
+    .maxVal {
+      color: #c4c4c4;
+      font-size: 22rpx;
+      flex-grow: 0;
+      margin-left: 8px;
+    }
+    .tempBar {
+      //background: red;
+      height: 10px;
+      flex-grow: 1;
+      position: relative;
+      display: flex;
+      border-radius: 10px;
+      .circle {
+        position: absolute;
+        width: 19px;
+        height: 19px;
+        left: 0px;
+        top: -5px;
+        background: #ffffff;
+        box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.1),
+          0px 4px 10px rgba(0, 0, 0, 0.07);
+        border-radius: 21px;
+        z-index: 1;
+        .tvalue {
+          position: relative;
+          top: -26px;
+          text-align: center;
+          color: #1f2429;
+          font-size: 22rpx;
+        }
+        &.disable {
+          opacity: 0.6;
+        }
+      }
+      .eachBlock {
+        width: 20%;
+        background: red;
+        &:nth-child(1) {
+          background: #5e8bcf;
+          border-top-left-radius: 10px;
+          border-bottom-left-radius: 10px;
+        }
+        &:nth-child(2) {
+          background: #9fb7cd;
+        }
+        &:nth-child(3) {
+          background: #f3f3f3;
+        }
+        &:nth-child(4) {
+          background: #ff9882;
+        }
+        &:nth-child(5) {
+          background: #e5574f;
+          border-top-right-radius: 10px;
+          border-bottom-right-radius: 10px;
+        }
+      }
+    }
+  }
+  .air-control-item-box {
+    display: flex;
+    margin-bottom: 30rpx;
+    align-items: center;
+
+    .air-common-text {
+      padding-top: 2rpx;
+      font-family: PingFang SC;
+      font-size: 32rpx;
+      font-weight: 600;
+      line-height: 30rpx;
+      color: #1b2129;
+      padding-right: 12px;
+      border-right: 1px solid #e1e5eb;
+    }
+  }
+  .envnum-common {
+    padding-left: 12px;
+    font-family: PingFang SC;
+    line-height: 48rpx;
+    font-size: 32rpx;
+    color: #1b2129;
+    &.air-envnum-comon {
+      display: flex;
+      align-items: center;
+    }
+    .envnum-common-wind {
+      font-family: Montserrat;
+      // font-size: 24rpx;
+      // font-weight: 500;
+      // line-height: 30rpx;
+      margin-right: 14rpx;
+      &.windBlack {
+        // font-size: 40rpx;
+        // font-weight: 500;
+        // line-height: 48rpx;
+        color: #1b2129;
+      }
+    }
+    &.colorRed {
+      color: red;
+    }
+    &.colorBlue {
+      color: rgba(94, 139, 207, 1);
+    }
+    &.colorBlack {
+      color: rgba(77, 82, 98, 1);
+    }
+    label {
+      font-size: 32rpx;
+      line-height: 13px;
+      color: #C4C9CF;
+      vertical-align: top;
+    }
+  }
+  .air-common-switch {
+    display: flex;
+    justify-content: space-around;
+  }
+  .switch:last-child {
+    margin-right: 0rpx;
+  }
+  .switch {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    height: 112rpx;
+    width: 112rpx;
+    font-size: 12px;
+    background: #F1F4F6;
+    border-radius: 50%;
+    image {
+      width: 56rpx;
+      height: 56rpx;
+    }
+    &.yell {
+      background: rgba(61, 203, 204, 0.3);
+    }
+  }
+  .disabled {
+    opacity: 0.5;
+  }
+  .switchName {
+    width: 112rpx;
+    margin-top: 8px;
+    color: #626c78;
+    text-align: center;
+  }
+}
+</style>

+ 10 - 11
src/packagesEnv/pages/officehome/comComponents/Switch.wpy

@@ -7,7 +7,7 @@
     align-items: center;
 }
 .component-switch {
-    background: #ffe823;
+    background:  #37C3C4;
     border-radius: 12px;
     display: inline-block;
     box-sizing: border-box;
@@ -62,12 +62,12 @@
 </template>
 
 <script>
-import wepy from '@wepy/core';
+import wepy from '@wepy/core'
 
 wepy.component({
   data: {
     defaultInactiveColor: 'rgba(196, 196, 196, 0.2)',
-    defaultActiveColor: 'rgba(255, 232, 35, 1)',
+    defaultActiveColor: '#37C3C4',
     disable: false
   },
   props: {
@@ -84,29 +84,28 @@ wepy.component({
   },
   computed: {
     confirmText() {
-      const text = this.checked ? '关闭' : '开启';
+      const text = this.checked ? '关闭' : '开启'
       return text
     }
   },
   watch: {
     checked() {
-      this.disable = false;
+      this.disable = false
     }
   },
   methods: {
     changChecked() {
-      this.vibrateShort();
-      this.$emit('component-switch-change', !this.checked);
+      this.vibrateShort()
+      this.$emit('component-switch-change', !this.checked)
     },
     vibrateShort() {
       if (wx.canIUse('vibrateShort')) {
-        wx.vibrateShort();
+        wx.vibrateShort()
       } else {
-        wx.vibrateLong();
+        wx.vibrateLong()
       }
     }
 
   }
-});
+})
 </script>
-

+ 208 - 208
src/packagesEnv/pages/officehome/components/air-adjust-hand.wpy

@@ -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);
         }
     }
 }

+ 1 - 1
src/packagesEnv/pages/officehome/components/air-adjust.wpy

@@ -628,7 +628,7 @@ wepy.component({
             height: 40rpx;
         }
         &.yell {
-            background: #ffe823;
+            background: rgba(61, 203, 204, 0.3);
         }
     }
 }

+ 27 - 27
src/packagesEnv/pages/officehome/components/date-selector.wpy

@@ -24,7 +24,7 @@
 }
 
 .day-selecotr .day-selecotr-item.selected {
-  background: #ffe823;
+  background: rgba(61, 203, 204, 0.3);
   border-radius: 30rpx;
   color: #140050;
   font-weight: 600px;
@@ -69,19 +69,19 @@
 </template>
 
 <script>
-import wepy from '@wepy/core';
+import wepy from '@wepy/core'
 
 import {
   getNowDate,
   getDate,
   getWeekDay,
   getMonthText
-} from '@/service/meetingTimes';
+} from '@/service/meetingTimes'
 // import {
 //     getNowDate,
 //    getDate
 //   } from '@/packagesEnv/pages/common.js'
-const selectorsNumber = 7; // 总共展示多个选择项;
+const selectorsNumber = 7 // 总共展示多个选择项;
 wepy.component({
   data: {
     daySelectors: [],
@@ -94,15 +94,15 @@ wepy.component({
     }
   },
   created() {
-    this.daySelectors = getDaysSelctors();
+    this.daySelectors = getDaysSelctors()
   },
   ready() {
-    let { selectValue } = this;
+    let { selectValue } = this
     if (selectValue) {
       let selectDaySelectorsIndex = this.daySelectors.findIndex(
         selecotr => selecotr.value == selectValue
-      );
-      this.selectDaySelectorsIndex = selectDaySelectorsIndex;
+      )
+      this.selectDaySelectorsIndex = selectDaySelectorsIndex
     }
   },
   watch: {
@@ -110,42 +110,42 @@ wepy.component({
       if (newSelectValue !== oldSelectValue) {
         let selectDaySelectorsIndex = this.daySelectors.findIndex(
           selecotr => selecotr.value == newSelectValue
-        );
-        this.selectDaySelectorsIndex = selectDaySelectorsIndex;
+        )
+        this.selectDaySelectorsIndex = selectDaySelectorsIndex
       }
     }
   },
   methods: {
     selectDaySelectors(index) {
-      this.selectDaySelectorsIndex = index;
-      this.emmitSelect(index);
+      this.selectDaySelectorsIndex = index
+      this.emmitSelect(index)
     },
     emmitSelect(index) {
-      let selector = this.daySelectors[index];
-      this.$emit('component-date-selector-select', selector.value);
+      let selector = this.daySelectors[index]
+      this.$emit('component-date-selector-select', selector.value)
     }
   }
-});
+})
 
 function getDaysSelctors() {
-  let now = new Date();
-  let nowDate = now.getDate();
+  let now = new Date()
+  let nowDate = now.getDate()
   let selectors = [
     {
       weekday: '今天',
       date: nowDate,
       value: getNowDate()
     }
-  ];
-  let newTime = now.getTime();
+  ]
+  let newTime = now.getTime()
   for (let i = 0; i < selectorsNumber - 1; i++) {
-    newTime = newTime + 24 * 60 * 60 * 1000;
-    let date = new Date(newTime);
-    let weekday = getWeekDay(date);
-    let selectorIscrossMonth = false;
+    newTime = newTime + 24 * 60 * 60 * 1000
+    let date = new Date(newTime)
+    let weekday = getWeekDay(date)
+    let selectorIscrossMonth = false
     if (now.getMonth() !== date.getMonth() && date.getDate() == '1') {
-      weekday = getMonthText(date);
-      selectorIscrossMonth = true;
+      weekday = getMonthText(date)
+      selectorIscrossMonth = true
     }
 
     selectors.push({
@@ -153,8 +153,8 @@ function getDaysSelctors() {
       date: date.getDate(),
       value: getDate(date),
       selectorIscrossMonth
-    });
+    })
   }
-  return selectors;
+  return selectors
 }
 </script>

+ 16 - 16
src/packagesEnv/pages/officehome/components/switch-small.wpy

@@ -9,7 +9,7 @@
 .component-switch {
     height: 32rpx;
     width: 64rpx;
-    background: #ffe823;
+    background:  #37C3C4;
     border-radius: 24rpx;
     display: inline-block;
     box-sizing: border-box;
@@ -70,12 +70,12 @@
 </template>
 
 <script>
-import wepy from '@wepy/core';
+import wepy from '@wepy/core'
 
 wepy.component({
   data: {
     defaultInactiveColor: 'rgba(196, 196, 196, 0.2)',
-    defaultActiveColor: 'rgba(255, 232, 35, 1)',
+    defaultActiveColor: '#37C3C4',
     disable: false
   },
   props: {
@@ -90,14 +90,14 @@ wepy.component({
   },
   computed: {
     confirmText() {
-      const text = this.checked ? '关闭' : '开启';
+      const text = this.checked ? '关闭' : '开启'
       return text
     }
   },
   watch: {
     checked: {
       handler() {
-        this.disable = false;
+        this.disable = false
       },
       immediate: true
     }
@@ -105,8 +105,8 @@ wepy.component({
   },
   methods: {
     changChecked() {
-      const that = this;
-      if (this.disable) return;
+      const that = this
+      if (this.disable) return
       if (this.isHand == 'auto') {
         wx.showModal({
                     // title: '提示',
@@ -114,26 +114,26 @@ wepy.component({
           confirmText: that.confirmText,
           success: function (res) {
             if (res.confirm) {
-              that.emitCheck(that); // 开关状态提交
+              that.emitCheck(that) // 开关状态提交
             }
           }
-        });
-        return;
+        })
+        return
       }
-      that.emitCheck(that); // 开关状态提交
+      that.emitCheck(that) // 开关状态提交
     },
 
     emitCheck(that) {
-      let checked = that.checked;
+      let checked = that.checked
 
       if (!this.showWorkTime) {
-        this.disable = false;
+        this.disable = false
       } else {
-        this.disable = true;
+        this.disable = true
       }
-      that.$emit('component-switch-change', !checked);
+      that.$emit('component-switch-change', !checked)
     }
 
   }
-});
+})
 </script>

+ 20 - 20
src/packagesEnv/pages/officehome/components/switch.wpy

@@ -9,7 +9,7 @@
 .component-switch {
     height: 48rpx;
     width: 96rpx;
-    background: #ffe823;
+    background:  #37C3C4;
     border-radius: 12px;
     display: inline-block;
     box-sizing: border-box;
@@ -70,12 +70,12 @@
 </template>
 
 <script>
-import wepy from '@wepy/core';
+import wepy from '@wepy/core'
 
 wepy.component({
   data: {
     defaultInactiveColor: 'rgba(196, 196, 196, 0.2)',
-    defaultActiveColor: 'rgba(255, 232, 35, 1)',
+    defaultActiveColor: ' #37C3C4',
     disable: false
   },
   props: {
@@ -90,19 +90,19 @@ wepy.component({
   },
   computed: {
     confirmText() {
-      const text = this.checked ? '关闭' : '开启';
+      const text = this.checked ? '关闭' : '开启'
       return text
     }
   },
   watch: {
     checked() {
-      this.disable = false;
+      this.disable = false
     }
   },
   methods: {
     changChecked() {
-      const that = this;
-      if (this.disable) return;
+      const that = this
+      if (this.disable) return
             // console.log('this.isHand,isAirSwitch', this.isHand);
             // 如果是过渡季 并且是ATFC 空调 则不能开启
       if (this.isHand == 'auto' && this.isACATFC && !this.checked && this.seasonType == 'Transition') {
@@ -112,8 +112,8 @@ wepy.component({
             duration: 2600,
             icon: 'none'
           })
-        }, 0);
-        return;
+        }, 0)
+        return
       }
 
       if (this.isHand == 'auto') {
@@ -123,28 +123,28 @@ wepy.component({
           confirmText: that.confirmText,
           success: function (res) {
             if (res.confirm) {
-              that.emitCheck(that); // 开关状态提交
+              that.emitCheck(that) // 开关状态提交
             }
           }
-        });
-        return;
+        })
+        return
       }
-      that.emitCheck(that); // 开关状态提交
+      that.emitCheck(that) // 开关状态提交
     },
 
     emitCheck(that) {
-      let checked = that.checked;
+      let checked = that.checked
 
       if (!this.showWorkTime) {
-        this.disable = false;
+        this.disable = false
       } else {
-        this.disable = true;
+        this.disable = true
       }
-      console.log(this.showWorkTime, 'this.showWorkTimeSW');
-      console.log(this.disable, 'this.disableSw');
-      that.$emit('component-switch-change', !checked);
+      console.log(this.showWorkTime, 'this.showWorkTimeSW')
+      console.log(this.disable, 'this.disableSw')
+      that.$emit('component-switch-change', !checked)
     }
 
   }
-});
+})
 </script>

+ 22 - 22
src/packagesEnv/pages/officehome/components/voice-adjust.wpy

@@ -46,8 +46,8 @@
 </template>
 
 <script>
-import wepy from '@wepy/core';
-import config from '@/config';
+import wepy from '@wepy/core'
+import config from '@/config'
 let RecorderManager = wx.getRecorderManager()
 wepy.component({
   externalClasses: ['my-class'],
@@ -59,42 +59,42 @@ wepy.component({
   },
   computed: {
     dbText() {
-      let dbText = '适宜办公';
+      let dbText = '适宜'
       if (this.dbs <= 60) {
-        dbText = '适宜办公';
-        this.iconFlag = false;
+        dbText = '适宜'
+        this.iconFlag = false
       } else {
-        dbText = '闭目养神2分钟';
-        this.iconFlag = true;
+        dbText = '闭目养神2分钟'
+        this.iconFlag = true
       }
-      return dbText;
+      return dbText
     }
   },
   attached() {
     RecorderManager.onFrameRecorded((res) => {
       console.log('onFrameRecorded', res)
-      const myTypedArray = new Int16Array(res.frameBuffer);
-      var sum = 0;
+      const myTypedArray = new Int16Array(res.frameBuffer)
+      var sum = 0
       for (var i = 0; i < myTypedArray.length; i++) {
-        sum += Math.abs(myTypedArray[i]);
+        sum += Math.abs(myTypedArray[i])
       }
-      var mean = sum / myTypedArray.length;
-      let value = Math.abs(parseFloat(mean));
+      var mean = sum / myTypedArray.length
+      let value = Math.abs(parseFloat(mean))
             // 公式
-      let db = parseInt(20 * Math.log10(value));
-      this.dbs = db ? parseInt(db) : 45;
+      let db = parseInt(20 * Math.log10(value))
+      this.dbs = db ? parseInt(db) : 45
     })
   },
   methods: {
     vibrateShort() {
       if (wx.canIUse('vibrateShort')) {
-        wx.vibrateShort();
+        wx.vibrateShort()
       } else {
-        wx.vibrateLong();
+        wx.vibrateLong()
       }
     },
     handleReplay() {
-      this.vibrateShort();
+      this.vibrateShort()
       this.replayFlag = true
       RecorderManager.start({
                 // duration:3000, // 录音时长
@@ -106,10 +106,10 @@ wepy.component({
       })
 
       setTimeout(() => {
-        this.replayFlag = false;
-        RecorderManager.stop();
-      }, 2000);
-      wx.uma.trackEvent('officeHome_checkVoice', {key: '噪声'});
+        this.replayFlag = false
+        RecorderManager.stop()
+      }, 2000)
+      wx.uma.trackEvent('officeHome_checkVoice', {key: '噪声'})
     }
   }
 })

+ 11 - 11
src/packagesEnv/pages/officehome/components/work-off.wpy

@@ -25,7 +25,7 @@
             align-items: center;
             width: 140rpx;
             height: 140rpx;
-            background: #FFE823;
+            background: rgba(61, 203, 204, 0.3);
             border-radius: 50%;
             margin-bottom: 30rpx;
             &.grey {
@@ -77,7 +77,7 @@
             .text-status {
                 width: 32rpx;
                 height: 32rpx;
-                background: #FFE823;
+                background: rgba(61, 203, 204, 0.3);
                 border-radius: 100%;
                 display: inline-block;
             }
@@ -164,8 +164,8 @@
 </template>
 <script>
 
-import wepy from '@wepy/core';
-import config from '@/config';
+import wepy from '@wepy/core'
+import config from '@/config'
 let textData = [
   {
     text: '已为您取消当前的预约时间',
@@ -191,19 +191,19 @@ wepy.component({
   watch: {
     sceneShow(newVal) {
       if (newVal) {
-        let timer = null;
-        let statusTimer = null;
-        let idx = 0;
+        let timer = null
+        let statusTimer = null
+        let idx = 0
         timer = setInterval(() => {
           if (idx > 2) {
-            clearInterval(timer);
-            clearTimeout(statusTimer);
-            return;
+            clearInterval(timer)
+            clearTimeout(statusTimer)
+            return
           }
           this.textObj.push(textData[idx])
           this.textObj[idx].status = 'ok'
           idx++
-        }, 600);
+        }, 600)
       } else {
         this.textObj = []
       }

+ 1 - 1
src/packagesEnv/pages/officehome/components/work-scene-hand.wpy

@@ -44,7 +44,7 @@
     height: 116rpx;
     background: rgba(159, 183, 205, 0.15);
     &.hasWorkTime {
-        background: #ffe723;
+        background:  rgba(61, 203, 204, 0.3);
     }
     border-radius: 16px;
     padding-left: 24rpx;

+ 1 - 1
src/packagesEnv/pages/officehome/components/work-scene.wpy

@@ -44,7 +44,7 @@
     height: 116rpx;
     background: rgba(159, 183, 205, 0.15);
     &.hasWorkTime {
-        background: #ffe723;
+        background:  rgba(61, 203, 204, 0.3);
     }
     border-radius: 16px;
     padding-left: 24rpx;

+ 80 - 58
src/packagesEnv/pages/officehome/index.wpy

@@ -1,5 +1,5 @@
 <template>
-    <div class="overflow-wrap">
+    <div class="overflow-wrap" style="position: {{airHandVisible ? 'fixed':'static'}};">
         <page-top-bar-custom
             @component-page-top-bar-custom-ready="setTopBarHeight"
             :bgColor="[navFixed? '#f7f8fa' : 'transparent']"
@@ -187,6 +187,7 @@
                         id="inToView0"
                         :isControl="isControl"
                         :airVisible="airVisible"
+ 			:cardWidth="cardWidth"
                         :roomHasScene="roomHasScene"
                         :hasAir="spaceEqFlagObj.hasAir"
                         :hasBlowing="spaceEqFlagObj.hasBlowing"
@@ -203,20 +204,20 @@
                         @airTemp="airTemp"
                         v-bind:key="airKey"
                     ></air-adjust>
-                    <air-adjust-hand
+                   <air-hand-card
+                        ref="airHandCard"
                         v-if="spaceEqFlagObj.hasAir&&controlMode==1"
                         id="inToView02"
+                        :cardWidth="cardWidth"
                         :isControl="isControl"
                         :airVisible="airVisible"
                         :roomHasScene="roomHasScene"
                         :hasAir="spaceEqFlagObj.hasAir"
-                        :hasBlowing="spaceEqFlagObj.hasBlowing"
-                        :airVolumes="officeData.airVolumes"
-                        :temperature="officeData.temperature"
                         :equipConfig="equipmentsConfig"
                         :objectId="options.spaceId"
                         :roomType="options.roomType"
                         :projectId="projectId"
+                        :temperature="officeData.temperature"
                         :isACATVA="isACATVA"
                         :isACATFC="isACATFC"
                         @showDetail="handleDetail"
@@ -225,8 +226,9 @@
                         @component-EquipType-workTimePop="dialogShowEquipType"
                         @airTemp="airTemp"
                         @setCanScroll="setCanScroll"
+                        @component-open-airHand-pop="openAirHandPop"
                         v-bind:key="airKey"
-                    ></air-adjust-hand>
+                    ></air-hand-card>
                     <!-- 地暖 -->
                     <div v-show="floorHeatData.len">
                         <Floor-Heating
@@ -394,6 +396,25 @@
                 ></Floor-Pop>
             </div>
         </van-popup>
+        <!-- 空调 -->
+           <van-popup
+            overlay-style="background: rgba(0, 0, 0, 0.4)"
+            :custom-style="'height:'+airPopHight+'%'"
+            round
+            :show="airHandVisible"
+            position="bottom"
+            @close="airHandVisible = false"
+        >
+            <div style="display:flex;justify-content: center;">
+                <airHand-Pop
+                :airHandItem="airHandItem"
+                :maxValue="airHandData.maxValue"
+                :minValue="airHandData.minValue"
+                :roomType="options.roomType"
+                @change-airHand-order="changeAirHandOrder"
+                ></airHand-Pop>
+            </div>
+        </van-popup>
         <!-- 灯控色温 -->
         <van-popup
             overlay-style="background: rgba(0, 0, 0, 0.4)"
@@ -732,12 +753,19 @@ wepy.page({
     projectId: 'Pj1101080259',
     cardWidth: 0, // 动态获取卡片的宽度
     floorFeatItem: {}, // 地暖弹窗数据
+    airHandItem: {},
+    airPopHight: 0,
+    airHandData: {
+      maxValue: 0,
+      minValue: 0
+    }, // 地暖数据
     floorHeatData: {
       maxValue: 0,
       minValue: 0,
       len: false
     }, // 地暖数据
     floorfeatVisible: false, // 地暖弹窗
+    airHandVisible: false, // 空调手动弹窗
     curtainVisible: false, // 窗帘弹窗
     crutainType: {
       btnArr: [],
@@ -789,7 +817,7 @@ wepy.page({
     officeData: null,
     headScene: '', // 头部文案
     headImg: '', // 头部背景图片
-    options: { roomType: null, spaceId: 'Sp1101080259308f5ed92e964bc1b029038dea962de4' }, // 本地数据
+    options: { roomType: null, spaceId: 'Sp1101080259c4434730d12144ba890fe11f796d3143' }, // 本地数据
     sceneDetail: null,
     popList: [],
     listOffice: [
@@ -887,18 +915,6 @@ wepy.page({
             text: '已为您切换至适宜讨论的环境',
             status: 'ok'
           }
-                    // {
-                    // text: '照明灯光已全部为您开启',
-                    // status: 'ok'
-                    // },
-                    // {
-                    // text: '演示设备已为您准备',
-                    // status: 'ok'
-                    // },
-                    // {
-                    // text: '空调已为您开启,目标温度24℃',
-                    // status: 'ok'
-                    // }
         ]
       },
       {
@@ -912,22 +928,7 @@ wepy.page({
             text: '已为您切换至适宜演示的环境',
             status: 'ok'
           }
-                    // {
-                    // text: '主灯已为您关闭,氛围灯为您开启',
-                    // status: 'ok'
-                    // },
-                    // {
-                    // text: '演示设备已为您开启',
-                    // status: 'ok'
-                    // },
-                    // {
-                    // text: '空调已为您开启,目标温度24℃',
-                    // status: 'ok'
-                    // },
-                    // {
-                    // text: '窗帘已为您关闭',
-                    // status: 'ok'
-                    // }
+
         ]
       },
       {
@@ -941,22 +942,7 @@ wepy.page({
             text: '会议室内设备已切换至节能模式',
             status: 'ok'
           }
-                    // {
-                    // text: '照明灯光2min后将全部关闭',
-                    // status: 'ok'
-                    // },
-                    // {
-                    // text: '演示设备已为您关闭',
-                    // status: 'ok'
-                    // },
-                    // {
-                    // text: '房间温度将维持26℃',
-                    // status: 'ok'
-                    // },
-                    // {
-                    // text: '窗帘已为您关闭',
-                    // status: 'ok'
-                    // }
+
         ]
       }
     ],
@@ -1279,6 +1265,28 @@ wepy.page({
     setCanScroll(val) {
       this.canscroll = val
     },
+    // 空调弹框
+    openAirHandPop(val, tempObj) {
+      this.airHandItem = val
+      let hight = 0
+      if ((val.boundPoint.gearSetBound || val.boundPoint.modeSetBound) && val.boundPoint.tempSetBound) {
+        hight = 45
+      }
+      if ((val.boundPoint.gearSetBound || val.boundPoint.modeSetBound) && val.boundPoint.tempSetBound) {
+        hight = 55
+      }
+      if (val.boundPoint.gearSetBound && val.boundPoint.modeSetBound && val.boundPoint.tempSetBound) {
+        hight = 70
+      }
+      this.airPopHight = hight
+      this.airHandData = tempObj
+      this.airHandVisible = true
+    },
+    changeAirHandOrder(pobj, deviceObjCopy) {
+      this.$refs.airHandCard.changeOneAir(pobj.id, pobj.code, pobj.value, deviceObjCopy)
+      this.airHandItem = deviceObjCopy
+      console.log('changeAirHandOrderchangeAirHandOrder')
+    },
         // 地暖弹框
     openFloorFeatPop(val) {
       this.floorfeatVisible = true
@@ -1800,7 +1808,21 @@ wepy.page({
       }
       return newStr
     },
-    checkLevel(value, name) {
+    checkLevel(value, name, seasonType) {
+      let tdbParam = {
+        Cooling: {
+          range: [22, 26],
+          text: ['偏冷', '舒适', '偏热']
+        },
+        Warm: {
+          range: [18, 24],
+          text: ['偏冷', '舒适', '偏热']
+        },
+        Transition: {
+          range: [18, 26],
+          text: ['偏冷', '舒适', '偏热']
+        }
+      }
       let objList = {
         humidity: {
           range: [30, 70],
@@ -1823,10 +1845,9 @@ wepy.page({
           text: ['偏冷', '舒适', '偏热']
         }
       }
-      let sortArr = [value, ...objList[name].range].sort((a, b) => {
-        return a - b
-      })
-
+      seasonType = seasonType || 'Transition'
+      objList.temper = tdbParam[seasonType]
+      let sortArr = [value, ...objList[name].range].sort((a, b) => { return a - b })
       let level = sortArr.findIndex(item => item === value)
       let levelTxt = objList[name].text[level]
       return { level, levelTxt }
@@ -2639,7 +2660,7 @@ page {
             align-items: center;
             flex-shrink: 0;
             &.selScene {
-                background: #ffe723;
+                background:  rgba(61, 203, 204, 0.3);
             }
             &.firstScene {
                 width: auto;
@@ -3217,6 +3238,7 @@ backgroundColor: '#f7f8fa',
 usingComponents: {
 "Curtain-Pop":'./Curtain/curtainPop.wpy',
 "Floor-Pop":'./FloorHeating/floorPop.wpy',
+       "airHand-Pop":'./airHand/airHandPop.wpy',
 "Floor-Heating":'./FloorHeating/floorHeating',
 "curtain-card":"./Curtain/curtain-card",
 'has-person':'./components/has-person.wpy',
@@ -3227,7 +3249,7 @@ usingComponents: {
 "work-scene-hand":"./components/work-scene-hand",
 "work-scene":"./components/work-scene",
 "air-adjust":"./components/air-adjust",
-"air-adjust-hand":"./components/air-adjust-hand",
+        "air-hand-card":"./airHand/air-hand-card",
 "air-feedback":"./components/air-feedback",
 "lamp-adjust":"./components/lamp-adjust",
 "lamp-colour":"./components/lamp-colour",

+ 130 - 130
src/packagesEnv/pages/officehome/workOvertime-hand.wpy

@@ -41,7 +41,7 @@
             line-height: 100rpx;
             &.sub {
                 border-color: white;
-                background: #ffe723;
+                background:  rgba(61, 203, 204, 0.3);
                 width: 390rpx;
             }
             &.dis-sub {
@@ -109,17 +109,17 @@
     </div>
 </template>
 <script>
-import wepy from '@wepy/core';
-import store from '@/store';
+import wepy from '@wepy/core'
+import store from '@/store'
 import { saveBatchCustomScene } from '@/packagesEnv/api/officehome.js'
 
-import config from '@/config';
-import moment from 'moment';
+import config from '@/config'
+import moment from 'moment'
 import {
     getNowDate,
     getNowTime,
     SliderUnit
-} from '@/service/meetingTimes';
+} from '@/service/meetingTimes'
 import {
     formateBookedList,
     formateTimeValue,
@@ -132,7 +132,7 @@ import {
 } from '@/packagesEnv/pages/common.js'
 
 let resData = {}
-let timer = null;
+let timer = null
 wepy.component({
   props: {
     equipConfig: Array, // 设备配置是否可控
@@ -165,12 +165,12 @@ wepy.component({
     workDayTime(newVal) {
       if (newVal) {
         resData = newVal
-        this.spaceEquipList = resData.data[0].equipmentList;
-        this.cusTime();
+        this.spaceEquipList = resData.data[0].equipmentList
+        this.cusTime()
       }
     },
     countDownTwoMin(ss) {
-      this.text = '';
+      this.text = ''
       if (ss < 60 && ss !== 0) {
         this.sstext = `( ${ss} s )`
       } else {
@@ -179,28 +179,28 @@ wepy.component({
     }
   },
   ready() {
-    this.setDefaultPeriod();
+    this.setDefaultPeriod()
   },
   detached() {
   },
   methods: {
     timeRangeLowLastTime(val, type) {
-      let newVal;
+      let newVal
             // 服务定制中,判断之后的一个服务定制开始时间
       if (type === '中') {
-        let arrTimes = [];
+        let arrTimes = []
         this.customList.map(item => {
-          arrTimes.push(item.openStartTime);
-          arrTimes.push(item.openEndTime);
+          arrTimes.push(item.openStartTime)
+          arrTimes.push(item.openEndTime)
         })
-        arrTimes = Array.from(new Set(arrTimes));
+        arrTimes = Array.from(new Set(arrTimes))
         for (let i = 0; i < arrTimes.length; i++) {
-          const item = arrTimes[i];
+          const item = arrTimes[i]
           if (item > val && (item - val <= 2)) {
-            newVal = item;
-            return newVal;
+            newVal = item
+            return newVal
           } else {
-            newVal = val + SliderUnit * 4;
+            newVal = val + SliderUnit * 4
             if (newVal > 24) {
               return 24
             }
@@ -208,7 +208,7 @@ wepy.component({
         }
       }
 
-      newVal = val + SliderUnit * 4;
+      newVal = val + SliderUnit * 4
       if (newVal > 24) {
         return 24
       }
@@ -217,14 +217,14 @@ wepy.component({
     cusTime() { // 服务定制时间及预约时段
       let copyResData = JSON.parse(JSON.stringify(resData));
       (copyResData.data || []).forEach(item => {
-        item.date = dateToDate(item.date);
-        this.customList = [];
+        item.date = dateToDate(item.date)
+        this.customList = []
         if (item.date === this.date) {
-          const spaceCustomContentList = item.spaceCustomContentList || []; // 服务定制
+          const spaceCustomContentList = item.spaceCustomContentList || [] // 服务定制
           spaceCustomContentList.map(cusItem => {
-            this.hasCus = true;
-            cusItem.startTime = cusItem.startTime ? cusItem.startTime : '000000';
-            cusItem.endTime = cusItem.endTime ? cusItem.endTime : '000000';
+            this.hasCus = true
+            cusItem.startTime = cusItem.startTime ? cusItem.startTime : '000000'
+            cusItem.endTime = cusItem.endTime ? cusItem.endTime : '000000'
 
             const obj = {
               start: cusItem.startTime,
@@ -232,8 +232,8 @@ wepy.component({
             }
             this.customTimeInit.push(obj)
 
-            const start = startimeToUnitTime(cusItem.startTime);
-            const end = endtimeToUnitTime(cusItem.endTime);
+            const start = startimeToUnitTime(cusItem.startTime)
+            const end = endtimeToUnitTime(cusItem.endTime)
 
             const cusObj = {
               openStartTime: formateTimeToValue(start),
@@ -243,12 +243,12 @@ wepy.component({
           })
 
           item.customSceneList && item.customSceneList.find(item => {
-            item.startDate = dateToDate(item.startDate);
+            item.startDate = dateToDate(item.startDate)
             item.endDate = dateToDate(item.endDate)
           })
           this.currentCheckedItem = item.customSceneList || []
         }
-      });
+      })
       if (!this.hasCus) { // 没有服务定制  当前值保持数组不为空
         const cusObj = {
           openStartTime: '',
@@ -258,39 +258,39 @@ wepy.component({
       }
       setTimeout(() => {
         this.roomData.bookedList = formateBookedList(this.currentCheckedItem)
-      }, 200);
+      }, 200)
     },
     handleCancel() { // 取消
       this.$emit('component-close-visible', false)
     },
     deleteOrAdd(type) { // 删除或者增加
-      const bookListDayArr = this.roomData.bookedList[this.date] || [];
-      let workType = 0;  // 0 预约加班,1 取消,2 加班(我来了), 3 我要离开
+      const bookListDayArr = this.roomData.bookedList[this.date] || []
+      let workType = 0  // 0 预约加班,1 取消,2 加班(我来了), 3 我要离开
       if (type === 'cancel') {
-        workType = 1;
+        workType = 1
       } else {
-        const nowTime = getNowTime().juggeValue;
+        const nowTime = getNowTime().juggeValue
         if ((this.period.start <= nowTime) && nowTime <= this.period.end && this.date === getNowDate()) {
-          workType = 2;
+          workType = 2
         } else {
-          workType = 0;
+          workType = 0
         }
       }
-      let historyBookList = []; // 历史选择的时段
-      let equipArr = [];
+      let historyBookList = [] // 历史选择的时段
+      let equipArr = []
       bookListDayArr && bookListDayArr.forEach((item, idx) => {
         if (
                     (this.period.start <= item.start && item.start <= this.period.end) ||
                     (this.period.start <= item.end && item.end <= this.period.end) ||
                     (item.start <= this.period.start && this.period.end <= item.end)
                 ) {  // 跟选择的时段有交集
-          item.type = 1;
+          item.type = 1
           historyBookList.push(item)
-          const sceneEquipList = item.sceneEquipList || [];
+          const sceneEquipList = item.sceneEquipList || []
           equipArr = [...equipArr, ...sceneEquipList]
         }
       })
-      const date = formateDateValue(this.date);
+      const date = formateDateValue(this.date)
       let newBooklist = {
         startDate: date,
         endDate: date,
@@ -304,23 +304,23 @@ wepy.component({
       return { historyBookList, newBooklist }
     },
     bookAndPried(newBooklist, historyBookList) {
-      const newBookStart = newBooklist.startTime;
-      const newBookEnd = newBooklist.endTime;
+      const newBookStart = newBooklist.startTime
+      const newBookEnd = newBooklist.endTime
       let bookedrange = []; // 已选择的区间
       (historyBookList || []).forEach((item, idx) => {
-        bookedrange.push(item.startTime);
-        bookedrange.push(item.endTime);
+        bookedrange.push(item.startTime)
+        bookedrange.push(item.endTime)
       })
-      bookedrange = [...new Set(bookedrange)];
-      bookedrange.sort();
-      const bookedrangeStart = bookedrange[0];
-      const bookedrangeEnd = bookedrange[bookedrange.length - 1];
+      bookedrange = [...new Set(bookedrange)]
+      bookedrange.sort()
+      const bookedrangeStart = bookedrange[0]
+      const bookedrangeEnd = bookedrange[bookedrange.length - 1]
       return { newBookStart, newBookEnd, bookedrangeStart, bookedrangeEnd }
     },
         // 删除的时间 于服务定制的关系
     checkeDeleteCustom(newBookStart, newBookEnd, paramsArr) {
-      let deleStart = newBookStart;
-      let deleEnd = newBookEnd;
+      let deleStart = newBookStart
+      let deleEnd = newBookEnd
       this.customTimeInit.map(item => {
         if (deleStart < item.end && deleStart > item.start) {
           deleStart = item.end
@@ -329,13 +329,13 @@ wepy.component({
           deleEnd = item.start
         }
       })
-      let nowTime = moment().format('HHmmss');
+      let nowTime = moment().format('HHmmss')
             // 当日 当前时间 删除数据 表示 我要离开
       paramsArr.map(item => {
          // 0 为预约 2为我来了,设备参数不能传id
         if (item.type === 0 || item.type === 2) {
-          console.log(item, item.sceneEquipList);
-          let arr = item.sceneEquipList || [];
+          console.log(item, item.sceneEquipList)
+          let arr = item.sceneEquipList || []
           for (let i = 0; i < arr.length; i++) {
             const eq = arr[i]
             if (eq.id) {
@@ -344,14 +344,14 @@ wepy.component({
           }
         }
         if (nowTime >= deleStart && nowTime <= deleEnd) {
-          if (item.endDate != getNowDate()) return;
+          if (item.endDate != getNowDate()) return
           if (item.startTime >= deleStart && item.startTime <= deleEnd) {
-            item.type = 3;
-            item.endTimeReal = nowTime;
+            item.type = 3
+            item.endTimeReal = nowTime
           }
           if (item.endTime >= deleStart && item.endTime <= deleEnd) {
-            item.type = 3;
-            item.endTimeReal = nowTime;
+            item.type = 3
+            item.endTimeReal = nowTime
           }
         }
       })
@@ -359,34 +359,34 @@ wepy.component({
       return { deleStart, deleEnd, paramsArr }
     },
     bookListDelete() { // 删除一条加班记录
-      let { historyBookList, newBooklist } = this.deleteOrAdd('cancel');
-      let { newBookStart, newBookEnd, bookedrangeStart, bookedrangeEnd } = this.bookAndPried(newBooklist, historyBookList);
-      let saveBookList = [];
+      let { historyBookList, newBooklist } = this.deleteOrAdd('cancel')
+      let { newBookStart, newBookEnd, bookedrangeStart, bookedrangeEnd } = this.bookAndPried(newBooklist, historyBookList)
+      let saveBookList = []
       if (bookedrangeStart === newBookStart && bookedrangeEnd === newBookEnd) {
                 // 选区全部包括
       } else {
         if (bookedrangeStart === newBookStart) { // 选区的开始重合
-          newBooklist.startTime = newBookEnd;
-          newBooklist.endTime = bookedrangeEnd;
-          saveBookList.push(newBooklist);
-          console.log('选区的开始重合');
+          newBooklist.startTime = newBookEnd
+          newBooklist.endTime = bookedrangeEnd
+          saveBookList.push(newBooklist)
+          console.log('选区的开始重合')
         } else if (bookedrangeEnd === newBookEnd) { // 选区的结束重合
-          newBooklist.startTime = bookedrangeStart;
-          newBooklist.endTime = newBookStart;
-          saveBookList.push(newBooklist);
-          console.log('选区的结束重合');
+          newBooklist.startTime = bookedrangeStart
+          newBooklist.endTime = newBookStart
+          saveBookList.push(newBooklist)
+          console.log('选区的结束重合')
         } else { // 选区中间
-          newBooklist.startTime = bookedrangeStart;
-          newBooklist.endTime = newBookStart;
-          saveBookList.push(newBooklist);
+          newBooklist.startTime = bookedrangeStart
+          newBooklist.endTime = newBookStart
+          saveBookList.push(newBooklist)
           const newBooklistTwo = JSON.parse(JSON.stringify(newBooklist))
-          newBooklistTwo.startTime = newBookEnd;
-          newBooklistTwo.endTime = bookedrangeEnd;
-          saveBookList.push(newBooklistTwo);
-          console.log('选区的中间');
+          newBooklistTwo.startTime = newBookEnd
+          newBooklistTwo.endTime = bookedrangeEnd
+          saveBookList.push(newBooklistTwo)
+          console.log('选区的中间')
         }
       }
-      const nowTime = moment().format('HHmmss');
+      const nowTime = moment().format('HHmmss')
       saveBookList.find(item => {
         if (nowTime >= item.startTime && nowTime <= item.endTime) {
           item.type = 2
@@ -395,24 +395,24 @@ wepy.component({
         }
       })
 
-      let arr = [...historyBookList, ...saveBookList];
-      let params = [];
+      let arr = [...historyBookList, ...saveBookList]
+      let params = []
       arr.map(item => {
         if (item.startTime < item.endTime) {
-          params.push(item);
+          params.push(item)
         }
       })
-      let { deleStart, deleEnd, paramsArr } = this.checkeDeleteCustom(newBookStart, newBookEnd, params);
-      let _this = this;
+      let { deleStart, deleEnd, paramsArr } = this.checkeDeleteCustom(newBookStart, newBookEnd, params)
+      let _this = this
       wx.showModal({
         title: '',
         content: `删除 ${formateTimeToColon(deleStart)}-${formateTimeToColon(deleEnd)} 预约时间?`,
         success: function (sm) {
           if (sm.confirm) {
             saveBatchCustomScene({ 'historyBookList': paramsArr, type: 'delete' }).then(res => {
-              _this.$emit('component-set-countDown');
+              _this.$emit('component-set-countDown')
               _this.$emit('component-close-visible', false)
-            });
+            })
           } else {
                         // console.log('取消');
           }
@@ -425,13 +425,13 @@ wepy.component({
               this.roomData.bookedList[this.date] = arr */
     },
     setParamsEquiplist(historyEquips) {
-      const arr = this.$refs.refBookEquip.equipData;
+      const arr = this.$refs.refBookEquip.equipData
       let res = []
       for (let i = 0; i < arr.length; i++) {
-        const item = arr[i];
+        const item = arr[i]
         item.eqlist.map(eq => {
           for (let j = 0; j < this.equipConfig.length; j++) {
-            const cf = this.equipConfig[j];
+            const cf = this.equipConfig[j]
                         // 设备需要开启 且是受控状态
             if (eq.status && eq.id === cf.equipmentId && cf.isExeSpaceTime) {
               res.push({
@@ -446,14 +446,14 @@ wepy.component({
       let copyRes = JSON.parse(JSON.stringify(res))
             // 历史数据设备 推入到当前需要的
       for (let i = 0; i < historyEquips.length; i++) {
-        const ele = historyEquips[i];
-        let searchFlag = false;
+        const ele = historyEquips[i]
+        let searchFlag = false
         for (let j = 0; j < copyRes.length; j++) {
-          const jele = copyRes[j];
+          const jele = copyRes[j]
           if (ele.objectId !== jele.objectId) {
-            searchFlag = true;
+            searchFlag = true
           } else {
-            searchFlag = false;
+            searchFlag = false
           }
         }
         if (searchFlag) {
@@ -466,10 +466,10 @@ wepy.component({
     },
         // 提交的使用时间和服务定制的关系
     checkNowCustomTime(newBooklist) {
-      const serNewBookList = JSON.parse(JSON.stringify(newBooklist));
+      const serNewBookList = JSON.parse(JSON.stringify(newBooklist))
       this.customTimeInit.map(item => {
         if (newBooklist.startTime > item.start && newBooklist.startTime < item.end) {
-          serNewBookList.startTime = item.end;
+          serNewBookList.startTime = item.end
         }
         if (newBooklist.endTime > item.start && newBooklist.endTime < item.end) {
           serNewBookList.endTime = item.start
@@ -479,65 +479,65 @@ wepy.component({
     },
     handleSubmit() { // 提交申T请
       if (!this.canBooked) return
-      if (timer) return;
-      timer = setTimeout(() => { }, 1000 * 2);
-      this.canBooked = false;
-      let { historyBookList, newBooklist } = this.deleteOrAdd('save');
-      let { newBookStart, newBookEnd, bookedrangeStart, bookedrangeEnd } = this.bookAndPried(newBooklist, historyBookList);
+      if (timer) return
+      timer = setTimeout(() => { }, 1000 * 2)
+      this.canBooked = false
+      let { historyBookList, newBooklist } = this.deleteOrAdd('save')
+      let { newBookStart, newBookEnd, bookedrangeStart, bookedrangeEnd } = this.bookAndPried(newBooklist, historyBookList)
       if (bookedrangeStart <= newBookStart && newBookEnd <= bookedrangeEnd) {
         if (this.period.hasUuBooked) {
-          newBooklist.startTime = bookedrangeStart;
+          newBooklist.startTime = bookedrangeStart
           newBooklist.endTime = bookedrangeEnd
         }
       } else {
         if (((bookedrangeStart < newBookEnd) && (newBookEnd < bookedrangeEnd)) || newBookEnd === bookedrangeStart) {
                     //    开始时间早于 已经预约的时间
-          newBooklist.endTime = bookedrangeEnd;
+          newBooklist.endTime = bookedrangeEnd
         }
         if (((bookedrangeStart < newBookStart) && (newBookStart < bookedrangeEnd)) || newBookStart === bookedrangeEnd) {
                     // 结束时间时间晚于 已经预约的时间
-          newBooklist.startTime = bookedrangeStart;
+          newBooklist.startTime = bookedrangeStart
         }
       }
       newBooklist = this.checkNowCustomTime(newBooklist)
       newBooklist.sceneEquipList = this.setParamsEquiplist(newBooklist.sceneEquipList)
       saveBatchCustomScene({ historyBookList, newBooklist })
                 .then(res => {
-                  clearTimeout(timer);
-                  timer = null;
-                  this.$emit('component-set-countDown');
-                  this.$emit('component-close-visible', false);
+                  clearTimeout(timer)
+                  timer = null
+                  this.$emit('component-set-countDown')
+                  this.$emit('component-close-visible', false)
                 })
                 .catch(() => {
-                  clearTimeout(timer);
-                  timer = null;
+                  clearTimeout(timer)
+                  timer = null
                   this.$emit('component-set-countDown')
                   this.$emit('component-close-visible', false)
                 })
     },
     setDefaultPeriod() {    // 默认选中时间
-      let nowHour = getNowTime().juggeValue;
+      let nowHour = getNowTime().juggeValue
       if (this.customList.length) { // 有服务定制  服务定制向后两个小时
         for (let i = 0; i < this.customList.length; i++) {
-          const item = this.customList[i];
+          const item = this.customList[i]
 
-          const start = item.openStartTime;
-          const end = item.openEndTime;
+          const start = item.openStartTime
+          const end = item.openEndTime
           const realOpenEndTime = end + 0.5
           if (nowHour >= start && nowHour < realOpenEndTime) { // 服务定制中
             this.period = {
               start: realOpenEndTime,
               end: this.timeRangeLowLastTime(realOpenEndTime, '中'),
               from: 'outer'
-            };
-            break;
+            }
+            break
           }
           if (nowHour >= realOpenEndTime || nowHour === start) { // 服务定制后
             this.period = {
               start: nowHour,
               end: this.timeRangeLowLastTime(nowHour),
               from: 'outer'
-            };
+            }
           }
           if (nowHour < start) { // 服务定制前
             if ((start - nowHour) >= 2) {
@@ -545,15 +545,15 @@ wepy.component({
                 start: nowHour,
                 end: this.timeRangeLowLastTime(nowHour),
                 from: 'outer'
-              };
+              }
             } else {
               this.period = {
                 start: nowHour,
                 end: nowHour + (start - nowHour),
                 from: 'outer'
-              };
+              }
             }
-            break;
+            break
           }
         }
       } else { // 没有服务定制
@@ -561,26 +561,26 @@ wepy.component({
           start: nowHour,
           end: this.timeRangeLowLastTime(nowHour),
           from: 'outer'
-        };
+        }
       }
     },
     selectedPeriod({ start, end, hasUuBooked }) {
-      this.period = { start, end, hasUuBooked };
+      this.period = { start, end, hasUuBooked }
     },
     judgeCanSelectedEnd(canBooked) {
-      this.canBooked = canBooked;
+      this.canBooked = canBooked
     },
     changeSelectedData(date) {  // 选择日期
-      this.selectedDate(date);
-      this.hasCus = false;
-      this.cusTime();
+      this.selectedDate(date)
+      this.hasCus = false
+      this.cusTime()
     },
     selectedDate(date) {
-      this.date = date;
-      this.disabledPast = date == getNowDate();
+      this.date = date
+      this.disabledPast = date == getNowDate()
     },
     getServeTime(date) {
-      this.canBooked = false;
+      this.canBooked = false
     }
   }
 })

+ 94 - 94
src/packagesEnv/pages/officehome/workOvertime.wpy

@@ -29,7 +29,7 @@
             line-height: 100rpx;
             &.sub {
                 border-color: white;
-                background: #ffe723;
+                background:  rgba(61, 203, 204, 0.3);
                 width: 390rpx;
             }
             &.dis-sub {
@@ -87,17 +87,17 @@
     </div>
 </template>
 <script>
-import wepy from '@wepy/core';
-import store from '@/store';
+import wepy from '@wepy/core'
+import store from '@/store'
 import { saveBatchCustomScene } from '@/packagesEnv/api/officehome.js'
 
-import config from '@/config';
-import moment from 'moment';
+import config from '@/config'
+import moment from 'moment'
 import {
     getNowDate,
     getNowTime,
     SliderUnit
-} from '@/service/meetingTimes';
+} from '@/service/meetingTimes'
 import {
     formateBookedList,
     formateTimeValue,
@@ -109,14 +109,14 @@ import {
     startimeToUnitTime
 } from '@/packagesEnv/pages/common.js'
 function timeRangeLowLastTime(val) {
-  let newVal = val + SliderUnit * 4;
+  let newVal = val + SliderUnit * 4
   if (newVal > 24) {
     return 24
   }
   return newVal
 }
 let resData = {}
-let timer = null;
+let timer = null
 wepy.component({
   props: {
     localName: String,
@@ -151,11 +151,11 @@ wepy.component({
     workDayTime(newVal) {
       if (newVal) {
         resData = newVal
-        this.cusTime();
+        this.cusTime()
       }
     },
     countDownTwoMin(ss) {
-      this.text = '';
+      this.text = ''
       if (ss < 60 && ss !== 0) {
         this.sstext = `( ${ss} s )`
       } else {
@@ -164,7 +164,7 @@ wepy.component({
     }
   },
   ready() {
-    this.setDefaultPeriod();
+    this.setDefaultPeriod()
   },
   detached() {
   },
@@ -172,64 +172,64 @@ wepy.component({
     cusTime() { // 服务定制时间及预约时段
       let copyResData = JSON.parse(JSON.stringify(resData));
       (copyResData.data || []).forEach(item => {
-        item.date = dateToDate(item.date);
+        item.date = dateToDate(item.date)
         if (item.date === this.date) {
-          this.hasCus = true;
-          item.cusStartTime = item.cusStartTime ? item.cusStartTime : '000000';
-          item.cusEndTime = item.cusEndTime ? item.cusEndTime : '000000';
+          this.hasCus = true
+          item.cusStartTime = item.cusStartTime ? item.cusStartTime : '000000'
+          item.cusEndTime = item.cusEndTime ? item.cusEndTime : '000000'
           this.customTime = {
             start: item.cusStartTime,
             end: item.cusEndTime
           }
-          const start = startimeToUnitTime(item.cusStartTime);
-          const end = endtimeToUnitTime(item.cusEndTime);
-          this.openStartTime = formateTimeToValue(start);
-          this.openEndTime = formateTimeToValue(end) - 0.5;
+          const start = startimeToUnitTime(item.cusStartTime)
+          const end = endtimeToUnitTime(item.cusEndTime)
+          this.openStartTime = formateTimeToValue(start)
+          this.openEndTime = formateTimeToValue(end) - 0.5
 
           item.customSceneList && item.customSceneList.find(item => {
                         // console.log(item, 'yuyue');
-            item.startDate = dateToDate(item.startDate);
+            item.startDate = dateToDate(item.startDate)
             item.endDate = dateToDate(item.endDate)
           })
           this.currentCheckedItem = item.customSceneList || []
         }
-      });
+      })
       if (!this.hasCus) {
-        this.openStartTime = '';
-        this.openEndTime = '';
+        this.openStartTime = ''
+        this.openEndTime = ''
       }
       setTimeout(() => {
         this.roomData.bookedList = formateBookedList(this.currentCheckedItem)
-      }, 200);
+      }, 200)
     },
     handleCancel() { // 取消
       this.$emit('component-close-visible', false)
     },
     deleteOrAdd(type) { // 删除或者增加
-      const bookListDayArr = this.roomData.bookedList[this.date] || [];
-      let workType = 0;  // 0 预约加班,1 取消,2 加班(我来了), 3 最后一个走
+      const bookListDayArr = this.roomData.bookedList[this.date] || []
+      let workType = 0  // 0 预约加班,1 取消,2 加班(我来了), 3 最后一个走
       if (type === 'cancel') {
-        workType = 1;
+        workType = 1
       } else {
-        const nowTime = getNowTime().juggeValue;
+        const nowTime = getNowTime().juggeValue
         if ((this.period.start <= nowTime) && nowTime <= this.period.end) {
-          workType = 2;
+          workType = 2
         } else {
-          workType = 0;
+          workType = 0
         }
       }
-      let historyBookList = []; // 历史选择的时段
+      let historyBookList = [] // 历史选择的时段
       bookListDayArr && bookListDayArr.forEach((item, idx) => {
         if (
                     (this.period.start <= item.start && item.start <= this.period.end) ||
                     (this.period.start <= item.end && item.end <= this.period.end) ||
                     (item.start <= this.period.start && this.period.end <= item.end)
                 ) {  // 跟选择的时段有交集
-          item.type = 1;
+          item.type = 1
           historyBookList.push(item)
         }
       })
-      const date = formateDateValue(this.date);
+      const date = formateDateValue(this.date)
       let newBooklist = {
         startDate: date,
         endDate: date,
@@ -242,48 +242,48 @@ wepy.component({
       return { historyBookList, newBooklist }
     },
     bookAndPried(newBooklist, historyBookList) {
-      const newBookStart = newBooklist.startTime;
-      const newBookEnd = newBooklist.endTime;
+      const newBookStart = newBooklist.startTime
+      const newBookEnd = newBooklist.endTime
       let bookedrange = []; // 已选择的区间
       (historyBookList || []).forEach((item, idx) => {
-        bookedrange.push(item.startTime);
-        bookedrange.push(item.endTime);
+        bookedrange.push(item.startTime)
+        bookedrange.push(item.endTime)
       })
-      bookedrange = [...new Set(bookedrange)];
-      bookedrange.sort();
-      const bookedrangeStart = bookedrange[0];
-      const bookedrangeEnd = bookedrange[bookedrange.length - 1];
+      bookedrange = [...new Set(bookedrange)]
+      bookedrange.sort()
+      const bookedrangeStart = bookedrange[0]
+      const bookedrangeEnd = bookedrange[bookedrange.length - 1]
       return { newBookStart, newBookEnd, bookedrangeStart, bookedrangeEnd }
     },
     bookListDelete() { // 删除一条加班记录
-      let { historyBookList, newBooklist } = this.deleteOrAdd('cancel');
-      let { newBookStart, newBookEnd, bookedrangeStart, bookedrangeEnd } = this.bookAndPried(newBooklist, historyBookList);
-      let saveBookList = [];
+      let { historyBookList, newBooklist } = this.deleteOrAdd('cancel')
+      let { newBookStart, newBookEnd, bookedrangeStart, bookedrangeEnd } = this.bookAndPried(newBooklist, historyBookList)
+      let saveBookList = []
       if (bookedrangeStart === newBookStart && bookedrangeEnd === newBookEnd) {
                 // 选区全部包括
       } else {
         if (bookedrangeStart === newBookStart) { // 选区的开始重合
-          newBooklist.startTime = newBookEnd;
-          newBooklist.endTime = bookedrangeEnd;
-          saveBookList.push(newBooklist);
-          console.log('选区的开始重合');
+          newBooklist.startTime = newBookEnd
+          newBooklist.endTime = bookedrangeEnd
+          saveBookList.push(newBooklist)
+          console.log('选区的开始重合')
         } else if (bookedrangeEnd === newBookEnd) { // 选区的结束重合
-          newBooklist.startTime = bookedrangeStart;
-          newBooklist.endTime = newBookStart;
-          saveBookList.push(newBooklist);
-          console.log('选区的结束重合');
+          newBooklist.startTime = bookedrangeStart
+          newBooklist.endTime = newBookStart
+          saveBookList.push(newBooklist)
+          console.log('选区的结束重合')
         } else { // 选区中间
-          newBooklist.startTime = bookedrangeStart;
-          newBooklist.endTime = newBookStart;
-          saveBookList.push(newBooklist);
+          newBooklist.startTime = bookedrangeStart
+          newBooklist.endTime = newBookStart
+          saveBookList.push(newBooklist)
           const newBooklistTwo = JSON.parse(JSON.stringify(newBooklist))
-          newBooklistTwo.startTime = newBookEnd;
-          newBooklistTwo.endTime = bookedrangeEnd;
-          saveBookList.push(newBooklistTwo);
-          console.log('选区的中间');
+          newBooklistTwo.startTime = newBookEnd
+          newBooklistTwo.endTime = bookedrangeEnd
+          saveBookList.push(newBooklistTwo)
+          console.log('选区的中间')
         }
       }
-      const nowTime = moment().format('HHmmss');
+      const nowTime = moment().format('HHmmss')
       saveBookList.find(item => {
         if (nowTime >= item.startTime && nowTime <= item.endTime) {
           item.type = 2
@@ -292,15 +292,15 @@ wepy.component({
         }
       })
 
-      let arr = [...historyBookList, ...saveBookList];
-      let paramsArr = [];
+      let arr = [...historyBookList, ...saveBookList]
+      let paramsArr = []
       arr.map(item => {
         if (item.startTime < item.endTime) {
-          paramsArr.push(item);
+          paramsArr.push(item)
         }
       })
-      let deleStart = newBookStart;
-      let deleEnd = newBookEnd;
+      let deleStart = newBookStart
+      let deleEnd = newBookEnd
       if (deleStart < this.customTime.end && deleStart > this.customTime.start) {
         deleStart = this.customTime.end
       }
@@ -308,16 +308,16 @@ wepy.component({
         deleEnd = this.customTime.start
       }
 
-      let _this = this;
+      let _this = this
       wx.showModal({
         title: '',
         content: `删除 ${formateTimeToColon(deleStart)}-${formateTimeToColon(deleEnd)} 预约时间?`,
         success: function (sm) {
           if (sm.confirm) {
             saveBatchCustomScene({ 'historyBookList': paramsArr, type: 'delete' }).then(res => {
-              _this.$emit('component-set-countDown');
+              _this.$emit('component-set-countDown')
               _this.$emit('component-close-visible', false)
-            });
+            })
           } else {
                         // console.log('取消');
           }
@@ -331,24 +331,24 @@ wepy.component({
     },
     handleSubmit() { // 提交申T请
       if (!this.canBooked) return
-      if (timer) return;
-      timer = setTimeout(() => { }, 1000 * 2);
-      this.canBooked = false;
-      let { historyBookList, newBooklist } = this.deleteOrAdd('save');
-      let { newBookStart, newBookEnd, bookedrangeStart, bookedrangeEnd } = this.bookAndPried(newBooklist, historyBookList);
+      if (timer) return
+      timer = setTimeout(() => { }, 1000 * 2)
+      this.canBooked = false
+      let { historyBookList, newBooklist } = this.deleteOrAdd('save')
+      let { newBookStart, newBookEnd, bookedrangeStart, bookedrangeEnd } = this.bookAndPried(newBooklist, historyBookList)
       if (bookedrangeStart <= newBookStart && newBookEnd <= bookedrangeEnd) {
         if (this.period.hasUuBooked) {
-          newBooklist.startTime = bookedrangeStart;
+          newBooklist.startTime = bookedrangeStart
           newBooklist.endTime = bookedrangeEnd
         }
       } else {
         if (((bookedrangeStart < newBookEnd) && (newBookEnd < bookedrangeEnd)) || newBookEnd === bookedrangeStart) {
                     //    开始时间早于 已经预约的时间
-          newBooklist.endTime = bookedrangeEnd;
+          newBooklist.endTime = bookedrangeEnd
         }
         if (((bookedrangeStart < newBookStart) && (newBookStart < bookedrangeEnd)) || newBookStart === bookedrangeEnd) {
                     // 结束时间时间晚于 已经预约的时间
-          newBooklist.startTime = bookedrangeStart;
+          newBooklist.startTime = bookedrangeStart
         }
       }
       if (newBooklist.startTime > this.customTime.start &&
@@ -362,21 +362,21 @@ wepy.component({
 
       saveBatchCustomScene({ historyBookList, newBooklist })
       .then(res => {
-        clearTimeout(timer);
-        timer = null;
+        clearTimeout(timer)
+        timer = null
         this.$emit('component-set-countDown')
         this.$emit('component-close-visible', false)
         // this.canBooked = true;
       })
       .catch(() => {
-        clearTimeout(timer);
-        timer = null;
+        clearTimeout(timer)
+        timer = null
         this.$emit('component-set-countDown')
         this.$emit('component-close-visible', false)
       })
     },
     setDefaultPeriod() {    // 默认选中时间
-      let nowHour = getNowTime().juggeValue;
+      let nowHour = getNowTime().juggeValue
       if (this.openStartTime !== this.openEndTime) { // 有服务定制  服务定制向后两个小时
         const realOpenEndTime = this.openEndTime + 0.5
         if (nowHour > this.openStartTime && nowHour < realOpenEndTime) { // 服务定制中
@@ -384,15 +384,15 @@ wepy.component({
             start: realOpenEndTime,
             end: timeRangeLowLastTime(realOpenEndTime),
             from: 'outer'
-          };
+          }
         }
         if (nowHour >= realOpenEndTime || nowHour === this.openStartTime) { // 服务定制后
           this.period = {
             start: nowHour,
             end: timeRangeLowLastTime(nowHour),
             from: 'outer'
-          };
-          return;
+          }
+          return
         }
         if (nowHour < this.openStartTime) { // 服务定制前
           if ((this.openStartTime - nowHour) >= 2) {
@@ -400,13 +400,13 @@ wepy.component({
               start: nowHour,
               end: timeRangeLowLastTime(nowHour),
               from: 'outer'
-            };
+            }
           } else {
             this.period = {
               start: nowHour,
               end: nowHour + (this.openStartTime - nowHour),
               from: 'outer'
-            };
+            }
           }
         }
       } else { // 没有服务定制
@@ -414,23 +414,23 @@ wepy.component({
           start: nowHour,
           end: timeRangeLowLastTime(nowHour),
           from: 'outer'
-        };
+        }
       }
     },
     selectedPeriod({ start, end, hasUuBooked }) {
-      this.period = { start, end, hasUuBooked };
+      this.period = { start, end, hasUuBooked }
     },
     judgeCanSelectedEnd(canBooked) {
-      this.canBooked = canBooked;
+      this.canBooked = canBooked
     },
     changeSelectedData(date) {  // 选择日期
-      this.selectedDate(date);
+      this.selectedDate(date)
             //   this.getServeTime(date);
-      this.cusTime();
+      this.cusTime()
     },
     selectedDate(date) {
-      this.date = date;
-      this.disabledPast = date == getNowDate();
+      this.date = date
+      this.disabledPast = date == getNowDate()
     },
     getServeTime(date) {
             /*  if (!this.roomId) {
@@ -438,7 +438,7 @@ wepy.component({
              } */
             //   this.openStartTime = formateTimeToValue('24:00');
             //   this.openEndTime = formateTimeToValue('24:00');
-      this.canBooked = false;
+      this.canBooked = false
             /*  getMeetingRoomServerTime({
                id: this.roomId,
                day: date