|
@@ -506,8 +506,6 @@ page {
|
|
|
>
|
|
|
<!-- <map-home v-if="userInfo&& userInfo.userId" -->
|
|
|
<map-home
|
|
|
- :spaceIdProp="spaceIdProp"
|
|
|
- :companyIdProp="companyIdProp"
|
|
|
@mapChangeSpaceInfo="mapChangeSpaceInfo"
|
|
|
></map-home>
|
|
|
</div>
|
|
@@ -978,25 +976,18 @@ import {
|
|
|
queryEquipmentRunConfig
|
|
|
} from '../../api/officehome.js'
|
|
|
|
|
|
-import {
|
|
|
- getMeetingList,
|
|
|
- reserveMeetingroom,
|
|
|
- endMeetingReserve
|
|
|
-} from '@/api/meetingroom'
|
|
|
+import { getMeetingList} from '@/api/meetingroom'
|
|
|
import { isWithinLocation } from '@/service/location'
|
|
|
import config from '@/config'
|
|
|
import loadFont from '@/common/loadFont'
|
|
|
import { getCompanyMapData } from '@/api/home'
|
|
|
-import { saveCompanyConfig } from '@/service/companyConfig'
|
|
|
import { checkHasUserInfo } from '@/service/user'
|
|
|
-// import { floorInfo, defalutSelectedId } from '../intelligentControl/data/map';
|
|
|
import { getNowDate, getTowNum } from '@/service/meetingTimes'
|
|
|
|
|
|
let spaceInfoStatusTimer = null
|
|
|
let pageSelectedAreaRecord = {
|
|
|
// key为楼层ID,value 为spceId
|
|
|
}
|
|
|
-let defalutSelectedId = ''
|
|
|
|
|
|
const switchPanelHeight = 125 // 145是下面块的高
|
|
|
const roomPicTop = 185 // 135是建筑图片的高度 单位都是px
|
|
@@ -1091,12 +1082,7 @@ wepy.page({
|
|
|
movesign: false,
|
|
|
scale: 1,
|
|
|
moveToBottom: false,
|
|
|
- spaceIdProp: '',
|
|
|
- companyIdProp: '',
|
|
|
- preDataFinsh: false,
|
|
|
- selectedFloor: '', // 选择的楼层
|
|
|
floorInfo: [],
|
|
|
- homePageHasHidden: true,
|
|
|
h5StaticPath: config.h5StaticPath + '/page-officehome/',
|
|
|
h5StaticLogo: config.h5StaticPath,
|
|
|
lampHide: false, // 灯列表收起
|
|
@@ -1185,8 +1171,6 @@ wepy.page({
|
|
|
},
|
|
|
viewOne: '', // 导航条第一个
|
|
|
airVisible: false, // 弹窗
|
|
|
- currcompanyId: '',
|
|
|
- saveCompanyIdRes: '',
|
|
|
routeParams: {},
|
|
|
isACATVA: false,
|
|
|
isACATFC: false,
|
|
@@ -1235,87 +1219,16 @@ wepy.page({
|
|
|
// 加载字体
|
|
|
onLoad(routeParams) {
|
|
|
this.getCardWidth()
|
|
|
- if (!this.homePageHasHidden) return
|
|
|
var nowTimeStr = moment().format('YYYY-MM-DD')
|
|
|
var eightTime = moment(nowTimeStr + ' 20:00:00').valueOf()
|
|
|
var sixTime = moment(nowTimeStr + ' 05:00:00').valueOf()
|
|
|
this.sixTime = sixTime
|
|
|
this.eightTime = eightTime
|
|
|
-
|
|
|
this.routeParams = routeParams
|
|
|
-
|
|
|
- console.log('this.userInfo==', this.userInfo)
|
|
|
-
|
|
|
- // checkHasUserInfo().then(userInfo => {
|
|
|
- // if (userInfo) {
|
|
|
- // // 获取用户对应的空间信息
|
|
|
- // let currcompanyId = routeParams.companyId || this.userInfo.companyId // 获取当前公司
|
|
|
- // let saveCompanyIdRes = wx.getStorageSync('saveCompanyId') // 获取缓存中公司
|
|
|
- // _this.currcompanyId = currcompanyId
|
|
|
- // _this.saveCompanyIdRes = saveCompanyIdRes
|
|
|
-
|
|
|
- // this.saveCompanyIdM(currcompanyId)
|
|
|
- // this.companyIdProp = routeParams.companyId || ''
|
|
|
- // if (this.companyIdProp) {
|
|
|
- // this.visit = true
|
|
|
- // }
|
|
|
- // this.setDefaultSpaceId(currcompanyId) // 给变量赋值
|
|
|
- // console.log('userInfo', userInfo, currcompanyId)
|
|
|
- // saveCompanyConfig(currcompanyId).then(() => {
|
|
|
- // this.preDataFinsh = true
|
|
|
- // let qspaceId = null
|
|
|
- // if (routeParams.q) {
|
|
|
- // let queryAll = decodeURIComponent(routeParams.q)
|
|
|
- // qspaceId = _this.gup('spaceId', queryAll) // 如果传入了spaceId 扫二维码传入的 链接中携带的
|
|
|
- // }
|
|
|
- // if (qspaceId) {
|
|
|
- // this.spaceIdProp = qspaceId
|
|
|
- // this.options.spaceId = qspaceId
|
|
|
- // this.getData()
|
|
|
- // } else if (routeParams.spaceId) {
|
|
|
- // // 如果跳转链接 传入的
|
|
|
- // this.spaceIdProp = routeParams.spaceId
|
|
|
- // this.options.spaceId = routeParams.spaceId
|
|
|
- // this.getData()
|
|
|
- // } else {
|
|
|
- // this.getHistorySelectedArea().then(res => {
|
|
|
- // this.spaceIdProp = res.spaceId
|
|
|
- // this.options.spaceId = res.spaceId
|
|
|
- // this.getData() // 获取数据
|
|
|
- // })
|
|
|
- // }
|
|
|
- // // console.log('onLoad');
|
|
|
- // this.spaceInfoStatusTimer()
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
-
|
|
|
- // // 加载字体
|
|
|
- // loadFont(400)
|
|
|
- // loadFont(500)
|
|
|
},
|
|
|
onShow() {
|
|
|
this.getData() // 获取数据
|
|
|
- if (!this.homePageHasHidden) {
|
|
|
- // 这个是从地图搜索回来
|
|
|
- const lastSearchedSpace = wx.getStorageSync('lastSearchedSpace')
|
|
|
- if (lastSearchedSpace) {
|
|
|
- this.spaceIdProp = lastSearchedSpace.spaceId
|
|
|
- this.options.spaceId = lastSearchedSpace.spaceId
|
|
|
- this.getData() // 获取数据
|
|
|
- wx.removeStorageSync('lastSearchedSpace')
|
|
|
- } else {
|
|
|
- // 这个是从地图切换按钮回来
|
|
|
-
|
|
|
- this.getHistorySelectedArea().then(res => {
|
|
|
- this.spaceIdProp = res.spaceId // 传给子组件
|
|
|
- this.options.spaceId = res.spaceId
|
|
|
- this.getData() // 获取数据
|
|
|
- })
|
|
|
- }
|
|
|
- // 2秒测试
|
|
|
- this.spaceInfoStatusTimer()
|
|
|
- }
|
|
|
+ this.spaceInfoStatusTimer()
|
|
|
},
|
|
|
onReady() {
|
|
|
// var scale = 750 / wx.getSystemInfoSync().windowWidth ; // 这是px转rpx 750/ wx.getSystemInfoSync().windowWidth=rpx/px 任何手机都是750rpx
|
|
@@ -1366,7 +1279,6 @@ wepy.page({
|
|
|
changeAirHandOrder(pobj, deviceObjCopy) {
|
|
|
this.$refs.airHandCard.changeOneAir(pobj.id, pobj.code, pobj.value, deviceObjCopy)
|
|
|
this.airHandItem = deviceObjCopy
|
|
|
- console.log('changeAirHandOrderchangeAirHandOrder')
|
|
|
},
|
|
|
// 地暖弹框
|
|
|
openFloorFeatPop(val) {
|
|
@@ -1482,76 +1394,6 @@ wepy.page({
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- gup(name, url) {
|
|
|
- if (!url) url = location.href
|
|
|
- // name = name.replace(/[\[]/, '\\\[').replace(/[\]]/, '\\\]');
|
|
|
- var regexS = name + '=([^&#]*)'
|
|
|
- var regex = new RegExp(regexS)
|
|
|
- var results = regex.exec(url)
|
|
|
- return results == null ? null : results[1]
|
|
|
- },
|
|
|
- saveCompanyIdM(companyId) {
|
|
|
- wx.setStorage({
|
|
|
- key: 'saveCompanyId',
|
|
|
- data: {
|
|
|
- companyId: companyId
|
|
|
- },
|
|
|
- success: function () { },
|
|
|
- fail: function () { }
|
|
|
- })
|
|
|
- },
|
|
|
- getHistorySelectedArea() {
|
|
|
- var _this = this
|
|
|
- var spaceId = ''
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- wx.getStorage({
|
|
|
- key: 'SelectedASpace',
|
|
|
- success: res => {
|
|
|
- if (res.data && res.data.spaceId) {
|
|
|
- if (
|
|
|
- _this.currcompanyId == _this.saveCompanyIdRes.companyId ||
|
|
|
- !_this.saveCompanyIdRes.companyId
|
|
|
- ) {
|
|
|
- // 如果公司id无变化
|
|
|
- spaceId = res.data.spaceId
|
|
|
- } else {
|
|
|
- // 如果公司id有变化
|
|
|
- if (_this.routeParams.companyId) {
|
|
|
- // 如果是访客 取默认
|
|
|
- spaceId = defalutSelectedId[this.selectedFloor]
|
|
|
- } else {
|
|
|
- // 取用户
|
|
|
- spaceId = _this.userInfo.spaceId
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- console.log(
|
|
|
- 'getHistorySelectedArea',
|
|
|
- _this.currcompanyId,
|
|
|
- _this.saveCompanyIdRes.companyId
|
|
|
- )
|
|
|
- spaceId = spaceId || defalutSelectedId[this.selectedFloor]
|
|
|
-
|
|
|
- resolve({
|
|
|
- spaceId: spaceId
|
|
|
- })
|
|
|
- },
|
|
|
- fail: () => {
|
|
|
- if (_this.routeParams.companyId) {
|
|
|
- // 如果是访客 取默认
|
|
|
- spaceId = defalutSelectedId[this.selectedFloor]
|
|
|
- } else {
|
|
|
- spaceId = _this.userInfo.spaceId
|
|
|
- }
|
|
|
- console.log('getHistorySelectedArea22', spaceId)
|
|
|
- resolve({
|
|
|
- spaceId: spaceId
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
getWeatherInfo() {
|
|
|
getWeather().then(res => {
|
|
|
const outWeather = res.content ? res.content : {}
|
|
@@ -1971,9 +1813,6 @@ wepy.page({
|
|
|
},
|
|
|
// 进入地图页
|
|
|
toRoom() {
|
|
|
- // wx.navigateTo({
|
|
|
- // url: `../intelligentControl/home?id=${this.officeData.id}&from=officehome&companyIdProp=${this.companyIdProp}`
|
|
|
- // }) ;
|
|
|
this.scrollTop = null
|
|
|
this.scrollTop = 0
|
|
|
this.transY = this.transYCopy
|
|
@@ -2020,24 +1859,6 @@ wepy.page({
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- // 取得所有的会议室
|
|
|
- getAlllMeeting() {
|
|
|
- var _this = this
|
|
|
- return getMeetingList().then(function (res) {
|
|
|
- // console.log('getMeetingList1111', res) ;
|
|
|
- var allmeeting = []
|
|
|
- var resdata = res.data
|
|
|
- for (var key in resdata) {
|
|
|
- var list = (resdata[key] && resdata[key].list) || []
|
|
|
- allmeeting = allmeeting.concat(list)
|
|
|
- }
|
|
|
- // 找到符合条件的会议室 同一个名字
|
|
|
- var filtermeetingArr = allmeeting.filter(function (item) {
|
|
|
- return item.meeting.name === _this.officeData.localName
|
|
|
- })
|
|
|
- _this.filtermeeting = filtermeetingArr[0] || {}
|
|
|
- })
|
|
|
- },
|
|
|
hideScene() {
|
|
|
this.sceneShow = false
|
|
|
},
|
|
@@ -2077,13 +1898,9 @@ wepy.page({
|
|
|
console.log('handleScene this.popList', this.popList)
|
|
|
},
|
|
|
|
|
|
- // 返回 首页
|
|
|
+ // 返回 上一页
|
|
|
goPre() {
|
|
|
- if (this.routeParams.q) {
|
|
|
- wx.redirectTo({ url: '/pages/homev2' })
|
|
|
- } else {
|
|
|
- wx.navigateBack()
|
|
|
- }
|
|
|
+ wx.navigateBack()
|
|
|
},
|
|
|
setTopBarHeight(height) {
|
|
|
this.topBarHeight = height
|