Browse Source

fix:搜索页面

chenzhen2 1 year ago
parent
commit
44e043fac8

+ 10 - 0
src/packagesEnv/pages/intelligentControl/home2.wpy

@@ -653,6 +653,13 @@ wepy.component({
           this.setMapIcon();
           this.getMapSize();
           console.log('this.selectArea===', this.selectArea);
+          if (this.selectArea) {
+            if (this.space.from) {
+              this.doSelectArea(this.selectArea);
+            } else {
+              this.doSelectArea(this.selectArea, true);
+            }
+          }
         })
         .catch(() => {});
     },
@@ -697,6 +704,9 @@ wepy.component({
           item.backgroundColor = '';
         }
       });
+      if (this.space.from == 'FindIt') {
+        this.selectArea;
+      }
     },
     // 切换建筑
     changeBuildingFun(building) {

+ 52 - 12
src/packagesEnv/pages/search/index.wpy

@@ -32,6 +32,7 @@ page {
     line-height: 48rpx;
     background-color: transparent;
     font-size: 14px;
+    caret-color: #1DB1B2;
   }
 
   .input-wrap .icon {
@@ -44,6 +45,12 @@ page {
     position: absolute;
     left: 40rpx;
     top: 24rpx;
+    width: 46rpx;
+    height: 46rpx;
+    image {
+      width: 46rpx;
+      height: 46rpx;
+    }
   }
 
   .input-wrap .icon-close-wrap {
@@ -112,10 +119,14 @@ page {
           line-height: 48rpx;
           letter-spacing: 0px;
         }
+        &:active {
+          border-radius: 16rpx;
+          background: #f1f4f6;
+        }
       }
       .active {
-        border-radius: 16rpx;
-        background: #f1f4f6;
+        // border-radius: 16rpx;
+        // background: #f1f4f6;
       }
     }
   }
@@ -162,6 +173,17 @@ page {
           color: #1b2129;
         }
       }
+      &:active {
+        background: #f1f4f6;
+      }
+    }
+  }
+  .no-search {
+    text-align: center;
+    image {
+      width: 440rpx;
+      height: 292rpx;
+      margin: 160rpx auto;
     }
   }
 }
@@ -177,7 +199,7 @@ page {
       <!--搜索框-->
       <view class="input-wrap">
         <label for="spaceSearchInputId" class="icon-search-wrap">
-          <image class="icon" src="{{h5StaticPath+ 'icon_search.svg'}}" />
+          <image class="icon" src="{{h5StaticPath+ 'icon-search.svg'}}" />
         </label>
         <input
           id="spaceSearchInputId"
@@ -205,9 +227,10 @@ page {
          <view class="content">
           <view class="content-item" 
           :key="index"
+          @click.stop="checkSpace(item)"
           v-for="(item,index) in histroyData">
           <image src="{{h5StaticPath+'metting-icon.svg'}}" alt=""/>
-          <view>ddgggggg</view>
+          <view>{{item.name?item.name:item.permanentSpaceName }}</view>
           </view>
          </view> 
       </view> 
@@ -220,7 +243,6 @@ page {
          <view class="content">
           <view class="content-item" 
           :key="'metting'+index"
-          :class="{'active':(activeId==item.permanentSpaceId)}"
           @click.stop="checkSpace(item)"
           v-for="(item,index) in meetingData">
           <image src="{{h5StaticPath+'metting-icon.svg'}}" alt=""/>
@@ -234,7 +256,9 @@ page {
           <view class="title">
           <label>匹配结果</label>
          </view>
-          <view class="searchable-item" :key="index+'serach'" v-for="(item,index) in serachData">
+          <view class="searchable-item" 
+          @click.stop="checkSpace(item,1)"
+          :key="index+'serach'" v-for="(item,index) in serachData">
             <image src="{{h5StaticPath+'metting-icon.svg'}}" alt=""/>
             <view class="searchable">
               <!-- {{ item.name?item.name:item.permanentSpaceName }} -->
@@ -242,8 +266,11 @@ page {
             </view>
           </view>
       </view>
-      
-   </view>
+
+      <view v-else-if="serachData && serachData.length==0" class="no-search">
+        <image src="{{ h5StaticPath+'no-data.svg'}}"/>
+     </view>
+     </view>
 </template>
 
 <script>
@@ -285,6 +312,8 @@ wepy.page({
   },
   methods: {
     init() {
+      let histroyData = wx.getStorageSync('histroyData') || [];
+      this.histroyData = histroyData;
       this.getMeeting();
     },
     getHilightStrArray(str, key) {
@@ -322,16 +351,27 @@ wepy.page({
         });
       });
     },
-    checkSpace(item) {
-      this.activeId = item.permanentSpaceId;
-      console.log("item.permanentSpaceId==",item.permanentSpaceId)
+    checkSpace(item, type) {
+      // this.activeId = item.permanentSpaceId;
+      // console.log('item.permanentSpaceId==', item.permanentSpaceId);
+      if (type == 1) {
+        this.histroyData.map((historyItem, index) => {
+          if (
+            historyItem.permanentSpaceId == item.permanentSpaceId &&
+            historyItem.name == item.name
+          ) {
+            this.histroyData.split(index, 1);
+          }
+        });
+        this.histroyData.push(item);
+        wx.setStorageSync('histroyData', this.histroyData);
+      }
       // 去地图页面
       wx.navigateTo({
         url: `/packagesEnv/pages/officehome/index?from=FindIt&floorId=${
           item.floorId
         }&buildingId=${item.buildingId}&spaceId=${item.permanentSpaceId}`
       });
-      
     },
     // 搜索
     getInputValue(e) {

File diff suppressed because it is too large
+ 3 - 0
static/page-search/icon-search.svg


File diff suppressed because it is too large
+ 37 - 0
static/page-search/no-data.svg