Преглед на файлове

📦 按要求修改栏目

快乐的梦鱼 преди 1 месец
родител
ревизия
4182678e4b
променени са 6 файла, в които са добавени 261 реда и са изтрити 66 реда
  1. 19 1
      src/pages/article/common/CommonContent.ts
  2. 1 0
      src/pages/article/common/CommonListPage.vue
  3. 84 17
      src/pages/discover.vue
  4. 51 17
      src/pages/home.vue
  5. 64 27
      src/pages/inhert.vue
  6. 42 4
      src/pages/travel/fashion/list.vue

+ 19 - 1
src/pages/article/common/CommonContent.ts

@@ -8,6 +8,24 @@ export interface IHomePageMiniCommonListGoMoreAndGoDetail {
   goList: () => void; 
 }
 
+export function navHomePageMiniCommonListGo(p: {
+  title?: string,
+  mainBodyColumnId?: string|number|number[],
+  modelId?: number,
+  itemType?: string,
+  detailsPage? : string,
+}) {
+  navTo('/pages/article/common/list', {
+    title: p.title,
+    mainBodyColumnId: typeof p.mainBodyColumnId == 'object' ? 
+      p.mainBodyColumnId.join(',') : 
+      p.mainBodyColumnId,
+    modelId: p.modelId,
+    itemType: p.itemType || 'article-common',
+    detailsPage: p.detailsPage || '/pages/article/common/detail',
+  }) 
+}
+
 /**
  * 专用于通用内容的首页小列表控制代码组合
  * @param p 
@@ -29,7 +47,7 @@ export function useHomePageMiniCommonListGoMoreAndGoDetail(p: {
     }) 
   }
   function goList() {
-    navTo('/pages/article/common/list', {
+    navHomePageMiniCommonListGo({
       title: p.title,
       mainBodyColumnId: typeof p.mainBodyColumnId == 'object' ? 
         p.mainBodyColumnId.join(',') : 

+ 1 - 0
src/pages/article/common/CommonListPage.vue

@@ -165,6 +165,7 @@ const props = defineProps({
       text: string,
       onlyJump?: boolean,
       jump?: () => void,
+      width?: number,
     }[]>,
     default: null,
   },

+ 84 - 17
src/pages/discover.vue

@@ -7,7 +7,7 @@
     />
     <view class="content d-flex flex-col wing-l">
       
-      <!-- 文化百科 -->
+      <!-- 文化百科 
       <HomeTitle title="文化百科" />
       <scroll-view scroll-x>
         <view class="d-flex flex-row">
@@ -21,7 +21,7 @@
             <text class="width-130 text-align-center mt-2 color-primary size-s">{{ item.name }}</text>
           </view>
         </view>
-      </scroll-view>
+      </scroll-view>-->
 
       <!-- 闽南语猜猜猜 -->
       <!-- <view class="home-title">
@@ -53,7 +53,7 @@
         <Button :radius="40" type="primary" size="small" @click="goAnswer">立即报名</Button>
       </Box2LineRightSlot> -->
 
-      <!-- 老照片 -->
+      <!-- 老照片
       <HomeTitle title="老照片" showMore @clickMore="goImagesList" />
       <SimplePageContentLoader :loader="imagesData">
         <scroll-view scroll-x>
@@ -77,7 +77,7 @@
           </view>
         </scroll-view>
       </SimplePageContentLoader>
-
+      -->
       
       <!-- 闽南文化资讯 -->
       <HomeTitle title="闽南文化资讯" showMore @clickMore="navTo('/pages/article/list')" />
@@ -95,6 +95,50 @@
         </view>
       </SimplePageContentLoader> 
 
+      <!-- 闽南文化百科 -->
+      <view class="d-flex flex-col">
+        <HomeTitle title="闽南文化百科" showMore @clickMore="goTopicsList" />
+        <SimplePageContentLoader :loader="topicsData">
+          <Box2LineRightShadow
+            v-for="(item, i) in topicsData.content.value" 
+            :key="i" 
+            :title="item.title"
+            :desc="item.desc"
+            @click="goTopicsDetail(item.id)"
+          />
+        </SimplePageContentLoader>
+      </view>
+
+      <!-- 传播交流 -->
+      <view class="d-flex flex-col">
+        <HomeTitle title="传播交流" showMore @clickMore="goCommunicationList" />
+        <SimplePageContentLoader :loader="communicationData">
+          <Box2LineLargeImageUserShadow
+            v-for="(item, i) in communicationData.content.value" 
+            :key="i" 
+            :title="item.title"
+            :image="item.thumbnail || item.image"
+            :desc="item.desc"
+            @click="goCommunicationDetail(item.id)"
+          />
+        </SimplePageContentLoader>
+      </view>
+
+      <!-- 理论研究 -->
+      <view class="d-flex flex-col">
+        <HomeTitle title="理论研究" showMore @clickMore="goDiscoveryList" />
+        <SimplePageContentLoader :loader="discoveryData">
+          <Box2LineLargeImageUserShadow
+            v-for="(item, i) in discoveryData.content.value" 
+            :key="i" 
+            :title="item.title"
+            :desc="item.desc"
+            :image="item.thumbnail || item.image"
+            @click="goDiscoveryDetail(item.id)"
+          />
+        </SimplePageContentLoader>
+      </view>
+
       <!-- 热门话题 -->
       <!-- <HomeTitle title="热门话题" />
       <SimplePageContentLoader :loader="topicsData">
@@ -127,6 +171,7 @@ import SimplePageContentLoader from '@/common/components/SimplePageContentLoader
 import NewsIndexContent from '@/api/news/NewsIndexContent';
 import Button from '@/components/basic/Button.vue';
 import { useAuthStore } from '@/store/auth';
+import Box2LineRightShadow from './parts/Box2LineRightShadow.vue';
 
 const authStore = useAuthStore();
 
@@ -229,19 +274,41 @@ const {
   detailsPage: '/pages/article/details',
 });
 
-const topicsData = useSimpleDataLoader(async () => {
-  return [
-    {
-      title: '宗族文化探讨',
-      desc: '关于闽南宗教的传承与发展',
-      right: '234 人参与讨论', 
-    },
-    {
-      title: '宗族文化探讨',
-      desc: '关于闽南宗教的传承与发展',
-      right: '234 人参与讨论', 
-    },
-  ]
+const {
+  loader: topicsData,
+  goList: goTopicsList,
+  goDetail: goTopicsDetail,
+} = useHomePageMiniCommonListGoMoreAndGoDetail({
+  title: '闽南文化百科',
+  mainBodyColumnId: 320,
+  modelId: 18,
+  itemType: 'article-common',
+  detailsPage: '/pages/article/details',
+});
+
+const {
+  loader: discoveryData,
+  goList: goDiscoveryList,
+  goDetail: goDiscoveryDetail,
+} = useHomePageMiniCommonListGoMoreAndGoDetail({
+  title: '理论研究',
+  mainBodyColumnId: 266,
+  modelId: 19,
+  itemType: 'article-common',
+  detailsPage: '/pages/article/details',
+});
+
+
+const {
+  loader: communicationData,
+  goList: goCommunicationList,
+  goDetail: goCommunicationDetail,
+} = useHomePageMiniCommonListGoMoreAndGoDetail({
+  title: '传播交流',
+  mainBodyColumnId: [260,261,262],
+  modelId: 18,
+  itemType: 'article-common',
+  detailsPage: '/pages/article/details',
 });
 
 function goAnswer() {

+ 51 - 17
src/pages/home.vue

@@ -185,6 +185,7 @@ import Tabbar from '@/common/components/tabs/tabbar.vue';
 import Box1AudioPlay from '@/pages/parts/Box1AudioPlay.vue';
 import SimplePageContentLoader from "@/common/components/SimplePageContentLoader.vue";
 import HorizontalScrollText from '@/components/typography/HorizontalScrollText.vue';
+import { navHomePageMiniCommonListGo } from './article/common/CommonContent';
 
 const subTabs = [
   { 
@@ -198,31 +199,64 @@ const subTabs = [
     onClick: () => navTo('/pages/inhert/artifact/list') 
   },
   { 
-    name: '老字号', 
-    icon: MainBoxIcon7 , 
-    onClick: () => navTo('/pages/inhert/old/list') 
-  },
-  { 
-    name: '传统村落', 
-    icon: MainBoxIcon8 , 
-    onClick: () => navTo('/pages/inhert/village/list')
+    name: '语言文化', 
+    icon: MainBoxIcon1, 
+    onClick: () => navHomePageMiniCommonListGo({
+      title: '语言文化',
+      mainBodyColumnId: 235,
+      modelId: 5,
+      itemType: 'article-common',
+      detailsPage: '/pages/article/common/detail',
+    })
+  },  { 
+    name: '建筑文化', 
+    icon: MainBoxIcon4, 
+    onClick: () => navHomePageMiniCommonListGo({
+      title: '建筑文化',
+      mainBodyColumnId: 252,
+      modelId: 3,
+      itemType: 'article-common',
+      detailsPage: '/pages/article/common/detail',
+    })
   },
+  { name: '历史人物', icon: MainBoxIcon3, onClick: () => navTo('/pages/introduction/character/list') },
   { 
-    name: '闽南话', 
-    icon: MainBoxIcon1, 
-    onClick: () => navTo('/pages/inhert/language/list') 
+    name: '民间习俗', 
+    icon: MainBoxIcon4, 
+    onClick: () => navHomePageMiniCommonListGo({
+      title: '民间习俗',
+      modelId: 4,
+      itemType: 'article-common',
+      detailsPage: '/pages/article/common/detail',
+    })
   },
   { 
-    name: '闽南美食', 
+    name: '饮食文化', 
     icon: MainBoxIcon2, 
-    onClick: () => navTo('/pages/introduction/food/list') 
+    onClick: () => navHomePageMiniCommonListGo({
+      title: '饮食文化',
+      mainBodyColumnId: 253,
+      modelId: 3,
+      itemType: 'article-common',
+      detailsPage: '/pages/article/common/detail',
+    })
   },
-  { name: '历史人物', icon: MainBoxIcon3, onClick: () => navTo('/pages/introduction/character/list') },
   { 
-    name: '闽南民俗', 
-    icon: MainBoxIcon4, 
-    onClick: () => navTo('/pages/introduction/custom/list')
+    name: '海洋文化', 
+    icon: MainBoxIcon8 , 
+    onClick: () => navHomePageMiniCommonListGo({
+      title: '海洋文化',
+      mainBodyColumnId: 254,
+      modelId: 3,
+      itemType: 'article-common',
+      detailsPage: '/pages/article/common/detail',
+    })
   },
+  /* { 
+    name: '老字号', 
+    icon: MainBoxIcon7 , 
+    onClick: () => navTo('/pages/inhert/old/list') 
+  }, */
 ];
 
 const mapCtx = uni.createMapContext('map');

+ 64 - 27
src/pages/inhert.vue

@@ -8,7 +8,7 @@
     <view class="content d-flex flex-col ">
 
       <!-- 非遗项目 -->
-      <HomeTitle title="非遗项目" showMore inWing @clickMore="navTo('inhert/intangible/list')" />
+      <HomeTitle title="非遗名录" showMore inWing @clickMore="navTo('inhert/intangible/list')" />
       <SimplePageContentLoader :loader="intangibleData" >
         <scroll-view scroll-x>
           <view class="padding-wing-l pb-3 pt-3 d-flex flex-row overflow-visible align-stretch">
@@ -93,7 +93,30 @@
         </scroll-view>
       </SimplePageContentLoader>
 
-      <!-- 闽南语在线课程 -->
+      <!-- 老字号 -->
+      <HomeTitle title="老字号" showMore inWing @clickMore="navTo('/pages/inhert/old/list')" />
+      <SimplePageContentLoader :loader="oldData">
+        <scroll-view scroll-x>
+          <view class="padding-wing-l pb-3 pt-3 d-flex flex-row overflow-visible align-stretch">
+            <Box2LineLargeImageUserShadow
+              v-for="(item, i) in oldData.content.value"
+              classNames="width-2-3 mr-2"
+              fixSize
+              titleColor="title-text"
+              :key="i"
+              :title="item.title"
+              :desc="item.desc"
+              :image="item.thumbnail"
+              :bottomLocate="(item.regionText as string)"
+              :bottomScore="''"
+              @click="navTo('/pages/inhert/intangible/details', { id: item.id })"
+            />
+          </view>
+        </scroll-view>
+      </SimplePageContentLoader>
+      
+
+      <!-- 闽南语在线课程-->
       <HomeTitle title="闽南语在线课程" :showMore="false" inWing @clickMore="goCourseList" />
       <SimplePageContentLoader :loader="corseData" >
         <scroll-view scroll-x>
@@ -125,9 +148,29 @@
           />
         </view>
       </SimplePageContentLoader>
+      
+      <!-- 传统村落 -->
+      <HomeTitle title="传统村落" showMore inWing @clickMore="navTo('/pages/inhert/village/list')" />
+      <SimplePageContentLoader :loader="villageData">
+        <scroll-view scroll-x>
+          <view class="padding-wing-l pb-3 pt-3 d-flex flex-row overflow-visible align-stretch">
+            <Box2LineLargeImageUserShadow
+              v-for="(item, i) in villageData.content.value"
+              classNames="width-2-3 mr-2"
+              fixSize
+              titleColor="title-text"
+              :key="i"
+              :title="item.title"
+              :desc="item.desc"
+              :image="item.image"
+              @click="navTo('/pages/inhert/village/details', { id: item.id })"
+            />
+          </view>
+        </scroll-view>
+      </SimplePageContentLoader>
 
       <view class="d-flex flex-col wing-l">
-        <!-- 闽南语原创歌曲 -->
+        <!-- 闽南语原创歌曲 
         <HomeTitle title="闽南语原创歌曲" showMore @clickMore="goMingnanSongsList" />
 
         <SimplePageContentLoader :loader="mingnanSongsData" >
@@ -143,6 +186,7 @@
             @click="goMingnanSongsDetail(s.id)"
           />
         </SimplePageContentLoader>
+        -->
 
         <!-- 闽南语作品库 
         <HomeTitle title="闽南语作品库" showMore @clickMore="goSongsList" />
@@ -158,28 +202,6 @@
         -->
       </view>
 
-      <!-- 老字号 -->
-      <HomeTitle title="老字号" showMore inWing @clickMore="navTo('/pages/inhert/old/list')" />
-      <SimplePageContentLoader :loader="oldData">
-        <scroll-view scroll-x>
-          <view class="padding-wing-l pb-3 pt-3 d-flex flex-row overflow-visible align-stretch">
-            <Box2LineLargeImageUserShadow
-              v-for="(item, i) in oldData.content.value"
-              classNames="width-2-3 mr-2"
-              fixSize
-              titleColor="title-text"
-              :key="i"
-              :title="item.title"
-              :desc="item.desc"
-              :image="item.thumbnail"
-              :bottomLocate="(item.regionText as string)"
-              :bottomScore="''"
-              @click="navTo('/pages/inhert/intangible/details', { id: item.id })"
-            />
-          </view>
-        </scroll-view>
-      </SimplePageContentLoader>
-
       <!-- 童趣记忆 
       <HomeTitle title="童趣记忆" showMore inWing @clickMore="goMemoryList" />
       <SimplePageContentLoader :loader="memoryData" >
@@ -201,7 +223,7 @@
       </SimplePageContentLoader>
       -->
 
-      <!-- 闽南文化百科 -->
+      <!-- 闽南文化百科
       <view class="d-flex flex-col wing-l">
         <HomeTitle title="闽南文化百科" showMore @clickMore="goTopicsList" />
         <SimplePageContentLoader :loader="topicsData">
@@ -213,7 +235,7 @@
             @click="goTopicsDetail(item.id)"
           />
         </SimplePageContentLoader>
-      </view>
+      </view> -->
 
     </view>
   </view>
@@ -238,6 +260,7 @@ import ProductsContent from '@/api/inheritor/ProductsContent';
 import InheritorContent from '@/api/inheritor/InheritorContent';
 import { onShareTimeline, onShareAppMessage } from '@dcloudio/uni-app';
 import { useSimpleListAudioPlayer } from '@/common/composeabe/SimpleAudioPlayer';
+import VillageApi from '@/api/inhert/VillageApi';
 
 const artifactData = useSimpleDataLoader(async () => 
   (await UnmoveableContent.getContentList(new GetContentListParams(), 1, 4)).list.map(p => ({
@@ -289,6 +312,20 @@ const productsData = useSimpleDataLoader(async () =>
     bottomScore: '5.0',
   }))
 );
+const villageData = useSimpleDataLoader(async () =>   {
+  const res = await CommonContent.getCategoryList(151);
+  const it2 = res.find(p => p.title == '省级');
+  return (await VillageApi.getVallageList(it2?.id)).map(p => ({
+    id: p.id,
+    title: p.title, 
+    desc: '', 
+    image: p.thumbnail || p.image,
+    tags: [p.levelText, p.district] as string[],
+    comment: p.comments,
+  }))
+});
+
+
 
 const indexAudioPlayer = useSimpleListAudioPlayer(async () => {
   return (await CommonContent.getContentList(new GetContentListParams()

+ 42 - 4
src/pages/travel/fashion/list.vue

@@ -6,14 +6,37 @@
     detailsPage="/pages/video/details"
     :dropDownNames="dropdownNames"
     :detailsParams="detailsParams"
+    :tabsScrollable="true"
     :tabs="[
       {
         id: 191,
         text: '闽南语经典歌曲',
+        width: 200,
+      },
+      {
+        id: 190,
+        text: '南音',
+        width: 100,
+      },
+      {
+        id: 189,
+        text: '闽南童谣',
       },
       {
         id: 315,
         text: '闽南语原创歌曲',
+        width: 200,
+      },
+      {
+        id: -100,
+        text: '常用闽南语',
+      },
+      {
+        id: -101,
+        text: '闽南语原声',
+        jump: () => {
+          navTo('/pages/inhert/language/list')
+        },
       },
     ]"
     :load="loadData" 
@@ -22,10 +45,19 @@
 
 <script setup lang="ts">
 import CommonContent, { GetContentListParams } from '@/api/CommonContent';
+import { navTo } from '@/components/utils/PageAction';
 import CommonListPage, { type DropDownNames } from '@/pages/article/common/CommonListPage.vue';
 import { onMounted, ref } from 'vue';
 
 const dropdownNames = ref<DropDownNames[]>([]);
+const modelDefine = [
+  { modelId: 16, id: 191, name: '闽南语经典歌曲' },
+  { modelId: 16, id: 190, name: '南音' },
+  { modelId: 16, id: 189, name: '闽南童谣' },
+  { modelId: 16, id: 315, name: '闽南语原创歌曲' },
+  { modelId: 5, mainBodyColumnId: [ 257,235,237,210 ], id: -100, name: '常用闽南语' },
+  { modelId: 5, mainBodyColumnId: 313, id: -101, name: '闽南语原声' },
+]
 
 async function loadData(
   page: number, 
@@ -34,10 +66,16 @@ async function loadData(
   dropDownValues: number[],
   tabId: number,
 ) {
-  detailsParams.value.mainBodyColumnId = tabId;
+
+  const model = modelDefine.find((p) => p.id === tabId);
+  if (!model)
+    throw new Error('tabId not found');
+
+  detailsParams.value.mainBodyColumnId = model.mainBodyColumnId;
+
   const res = (await CommonContent.getContentList(new GetContentListParams()
-    .setModelId(16)
-    .setMainBodyColumnId(tabId)
+    .setModelId(model.modelId)
+    .setMainBodyColumnId(model.mainBodyColumnId!)
     .setKeywords(searchText)
     .setSelfValues({
 
@@ -55,7 +93,7 @@ async function loadData(
 }
 
 const detailsParams = ref({
-  mainBodyColumnId: 0,
+  mainBodyColumnId: 0 as any,
   modelId: 16,
 });