Browse Source

Merge branch 'master' of http://39.106.8.246:3003/sagacloud/sagacloud-sagacare-weChat into feature

chenzhen2 1 year ago
parent
commit
d239e13263
26 changed files with 4676 additions and 3502 deletions
  1. 8 9
      src/app.wpy
  2. 19 20
      src/config/index.js
  3. 70 68
      src/packagesEnv/api/officehome.js
  4. 68 66
      src/packagesEnv/pages/officehome/Curtain/curtain-card.wpy
  5. 21 21
      src/packagesEnv/pages/officehome/Curtain/curtainPop.wpy
  6. 11 11
      src/packagesEnv/pages/officehome/Curtain/curtainSlider.wpy
  7. 14 13
      src/packagesEnv/pages/officehome/components/has-person.wpy
  8. 127 0
      src/packagesEnv/pages/officehome/Header/residen-work.wpy
  9. 80 0
      src/packagesEnv/pages/officehome/Header/space-basic.wpy
  10. 995 0
      src/packagesEnv/pages/officehome/airHand/air-hand-card.wpy
  11. 423 0
      src/packagesEnv/pages/officehome/airHand/airHandPop.wpy
  12. 10 11
      src/packagesEnv/pages/officehome/comComponents/Switch.wpy
  13. 208 208
      src/packagesEnv/pages/officehome/components/air-adjust-hand.wpy
  14. 79 79
      src/packagesEnv/pages/officehome/components/air-adjust.wpy
  15. 103 106
      src/packagesEnv/pages/officehome/components/all-close.wpy
  16. 39 39
      src/packagesEnv/pages/officehome/components/date-selector.wpy
  17. 16 16
      src/packagesEnv/pages/officehome/components/switch-small.wpy
  18. 20 20
      src/packagesEnv/pages/officehome/components/switch.wpy
  19. 22 22
      src/packagesEnv/pages/officehome/components/voice-adjust.wpy
  20. 11 11
      src/packagesEnv/pages/officehome/components/work-off.wpy
  21. 1 1
      src/packagesEnv/pages/officehome/components/work-scene-hand.wpy
  22. 1 1
      src/packagesEnv/pages/officehome/components/work-scene.wpy
  23. 2098 2550
      src/packagesEnv/pages/officehome/index.wpy
  24. 131 130
      src/packagesEnv/pages/officehome/workOvertime-hand.wpy
  25. 95 94
      src/packagesEnv/pages/officehome/workOvertime.wpy
  26. 6 6
      src/store/company.js

+ 8 - 9
src/app.wpy

@@ -10,20 +10,19 @@
 </style>
 
 <script>
-import wepy from '@wepy/core';
-import eventHub from './common/eventHub';
-import vuex from '@wepy/x';
-
-wepy.use(vuex);
+import wepy from '@wepy/core'
+import eventHub from './common/eventHub'
+import vuex from '@wepy/x'
 
+wepy.use(vuex)
 
 wepy.app({
   hooks: {
     // App 级别 hook,对整个 App 生效
     // 同时存在 Page hook 和 App hook 时,优先执行 Page hook,返回值再交由 App hook 处
     'before-setData': function (dirty) {
-      console.log('setData dirty: ', dirty);
-      return dirty;
+    //   console.log('setData dirty: ', dirty);
+      return dirty
     }
   },
   globalData: {
@@ -31,7 +30,7 @@ wepy.app({
   },
 
   onLaunch() {
-    //this.testAsync();
+    // this.testAsync();
    // eventHub.$on('app-launch', (...args) => {
     //  console.log('app-launch event emitted, the params are:');
     //  console.log(args);
@@ -40,7 +39,7 @@ wepy.app({
 
   methods: {
   }
-});
+})
 </script>
 <config>
 {

+ 19 - 20
src/config/index.js

@@ -1,34 +1,33 @@
 
 // featuresVersion属于哪个功能版本: experience-体验版, building-写字楼版, enterprise-企业版
 // npm run server-test-building 通过增加node_env 参数来判断test-building, test 是环境是test 还是prod ,building参数即是featuresVersion参数值
-let envValus = NODE_ENV.split('-');
-let env = envValus[0];
-let featuresVersion = envValus[1];
-let projectName = envValus[2] || '';
+let envValus = NODE_ENV.split('-')
+let env = envValus[0]
+let featuresVersion = envValus[1]
+let projectName = envValus[2] || ''
 // 根据在package.json中配置的不同编译命令,引用/config下不同的配置文件
-import base from './base';
-import demo from './demo';
-import dev from './dev';
-import test from './test';
-import prod from './prod';
-let config;
+import base from './base'
+import demo from './demo'
+import dev from './dev'
+import test from './test'
+import prod from './prod'
+let config
 if (env == 'dev') {
-  config = dev;
+  config = dev
 }
 
 if (env === 'prod') {
-  config = prod;
+  config = prod
 }
 
-
- const setupService = '/duoduo-service/setup-service/'
- const objectService = '/duoduo-service/object-service/'
- const duoduoenvService = '/duoduo-service/duoduoenv-service/'
+const setupService = '/duoduo-service/setup-service/'
+const objectService = '/duoduo-service/object-service/'
+const duoduoenvService = '/duoduo-service/duoduoenv-service/'
 
 config = Object.assign(base, config, {
   // h5PagePath: config.h5Origin + '/#',
-  h5PagePath: "http://localhost:8081/" + '/#',
-  h5StaticPath: "http://localhost:8081/" + '/static/WeChat',
+  h5PagePath: 'http://localhost:8081/' + '/#',
+  h5StaticPath: '/static',
   // h5StaticPath: config.h5Origin + '/static/WeChat',
   featuresVersion,
   projectName,
@@ -36,6 +35,6 @@ config = Object.assign(base, config, {
   objectService,
   duoduoenvService,
   env
-});
+})
 
-export default Object.freeze(config)
+export default Object.freeze(config)

+ 70 - 68
src/packagesEnv/api/officehome.js

@@ -1,16 +1,18 @@
-import $http from '@/common/request.js';
-import config from '@/config';
-import store from '@/store/index.js';
+import $http from '@/common/request.js'
+import config from '@/config'
+import store from '@/store/index.js'
 
 function storeUser() {
-  return store.state.user.userInfo;
+  return {
+    tag: '20247ac1b24e82760a733485969ef7ee',
+    userId: '9a1ecfbacb6b4f249bf2dd3ec7793ead',
+    phone: '17611228068',
+    userName: '安小霞'
+  }
 }
 
 function getProjectId() {
-  return (
-    store.state.company.companyConfig &&
-    store.state.company.companyConfig.sagacareProjectId
-  );
+  return 'Pj1101080259'
 }
 
 function commonParams() {
@@ -18,7 +20,7 @@ function commonParams() {
     config.brsgServer.pubname
   }&projectId=${getProjectId()}&userName=${storeUser().userName}&userPhone=${
     storeUser().phone
-  }&userId=${storeUser().userId}`;
+  }&userId=${storeUser().userId}`
 }
 
 // 获取地暖
@@ -29,7 +31,7 @@ function querySapceFloorHeating(params) {
     url: `/duoduo-service/duoduoenv-service/ctrl/querySapceFloorHeating?${commonParams()}&spaceId=${params.spaceId}`,
     errorSave: true,
     method: 'get'
-  });
+  })
 }
 
 //  设置设备
@@ -41,7 +43,7 @@ function setEquipeHttp(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     data: JSON.stringify(params)
-  });
+  })
 }
 
 // 获取设备
@@ -53,7 +55,7 @@ function getObjectDataEqpGroupHttp(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     data: JSON.stringify({ ...params })
-  });
+  })
 }
 
 // 改变场景
@@ -65,7 +67,7 @@ function switchoverSceneHttp(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     data: JSON.stringify({ ...params, projectId: getProjectId() })
-  });
+  })
 }
 // 获得空间当前会议室场景
 function getMeetingSceneHttp(params) {
@@ -77,7 +79,7 @@ function getMeetingSceneHttp(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     method: 'get'
-  });
+  })
 }
 // 获得空间场景
 function querySpaceSceneConfigHttp(params) {
@@ -89,7 +91,7 @@ function querySpaceSceneConfigHttp(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     method: 'get'
-  });
+  })
 }
 
 // 设备
@@ -102,7 +104,7 @@ function getEquipmentListHttp(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     method: 'POST'
-  });
+  })
 }
 // set 设备
 function setEquipmentHttp(params) {
@@ -113,7 +115,7 @@ function setEquipmentHttp(params) {
     errorSave: true,
     method: 'POST',
     data: JSON.stringify({ ...params, projectId: getProjectId() })
-  });
+  })
 }
 
 // 详情页 面积图
@@ -126,7 +128,7 @@ function getChartListHTTP(params) {
       params.spaceId
     }&funcid=${params.funcid}`,
     method: 'get'
-  });
+  })
 }
 // 办公空间
 function getSpaceAdjustList(params) {
@@ -141,7 +143,7 @@ function getSpaceAdjustList(params) {
       ...params,
       criteria: { ...params.criteria, projectId: getProjectId() }
     })
-  });
+  })
 }
 
 //  温度上下限
@@ -152,7 +154,7 @@ function getTempRangeHttp() {
     isNotShowErrorToast: true,
     errorSave: true,
     method: 'get'
-  });
+  })
 }
 
 // 天气预报
@@ -163,7 +165,7 @@ function getWeather() {
     url: `/duoduo-service/object-service/weather/getCurrentWeather?${commonParams()}`,
     errorSave: true,
     method: 'get'
-  });
+  })
 }
 //  空调 - 调节文案/空调信息
 function getFeedbackDocumentsHttp(params) {
@@ -174,7 +176,7 @@ function getFeedbackDocumentsHttp(params) {
     errorSave: true,
     method: 'POST',
     data: JSON.stringify(params)
-  });
+  })
 }
 
 //  空调 调节
@@ -186,7 +188,7 @@ function changeTempHttp(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     data: JSON.stringify({ ...params, projectId: getProjectId() })
-  });
+  })
 }
 
 //  手动控制 下发指令
@@ -198,7 +200,7 @@ function changeManualTempHttp(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     data: JSON.stringify(params)
-  });
+  })
 }
 
 // 查询空间空调信息
@@ -212,7 +214,7 @@ function querySpaceConditioners(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     method: 'GET'
-  });
+  })
 }
 
 // // 空调 调节
@@ -236,12 +238,12 @@ function getSetTimeHttp(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     method: 'GET'
-  });
+  })
 }
 
 // 更改 定制时间
 function changeSetTimeHttp(params) {
-  params = { ...params, projectId: getProjectId() };
+  params = { ...params, projectId: getProjectId() }
   return $http({
     serverSp: config.brsgServer.duoduoUrl,
     url: `/server/customScene/create?${commonParams()}`,
@@ -249,7 +251,7 @@ function changeSetTimeHttp(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     data: JSON.stringify(params)
-  });
+  })
 }
 
 // 灯的状态
@@ -262,7 +264,7 @@ function getLampHttp(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     method: 'GET'
-  });
+  })
 }
 
 // 批量 开关灯
@@ -274,7 +276,7 @@ function setallLampHttp(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     data: JSON.stringify(params)
-  });
+  })
 }
 
 // 全部关闭 关灯 走廊的灯 晚关
@@ -286,7 +288,7 @@ function specialLightSetHttp(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     data: JSON.stringify(params)
-  });
+  })
 }
 // 开关失败时 定时查询灯状态
 function getStatusHttp(params) {
@@ -297,7 +299,7 @@ function getStatusHttp(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     data: JSON.stringify(params)
-  });
+  })
 }
 // 插座-列表
 function getSocketHttp(params) {
@@ -309,7 +311,7 @@ function getSocketHttp(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     method: 'GET'
-  });
+  })
 }
 // 插座-控制
 function setSocketHttp(params) {
@@ -320,7 +322,7 @@ function setSocketHttp(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     data: JSON.stringify(params)
-  });
+  })
 }
 // 查询是否是过渡季
 function getSeasonType(params) {
@@ -330,7 +332,7 @@ function getSeasonType(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     method: 'GET'
-  });
+  })
 }
 // 查询所有空间设备
 function queryEquipStatistics(params) {
@@ -340,7 +342,7 @@ function queryEquipStatistics(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     method: 'GET'
-  });
+  })
 }
 //  批量空调 调节
 function changeAllAirHttp(params) {
@@ -352,50 +354,50 @@ function changeAllAirHttp(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     data: JSON.stringify(params)
-  });
+  })
 }
 
 // 批量取消和申请加班
 function saveBatchCustomScene(params) {
-  let paramsArr = JSON.parse(JSON.stringify(params.historyBookList));
+  let paramsArr = JSON.parse(JSON.stringify(params.historyBookList))
   paramsArr.find((item) => {
-    item.customSceneEqType = 'ALL';
-    if (!item.sceneEquipList) item.sceneEquipList = [];
-  });
+    item.customSceneEqType = 'ALL'
+    if (!item.sceneEquipList) item.sceneEquipList = []
+  })
   if (params.type !== 'workOff' && params.type !== 'delete') {
     if (
       params.newBooklist &&
       params.newBooklist.startTime &&
       params.newBooklist.startTime !== ''
     ) {
-      params.newBooklist.projectId = getProjectId();
-      params.newBooklist.sourceType = config.brsgServer.pubname;
-      params.newBooklist.userId = storeUser().userId;
-      params.newBooklist.userPhone = storeUser().phone;
-      params.newBooklist.userName = storeUser().userName;
+      params.newBooklist.projectId = getProjectId()
+      params.newBooklist.sourceType = config.brsgServer.pubname
+      params.newBooklist.userId = storeUser().userId
+      params.newBooklist.userPhone = storeUser().phone
+      params.newBooklist.userName = storeUser().userName
     }
     if (paramsArr.length > 0) {
       paramsArr.find((item) => {
-        item.startDate = item.startDate.replace(/-/g, '');
-        item.endDate = item.startDate;
-      });
+        item.startDate = item.startDate.replace(/-/g, '')
+        item.endDate = item.startDate
+      })
     }
-    params.newBooklist && paramsArr.push(params.newBooklist);
+    params.newBooklist && paramsArr.push(params.newBooklist)
   }
   if (params.type === 'delete') {
     paramsArr.find((item) => {
-      item.startDate = item.startDate.replace(/-/g, '');
-      item.endDate = item.startDate;
-      item.customSceneEqType = 'ALL';
-      item.projectId = getProjectId();
-      item.sourceType = config.brsgServer.pubname;
-      item.userId = storeUser().userId;
-      item.userPhone = storeUser().phone;
-      item.userName = storeUser().userName;
-    });
+      item.startDate = item.startDate.replace(/-/g, '')
+      item.endDate = item.startDate
+      item.customSceneEqType = 'ALL'
+      item.projectId = getProjectId()
+      item.sourceType = config.brsgServer.pubname
+      item.userId = storeUser().userId
+      item.userPhone = storeUser().phone
+      item.userName = storeUser().userName
+    })
   }
 
-  console.log(paramsArr, 'paramsArrparamsArr');
+  console.log(paramsArr, 'paramsArrparamsArr')
   return $http({
     serverSp: config.brsgServer.duoduoUrl,
     url: `/server/customScene/saveBatchCustomScene?${commonParams()}`,
@@ -403,7 +405,7 @@ function saveBatchCustomScene(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     data: JSON.stringify(paramsArr)
-  });
+  })
 }
 // 查询加班记录
 function queryCustomAndScence(params) {
@@ -415,7 +417,7 @@ function queryCustomAndScence(params) {
     method: 'GET',
     isNotShowErrorToast: true,
     errorSave: true
-  });
+  })
 }
 
 function changeDefaultSpace(params) {
@@ -424,7 +426,7 @@ function changeDefaultSpace(params) {
     method: 'POST',
     isNotShowErrorToast: true,
     errorSave: true
-  });
+  })
 }
 // 设备运行配置
 function queryEquipmentRunConfig(params) {
@@ -434,7 +436,7 @@ function queryEquipmentRunConfig(params) {
     method: 'GET',
     isNotShowErrorToast: true,
     errorSave: true
-  });
+  })
 }
 
 // ---权限控制---
@@ -446,7 +448,7 @@ function queryProjectConfig() {
     method: 'GET',
     isNotShowErrorToast: true,
     errorSave: true
-  });
+  })
 }
 // 空间控制权限
 function queryUserControlInfo() {
@@ -456,7 +458,7 @@ function queryUserControlInfo() {
     method: 'GET',
     isNotShowErrorToast: true,
     errorSave: true
-  });
+  })
 }
 // 会议室控制权限
 function querySpaceMeetingInfo(params) {
@@ -467,7 +469,7 @@ function querySpaceMeetingInfo(params) {
     isNotShowErrorToast: true,
     errorSave: true,
     data: JSON.stringify(params)
-  });
+  })
 }
 
 export {
@@ -505,4 +507,4 @@ export {
   querySpaceConditioners,
   changeManualTempHttp,
   changeDefaultSpace
-};
+}

+ 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() {

+ 14 - 13
src/packagesEnv/pages/officehome/components/has-person.wpy

@@ -1,26 +1,27 @@
 <style lang="less" scoped>
 .has-person {
-    margin-left: 24rpx;
-    height: 40rpx;
-    width: 110rpx;
-    border-radius: 20rpx;
-    background: #edf1f5;
     display: flex;
     justify-content: center;
     align-items: center;
+    margin-left: 24rpx;
+    height: 36rpx;
+    width: 92rpx;
+    border-radius: 24rpx;
+    background: rgba(0, 0, 0, 0.16);
+    padding: 0px 8rpx 0px 8rpx;
     .img-box {
         height: 32rpx;
         width: 32rpx;
     }
     .text-box {
         margin-left: 4rpx;
-        font-family: Inter;
-        font-size: 24rpx;
-        font-weight: 400;
-        line-height: 32rpx;
-        color: #626c78;
+        font-family: PingFang SC;
+        font-size: 22rpx;
+        font-weight: 500;
+        line-height: 36rpx;
+        color: rgba(255, 255, 255, 1);;
         .notHas {
-            color: #8b949e;
+            color: rgba(255, 255, 255, 1);
         }
     }
 }
@@ -42,8 +43,8 @@
     </div>
 </template>
 <script>
-import wepy from '@wepy/core';
-import config from '@/config';
+import wepy from '@wepy/core'
+import config from '@/config'
 
 wepy.component({
   props: {

+ 127 - 0
src/packagesEnv/pages/officehome/Header/residen-work.wpy

@@ -0,0 +1,127 @@
+<!-- 常驻工区--> 
+<template>
+    <div>
+        <div
+            class="set-residen-work"
+            @click="showSaveSpace"
+            v-show="!IsResiden"
+        >
+            <span class="set-text">设置常驻</span>
+            <image
+                class="spimg"
+                :src="h5StaticPath+'arrow.svg'"
+            />
+        </div>
+        <div class="residen-work" v-show="IsResiden">
+            <span class="just-text">常驻工区</span>
+        </div>
+    </div>
+
+</template>
+
+<script>
+import wepy from '@wepy/core'
+import config from '@/config'
+import {changeDefaultSpace} from '@/packagesEnv/api/officehome.js'
+wepy.component({
+  props: {
+    IsResiden: Boolean,
+    spaceId: String,
+    userInfo: Object
+  },
+  data: {
+    h5StaticPath: config.h5StaticPath + '/page-officehome/'
+  },
+  computed: {},
+  methods: {
+    showSaveSpace() {
+      var _this = this
+      if (_this.spaceId == _this.userInfo.spaceId) {
+        wx.showToast({
+          title: '该空间已是您的常驻工区',
+          icon: 'none',
+          duration: 3000
+        })
+      } else {
+        wx.showModal({
+          title: '设置常驻工区',
+          content: '将该空间设定为您的常驻工区?',
+          confirmText: '确定',
+          cancelText: '取消',
+          cancelColor: '#c4c4c4',
+          confirmColor: '#1DB1B2',
+          success: res => {
+            if (res.confirm) {
+              changeDefaultSpace(_this.options.spaceId).then(res => {
+                // getCurrentPages 小程序自己的方法
+                var pages = getCurrentPages()
+                console.log('res', res, pages)
+                _this.userInfo.spaceId = _this.options.spaceId
+                wx.showToast({
+                  title: '设置成功',
+                  icon: 'success',
+                  duration: 3000,
+                  complete: res => {
+                    if (pages.length <= 1) {
+                      wx.redirectTo({ url: '/pages/homev2' })
+                    } else {
+                      wx.navigateBack()
+                    }
+                  }
+                })
+              })
+            }
+          }
+        })
+      }
+    }
+  },
+    // 生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+
+  },
+    // 生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+
+  }
+})
+</script>
+<style lang='less' scoped>
+.residen-work {
+    margin-right: 40rpx;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width: 120rpx;
+    height: 46rpx;
+    padding: 8rpx 16rpx 8rpx 16rpx;
+    border-radius: 8rpx;
+    gap: 20rpx;
+    background: rgba(61, 203, 204, 0.3);
+    .just-text {
+        font-family: PingFang SC;
+        font-size: 22rpx;
+        font-weight: 400;
+        line-height: 30rpx;
+        color: rgba(27, 33, 41, 1);
+    }
+}
+.set-residen-work {
+    margin-right: 40rpx;
+    width: 128rpx;
+    display: flex;
+    align-items: center;
+    .set-text {
+        font-family: PingFang SC;
+        font-size: 24rpx;
+        font-weight: 400;
+        line-height: 40rpx;
+        color: #8b949e;
+    }
+    .spimg {
+        margin-left: 8rpx;
+        width: 24rpx;
+        height: 24rpx;
+    }
+}
+</style>

+ 80 - 0
src/packagesEnv/pages/officehome/Header/space-basic.wpy

@@ -0,0 +1,80 @@
+<!-- 头部 空间名称 -->
+<style lang='less' scoped>
+.space-name{
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    height: 64rpx;
+    margin-left: 40rpx;
+    padding-top: 32rpx;
+    padding-bottom: 32rpx;
+}
+.name_text{
+    font-family: PingFang SC;
+    font-size: 44rpx;
+    font-weight: 600;
+    line-height: 64px;
+}
+.room-name {
+    display: flex;
+    align-items: center;
+}
+</style>
+<template>
+    <div class="room-bg">
+        <div class="space-name">
+            <div class="g-fl room-name">
+                <span class="name_text">{{officeData.localName}}</span>
+                <has-person
+                    v-if="officeData.isPassengerPass !== undefined"
+                    :isPassengerPass="officeData.isPassengerPass"
+                ></has-person>
+            </div>
+            <div>
+                <residen-work
+                    :IsResiden="true"
+                    :spaceId="options.spaceId"
+                    :userInfo="userInfo"
+                ></residen-work>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+import wepy from '@wepy/core'
+import config from '@/config'
+
+wepy.component({
+  props: {
+    officeData: Object,
+    options: Object,
+    userInfo: Object
+  },
+  data: {
+    h5StaticPath: config.h5StaticPath + '/page-officehome/'
+
+  },
+  computed: {},
+  methods: {
+
+  },
+    // 生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+
+  },
+    // 生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+
+  }
+})
+</script>
+
+<config>
+    {
+        usingComponents: {
+            'has-person':'./has-person.wpy',
+            "residen-work":"./residen-work",
+        }
+    }
+</config>

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

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

@@ -119,17 +119,17 @@
 </template>
 
 <script>
-import wepy from '@wepy/core';
+import wepy from '@wepy/core'
 import { changeTempHttp, getFeedbackDocumentsHttp, getTempRangeHttp, getSeasonType } from '@/packagesEnv/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 feedbackTimer;
+let infoTimer
+let feedbackTimer
 
 wepy.component({
   props: {
@@ -175,28 +175,28 @@ wepy.component({
   watch: {
     airVisible(val) {
       if (!val) {
-        console.log('---关闭定时器');
-        clearInterval(feedbackTimer);
+        console.log('---关闭定时器')
+        clearInterval(feedbackTimer)
       }
     },
     hasAir(val) {
       if (!val) {
-        clearInterval(infoTimer);
-        this.airData.isOpen = false;
-        this.airImg = 'air_close.png';
+        clearInterval(infoTimer)
+        this.airData.isOpen = false
+        this.airImg = 'air_close.png'
       }
     },
     objectId(val) {
             //   this.glistenAirTemHttp();
 
       if (val) {
-        clearInterval(infoTimer); // 定时器先清理 再设定
+        clearInterval(infoTimer) // 定时器先清理 再设定
         infoTimer = setInterval(() => {
-          this.getInfo();
-        }, 1000);
+          this.getInfo()
+        }, 1000)
       } else {
-        this.airData.isOpen = false;
-        this.airImg = 'air_close.png';
+        this.airData.isOpen = false
+        this.airImg = 'air_close.png'
       }
     }
 
@@ -205,33 +205,33 @@ wepy.component({
     ...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
     }
   },
   ready() {
-    this.querySeasonType();
+    this.querySeasonType()
   },
   detached() {
-    this.airData.isOpen = false;
-    this.airData.icon = 1;
+    this.airData.isOpen = false
+    this.airData.icon = 1
 
-    clearInterval(feedbackTimer);
-    clearInterval(infoTimer);
+    clearInterval(feedbackTimer)
+    clearInterval(infoTimer)
   },
   methods: {
     querySeasonType() {
@@ -241,17 +241,17 @@ 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('info');
+      await this.getAirInfo('info')
             //   this.judgeAirLevel();
             //   this.glistenAirTem();
     },
@@ -259,36 +259,36 @@ wepy.component({
         // 空调信息airTemp
     getAirInfo(type, btnType, feedbackId) {
       const paramObj = {
-        projectId: this.projectId, // 项目id
+        projectId: 'Pj1101080259', // 项目id
         objectId: this.objectId // 空间id
       }
       if (type === 'feedback') {
-        paramObj.id = feedbackId;
+        paramObj.id = feedbackId
       }
       getFeedbackDocumentsHttp(paramObj).then(res => {
         if (type !== 'feedback') {
-          res.isOpen = false;
-          this.airData = res;
+          res.isOpen = false
+          this.airData = res
           this.airData.designTemperature = res.designTemperature ? res.designTemperature.toFixed(1) : '--'
 
           if (this.airData.icon === 7) {
-            this.airData.isOpen = false;
-            this.airImg = 'air_close.png';
+            this.airData.isOpen = false
+            this.airImg = 'air_close.png'
                         // 如果是过渡季 并且 是ATVA 空调 开启时则显示 过渡季节运行中...
           } else if (this.airData.icon != 6) {
-            this.airData.isOpen = true;
-            this.airImg = 'openair.png';
+            this.airData.isOpen = true
+            this.airImg = 'openair.png'
 
             if (this.isACATVA && this.seasonType == 'Transition') {
-              this.airData.spaceStatus = '过渡季节运行中...';
-              this.airData.icon = 1;
+              this.airData.spaceStatus = '过渡季节运行中...'
+              this.airData.icon = 1
             }
           }
         }
                 //   弹窗
         if (type === 'feedback' && res.notice && btnType != 'sw') {
-          clearInterval(feedbackTimer); // 拿到反馈文案清除定时器
-          this.$emit('airTemp', {notice: res.notice, remark: res.remark});
+          clearInterval(feedbackTimer) // 拿到反馈文案清除定时器
+          this.$emit('airTemp', {notice: res.notice, remark: res.remark})
         }
       })
     },
@@ -296,8 +296,8 @@ wepy.component({
         // 空调温度 闪烁
     glistenAirTemHttp() {
       getTempRangeHttp().then(res => {
-        this.tempMax = res.tempMax;
-        this.tempMin = res.tempMin;
+        this.tempMax = res.tempMax
+        this.tempMin = res.tempMin
       })
     },
         // glistenAirTem() {
@@ -350,24 +350,24 @@ wepy.component({
 
     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()
       }
     },
 
     airChange(value) {
-      if (!checkSpaceControl(this.isControl)) return;
-      const itemId = value ? 12 : 10; // 10关闭 12开启
-      console.log('itemId', itemId, value);
-      let btnTypeDetail = '';
+      if (!checkSpaceControl(this.isControl)) return
+      const itemId = value ? 12 : 10 // 10关闭 12开启
+      console.log('itemId', itemId, value)
+      let btnTypeDetail = ''
       if (itemId == 12) {
         btnTypeDetail = 'openAir'
       } else {
@@ -376,10 +376,10 @@ wepy.component({
       this.changeAir(itemId, 'sw', btnTypeDetail)
     },
     onClose() {
-      this.visible = false;
+      this.visible = false
     },
     popShow() {
-      this.visible = true;
+      this.visible = true
     },
 
     checkAirCanOpen(itemId) { // 判断空调是否能开启
@@ -389,19 +389,19 @@ wepy.component({
           icon: 'info',
           duration: 1000
         })
-        return false;
+        return false
       }
       if (itemId === 12) { // 12表示开空调
-        console.log(this.isNowTime, 'this.isNowTime');
+        console.log(this.isNowTime, 'this.isNowTime')
         if (this.roomHasScene && !this.isNowTime) {
-          this.$emit('component-open-workTimePop', true);
-          return false;
+          this.$emit('component-open-workTimePop', true)
+          return false
         }
       }
-      return true;
+      return true
     },
     changeAir(itemId, btnType, btnTypeDetail) {
-      if (!checkSpaceControl(this.isControl)) return;
+      if (!checkSpaceControl(this.isControl)) return
             // 如果是过渡季 并且ACATVA 空调  则不能调节温度 不能开
     //   console.log('btnType,this.isACATVA,this.seasonType', btnType, this.isACATVA, this.isACATFC, this.seasonType);
       if (btnType == 'temp' && this.isACATVA && this.seasonType == 'Transition') {
@@ -411,16 +411,16 @@ wepy.component({
             duration: 2600,
             icon: 'none'
           })
-        }, 0);
-        return;
+        }, 0)
+        return
       }
       isWithinLocation().then(() => {
         if (this.roomType === '开放') {
-          this.showWorkTime = this.checkAirCanOpen(itemId);
-          if (!this.showWorkTime) return;
+          this.showWorkTime = this.checkAirCanOpen(itemId)
+          if (!this.showWorkTime) return
         }
-        wx.uma.trackEvent(`officeHome_changeAir_${btnTypeDetail}`, { key: btnTypeDetail });
-        this.vibrateShort();
+        wx.uma.trackEvent(`officeHome_changeAir_${btnTypeDetail}`, { key: btnTypeDetail })
+        this.vibrateShort()
         const paramObj = {
           objectId: this.objectId, // 空间id
           valueType: 1, // 固定为1
@@ -431,22 +431,22 @@ wepy.component({
           this.$emit('airShowVisible', {
             'toWhere': btnTypeDetail,
             'designTemperature': 0 }
-                    );
+                    )
         }
-        console.log('空调下发指令');
+        console.log('空调下发指令')
                 //  下达指令
         changeTempHttp(paramObj).then(res => {
           if (btnType != 'sw') {
             this.$emit('airShowVisible', {
               'toWhere': btnTypeDetail,
               'designTemperature': res.designTemperature }
-                        );
+                        )
             if (res.notice) {
-              this.$emit('airTemp', {notice: res.notice, remark: res.remark});
+              this.$emit('airTemp', {notice: res.notice, remark: res.remark})
             } else {
               feedbackTimer = setInterval(() => {
-                this.getAirInfo('feedback', btnType, res.id); // 调节反馈文案
-              }, 1000);
+                this.getAirInfo('feedback', btnType, res.id) // 调节反馈文案
+              }, 1000)
             }
           }
         }).catch(() => {
@@ -628,7 +628,7 @@ wepy.component({
             height: 40rpx;
         }
         &.yell {
-            background: #ffe823;
+            background: rgba(61, 203, 204, 0.3);
         }
     }
 }

+ 103 - 106
src/packagesEnv/pages/officehome/components/all-close.wpy

@@ -40,7 +40,7 @@
     >
         <div class="cont">办公室已经没人了,我是最后一个走的</div>
         <div class="check">
-            <image src="{{h5StaticPath}}icon_done_btn.svg" />
+            <!-- <image src="{{h5StaticPath}}icon_done_btn.svg" /> -->
         </div>
 
     </div>
@@ -48,121 +48,118 @@
 </template>
 
 <script>
-import wepy from '@wepy/core';
+import wepy from '@wepy/core'
 import { specialLightSetHttp, queryEquipStatistics, changeAllAirHttp } from '@/packagesEnv/api/officehome.js'
-import config from '@/config';
+import config from '@/config'
 wepy.component({
-    data: {
-        h5StaticPath: config.h5StaticPath + '/',
-        allSpaceList: [],
-        lightSpaceList: [],
-        airSpaceList: [],
-    },
-    props: {
-        floorInfo: Array,
-        projectId: String,
-    },
-    computed: {
+  data: {
+    h5StaticPath: config.h5StaticPath + '/',
+    allSpaceList: [],
+    lightSpaceList: [],
+    airSpaceList: []
+  },
+  props: {
+    floorInfo: Array,
+    projectId: String
+  },
+  computed: {
 
-    },
-    watch: {
+  },
+  watch: {
 
+  },
+  ready() {
+    this.getEquipStatistics()
+  },
+  methods: {
+    changeLight(status) {
+      const setType = status === '打开' // 10关闭 12开启
+      var paramsArr = []
+      this.allSpaceList.forEach((citem) => {
+        (citem.equipList || []).forEach((item) => {
+          if (item.equipType == 'light') {
+            paramsArr.push({
+              id: item.id,
+              switch: setType
+            })
+          }
+        })
+      })
+      specialLightSetHttp(paramsArr).then((res) => {
+
+      })
     },
-    ready() {
-        this.getEquipStatistics();
+        // 开关全部空调
+    changeAllAir(status) {
+      let paramsArr = []
+      this.allSpaceList.forEach((sitem) => {
+        const itemId = status === '打开' ? 12 : 10 // 10关闭 12开启
+        paramsArr.push({
+          projectId: this.projectId,
+          objectId: sitem.id, // 空间id
+          valueType: 1, // 固定为1 1
+          itemId: itemId
+        })
+      })
+            // console.log("paramsArr2", paramsArr);
+      changeAllAirHttp(paramsArr).then((res) => {
+        if (res.result == 'success') {
+        } else {
+        }
+      })
     },
-    methods: {
-        changeLight(status) {
-            const setType = status === '打开' ? true : false; // 10关闭 12开启
-            var paramsArr = [];
-            this.allSpaceList.forEach((citem) => {
-                (citem.equipList || []).forEach((item) => {
-                    if (item.equipType == 'light') {
-                        paramsArr.push({
-                            id: item.id,
-                            switch: setType,
-                        });
-                    }
-                });
-            });
-            specialLightSetHttp(paramsArr).then((res) => {
-
-            });
-        },
-        //开关全部空调 
-        changeAllAir(status) {
-            let paramsArr = [];
-            this.allSpaceList.forEach((sitem) => {
-                const itemId = status === '打开' ? 12 : 10; // 10关闭 12开启
-                paramsArr.push({
-                    projectId: this.projectId,
-                    objectId: sitem.id, // 空间id
-                    valueType: 1, // 固定为1 1
-                    itemId: itemId,
-                });
-            });
-            //console.log("paramsArr2", paramsArr);
-            changeAllAirHttp(paramsArr).then((res) => {
-                if (res.result == 'success') {
-                } else {
-                }
-            });
-        },
-        getEquipStatistics() {
-            var params1 = {
-                floorId: this.floorInfo[0] && this.floorInfo[0].floorId,
-                projectId: this.projectId
-            };
-            var params2 = {
-                floorId: this.floorInfo[1] && this.floorInfo[1].floorId,
-                projectId: this.projectId
-            };
-            Promise.all([queryEquipStatistics(params1), queryEquipStatistics(params2)]).then((res) => {
+    getEquipStatistics() {
+      var params1 = {
+        floorId: this.floorInfo[0] && this.floorInfo[0].floorId,
+        projectId: this.projectId
+      }
+      var params2 = {
+        floorId: this.floorInfo[1] && this.floorInfo[1].floorId,
+        projectId: this.projectId
+      }
+      Promise.all([queryEquipStatistics(params1), queryEquipStatistics(params2)]).then((res) => {
+        var allSpaceList = [];
+        (res || []).forEach((ritem) => {
+          var spaceList = (ritem.data && ritem.data.spaceList) || []
+          allSpaceList.push(...spaceList)
+        })
+                // || item.localName == '上格云休闲区'
+        var filterSpaceArr = allSpaceList.filter((item) => {
+          return item.localName == '图书休闲区'
+        })
+                // 没用
+        this.airSpaceList = allSpaceList.filter((item) => {
+          var airStatus = (item.equipStatusList || []).filter((eitem) => {
+            return eitem.equipType == 'airConditioner'
+          })
 
-                var allSpaceList = [];
-                (res || []).forEach((ritem) => {
-                    var spaceList = (ritem.data && ritem.data.spaceList) || [];
-                    allSpaceList.push(...spaceList)
-                });
-                //|| item.localName == '上格云休闲区'
-                var filterSpaceArr = allSpaceList.filter((item) => {
-                    return item.localName == '图书休闲区';
-                });
-                //没用
-                this.airSpaceList = allSpaceList.filter((item) => {
-                    var airStatus = (item.equipStatusList || []).filter((eitem) => {
-                        return eitem.equipType == 'airConditioner'
-                    })
+          var status = airStatus[0] && airStatus[0].status
+                    // if(status !== 0){ console.log('this.airSpaceList-name', item.localName,status);}
+          return status !== 0
+        })
+                // 没用
+        this.lightSpaceList = allSpaceList.filter((item) => {
+          var lightStatus = (item.equipStatusList || []).filter((eitem) => {
+            return eitem.equipType == 'light'
+          })
 
-                    var status = airStatus[0] && airStatus[0].status;
-                    //if(status !== 0){ console.log('this.airSpaceList-name', item.localName,status);}
-                    return status !== 0;
-                });
-                //没用
-                this.lightSpaceList = allSpaceList.filter((item) => {
-                    var lightStatus = (item.equipStatusList || []).filter((eitem) => {
-                        return eitem.equipType == 'light'
-                    })
-
-                    var status = lightStatus[0] && lightStatus[0].status;
+          var status = lightStatus[0] && lightStatus[0].status
                     // if(status !== 0){ console.log('this.lightSpaceList-name', item.localName,status);}
-                    return status !== 0;
-                });
-                //console.log('this.lightSpaceList', this.lightSpaceList);
-                this.allSpaceList = allSpaceList;
-
-            });
-        },
-        controlEquipStatistics() {
-            this.changeLight('关闭');
-            this.changeAllAir('关闭');
-        },
-        showPopup() {
-            this.$emit("showAllClose");
-
-        }
+          return status !== 0
+        })
+                // console.log('this.lightSpaceList', this.lightSpaceList);
+        this.allSpaceList = allSpaceList
+      })
+    },
+    controlEquipStatistics() {
+      this.changeLight('关闭')
+      this.changeAllAir('关闭')
+    },
+    showPopup() {
+      this.$emit('showAllClose')
     }
-});
+  }
+})
 </script>
 
 <config>

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

@@ -24,29 +24,29 @@
 }
 
 .day-selecotr .day-selecotr-item.selected {
-  background: #ffe823;
+  background: rgba(150, 242, 227, 0.4);
   border-radius: 30rpx;
-  color: #140050;
-  font-weight: 600px;
-  .weekday {
-    color: #140050;
-    font-weight: 600;
-  }
-  .date {
-    font-weight: 500;
-    color: #140050;
-  }
+//   color: #140050;
+//   font-weight: 600px;
+//   .weekday {
+//     color: #140050;
+//     font-weight: 600;
+//   }
+//   .date {
+//     font-weight: 500;
+//     color: #140050;
+//   }
 }
 
 .day-selecotr .day-selecotr-item .weekday {
   font-size: 10px;
   line-height: 14px;
-  color: #9fb7cd;
+  color: #8B949E;
   margin-bottom: 2rpx;
 }
 
 .day-selecotr .day-selecotr-item .date {
-  color: #4d5262;
+  color: #000000;
   font-family: Montserrat;
   font-size: 22px;
   line-height: 27px;
@@ -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;

File diff suppressed because it is too large
+ 2098 - 2550
src/packagesEnv/pages/officehome/index.wpy


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

@@ -41,7 +41,8 @@
             line-height: 100rpx;
             &.sub {
                 border-color: white;
-                background: #ffe723;
+                color:#FFFFFF;
+                background: rgba(61, 203, 204, 1);
                 width: 390rpx;
             }
             &.dis-sub {
@@ -109,17 +110,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 +133,7 @@ import {
 } from '@/packagesEnv/pages/common.js'
 
 let resData = {}
-let timer = null;
+let timer = null
 wepy.component({
   props: {
     equipConfig: Array, // 设备配置是否可控
@@ -165,12 +166,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 +180,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 +209,7 @@ wepy.component({
         }
       }
 
-      newVal = val + SliderUnit * 4;
+      newVal = val + SliderUnit * 4
       if (newVal > 24) {
         return 24
       }
@@ -217,14 +218,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 +233,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 +244,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 +259,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 +305,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 +330,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 +345,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 +360,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 +396,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 +426,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 +447,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 +467,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 +480,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 +546,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 +562,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
     }
   }
 })

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

@@ -29,7 +29,8 @@
             line-height: 100rpx;
             &.sub {
                 border-color: white;
-                background: #ffe723;
+                background: rgba(61, 203, 204, 1);
+                color: #FFFFFF;
                 width: 390rpx;
             }
             &.dis-sub {
@@ -87,17 +88,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 +110,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 +152,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 +165,7 @@ wepy.component({
     }
   },
   ready() {
-    this.setDefaultPeriod();
+    this.setDefaultPeriod()
   },
   detached() {
   },
@@ -172,64 +173,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 +243,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 +293,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 +309,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 +332,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 +363,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 +385,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 +401,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 +415,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 +439,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

+ 6 - 6
src/store/company.js

@@ -1,26 +1,26 @@
 export default {
   state: {
     companyConfig: {
-      sagacareProjectId: 'Pj1101080255'  // 测试阶段先给一个默认值
+      sagacareProjectId: 'Pj1101080259'  // 测试阶段先给一个默认值
     }
   },
   mutations: {
     setCompanyConfig(state, configInfo) {
-      state.companyConfig = configInfo;
+      state.companyConfig = configInfo
     },
     clearCompanyConfig(state) {
       // state.companyConfig = null;
       state.companyConfig = {
-        sagacareProjectId: 'Pj1101080255'  // 测试阶段先给一个默认值
+        sagacareProjectId: 'Pj1101080259'  // 测试阶段先给一个默认值
       }
     }
   },
   actions: {
     setCompanyConfig({ commit }, data) {
-      commit('setCompanyConfig', data);
+      commit('setCompanyConfig', data)
     },
     clearCompanyConfig({ commit }) {
-      commit('clearCompanyConfig');
+      commit('clearCompanyConfig')
     }
   }
-}
+}