feature.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <CommonListPage
  3. :title="'艺术特色'"
  4. :prevPage="{ title: '文化常识' }"
  5. :dropDownNames="[]"
  6. :showSearch="true"
  7. :tagsData="tagsData"
  8. :pageSize="8"
  9. :defaultSelectTag="243"
  10. :loadDetail="loadDetail"
  11. :load="loadData"
  12. />
  13. </template>
  14. <script setup lang="ts">
  15. import { ref } from 'vue';
  16. import { GetContentListParams } from '@/api/CommonContent';
  17. import FeatureContentApi from '@/api/introduction/FeatureContent';
  18. async function loadDetail(id: number, item: any) {
  19. return await FeatureContentApi.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 FeatureContentApi.getContentList(new GetContentListParams().setSelfValues({
  29. mainBodyColumnId: selectedTag == tagsData.value[0].id ? tagsData.value.map(p => p.id) : 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: 243, name: '全部' },
  48. { id: 238, name: '音乐' },
  49. { id: 239, name: '舞蹈' },
  50. { id: 240, name: '戏曲' },
  51. { id: 241, name: '曲艺' },
  52. { id: 242, name: '民间工艺' },
  53. ]);
  54. </script>
  55. <style>
  56. </style>