<nav title="搜索"></nav>
<ion-content class="content">
  <ion-searchbar
    animated="true"
    [(ngModel)]="value"
    (keyup.enter)="toSearch()"
    placeholder="搜索"
    color="light"
  ></ion-searchbar>
  @if (roomList.length == 0) {
  <div class="title">搜索历史</div>
  <div class="history-data">
    @for (item of Search; track $index) {
    <div class="data-li" (click)="SearchHot(item)">
      {{ item }}
    </div>
    }
  </div>
  <div class="title">热门搜索</div>
  <div class="history-data">
    @for (item of hots; track $index) {
    <div class="data-item" (click)="SearchHot(item?.get('title'))">
      {{ $index + 1 }}
      <div class="date-li-name">.{{ item?.get("title") }}</div>
    </div>
    }
  </div>
  }@else {
  <div class="room-list">
    @for (item of roomList; track $index) {
    <div
      class="list-row"
      (click)="toUrl('user/profile/' + item.uid)"
      [style.background-image]="'url(' + item?.cover + ')'"
    >
      <div class="title-tag">在线聊天</div>
      <div class="live-tag">
        <!-- <span></span>  -->
        <img src="img/live.gif" alt="" />
        直播中
      </div>
      <div class="room-footer">
        <div class="user">
          {{
            item?.nickname || item?.mobile
          }}
        </div>
        <div class="desc">{{ item?.title }}</div>
        <div class="city-block">
          <div class="row-li">
            <ion-icon name="location-outline"></ion-icon>
            江西
          </div>
          <div class="row-li" style="margin-left: 4px">
            <img
              src="https://file-cloud.fmode.cn/Qje9D4bqol/20241109/pctmvt110807052.png"
              alt=""
            />
            22
          </div>
        </div>
      </div>
    </div>
    }
  </div>
  }
</ion-content>
