Browse Source

fix:地图数据

chenzhen2 1 year ago
parent
commit
d56efa2982

+ 14 - 1
project.private.config.json

@@ -8,5 +8,18 @@
     "preloadBackgroundData": false
   },
   "libVersion": "3.0.1",
-  "projectname": "sagacloud-sagacare-weChat"
+  "projectname": "sagacloud-sagacare-weChat",
+  "condition": {
+    "miniprogram": {
+      "list": [
+        {
+          "name": "",
+          "pathName": "packagesEnv/pages/officehome/index",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        }
+      ]
+    }
+  }
 }

+ 2 - 2
src/api/user.js

@@ -71,8 +71,8 @@ function refreshToken(refreshToken) {
 // 获取用户空间权限
 function getUserControlSpace(params) {
   return $http({
-      url: `http://192.168.88.4:52009/userControlSpace/query`,
-      // url: `${config.setupService}userControlSpace/query`,
+      // url: `http://192.168.88.4:52009/userControlSpace/query`,
+      url: `${config.setupService}userControlSpace/query`,
       method: 'POST',
       data: JSON.stringify(params),
       isComParams: false    // 是否携带通用的参数

+ 2 - 2
src/packagesEnv/api/mapApi.js

@@ -24,8 +24,8 @@ function getFloorList(params) {
 // 获取地图数据
 function getMapInfo(params) {
     return $http({
-        url: `http://192.168.88.4:52015/map/queryMapInfo`,
-        // url: `${config.setupService}map/queryMapInfo`,
+        // url: `http://192.168.88.4:52015/map/queryMapInfo`,
+        url: `${config.setupService}map/queryMapInfo`,
         method: 'POST',
         data: JSON.stringify(params),
         isComParams: false    // 是否携带通用的参数

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

@@ -201,15 +201,14 @@ movable-view {
 
 .selected-icon {
   height: 38px;
-  // width: 102px;
   position: absolute;
-  // background: '#AC8BE8';
+  background: #ac8be8;
+  border-radius: 30px;
   background-size: 100% 100%;
   z-index: 9999;
   text-align: center;
-  // transform-origin: 36px 54px; //偏移量决定的
-  // img
   label {
+    position: relative;
     display: inline-block;
     font-family: PingFang SC;
     font-size: 14px;
@@ -219,6 +218,27 @@ movable-view {
     letter-spacing: 0px;
     text-align: center;
     margin: 0 auto;
+    &:before {
+      position: absolute;
+      content: '';
+      width: 0;
+      height: 0;
+      top: 30px;
+      left: 50%;
+      transform: translateX(-50%) rotate(90deg);
+      border-top: solid 10px transparent;
+      border-left: solid 10px #ac8be8;
+      border-bottom: solid 10px transparent;
+      border-top-width: 10px;
+      border-top-style: solid;
+      border-top-color: transparent;
+      border-left-width: 10px;
+      border-left-style: solid;
+      border-left-color: #ac8be8;
+      border-bottom-width: 10px;
+      border-bottom-style: solid;
+      border-bottom-color: transparent;
+    }
   }
 }
 
@@ -373,7 +393,7 @@ movable-view {
                   class="selected-icon"
                   wx:if="{{selectArea}}"
                   mode="scaleToFill"
-                  :style="{width:(selectArea.selectIconWidth)+'px', top:(selectArea.top*mapScale+10)+'px',left:(selectArea.left*mapScale+(selectArea.width*mapScale/2)-selectArea.selectIconWidth/2)+'px', transform: 'rotate('+(selectArea.rotate)+'deg)',backgroundImage:'url('+(h5StaticPath)+'/page-map-icon/select-lanse.svg)'}"
+                  :style="{width:(selectArea.selectIconWidth)+'px', top:(selectArea.top*mapScale+10)+'px',left:(selectArea.left*mapScale+(selectArea.width*mapScale/2)-selectArea.selectIconWidth/2)+'px', transform: 'rotate('+(selectArea.rotate)+'deg)'}"
                 >
                 <label>{{ selectArea.localName }}</label>
             </div>
@@ -499,7 +519,7 @@ wepy.component({
     currentSp: '', // 空间id 用于路由跳转
     h5StaticPath,
     mapAreasInfo: [],
-    selectArea: {},
+    selectArea: null,
     x: 0,
     y: 0,
     selectedBuilding: '',
@@ -722,17 +742,6 @@ wepy.component({
         [selectedFloor]: area.id
       };
     },
-    setCacheSelectedFloor(floorId) {
-      const { selectArea } = this;
-      wx.setStorage({
-        key: 'SelectedASpace',
-        data: {
-          floorId: floorId,
-          spaceId: selectArea.floorId == floorId ? selectArea.id : ''
-        },
-        success: function() {}
-      });
-    },
     getHistorySelectedArea() {
       return new Promise((resolve, reject) => {
         wx.getStorage({
@@ -762,30 +771,23 @@ wepy.component({
         });
       });
     },
-
+    // 设置选中的路径
     doSelectArea(area, sign) {
       if (!area) {
         return;
       }
       this.selectArea = area;
       this.selectedFloor = area.floorId;
-      // this.getSpaceTem();
-      this.setCacheSelectedArea(area);
       this.setAreaCenter(area);
       if (!sign) {
         // 如果是父亲传进来的areaId  不执行下面的触发
-        this.$emit('mapChangeSpaceInfo', area.id); // 传给父组件,以请求数据
+        console.log('this.selectArea==', this.selectArea);
+        this.$emit('mapChangeSpaceInfo', area); // 传给父组件,以请求数据
       }
     },
+    // 获取选中的空间
     selectAreaFun(currentSelect) {
-      if (!currentSelect.canClick) {
-        wx.showToast({
-          title: '不可选区域',
-          duration: 1000,
-          icon: 'none'
-        });
-        return;
-      }
+      this.selectArea = null;
       this.doSelectArea(currentSelect);
     },
     setAreaCenter(area) {