Browse Source

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

chenzhen2 1 year ago
parent
commit
53339d92d6

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

@@ -4,7 +4,7 @@
         <div
             class="set-residen-work"
             @click="showSaveSpace"
-            v-show="!IsResiden"
+            v-if="IsResiden==3"
         >
             <span class="set-text">设置常驻</span>
             <image
@@ -12,7 +12,7 @@
                 :src="h5StaticPath+'arrow.svg'"
             />
         </div>
-        <div class="residen-work" v-show="IsResiden">
+        <div class="residen-work" v-if="IsResiden===4">
             <span class="just-text">常驻工区</span>
         </div>
     </div>
@@ -25,7 +25,7 @@ import config from '@/config'
 import {changeDefaultSpace} from '@/packagesEnv/api/officehome.js'
 wepy.component({
   props: {
-    IsResiden: Boolean,
+    IsResiden: Number,
     spaceId: String,
     userInfo: Object
   },

+ 4 - 3
src/packagesEnv/pages/officehome/Header/space-basic.wpy

@@ -24,7 +24,7 @@
     <div class="room-bg">
         <div class="space-name">
             <div class="g-fl room-name">
-                <span class="name_text">{{officeData.localName}}</span>
+                <span class="name_text">{{officeData.localName || '该空间不可调节'}}</span>
                 <has-person
                     v-if="officeData.isPassengerPass !== undefined && IsShowPerson"
                     :isPassengerPass="officeData.isPassengerPass"
@@ -32,8 +32,8 @@
             </div>
             <div>
                 <residen-work
-                    v-if="options.roomType =='开放'"
-                    :IsResiden="true"
+                    v-if="options.roomType =='开放' && isControlSpace===3 || isControlSpace===4"
+                    :IsResiden="isControlSpace"
                     :spaceId="options.spaceId"
                     :userInfo="userInfo"
                 ></residen-work>
@@ -51,6 +51,7 @@ wepy.component({
     IsShowPerson: Boolean,
     officeData: Object,
     options: Object,
+    isControlSpace: Boolean,
     userInfo: Object
   },
   data: {

+ 5 - 13
src/packagesEnv/pages/officehome/Meeting/pop-meet-scene.wpy

@@ -1,19 +1,12 @@
 <style lang="less" scoped>
 .meet-popup {
     position: relative;
-    height: 580rpx;
+    height: 634rpx;
     width: 622rpx;
     text-align: center;
-    .meet_head {
-        width: 100%;
-        height: 90rpx;
-        background: #96f2e366;
-    }
     .meet_head_bg {
         width: 100%;
-        height: 150rpx;
-        border-radius: 0 0 50% 50%;
-        background: #96f2e366;
+        height: 360rpx;
     }
 
     .meet_body {
@@ -26,7 +19,6 @@
         }
     }
     .meet_content {
-        padding-top: 58rpx;
         padding-bottom: 16rpx;
         .meet-title {
             font-family: PingFang SC;
@@ -66,9 +58,9 @@
     <div
         class="meet-popup"
     >
-        <div class="meet_head">
+        <div class="meet_head_bg">
+            <image src="{{ h5StaticPath }}{{ sceneDetail.img }}"/>
         </div>
-        <div class="meet_head_bg"></div>
         <div class="meet_content">
             <span class="meet-title">切换至<span class="name">{{sceneDetail.name}}</span>场景</span>
         </div>
@@ -98,7 +90,7 @@ wepy.component({
     sceneDetail: Object
   },
   data: {
-
+    h5StaticPath: config.h5StaticPath + '/page-officehome/'
   },
   watch: {
     sceneDetail: {

+ 122 - 0
src/packagesEnv/pages/officehome/components/set-permanent.wpy

@@ -0,0 +1,122 @@
+<style lang="less">
+.set-permanent {
+    position: fixed;
+    top: 0;
+    bottom: 0;
+    right: 0;
+    left: 0;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    z-index: 2;
+    &.show {
+        display: flex;
+    }
+    &.hide {
+        display: none;
+    }
+    .panel-mask {
+        position: absolute;
+        top: 0;
+        right: 0;
+        left: 0;
+        bottom: 0;
+        background: rgba(0, 0, 0, 0.2);
+    }
+    .content {
+        position: absolute;
+        bottom: 88rpx;
+        right: 34rpx;
+        width: 640rpx;
+        height: 448rpx;
+        .tip-image {
+            width: 640rpx;
+            height: 350rpx;
+        }
+        .little-box {
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            position: absolute;
+            right: 0px;
+            margin-top: 18rpx;
+            width: 168rpx;
+            height: 80rpx;
+            border-radius: 20rpx;
+            background: #ffffff;
+            .text {
+                font-family: PingFang SC;
+                font-size: 24rpx;
+                font-weight: 400;
+                line-height: 40rpx;
+                color: #8b949e;
+            }
+            .little-img{
+                margin-left: 8rpx;
+                width: 24rpx;
+                height: 24rpx;
+            }
+        }
+    }
+}
+</style>
+
+<template>
+    <cover-view
+        class="{{'set-permanent '+(show?'show':'hide')}}"
+        v-on:touchmove.stop="stopProgration"
+    >
+        <cover-view
+            class="panel-mask"
+            v-on:click="closePanel"
+        ></cover-view>
+        <cover-view class="content">
+            <cover-image
+                class="tip-image"
+                src="{{ h5StaticPath }}set-permanent.png"
+            ></cover-image>
+            <cover-view class="little-box">
+                <cover-view class="text">设为常驻 </cover-view>
+                <cover-image class="little-img" :src="h5StaticPath+'/arrow.svg'"></cover-image>
+            </cover-view>
+        </cover-view>
+
+    </cover-view>
+</template>
+
+<script>
+import wepy from '@wepy/core'
+import config from '@config'
+import { mapState } from '@wepy/x'
+import store from '@/store'
+
+wepy.component({
+  store,
+  data: {
+    h5StaticPath: config.h5StaticPath + '/page-officehome/'
+  },
+  props: {
+    data: Object,
+    show: Boolean
+  },
+  computed: {
+    ...mapState({ userInfo: state => state.user.userInfo })
+  },
+  created() {
+
+  },
+  methods: {
+    closePanel() {
+      this.$emit('component-permanent-panel-close')
+    },
+    stopProgration() { }
+  }
+})
+</script>
+
+
+<config>
+{
+  
+}
+</config>

+ 124 - 12
src/packagesEnv/pages/officehome/index.wpy

@@ -117,7 +117,6 @@ page {
 .maproom-detail {
     width: 750rpx;
     margin-left: -45rpx;
-    padding: 10rpx 45rpx 0;
     height: 125px;
     position: relative;
     background: #fff;
@@ -154,6 +153,24 @@ page {
             color: #bab8c7;
         }
     }
+    .upToSpace {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        padding-top: 24rpx;
+        .imgSt {
+            width: 24rpx;
+            height: 24rpx;
+        }
+        .text {
+            color: #8b949e;
+            font-family: PingFang SC;
+            font-size: 24rpx;
+            font-style: normal;
+            font-weight: 400;
+            line-height: 40rpx;
+        }
+    }
 }
 
 .office-container {
@@ -505,9 +522,7 @@ page {
                 v-show="transY"
             >
                 <!--      <map-home    v-if="userInfo&& userInfo.userId" -->
-                <map-home
-                    @mapChangeSpaceInfo="mapChangeSpaceInfo"
-                ></map-home>
+                <map-home @mapChangeSpaceInfo="mapChangeSpaceInfo"></map-home>
             </div>
             <div
                 class="move-wrap"
@@ -545,11 +560,19 @@ page {
                         class="maproom-detail"
                         v-show="moveToBottom"
                     >
+                        <div class="upToSpace">
+                            <image
+                                class="imgSt"
+                                src="{{h5StaticPath}}icon-double-arrow.svg"
+                            />
+                            <span class="text">上滑进入空间</span>
+                        </div>
                         <space-basic
                             :IsShowPerson="false"
                             :officeData="officeData"
                             :options="options"
                             :userInfo="userInfo"
+                            :isControlSpace="userControlSpace.isControlSpace"
                         ></space-basic>
                     </div>
                     <!-- 空间基本情况 -->
@@ -563,6 +586,7 @@ page {
                             :officeData="officeData"
                             :options="options"
                             :userInfo="userInfo"
+                            :isControlSpace="userControlSpace.isControlSpace"
                         ></space-basic>
                         <!-- 空间信息 -->
                         <div class="office-room-info">
@@ -650,6 +674,7 @@ page {
                     <lamp-adjust
                         v-if="spaceEqFlagObj.hasLamp"
                         id="inToView1"
+                        ref="lampAdjust"
                         :roomHasScene="roomHasScene"
                         :lampHide="lampHide"
                         :spaceId="options.spaceId"
@@ -955,6 +980,12 @@ page {
                 <div>进入地图</div>
             </div>
         </div>
+        <set-permanent
+            v-if="userControlSpace.isControlSpace === 3 && this.routeParams.from==='homeSetSpace'"
+            :show="isShowPermanent"
+            @component-permanent-panel-close="closePermanentPanel(false)"
+        >
+        </set-permanent>
     </div>
 
 </template>
@@ -976,7 +1007,7 @@ import {
     queryEquipmentRunConfig
 } from '../../api/officehome.js'
 
-import { getMeetingList} from '@/api/meetingroom'
+import { getMeetingList } from '@/api/meetingroom'
 import { isWithinLocation } from '@/service/location'
 import config from '@/config'
 import loadFont from '@/common/loadFont'
@@ -998,7 +1029,7 @@ let initListSen = [
     id: 0,
     code: 'DISCUSSING',
     name: '讨论',
-    img: 'discuss.svg',
+    img: 'discuss.png',
     checked: true,
     textObj: [
       {
@@ -1011,7 +1042,7 @@ let initListSen = [
     id: 1,
     code: 'PROJECTING',
     name: '投影',
-    img: 'shadow2.svg',
+    img: 'shadow2.png',
     checked: false,
     textObj: [
       {
@@ -1024,7 +1055,7 @@ let initListSen = [
     id: 2,
     code: 'ADJOURNMENT',
     name: '散会',
-    img: 'beover.svg',
+    img: 'beover.png',
     checked: false,
     textObj: [
       {
@@ -1037,7 +1068,10 @@ let initListSen = [
 wepy.page({
   store,
   data: {
+    sceneShow: false,
     projectId: 'Pj1101080259',
+    isShowPermanent: false,
+    userControlSpace: {}, // 用户控制空间
     cardWidth: 0, // 动态获取卡片的宽度
     floorFeatItem: {}, // 地暖弹窗数据
     airHandItem: {},
@@ -1094,7 +1128,6 @@ wepy.page({
     headScene: '', // 头部文案
     headImg: '', // 头部背景图片
     options: { roomType: null, spaceId: 'Sp1101080259c4434730d12144ba890fe11f796d3143' }, // 本地数据
-    sceneDetail: null,
     popList: [],
         // 上班=ATWORK 讨论=DISCUSSING 投影=PROJECTING 散会=ADJOURNMENT 下班=OFFWORK
     meetingRoomSence: [
@@ -1218,6 +1251,14 @@ wepy.page({
   },
     // 加载字体
   onLoad(routeParams) {
+    routeParams = {
+      'from': 'homeSetSpace',
+      'isControlSpace': 3,
+      'buildingId': 'string',
+      'spaceId': 'Sp1101080259c4434730d12144ba890fe11f796d3143',
+      'spaceName': 'string',
+      'floorId': 'string'
+    }
     this.getCardWidth()
     var nowTimeStr = moment().format('YYYY-MM-DD')
     var eightTime = moment(nowTimeStr + ' 20:00:00').valueOf()
@@ -1227,7 +1268,7 @@ wepy.page({
     this.routeParams = routeParams
   },
   onShow() {
-    this.getData() // 获取数据
+    this.fromOtherPages()
     this.spaceInfoStatusTimer()
   },
   onReady() {
@@ -1256,6 +1297,72 @@ wepy.page({
     spaceInfoStatusTimer = clearInterval(spaceInfoStatusTimer)
   },
   methods: {
+    closePermanentPanel(val) {
+      this.isShowPermanent = val
+    },
+    async fromOtherPages() {
+            // homeSetSpace 设置常驻,  homeShowEnv 环境调节,  FindIt 找一找
+            // openLamp 开灯,  airAddOne 空调调高一度,  airReduceOne 空调下降一度 , closeLampAir 关闭灯和空调
+
+      if (this.routeParams.from === 'FindIt') {
+        this.options.spaceId = this.routeParams.spaceId
+        this.moveToBottom = true  // 来自找一找, 页面在底部
+        this.getData() // 获取数据
+      } else {
+        await this.getCurrentSpace()
+        if (this.options.spaceId) {
+          await this.getData()
+        }
+                // 从首页过来
+        let setAirtemp = this.$refs.airHandCard.airTemp
+        switch (this.routeParams.from) {
+          case 'homeShowEnv':
+            if (this.userControlSpace.isControlSpace === 1 || this.userControlSpace.isControlSpace === 2) {
+              this.moveToBottom = true
+            }
+            break
+          case 'homeSetSpace':
+            this.isShowPermanent = true
+            this.moveToBottom = true
+            this.toRoom()
+            break
+          case 'openLamp':
+            this.selectCrad('', 'lamp')
+            this.$refs.lampAdjust.eqChange(true, 'allLamp')
+            break
+          case 'airAddOne':
+            this.selectCrad('', 'air')
+            this.$refs.airHandCard.changeZongAir('temp', setAirtemp + 1)
+            break
+          case 'airReduceOne':
+            this.selectCrad('', 'air')
+            this.$refs.airHandCard.changeZongAir('temp', setAirtemp - 1)
+
+            break
+          case 'closeLampAir':
+            this.selectCrad('', 'air')
+            this.$refs.lampAdjust.eqChange(false, 'allLamp')
+            this.$refs.airHandCard.airData.isOpen = false
+            this.$refs.airHandCard.changeZongAir('sw')
+            break
+
+          default:
+            break
+        }
+      }
+    },
+    getCurrentSpace() {
+      const resData = {
+        'isControlSpace': 3, // 1-租户下无可控;2-租户有可控;3-用户有可控 4-当前空间为常驻空间
+        'buildingId': 'string',
+        'spaceId': 'Sp1101080259c4434730d12144ba890fe11f796d3143',
+        'spaceName': 'string',
+        'floorId': 'string'
+      }
+      this.userControlSpace = resData
+      this.options.spaceId = resData.spaceId
+    },
+
     setCanScroll(val) {
       this.canscroll = val
     },
@@ -1763,8 +1870,12 @@ wepy.page({
                 ? 0
                 : (res[next] && res[next].height) || 0
     },
-    async selectCrad(e, nav) {
-      let id = e.currentTarget.id
+        // 导航条
+    async selectCrad(e, code) {
+      const targetObj = this.navList.find(function (item) {
+        return item.code === code
+      })
+      let id = code ? targetObj.id : e.currentTarget.id
       if (id === this.navId) return
       this.navId = id
       this.lampHide = !this.lampHide // 当点击了导航 灯的列表要收起
@@ -2021,6 +2132,7 @@ usingComponents: {
     "pop-scene":"./Meeting/pop-meet-scene.wpy",
     "work-off":"./components/work-off",
     "work-scene-hand":"./components/work-scene-hand",
+    "set-permanent":"./components/set-permanent",
     "air-hand-card":"./airHand/air-hand-card",
     "air-feedback":"./components/air-feedback",
     "lamp-adjust":"./components/lamp-adjust",

+ 57 - 19
src/packagesEnv/pages/personalCenter/footer.wpy

@@ -1,14 +1,13 @@
 <style lang='less' scoped>
-    .footer {
-        position: absolute;
-        bottom: 68rpx;
-        left: 50%;
-        transform: translate(-50%);
-        .footer-content {
-            display: flex;
-            justify-content: center;
-            align-items: center;
-        }
+.footer {
+    position: absolute;
+    bottom: 68rpx;
+    left: 50%;
+    transform: translate(-50%);
+    .footer-content {
+        display: flex;
+        justify-content: center;
+        align-items: center;
         .text {
             font-family: PingFang SC;
             font-size: 28rpx;
@@ -23,16 +22,53 @@
             border: 2rpx solid #c4c9cf;
         }
     }
+
+    .btn-box {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 272rpx;
+        height: 88rpx;
+        padding: 20rpx 48rpx 20rpx 48rpx;
+        border-radius: 40px;
+        background: #ffffff;
+        .text {
+            font-family: PingFang SC;
+            font-size: 28rpx;
+            font-weight: 400;
+            line-height: 44rpx;
+            color: #626c78;
+        }
+        .imgSt {
+            width: 48rpx;
+            height: 48rpx;
+        }
+    }
+}
 </style>
 <!-- 个人中心 -->
 <template>
-        <div class="footer">
-            <div class="footer-content">
-                <div class="footer-line"></div>
-                <div class="text">小飒智控</div>
-                <div class="footer-line"></div>
-            </div>
+    <div class="footer">
+        <div
+            class="btn-box"
+            v-if="IsShowPhone"
+        >
+            <image
+                class="imgSt"
+                src="/static/icon-phone.svg"
+            />
+            <span class="text">客服电话</span>
         </div>
+        <div
+            class="footer-content"
+            v-else
+        >
+            <div class="footer-line"></div>
+            <div class="text">小飒智控</div>
+            <div class="footer-line"></div>
+        </div>
+
+    </div>
 </template>
 
 <script>
@@ -41,7 +77,9 @@ import wepy from '@wepy/core'
 // import config from '@/config';
 wepy.component({
   name: 'Footer',
-  props: {},
+  props: {
+    IsShowPhone: Boolean
+  },
   data: {
 
   },
@@ -49,11 +87,11 @@ wepy.component({
   methods: {
 
   },
-// 生命周期 - 创建完成(可以访问当前this实例)
+    // 生命周期 - 创建完成(可以访问当前this实例)
   created() {
 
   },
-// 生命周期 - 挂载完成(可以访问DOM元素)
+    // 生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
 
   }

+ 2 - 1
src/packagesEnv/pages/personalCenter/index.wpy

@@ -188,7 +188,7 @@ page {
 
             </div>
         </div>
-        <footer></footer>
+        <footer :IsShowPhone="IsShowPhone"></footer>
         <add-miniprogram-to-desk-panel
             :show="isShowAddminiProgramToDesk"
             @component-add-miniprogram-to-desk-panel-close="handleAdd(false)"
@@ -207,6 +207,7 @@ wepy.page({
     h5StaticPath: config.h5StaticPath + '/page-personalCenter',
     h5Static: config.h5StaticPath,
     isShowAddminiProgramToDesk: false,
+    IsShowPhone: true,
     arr: [
             // { name: '问题反馈', icon: 'icon-message.svg', url: '' },
             { name: '操作指引', icon: 'icon-guid.svg', url: '/packagesEnv/pages/personalCenter/operating' },

+ 12 - 4
src/packagesEnv/pages/personalCenter/operating.wpy

@@ -56,11 +56,14 @@ page {
         title="操作指引"
         titleColor="#1B2129"
         icon="{{h5Static+'/page-top-bar/return-icon.svg'}}"
+        iconClickedEmitId="toPre"
+        @toPre="iconClickedEmitId"
     ></page-top-bar>
     <div class="operating">
         <div
             v-for="(item,idx) in arr"
             :key="item.title"
+            @click="changePage(item.url)"
         >
             <div  class="each-row">
                 <div class="each-box">
@@ -89,15 +92,20 @@ wepy.page({
     h5Static: config.h5StaticPath,
     h5StaticPath: config.h5StaticPath + '/page-personalCenter',
     arr: [
-            { title: '如何置常驻工区?', text: '设定后将在首页置顶显示,方便调节', img: 'operation-work.png', url: '' },
-            { title: '如何获取碳积分?', text: '这是一句解释,这是一句解释', img: 'operation-carbon.png', url: '' },
-            { title: '如何预约加时?', text: '这是一句解释,这是一句解释', img: 'operation-time.png', url: '' }
+            { title: '如何置常驻工区?', text: '设定后将在首页置顶显示,方便调节', img: 'operation-work.png', url: '/packagesEnv/pages/home/resident' },
+            { title: '如何获取碳积分?', text: '这是一句解释,这是一句解释', img: 'operation-carbon.png', url: '/packagesEnv/pages/home/carboncredit' },
+            { title: '如何预约加时?', text: '这是一句解释,这是一句解释', img: 'operation-time.png', url: '/packagesEnv/pages/home/overtime' }
     ]
 
   },
   computed: {},
   methods: {
-
+    iconClickedEmitId() {
+      wx.navigateTo({url: '/packagesEnv/pages/personalCenter/index'})
+    },
+    changePage(url) {
+      wx.navigateTo({url: url})
+    }
   },
     // 生命周期 - 创建完成(可以访问当前this实例)
   created() {