<template>
  <view class="asset_houses">
    <!-- <MyTabs /> -->
    <cc-scroll-loading :meta="useModel?.meta?.value" @load="method?.handleLoadMore">
      <MyMeHouseItem v-if="useModel?.currentTabs?.value === 0" />
      <MyMeReviewItem v-if="useModel?.currentTabs?.value === 1" />
    </cc-scroll-loading>
    <view class="footer">
      <view class="btn" @click="method?.hadnleNewBindingHouse">
        添加新房屋 <uni-icons type="plusempty" color="#666" size="15"></uni-icons>
      </view>
    </view>
  </view>
</template>
<script setup lang="ts">
import { onLoad, onShow } from '@dcloudio/uni-app'
import MyTabs from './components/Tabs.vue'
import method from './method'
import MyMeHouseItem from './components/MeHouseItem.vue'
import MyMeReviewItem from './components/MeReviewItem.vue'
import { HouseOccupantsHouseRelationEnum } from '@/gen/Enums'
import useModel from './model'
import { useWeAppAuthStore } from '@/common'
const auth = useWeAppAuthStore()
import MyCreateHousehold from './components/CreateHousehold.vue'

onShow(() => {
  useModel.selectedHouseEd.value = { id: auth?.data?.selected_house?.id || '' }
})

onLoad((opt: any) => {
  useModel.dataList.value = []
  useModel.currentTabs.value = opt?.type === '1' ? 1 : 0
  method?.handleLoadMore(1)
})
</script>
<style lang="scss">
@import './style.scss';
</style>
