|
@@ -522,7 +522,9 @@ page {
|
|
|
v-show="transY"
|
|
|
>
|
|
|
<!-- <map-home v-if="userInfo&& userInfo.userId" -->
|
|
|
- <map-home @mapChangeSpaceInfo="mapChangeSpaceInfo"></map-home>
|
|
|
+ <map-home @mapChangeSpaceInfo="mapChangeSpaceInfo"
|
|
|
+ :space="userControlSpace"
|
|
|
+ ></map-home>
|
|
|
</div>
|
|
|
<div
|
|
|
class="move-wrap"
|
|
@@ -614,7 +616,7 @@ page {
|
|
|
:key="idx"
|
|
|
@click="handleScene(item,idx)"
|
|
|
>
|
|
|
- <image :src="h5StaticPath+item.img" />
|
|
|
+ <image :src="h5StaticPath+item.headImg" />
|
|
|
<span>{{item.name}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -994,7 +996,7 @@ page {
|
|
|
import wepy from '@wepy/core'
|
|
|
import store from '@/store'
|
|
|
import { mapState, mapActions } from '@wepy/x'
|
|
|
-
|
|
|
+import { checkUserControl } from '@/service/user.js'
|
|
|
import moment from 'moment'
|
|
|
import {
|
|
|
getSpaceAdjustList,
|
|
@@ -1029,6 +1031,7 @@ let initListSen = [
|
|
|
id: 0,
|
|
|
code: 'DISCUSSING',
|
|
|
name: '讨论',
|
|
|
+ headImg: 'discuss.svg',
|
|
|
img: 'discuss.png',
|
|
|
checked: true,
|
|
|
textObj: [
|
|
@@ -1042,6 +1045,7 @@ let initListSen = [
|
|
|
id: 1,
|
|
|
code: 'PROJECTING',
|
|
|
name: '投影',
|
|
|
+ headImg: 'shadow2.svg',
|
|
|
img: 'shadow2.png',
|
|
|
checked: false,
|
|
|
textObj: [
|
|
@@ -1055,6 +1059,7 @@ let initListSen = [
|
|
|
id: 2,
|
|
|
code: 'ADJOURNMENT',
|
|
|
name: '散会',
|
|
|
+ headImg: 'beover.svg',
|
|
|
img: 'beover.png',
|
|
|
checked: false,
|
|
|
textObj: [
|
|
@@ -1127,7 +1132,7 @@ wepy.page({
|
|
|
officeData: null,
|
|
|
headScene: '', // 头部文案
|
|
|
headImg: '', // 头部背景图片
|
|
|
- options: { roomType: null, spaceId: 'Sp1101080259c4434730d12144ba890fe11f796d3143' }, // 本地数据
|
|
|
+ options: { roomType: null, spaceId: '' }, // 本地数据
|
|
|
popList: [],
|
|
|
// 上班=ATWORK 讨论=DISCUSSING 投影=PROJECTING 散会=ADJOURNMENT 下班=OFFWORK
|
|
|
meetingRoomSence: [
|
|
@@ -1251,15 +1256,9 @@ wepy.page({
|
|
|
},
|
|
|
// 加载字体
|
|
|
onLoad(routeParams) {
|
|
|
- routeParams = {
|
|
|
- 'from': 'homeSetSpace',
|
|
|
- 'isControlSpace': 3,
|
|
|
- 'buildingId': 'string',
|
|
|
- 'spaceId': 'Sp1101080259c4434730d12144ba890fe11f796d3143',
|
|
|
- 'spaceName': 'string',
|
|
|
- 'floorId': 'string'
|
|
|
- }
|
|
|
+ console.log(routeParams, '----routeParams')
|
|
|
this.getCardWidth()
|
|
|
+ this.getWeatherInfo()// 天气预报
|
|
|
var nowTimeStr = moment().format('YYYY-MM-DD')
|
|
|
var eightTime = moment(nowTimeStr + ' 20:00:00').valueOf()
|
|
|
var sixTime = moment(nowTimeStr + ' 05:00:00').valueOf()
|
|
@@ -1297,28 +1296,32 @@ 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.userControlSpace = this.routeParams
|
|
|
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
|
|
|
+ this.toRoom()
|
|
|
}
|
|
|
break
|
|
|
case 'homeSetSpace':
|
|
@@ -1352,15 +1355,12 @@ wepy.page({
|
|
|
}
|
|
|
},
|
|
|
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
|
|
|
+ return checkUserControl().then(res => {
|
|
|
+ console.log(res, '-----1')
|
|
|
+ // 1-租户下无可控;2-租户有可控;3-用户有可控 4-当前空间为常驻空间
|
|
|
+ this.userControlSpace = res
|
|
|
+ this.options.spaceId = res.spaceId || ''
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
setCanScroll(val) {
|
|
@@ -1530,7 +1530,6 @@ wepy.page({
|
|
|
await this.getWorkDayTime() // 工作组时间
|
|
|
this.getEquipments() // 空间下的设备
|
|
|
this.checkEquipmentConfigStatus()
|
|
|
- this.getWeatherInfo()// 天气预报
|
|
|
},
|
|
|
getEquipments() {
|
|
|
// 获取空间下设备
|
|
@@ -1595,9 +1594,10 @@ wepy.page({
|
|
|
this.getSpaceInfo() // 空间信息
|
|
|
}, 20 * 1000) // 2秒描刷接口
|
|
|
},
|
|
|
-
|
|
|
- mapChangeSpaceInfo(spaceId) {
|
|
|
- this.options.spaceId = spaceId
|
|
|
+ // 地图数据切换空间
|
|
|
+ mapChangeSpaceInfo(obj) {
|
|
|
+ this.userControlSpace = obj
|
|
|
+ this.options.spaceId = obj.spaceId
|
|
|
this.getData()
|
|
|
},
|
|
|
getSpaceInfo() {
|