<template>
  <view class="tabs_content">
    <hs-tabs :list="list" :current="useModel.currentTabs.value" @onChange="handleTabsChange" />
  </view>
</template>

<script setup lang="ts">
import { ref } from 'vue'
let list = [
  { label: '我的房屋', value: '1' },
  { label: '待审中房屋', value: '2' }
]
const emit = defineEmits(['change'])
import useModel from '../model'
import method from '../method'

const handleTabsChange = (idx: number) => {
  console.log(idx, '切换tab')
  useModel.currentTabs.value = idx
  useModel.formData.value.page = 1
  useModel.dataList.value = []
  if (idx === 0) {
    method?.getHouseList()
  }
  if (idx === 1) {
    method?.getHouseRegistersList()
  }
  // method?.handleGetList()
}
</script>

<style lang="scss" scoped>
.tabs_content {
  border-top: 1rpx solid #eee;
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  z-index: 100;
  background-color: #fff;
  .filter_content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1rpx solid #eee;
    padding: 15rpx 30rpx;
  }
}
</style>
