<template>
  <view>
    <MySearchBox />
    <view class="house_contents">
      <hs-empty v-if="!useModel?.listData?.value?.length" />
      <view
        class="house_list"
        v-for="(i, index) in useModel?.listData?.value"
        :key="`item_${index}`"
      >
        <view class="house_floor_title"> {{ i?.floor }}楼 </view>
        <view class="house_list_content">
          <view
            class="house_item"
            v-for="(k, idx) in i?.houses"
            :key="`item_${index}_${idx}`"
            @click="method?.toDetaile(k)"
          >
            <view class="room_number"> {{ k?.name }} </view>
            <view :class="`status status_${k?.has_arrear}`">
              {{ k?.has_arrear ? '欠费' : '结清' }}
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>
<script setup lang="ts">
import useModel from './model'
import method from './method'
import MySearchBox from './components/SearchBox.vue'
import { onLoad } from '@dcloudio/uni-app'
onLoad(() => {
  method.getGridAssetBuilding()
})
</script>

<style lang="scss">
@import './style.scss';
</style>
