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(page: number) {
    useModel.formData.value.page = page
    getList()
  },
  toDetaile(e: { id: string }) {
    uni.navigateTo({
      url: `/INDEX/message_center/show/index?id=${e?.id}`
    })
  }
}
