custom.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <CommonListPage
  3. :title="'民间习俗'"
  4. :prevPage="{ title: '文化常识' }"
  5. :dropDownNames="[]"
  6. :showSearch="true"
  7. :tagsData="tagsData"
  8. :pageSize="8"
  9. :defaultSelectTag="245"
  10. :load="loadData"
  11. :loadDetail="loadDetail"
  12. />
  13. </template>
  14. <script setup lang="ts">
  15. import { ref } from 'vue';
  16. import { GetContentListParams } from '@/api/CommonContent';
  17. import CustomContent from '@/api/introduction/CustomContent';
  18. async function loadDetail(id: number, item: any) {
  19. return await CustomContent.getContentDetail(id);
  20. }
  21. async function loadData(
  22. page: number,
  23. pageSize: number,
  24. selectedTag: number,
  25. searchText: string,
  26. dropDownValues: number[]
  27. ) {
  28. const res = await CustomContent.getContentList(new GetContentListParams().setSelfValues({
  29. mainBodyColumnId: selectedTag,
  30. keywords: searchText,
  31. }), page, pageSize);
  32. return {
  33. page: page,
  34. total: res.total,
  35. data: res.list.map((item, index) => {
  36. return {
  37. id: item.id,
  38. title: item.title,
  39. desc: item.desc,
  40. image: item.thumbnail || item.image,
  41. };
  42. }),
  43. }
  44. }
  45. //子分类
  46. const tagsData = ref([
  47. { id: 245, name: '全部' },
  48. //{ id: 246, name: '婚丧嫁娶' },
  49. //{ id: 111, name: '民俗节庆' },
  50. //{ id: 248, name: '信仰' },
  51. ]);
  52. </script>
  53. <style>
  54. </style>