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