Bladeren bron

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

chenzhen2 1 jaar geleden
bovenliggende
commit
d2dfc74a14

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

@@ -4,7 +4,7 @@
         <div
             class="set-residen-work"
             @click="showSaveSpace"
-            v-if="IsResiden==3"
+            v-if="userControlSpace.isControlSpace==3"
         >
             <span class="set-text">设置常驻</span>
             <image
@@ -12,7 +12,7 @@
                 :src="h5StaticPath+'arrow.svg'"
             />
         </div>
-        <div class="residen-work" v-if="IsResiden===4">
+        <div class="residen-work" v-if="userControlSpace.isControlSpace===4 && userControlSpace.spaceId === spaceId">
             <span class="just-text">常驻工区</span>
         </div>
     </div>
@@ -25,19 +25,20 @@ import config from '@/config'
 import {changeDefaultSpace} from '@/packagesEnv/api/officehome.js'
 wepy.component({
   props: {
-    IsResiden: Number,
+    userControlSpace: Object,
     spaceId: String,
     userInfo: Object
   },
   data: {
     h5StaticPath: config.h5StaticPath + '/page-officehome/'
   },
-  computed: {},
+
+  computed: {
+
+  },
   methods: {
     showSaveSpace() {
       const _this = this
-      console.log(this, '----this')
-      _this.$root.getCurrentSpace()
       wx.showModal({
         title: '设置常驻工区',
         content: '将该空间设定为您的常驻工区?',
@@ -56,6 +57,7 @@ wepy.component({
                 icon: 'success',
                 duration: 3000,
                 complete: res => {
+                //   _this.$root.getCurrentSpace()
                   if (pages.length <= 1) {
                     wx.redirectTo({ url: '/packagesEnv/pages/home/index' })
                   } else {

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

@@ -26,14 +26,14 @@
             <div class="g-fl room-name">
                 <span class="name_text">{{officeData.localName || '该空间不可调节'}}</span>
                 <has-person
-                    v-show="officeData.isPassengerPass !== undefined && IsShowPerson"
+                    v-if="officeData.isPassengerPass !== undefined && IsShowPerson"
                     :isPassengerPass="officeData.isPassengerPass"
                 ></has-person>
             </div>
             <div>
                 <residen-work
-                    v-show="isControlSpace===3 || isControlSpace===4"
-                    :IsResiden="isControlSpace"
+                    v-show="userControlSpace.isControlSpace===3 || userControlSpace.isControlSpace===4"
+                    :userControlSpace="userControlSpace"
                     :spaceId="options.spaceId"
                     :userInfo="userInfo"
                 ></residen-work>
@@ -51,12 +51,12 @@ wepy.component({
     IsShowPerson: Boolean,
     officeData: Object,
     options: Object,
-    isControlSpace: Boolean,
+    fromMapInfo: Object,
+    userControlSpace: Object,
     userInfo: Object
   },
   data: {
     h5StaticPath: config.h5StaticPath + '/page-officehome/'
-
   },
   computed: {},
   methods: {

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

@@ -575,7 +575,7 @@ page {
                             :officeData="officeData"
                             :options="options"
                             :userInfo="userInfo"
-                            :isControlSpace="userControlSpace.isControlSpace"
+                            :userControlSpace="userControlSpace"
                         ></space-basic>
                     </div>
                     <!-- 空间基本情况 -->
@@ -589,7 +589,7 @@ page {
                             :officeData="officeData"
                             :options="options"
                             :userInfo="userInfo"
-                            :isControlSpace="userControlSpace.isControlSpace"
+                            :userControlSpace="userControlSpace"
                         ></space-basic>
                         <!-- 空间信息 -->
                         <div class="office-room-info">
@@ -1256,7 +1256,6 @@ wepy.page({
   },
     // 加载字体
   onLoad(routeParams) {
-    console.log(routeParams, '----routeParams')
     this.getCardWidth()
     this.getWeatherInfo()// 天气预报
     var nowTimeStr = moment().format('YYYY-MM-DD')
@@ -1306,13 +1305,13 @@ wepy.page({
             // openLamp 开灯,  airAddOne 空调调高一度,  airReduceOne 空调下降一度 , closeLampAir 关闭灯和空调
 
       if (this.routeParams.from === 'FindIt') {
-        this.userControlSpace = this.routeParams
+        this.getCurrentSpace('FindIt')
         this.options.spaceId = this.routeParams.spaceId
         this.moveToBottom = true  // 来自找一找, 页面在底部
         this.getData() // 获取数据
       } else {
         // 从首页进入
-        await this.getCurrentSpace()
+        await this.getCurrentSpace('home')
         if (this.options.spaceId) {
           await this.getData()
         }
@@ -1356,12 +1355,14 @@ wepy.page({
         }
       }
     },
-    getCurrentSpace() {
+    getCurrentSpace(from) {
       return checkUserControl().then(res => {
-        console.log(res, '-----1')
         // 1-租户下无可控;2-租户有可控;3-用户有可控 4-当前空间为常驻空间
         this.userControlSpace = res
-        this.options.spaceId = res.spaceId || ''
+        // 从首页进入 才给空间重新赋值
+        if (from === 'home') {
+          this.options.spaceId = res.spaceId || ''
+        }
       })
     },
 
@@ -1599,8 +1600,9 @@ wepy.page({
     // 地图数据切换空间
     mapChangeSpaceInfo(obj) {
       console.log(obj, '----来自地图')
-      this.userControlSpace = obj
-      this.options.spaceId = obj.spaceId
+      // isCompanyControl: true 为常驻工区
+      const mapItem = JSON.parse(JSON.stringify(obj))
+      this.options.spaceId = mapItem.spaceId
       this.getData()
     },
     getSpaceInfo() {

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

@@ -119,7 +119,10 @@ page {
 <!-- 个人中心 -->
 <template>
     <div class="percsonal-center">
-        <page-top-bar icon="{{h5Static+'/page-top-bar/return-icon.svg'}}"></page-top-bar>
+        <page-top-bar
+        iconClickedEmitId="toPage"
+        @toPage="toPage('/packagesEnv/pages/home/index')"
+          icon="{{h5Static+'/page-top-bar/return-icon.svg'}}"></page-top-bar>
         <image
             class="imgst"
             src="{{h5StaticPath}}/bg-personal.png"
@@ -149,6 +152,7 @@ page {
                         hover-class="hover-st"
                         hover-style-time="100"
                         class="little-card"
+                        @click="toPage('/packagesEnv/pages/portrait/home')"
                     >
                         <image
                             class="little-imgst"