import { getApiLoading } from '@/common/libraries/apiLoading'
import { Apis } from '@/gen/Apis'
import useModel from './model'
import { useWeAppAuthStore } from '@/common'
const auth = useWeAppAuthStore()
const getList = () => {
  getApiLoading(Apis.Msg.MsgPropertyAnnouncements.List, useModel?.formData?.value).then(res => {
    useModel.listData.value = [...useModel.listData.value, ...res?.data]
    useModel.metaData.value = res?.meta
    console.log(res)
  })
}
export default {
  getList,
  loadMore(res: any) {
    useModel.formData.value.page = res?.page
    getList()
  },
  toDetaile(e: { id: string }) {
    uni.navigateTo({
      url: `/ME/announcement/show/index?id=${e?.id}`
    })
  }
}
