<template>
  <CommonListPage 
    title="我的投稿"
    showTotal
    emptyText="您还没有投稿，欢迎去投稿"
    detailsPage="custom"
    :load="loadData" 
    @goCustomDetails="goDetail"
  />
</template>

<script setup lang="ts">
import { navTo } from '@/components/utils/PageAction';
import ContributeApi from '@/api/user/ContributeApi';
import CommonListPage from '@/pages/article/common/CommonListPage.vue';

async function loadData(
  page: number, 
  pageSize: number,
  searchText: string,
  dropDownValues: number[]
) {
  const list = await ContributeApi.getContributeList(page, pageSize);
  return {
    list,
    total: list.length,
  }
}
function goDetail(item: any, id: number) {
  navTo('/pages/article/details', { 
    id,
    modelId: item.modelId, 
    mainBodyColumnId: item.mainBodyColumnId 
  });
}
</script>

<style lang="scss">
.article_list {
  padding: 20rpx;
}
</style>
