Selaa lähdekoodia

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

anxiaoxia 1 vuosi sitten
vanhempi
commit
51b7d7b4f2

+ 1 - 1
src/config/index.js

@@ -28,7 +28,7 @@ config = Object.assign(base, config, {
   // h5PagePath: config.h5Origin + '/#',
   h5PagePath: 'http://localhost:8081/' + '/#',
   // h5StaticPath: 'http://192.168.16.234:8080/static',
-  h5StaticPath:'/static',
+  h5StaticPath:'http://wechat.sagacloud.cn/saga/image/wechat/static',
   // h5StaticPath: config.h5Origin + '/static/WeChat',
   featuresVersion,
   projectName,

+ 13 - 1
src/packagesEnv/api/mapApi.js

@@ -1,6 +1,16 @@
 import $http from '@/common/request.js';
 import config from '@/config';
 
+// 获取建筑数据
+function getBuildingList(params) {
+    return $http({
+        url: `${config.objectService}object/building/query?projectId=Pj1101080259`,
+        method: 'POST',
+        data: JSON.stringify(params),
+        isComParams: false   // 是否携带通用的参数
+    })
+}
+
 // 获取楼层数据
 function getFloorList(params) {
     return $http({
@@ -22,5 +32,7 @@ function getMapInfo(params) {
 }
 
 export {
-    getFloorList
+    getFloorList,
+    getBuildingList,
+    getMapInfo
 }

+ 29 - 92
src/packagesEnv/pages/intelligentControl/home2.wpy

@@ -198,7 +198,6 @@ movable-view {
   }
 }
 </style>
-
 <template>
   <div class="page-intelligent-control" v-on:click="flodFloorFun">
     <div class="top-bar"></div>
@@ -316,7 +315,7 @@ import config from '@/config';
 import { mapState } from '@wepy/x';
 import { saveCompanyConfig } from '@/service/companyConfig';
 import { getCompanyMapData } from '@/api/home';
-import { getFloorList } from '@/packagesEnv/api/mapApi.js';
+import { getBuildingList, getFloorList } from '@/packagesEnv/api/mapApi.js';
 
 let h5StaticPath = config.h5StaticPath + '/page-intelligent-control/';
 const tarBarHeight = 96;
@@ -372,7 +371,6 @@ wepy.component({
     mapWidth: 2336,
     mapScale: 1,
     screenScale: 1,
-
     mapMoveByTouch: false,
     touchScale: 1,
     isShowLocationEntrance: false,
@@ -381,7 +379,9 @@ wepy.component({
     pageHide: false,
     query: {},
     floors: [],
-    companyId: ''
+    companyId: '',
+    buildingData: [],
+    buildingItem: {}
   },
   computed: {
     ...mapState({
@@ -393,95 +393,11 @@ wepy.component({
     })
   },
   ready() {
-    // 页面加载
-    // let from = query.from;
-    // this.canSearchPerson = query.from !== 'visit'; // 从访客进入的页面无法搜索人
-    // 如果从博瑞尚格智慧空间过来,面板是折叠起来,并且不能滑动
-    if (from == 'officehome') {
-      this.foldStatus = 'fold';
-      this.canSlideExpanel = false;
-    }
-
     // 获取地图数据
-    this.getFloorList();
-
-    // checkHasUserInfo()
-    //   .then(userInfo => {
-    //     // let companyId =
-    //     //   query.from !== 'visit' ? userInfo.companyId : query.companyId;
-    //     let companyId = this.companyIdProp || userInfo.companyId;
-    //     this.companyId = companyId;
-    //     return getCompanyMapData(companyId);
-    //   })
-    //   .then(res => {
-    //     CompanyMapData = JSON.parse(res.data);
-    //     this.selectedFloor = CompanyMapData.floorInfo[0].floorId;
-    //     this.floors = CompanyMapData.floorInfo;
-    //     this.isShowLocationEntrance = CompanyMapData.sagaCareBluetooth || false;
-    //     this.getMapSize();
-    //     return this.getHistorySelectedArea();
-    //   })
-    //   .then(historyArea => {
-    //     // let historyAreaInfo = CompanyMapData.mapInfo.find(
-    //     //   e => e.id == historyArea.spaceId
-    //     // );
-    //     return getMapInfoHttp(this.companyId).then(res => {
-    //       const result = JSON.parse(res.data);
-    //       const httpDdata = (result && result.content) || [];
-    //       return {
-    //         historyArea,
-    //         httpDdata
-    //       };
-    //     });
-    //   })
-    //   .then(res => {
-    //     const { httpDdata, historyArea } = res;
-    //     let historyAreaInfo;
-    //     let selectarea;
-    //     let selectAraeId = null;
-    //     if (from == 'officehome') {
-    //       selectAraeId = this.spaceIdProp;
-    //     } else {
-    //       selectAraeId = historyArea.spaceId;
-    //     }
-    //     CompanyMapData.mapInfo.forEach(item => {
-    //       item.canClick =
-    //         typeof item.canClick === 'boolean'
-    //           ? item.canClick
-    //           : JSON.parse(item.canClick);
-    //       item.borderRadius = item.borderRadius
-    //         ? item.borderRadius instanceof Array
-    //           ? item.borderRadius
-    //           : item.borderRadius
-    //               .slice(2, item.borderRadius.length - 2)
-    //               .split(',')
-    //         : undefined;
-    //     });
-    //     combinedData = httpDdata.reduce((acc, cur) => {
-    //       let target = acc.find(e => e.id == cur.id);
-
-    //       selectarea = acc.find(e => e.id == selectAraeId);
-    //       if (target) {
-    //         Object.assign(target, { title: cur.localName });
-    //       } else {
-    //       }
-
-    //       if (target && target.id == selectAraeId) {
-    //         selectarea = { ...target }; // 如果有新数据,则更新选中的数据
-    //       }
-    //       return acc;
-    //     }, CompanyMapData.mapInfo);
-    //     this.mapAreasInfo = combinedData;
-    //     // 如果从博瑞尚格智慧空间过来,面板是折叠起来,并且不能滑动
-    //     if (from == 'officehome') {
-    //       this.foldPanelFun();
-    //       this.doSelectArea(selectarea);
-    //       // this.getSpaceTem();
-    //     } else {
-    //       this.autoSelectArea(selectarea);
-    //     }
-    //   });
+    this.init();
   },
+  // 页面激活
+  attached() {},
   watch: {
     // 父亲传过来的空间id 搜索返回才会有这个传递
     spaceIdProp: function(newSpaceId, oldSpaceId) {
@@ -494,13 +410,34 @@ wepy.component({
     }
   },
   methods: {
+    init() {
+      this.projectId = 'Pj1101080259';
+      this.getPageBuildingList();
+    },
+    //获取建筑数据
+    getPageBuildingList() {
+      let params = {
+        criteria: {
+          projectId: 'Pj1101080259'
+        }
+      };
+      console.log(this.projectId);
+      getBuildingList(params).then(res => {
+        console.log('获取常驻空间');
+        console.log(res);
+        this.buildingData = res.content || [];
+        this.buildingItem = this.buildingData[0];
+        this.getFloorList();
+      });
+    },
     /**
      * 查询楼层信息
      */
     getFloorList() {
       let params = {
         criteria: {
-          projectId: this.projectId
+          projectId: 'Pj1101080259',
+          buildingId: this.buildingItem.id
         }
       };
       getFloorList(params).then(res => {

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 861 - 0
src/packagesEnv/pages/intelligentControl/home2copy.wpy


+ 16 - 9
src/pages/bindTenant/index.wpy

@@ -92,34 +92,34 @@ page {
 <template>
  <div class="overflow-wrap">
   <page-top-bar title="公司身份选择" 
-  titleColor="#1B2129" bgColor="#EBF5FA" icon="{{h5StaticPath+'/topBar/return-icon.svg'}}"></page-top-bar>
+  titleColor="#1B2129" bgColor="#EBF5FA" icon="{{h5StaticPath+'/page-top-bar/return-icon.svg'}}"></page-top-bar>
    <div class="bind-item check-item">
       <div class="tenant-name">禹数科技有限公司</div>
       <div class="tenant-identity">
         <div class="info">正式员工</div>
-        <image class="logo-icon" src="{{h5StaticPath+'/bindTenant/logo_icon.svg'}}"/>
+        <image class="logo-icon" src="{{h5StaticPath+'/page-bind-tenant/logo_icon.svg'}}"/>
       </div>
-      <image class="checked-icon" src="{{h5StaticPath+'/bindTenant/checked.svg'}}"/>
+      <image class="checked-icon" src="{{h5StaticPath+'/page-bind-tenant/checked.svg'}}"/>
    </div>
    <div class="bind-item">
       <div class="tenant-name">禹数科技有限公司</div>
       <div class="tenant-identity">
         <div class="info">正式员工</div>
-        <image class="logo-icon" src="{{h5StaticPath+'/bindTenant/logo_icon.svg'}}"/>
+        <image class="logo-icon" src="{{h5StaticPath+'/page-bind-tenant/logo_icon.svg'}}"/>
       </div>
-      <image class="checked-icon" src="{{h5StaticPath+'/bindTenant/checked.svg'}}"/>
+      <image class="checked-icon" src="{{h5StaticPath+'/page-bind-tenant/checked.svg'}}"/>
    </div>
    <div class="bind-item" :key="key" v-for="(item,key) in 20">
       <div class="tenant-name">禹数科技有限公司</div>
       <div class="tenant-identity">
         <div class="info">正式员工</div>
-        <image class="logo-icon" src="{{h5StaticPath+'/bindTenant/logo_icon.svg'}}"/>
+        <image class="logo-icon" src="{{h5StaticPath+'/page-bind-tenant/logo_icon.svg'}}"/>
       </div>
-      <image class="checked-icon" src="{{h5StaticPath+'/bindTenant/checked.svg'}}"/>
+      <image class="checked-icon" src="{{h5StaticPath+'/page-bind-tenant/checked.svg'}}"/>
    </div>
 
    <div class="bind-btn-box">
-    <button>确认</button>
+    <button @click="goEnv">确认</button>
    </div>
  </div>
 </template>
@@ -149,7 +149,14 @@ wepy.page({
   onShow() {
     // this.checkAuthCamra();
   },
-  methods: {},
+  methods: {
+    goEnv() {
+      wx.navigateTo({
+        url:
+          '/packagesEnv/pages/officehome/index?spaceId=Sp1101080259b3510e26e7dd4dd9bf9784f06f3feb68'
+      });
+    }
+  },
   created() {}
 });
 </script>