Просмотр исходного кода

🎨 按要求修改细节问题

快乐的梦鱼 месяцев назад: 2
Родитель
Сommit
829234efe9

+ 5 - 5
src/pages/inhert/intangible/DetailsCommon.vue

@@ -147,10 +147,6 @@
           small
           :descItems="[
             {
-              label: '地址',
-              value: content.address,
-            },
-            {
               label: '项目级别',
               value: content.levelText ,
             },
@@ -171,7 +167,11 @@
               value: content.unit 
             },
             {
-              label: '其他级别项目',
+              label: '地址',
+              value: content.address,
+            },
+            {
+              label: '其他级别保护单位',
               value: content.otherLevel && content.otherLevel.length > 0 ? `${content.otherLevel.length}个` : ''
             },
           ]"

+ 2 - 2
src/pages/inhert/village/list.vue

@@ -55,9 +55,9 @@ const tabs = ref<{id: number, text: string}[]>();
 
 onMounted(async () => {
   const res = await CommonContent.getCategoryList(151);
-  const it1 = res.find(p => p.title == '国家级');
+  const it1 = res.find(p => p.title == '特色村舍');
   const it2 = res.find(p => p.title == '省级');
-  if (it1) it1.title = '特色村舍';
+  if (it1) it1.title = '美丽村舍';
   if (it2) it2.title = '传统村落';
   tabs.value = res.slice(1).map((p) => ({ id: p.id, text: p.title }));
   await waitTimeOut(400);

+ 38 - 49
src/pages/introduction/custom/list.vue

@@ -2,34 +2,11 @@
   <CommonListPage 
     title="闽南民俗"
     itemType="image-large-2"
-    :detailsPage="[
-      {
-        page: '/pages/article/details',
-        params: {
-          modelId: 4,
-          mainBodyColumnId: 245,
-        }
-      },
-      {
-        page: '/pages/article/details',
-        params: {
-          modelId: 4,
-          mainBodyColumnId: 248,
-        }
-      },
-      {
-        page: '/pages/inhert/intangible/details',
-        params: {},
-      }
-    ]"
+    detailsPage="custom"
     showTotal
     :dropDownNames="dropdownNames"
     :load="loadData" 
-    :tabs="[
-      { id: 245, text: '婚丧嫁娶' },
-      { id: 248, text: '民俗节庆' },
-      { id: 100, text: '非遗民俗' },
-    ]"
+    @goCustomDetails="handleDetils"
   />
   <!--  -->
 </template>
@@ -39,6 +16,7 @@ import { ref } from 'vue';
 import CommonListPage, { type DropDownNames } from '@/pages/article/common/CommonListPage.vue';
 import CommonContent, { GetContentListParams } from '@/api/CommonContent';
 import ProjectsContent from '@/api/inheritor/ProjectsContent';
+import { navTo } from '@/components/utils/PageAction';
 
 const dropdownNames = ref<DropDownNames[]>([]);
 
@@ -49,30 +27,41 @@ async function loadData(
   dropDownValues: number[],
   tabSelect: number,
 ) {
-  let res;
-  switch (tabSelect) {
-    case 100:
-      res = await ProjectsContent.getContentList(new GetContentListParams()
-        .setKeywords('民俗 ' + searchText)
-      , page, pageSize);
-      res.list.forEach((item) => {
-        item.bottomTags = [
-          item.levelText, 
-          item.ichTypeText, 
-          item.batchText,
-          item.regionText,
-        ]
-      })
-      break;
-    case 0:
-    default:
-      res = await CommonContent.getContentList(new GetContentListParams()
-        .setKeywords(searchText)
-        .setModelId(4)
-        .setMainBodyColumnId(tabSelect)
-      , page, pageSize);
-      break;
-  }
+  const res = await CommonContent.getContentList(new GetContentListParams()
+    .setKeywords(searchText)
+    .setModelId(4)
+    .setMainBodyColumnId([ 245, 248 ])
+  , page, pageSize);
+  res.list.forEach((item) => {
+    item.pageType = 'news';
+  });
+
+  (await ProjectsContent.getContentList(new GetContentListParams()
+    .setKeywords('民俗 ' + searchText)
+  , 1, 20)).list.forEach((item) => {
+    item.pageType = 'intangible';
+    item.bottomTags = [
+      item.levelText, 
+      item.ichTypeText, 
+      item.batchText,
+      item.regionText,
+    ]
+    res.list.push(item);
+  });
   return { list: res.list, total: res.total }
 }
+
+function handleDetils(item: any) {
+  if (item.pageType == 'news') {
+    navTo('/pages/article/details', {
+      modelId: item.modelId,
+      mainBodyColumnId: item.mainBodyColumnId,
+      id: item.id,
+    });
+  } else {
+    navTo('/pages/inhert/intangible/details', {
+      id: item.id,
+    });
+  }
+}
 </script>