Bladeren bron

🎨 按要求修改问题

快乐的梦鱼 1 week geleden
bovenliggende
commit
1ead0c8835

+ 1 - 0
src/api/CommonContent.ts

@@ -89,6 +89,7 @@ export class GetContentListParams extends DataModel<GetContentListParams> {
   static TYPE_AUDIO = 2;
   static TYPE_VIDEO = 3;
   static TYPE_IMAGE = 4;
+  static TYPE_ARCHIVE = 5;
 
   modelId ?: number;
   /**

+ 2 - 2
src/pages.json

@@ -34,9 +34,9 @@
       }
     },
     {
-      "path": "pages/introduction/recommend-news",
+      "path": "pages/introduction/communicate",
       "style": {
-        "navigationBarTitleText": "世界闽南",
+        "navigationBarTitleText": "交流传播",
         "enablePullDownRefresh": true
       }
     },

+ 48 - 21
src/pages/article/common/CommonCategoryHome.vue

@@ -1,36 +1,56 @@
 <template>
+  <!--通用内容首页小分块组件-->
   <FlexCol width="100%">
     <!-- 分类 -->
     <template v-for="category in categoryDatas" :key="category.title">
       <HomeTitle 
         :title="category.title"
-        showMore 
+        :showMore="category.showMore !== false"
         moreText="更多"
         @clickMore="category.morePage" 
       />
       <SimplePageContentLoader :loader="category.data" >
         <FlexCol>
-          <template v-if="category.type !== 'article'">
-            <Box2LineImageRightShadow
-              v-for="(item, i) in category.data.content.value"
-              titleColor="title-text"
-              fixSize
-              :key="i"
+          <template v-if="category.type === 'article'">
+            <Box2LineRightShadow
+              v-for="(item, i) in category.data.content.value" 
+              :key="i" 
               :title="item.title"
               :desc="item.desc"
-              :image="item.image"
               :tags="(item.bottomTags as string[])"
-              @click="category.detailPage(item.id)"
+              @click="category.detailPage(item)"
             />
           </template>
+          <template v-else-if="category.type === 'large-image2'">
+            <scroll-view scroll-x>
+              <FlexRow>
+                <Box2LineLargeImageUserShadow
+                  v-for="(item, i) in category.data.content.value"
+                  classNames="width-2-3 mr-2"
+                  titleColor="title-text"
+                  fixSize
+                  title1
+                  :key="i"
+                  :title="item.title"
+                  :desc="item.desc"
+                  :image="item.image"
+                  :tags="(item.bottomTags as string[])"
+                  @click="category.detailPage(item)"
+                />
+              </FlexRow>
+            </scroll-view>
+          </template>
           <template v-else>
-            <Box2LineRightShadow
-              v-for="(item, i) in category.data.content.value" 
-              :key="i" 
+            <Box2LineImageRightShadow
+              v-for="(item, i) in category.data.content.value"
+              titleColor="title-text"
+              fixSize
+              :key="i"
               :title="item.title"
               :desc="item.desc"
+              :image="item.image"
               :tags="(item.bottomTags as string[])"
-              @click="category.detailPage(item.id)"
+              @click="category.detailPage(item)"
             />
           </template>
         </FlexCol>
@@ -46,19 +66,22 @@ import Box2LineImageRightShadow from '@/pages/parts/Box2LineImageRightShadow.vue
 import Box2LineRightShadow from '@/pages/parts/Box2LineRightShadow.vue';
 import FlexCol from '@/components/layout/FlexCol.vue';
 import type { PropType } from 'vue';
-import { CommonContentApi, GetContentListParams } from '@/api/CommonContent';
-import { navHomePageMiniCommonDetailGo, navHomePageMiniCommonListGo, resolveCommonContentFormData, type IHomeCommonCategoryBlock } from './CommonContent';
+import { CommonContentApi, GetContentListItem, GetContentListParams } from '@/api/CommonContent';
+import { navCommonDetail, navCommonList, resolveCommonContentFormData, resolveCommonContentGetPageDetailUrlAuto, type IHomeCommonCategoryBlock } from './CommonContent';
 import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
 import { navTo } from '@/components/utils/PageAction';
 import { DateUtils } from '@imengyu/imengyu-utils';
+import FlexRow from '@/components/layout/FlexRow.vue';
+import Box2LineLargeImageUserShadow from '@/pages/parts/Box2LineLargeImageUserShadow.vue';
 
 export interface CategoryDefine {
   title: string;
   content: CommonContentApi|IHomeCommonCategoryBlock;
-  type?: 'article'|''|undefined;
+  type?: 'article'|'large-image2'|''|undefined;
   detailPage?: string;
   morePage?: string;
   noFrom?: boolean;
+  showMore?: boolean;
 }
 
 const props = defineProps({
@@ -70,19 +93,23 @@ const props = defineProps({
 
 const categoryDatas = props.categoryDefine.map(item => ({
   ...item,
-  detailPage: (id: number) => {
+  detailPage: (dataItem: GetContentListItem) => {
+    const id = dataItem.id;
     if (item.content instanceof CommonContentApi) {
       if (item.detailPage) {
-        navTo(item.detailPage, { id });
+        if (item.detailPage === 'byContent')
+          navTo(resolveCommonContentGetPageDetailUrlAuto(dataItem), { id });
+        else
+          navTo(item.detailPage, { id });
       } else {
-        navHomePageMiniCommonDetailGo({
+        navCommonDetail({
           id,
           mainBodyColumnId: item.content.mainBodyColumnId,
           modelId: item.content.modelId,
         })
       }
     } else {
-      item.content.goDetail(id);
+      item.content.goDetail(dataItem);
     }
   },
   morePage: () => {
@@ -90,7 +117,7 @@ const categoryDatas = props.categoryDefine.map(item => ({
       if (item.morePage) {
         navTo(item.morePage, {});
       } else {
-        navHomePageMiniCommonListGo({
+        navCommonList({
           title: item.title,
           mainBodyColumnId: item.content.mainBodyColumnId,
           modelId: item.content.modelId,

+ 32 - 8
src/pages/article/common/CommonContent.ts

@@ -1,15 +1,18 @@
 import CommonContent, { GetContentListItem, GetContentListParams } from "@/api/CommonContent";
 import { useSimpleDataLoader, type ISimpleDataLoader } from "@/common/composeabe/SimpleDataLoader";
 import { navTo } from "@/components/utils/PageAction";
-import { DateUtils } from "@imengyu/imengyu-utils";
+
+/**
+ * 通用内容首页小列表控制代码组合
+ */
 
 export interface IHomeCommonCategoryBlock {
   loader: ISimpleDataLoader<GetContentListItem[], any>;
-  goDetail: (id: number) => void;
+  goDetail: (i: GetContentListItem) => void;
   goList: () => void; 
 }
 
-export function navHomePageMiniCommonDetailGo(p: {
+export function navCommonDetail(p: {
   id: number,
   title?: string,
   mainBodyColumnId?: string|number|number[],
@@ -21,7 +24,7 @@ export function navHomePageMiniCommonDetailGo(p: {
     id: p.id,
   }) 
 }
-export function navHomePageMiniCommonListGo(p: {
+export function navCommonList(p: {
   title?: string,
   mainBodyColumnId?: string|number|number[],
   modelId?: number,
@@ -47,6 +50,24 @@ export function resolveCommonContentFormData(item: GetContentListItem[]) {
   })
   return item;
 }
+export function resolveCommonContentMakeDoubleSpace(item: GetContentListItem[]) {
+  const result: GetContentListItem[] = [];
+  item.forEach((it) => {
+    const cloned = it.clone();
+    cloned.title = '\u00A0';
+    cloned.desc = '\u00A0';
+    result.push(it, cloned);
+  });
+  return result;
+}
+
+export function resolveCommonContentGetPageDetailUrlAuto(item: GetContentListItem) {
+  if (item.type === GetContentListParams.TYPE_VIDEO || item.video)
+    return '/pages/video/details';
+  if (item.type === GetContentListParams.TYPE_ARCHIVE && item.archive)
+    return '/pages/document/details';
+  return '/pages/article/details';
+}
 
 /**
  * 专用于通用内容的首页小列表控制代码组合
@@ -63,15 +84,18 @@ export function useHomeCommonCategoryBlock(p: {
   params?: Record<string, any>,
   resolveData?: (item: GetContentListItem[]) => GetContentListItem[],
 }) : IHomeCommonCategoryBlock {
-  function goDetail(id: number) {
-    navTo(p.detailsPage, {
+  function goDetail(i: GetContentListItem) {
+    navTo(p.detailsPage === 'byContent' ? 
+      resolveCommonContentGetPageDetailUrlAuto(i): 
+      p.detailsPage, 
+    {
       mainBodyColumnId: p.mainBodyColumnId,
       modelId: p.modelId,
-      id,
+      id: i.id,
     }) 
   }
   function goList() {
-    navHomePageMiniCommonListGo({
+    navCommonList({
       title: p.title,
       mainBodyColumnId: typeof p.mainBodyColumnId == 'object' ? 
         p.mainBodyColumnId.join(',') : 

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

@@ -222,7 +222,7 @@ const props = defineProps({
     default: false,
   },
   /**
-   * 显示列表的Tab ID
+   * 显示列表的Tab ID。默认所有Tab都显示列表。
    */
   showListTabIds: {
     type: Array as PropType<number[]>,

+ 3 - 7
src/pages/article/common/list.vue

@@ -4,7 +4,7 @@
     :load="loadData"
     :itemType="querys.itemType as any || undefined"
     :detailsPage="querys.detailsPage || 'byContent'"
-    :detailsPageByContentCallback="handleDetailsPageByContentCallback"
+    :detailsPageByContentCallback="resolveCommonContentGetPageDetailUrlAuto"
     :detailsParams="{
       mainBodyColumnId: querys.mainBodyColumnId || undefined,
       modelId: querys.modelId || undefined,
@@ -15,7 +15,8 @@
 <script setup lang="ts">
 import { useLoadQuerys, stringDotNumbersToNumbers } from '@/common/composeabe/LoadQuerys';
 import CommonListPage from './CommonListPage.vue';
-import CommonContent, { GetContentListItem, GetContentListParams } from '@/api/CommonContent';
+import CommonContent, { GetContentListParams } from '@/api/CommonContent';
+import { resolveCommonContentGetPageDetailUrlAuto } from './CommonContent';
 
 const { querys } = useLoadQuerys({
   mainBodyColumnId: '',
@@ -48,9 +49,4 @@ async function loadData(
 
   return res;
 }
-function handleDetailsPageByContentCallback(item: GetContentListItem) {
-  if (item.type === GetContentListParams.TYPE_VIDEO || item.video)
-    return '/pages/video/details';
-  return '/pages/article/details';
-}
 </script>

+ 1 - 0
src/pages/article/details.vue

@@ -12,6 +12,7 @@
             width="100%"
             :radius="15"
             :src="loader.content.value.image"
+            :defaultImage="AppCofig.defaultImage"
             mode="widthFix"
           />
           <view class="d-flex flex-col p-3">

+ 7 - 7
src/pages/home/index.vue

@@ -48,7 +48,7 @@
           <HomeButton
             title="交流传播"
             icon="https://mncdn.wenlvti.net/app_static/minnan/images/home/IconArtifact.png"
-            @click="navTo('/pages/introduction/recommend-news')"
+            @click="navTo('/pages/introduction/communicate')"
           />
           <HomeButton
             title="乐游厦门"
@@ -192,7 +192,7 @@ import { onShareTimeline, onShareAppMessage } from '@dcloudio/uni-app';
 import { navTo } from '@/components/utils/PageAction';
 import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
 import { useSimpleListAudioPlayer } from '@/common/composeabe/SimpleAudioPlayer';
-import { navHomePageMiniCommonListGo } from '@/pages/article/common/CommonContent';
+import { navCommonList } from '@/pages/article/common/CommonContent';
 import CommonContent, { GetContentListParams } from '@/api/CommonContent';
 import UnmoveableContent from '@/api/inheritor/UnmoveableContent';
 import SeminarContent from '@/api/inheritor/SeminarContent';
@@ -335,15 +335,15 @@ const statsLoader = useSimpleDataLoader(async () => {
 
   return [
     {
-      title: '非遗项目',
+      title: '非物质文化产代表性项目',
       datas: projects
     },
     {
-      title: '非遗传承人',
+      title: '非物质文化产代表性传承人',
       datas: inheritors
     },
     {
-      title: '非遗传习所',
+      title: '非物质文化遗产传习中心',
       datas: data.ichCenter.map((item: any) => {
         return {
           title: item.title,
@@ -364,7 +364,7 @@ const statsLoader = useSimpleDataLoader(async () => {
           onClick: () => {
             switch (item.title) {
               case '世界文化遗产':
-                navHomePageMiniCommonListGo({
+                navCommonList({
                   title: '世界文化遗产',
                   modelId: 17,
                   mainBodyColumnId: 310
@@ -374,7 +374,7 @@ const statsLoader = useSimpleDataLoader(async () => {
                 navTo('/pages/inhert/village/list');
                 break;
               case '重点区域':
-                navHomePageMiniCommonListGo({
+                navCommonList({
                   title: '重点区域',
                   modelId: 17,
                   mainBodyColumnId: 283

+ 1 - 1
src/pages/inhert/village/details.vue

@@ -99,7 +99,7 @@
                 :image="item.image"
                 :likes="item.likes"
                 :comment="item.comments"
-                @click="tag.goDetail(item.id)"
+                @click="tag.goDetail(item)"
               />
             </view>
           </SimplePageContentLoader>

+ 1 - 1
src/pages/introduction/recommend-news.vue

@@ -3,7 +3,7 @@
     itemType="article-common"
     :dropDownNames="dropdownNames"
     :tabs="[
-      { id: 0, text: '传播交流' },
+      { id: 0, text: '交流传播' },
       { id: 1, text: '海洋文化' },
     ]"
     :startTabIndex="startTab"

+ 3 - 3
src/pages/introduction/inhert.vue

@@ -74,7 +74,7 @@
       </SimplePageContentLoader>
 
       <!-- 非遗传习所 -->
-      <HomeTitle title="非遗传习所" showMore @clickMore="navHomePageMiniCommonListGo({
+      <HomeTitle title="非遗传习所" showMore @clickMore="navCommonList({
         title: '非遗传习所',
         modelId: SeminarContent.modelId,
         mainBodyColumnId: SeminarContent.mainBodyColumnId,
@@ -109,7 +109,7 @@
             :title="item.title"
             :desc="item.desc"
             :image="item.image"
-            @click="goActivityDetail(item.id)"
+            @click="goActivityDetail(item)"
           />
         </FlexRow>
       </SimplePageContentLoader>
@@ -148,7 +148,7 @@ import { ref } from 'vue';
 import { navTo } from '@/components/utils/PageAction';
 import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
 import { GetContentListParams } from '@/api/CommonContent';
-import { navHomePageMiniCommonListGo, useHomeCommonCategoryBlock } from '../article/common/CommonContent';
+import { navCommonList, useHomeCommonCategoryBlock } from '../article/common/CommonContent';
 import SimplePageContentLoader from '@/common/components/SimplePageContentLoader.vue';
 import FlexCol from '@/components/layout/FlexCol.vue';
 import HomeTitle from '../parts/HomeTitle.vue';

+ 2 - 2
src/pages/introduction/news.vue

@@ -54,7 +54,7 @@
 import { onMounted, ref, watch } from 'vue';
 import { type GetContentListItem, GetContentListParams } from '@/api/CommonContent';
 import { useSimplePageListLoader } from '@/common/composeabe/SimplePageListLoader';
-import { navHomePageMiniCommonDetailGo } from '../article/common/CommonContent';
+import { navCommonDetail } from '../article/common/CommonContent';
 import NewsIndexContent from '@/api/news/NewsIndexContent';
 import SimplePageListLoader from '@/common/components/SimplePageListLoader.vue';
 import CommonRoot from '@/components/dialog/CommonRoot';
@@ -97,7 +97,7 @@ function loadNews() {
   newsLoader.loadData(undefined, true);
 }
 function goDetails(item: GetContentListItem, id: number) {
-  navHomePageMiniCommonDetailGo({
+  navCommonDetail({
     id,
     mainBodyColumnId: item.mainBodyColumnId,
     modelId: item.modelId,

+ 5 - 5
src/pages/introduction/travel.vue

@@ -16,7 +16,7 @@
             :title="item.title"
             :desc="item.desc"
             :image="item.thumbnail || item.image"
-            @click="goCourseDetail(item.id)"
+            @click="goCourseDetail(item)"
           />
         </view>
       </scroll-view>
@@ -35,7 +35,7 @@
           :title="item.title"
           :desc="item.desc"
           :image="item.image"
-          @click="goSongsDetail(item.id)"
+          @click="goSongsDetail(item)"
         />
       </FlexRow>
     </SimplePageContentLoader>    
@@ -56,7 +56,7 @@
           :key="i"
           :title="item.title"
           :image="item.thumbnail || item.image"
-          @click="goFoodDetail(item.id)"
+          @click="goFoodDetail(item)"
         />
       </FlexRow>
     </SimplePageContentLoader>
@@ -95,7 +95,7 @@
             :title="item.title"
             :desc="item.desc"
             :image="item.thumbnail || item.image"
-            @click="goRouteDetail(item.id)"
+            @click="goRouteDetail(item)"
           />
         </view>
       </scroll-view>
@@ -114,7 +114,7 @@
             :key="i"
             :title="item.title"
             :image="item.thumbnail || item.image"
-            @click="goCreativeDetail(item.id)"
+            @click="goCreativeDetail(item)"
           />
         </view>
       </scroll-view>

+ 2 - 0
src/pages/parts/Box2LineImageRightShadow.vue

@@ -20,6 +20,7 @@
           :height="150"
           :radius="15"
           :src="image"
+          :defaultImage="AppCofig.defaultImage"
           mode="aspectFit"
         />
       </slot>
@@ -51,6 +52,7 @@
 import type { PropType } from 'vue';
 import RoundTags from './RoundTags.vue';
 import Image from '@/components/basic/Image.vue';
+import AppCofig from '@/common/config/AppCofig';
 
 defineProps({
   title: String,

+ 2 - 0
src/pages/parts/Box2LineLargeImageUserShadow.vue

@@ -20,6 +20,7 @@
       :height="300"
       :radius="15"
       :src="image" 
+      :defaultImage="AppCofig.defaultImage"
       mode="aspectFit" 
     />
     <image 
@@ -74,6 +75,7 @@
 import type { PropType } from 'vue';
 import RoundTags from './RoundTags.vue';
 import NaImage from '@/components/basic/Image.vue';
+import AppCofig from '@/common/config/AppCofig';
 
 const IconHeart = 'https://mncdn.wenlvti.net/app_static/minnan/images/discover/IconHeart.png';
 const IconChat = 'https://mncdn.wenlvti.net/app_static/minnan/images/discover/IconChat.png';

+ 2 - 1
src/pages/parts/StatsText.vue

@@ -159,8 +159,9 @@ $color-second: map.get($colors, "second");
         margin: 25rpx 0 5rpx 0;
         font-size: 46rpx;
         font-weight: bold;
+        font-style: italic;
         font-family: HUNdin1451;
-        color: $color-text;
+        color: $color-primary;
       }
       .sub-text {
         font-size: 26rpx;

+ 34 - 14
src/pages/research/index.vue

@@ -12,7 +12,7 @@
       1: '/pages/article/details',
     }"
     :detailsParams="detailsParams"
-    :detailsPageByContentCallback="handleDetailsPageByContentCallback"
+    :detailsPageByContentCallback="resolveCommonContentGetPageDetailUrlAuto"
     :startTabIndex="startTab"
     :load="loadData" 
   >
@@ -30,7 +30,8 @@ import ResultContent from '@/api/research/ResultContent';
 import InnovationContent from '@/api/research/InnovationContent';
 import TeamsContent from '@/api/research/TeamsContent';
 import CommonCategoryHome, { type CategoryDefine } from '../article/common/CommonCategoryHome.vue';
-import { resolveCommonContentFormData, useHomeCommonCategoryBlock } from '../article/common/CommonContent';
+import { resolveCommonContentFormData, resolveCommonContentGetPageDetailUrlAuto, resolveCommonContentMakeDoubleSpace, useHomeCommonCategoryBlock } from '../article/common/CommonContent';
+import NewsIndexContent from '@/api/news/NewsIndexContent';
 
 const dropdownNames = ref<DropDownNames[]>([]);
 const startTab = ref(0);
@@ -44,17 +45,12 @@ async function loadData(
   let res;
   startTab.value = tabSelect;
   switch (tabSelect) {
+    default:
     case 1: 
       res = (await TeamsContent.getContentList(new GetContentListParams()
         .setKeywords(searchText)
       , page, pageSize))
       break;
-    default:
-    case 0: 
-      res = (await InnovationContent.getContentList(new GetContentListParams()
-        .setKeywords(searchText)
-      , page, pageSize));
-    break;
   }
   res.list.forEach((item) => {
     item.desc = item.from ? `来源:${item.from}` : '';
@@ -120,11 +116,35 @@ const categoryDefine : CategoryDefine[] = [
     }),
     type: '',
   },
+  {
+    title: '其他闽南文化品牌活动',
+    content: useHomeCommonCategoryBlock({
+      title: '其他闽南文化品牌活动',
+      mainBodyColumnId: 368,
+      modelId: NewsIndexContent.modelId,
+      itemType: 'article-common',
+      detailsPage: 'byContent',
+      resolveData: (items) => {
+        const res = resolveCommonContentFormData(items as GetContentListItem[]);
+        return resolveCommonContentMakeDoubleSpace(res);
+      },
+    }),
+    type: 'large-image2',
+  },
+  {
+    title: '"一区一节"闽南文化品牌活动',
+    content: useHomeCommonCategoryBlock({
+      title: '"一区一节"闽南文化品牌活动',
+      mainBodyColumnId: 367,
+      modelId: NewsIndexContent.modelId,
+      itemType: 'article-common',
+      detailsPage: 'byContent',
+      resolveData: (items) => {
+        const res = resolveCommonContentFormData(items as GetContentListItem[]);
+        return resolveCommonContentMakeDoubleSpace(res);
+      },
+    }),
+    type: 'large-image2',
+  },
 ];
-
-function handleDetailsPageByContentCallback(item: GetContentListItem) {
-  if (item.type === GetContentListParams.TYPE_VIDEO || item.video)
-    return '/pages/video/details';
-  return '/pages/article/details';
-}
 </script>

+ 0 - 6
src/pages/video/details.vue

@@ -19,12 +19,6 @@
           :src="loader.content.value.video"
           controls
         />
-        <image 
-          v-else-if="loader.content.value.image"
-          class="w-100 radius-base"
-          :src="loader.content.value.image"
-          mode="widthFix"
-        />
         <view class="d-flex flex-col">
           <view class="d-flex flex-col p-3">
             <view class="size-ll color-title-text">{{ loader.content.value.title }}</view>