<template>
   <CommonListPage
    :title="'闽南文化百科'"
    :prevPage="{ title: '文化常识' }"
    :dropDownNames="[]"
    :pageSize="8"
    :load="loadData"
    :loadDetail="loadDetail"
    defaultImage="https://mncdn.wenlvti.net/app_static/minnan/BookDefaultImage.jpg"
  />
</template>

<script setup lang="ts">
import { GetContentListParams } from '@/api/CommonContent';
import BookContent from '@/api/introduction/BookContent';

async function loadDetail(id: number, item: any) {
  return await BookContent.getContentDetail(id);
}
async function loadData(
  page: number, 
  pageSize: number,
  selectedTag: number,
  searchText: string,
  dropDownValues: number[]
) {

  const res = await BookContent.getContentList(new GetContentListParams()
    .setKeywords(searchText)
  , page, pageSize);

  return { 
    page: page,
    total: res.total,
    data: res.list.map((item, index) => {
      return {
        id: item.id,
        title: item.title,
        desc: item.desc,
        image: item.thumbnail || item.image,
      };
    }),
  }
}
</script>

<style>
</style>

