import { Apis } from '@/gen/Apis'
import useModel from './model'
import { useWeAppAuthStore } from '@/common'
import { getApiLoading } from '@/common/libraries/apiLoading'
import userLoginStatus from '@/common/libraries/userUserLogin'
import { showToastBack, showToast } from '@/common/libraries/naviHelper'
const auth = useWeAppAuthStore()

const getList = () => {
  getApiLoading(Apis.Bill.Bills.List, useModel?.formData?.value).then(res => {
    useModel.listData.value = [...useModel.listData.value, ...res.data]
    useModel.metaData.value = res.meta
    useModel.loadingStatus.value = true
    console.log(res)
  })
}

export default {
  getList,
  loadMore(page: number) {
    useModel.formData.value.page = page
    this.getList()
  },
  showPassedDoc(res: { id: string }) {
    uni.navigateTo({
      url: `/ME/release_items/show/index?id=${res?.id}`
    })
  }
}
