快乐的梦鱼 5 dni temu
rodzic
commit
748679d196

+ 1 - 0
src/api/CommonContent.ts

@@ -285,6 +285,7 @@ export class GetContentDetailItem extends DataModel<GetContentDetailItem> {
       if (this.otherLevel) {
         this.otherLevelCount = this.otherLevel.length
       }
+      this.titleBox = Boolean(this.deathBirth);
     }
   }
 

+ 5 - 4
src/pages/article/common/DetailTabPage.ts

@@ -11,10 +11,11 @@ export interface DetailTabPageProps {
   load?: (
     id: number, 
     tabsArray: DetailTabPageTabsArray
-  ) => Promise<GetContentDetailItem>,
-  extraTabs?: TabControlItem[],
-  showHead?: boolean,
+  ) => Promise<GetContentDetailItem>;
+  extraTabs?: TabControlItem[];
+  showHead?: boolean;
+  showDeadBox?: boolean;
   overrideInternalTabsName?: undefined|{
     [key: number]: string,
-  },
+  };
 }

+ 2 - 1
src/pages/article/common/DetailTabPage.vue

@@ -16,7 +16,7 @@
             <slot name="title" :content="loader.content.value">
               <view class="d-flex flex-col">
                 <view class="d-flex flex-row align-center">
-                  <text :class="'size-lll font-songti font-bold color-text-content flex-shrink-1 mr-2' + (loader.content.value.titleBox ? ' border-all-text' : '')">
+                  <text :class="'size-lll font-songti font-bold color-text-content flex-shrink-1 mr-2' + (props.showDeadBox && loader.content.value.titleBox ? ' border-all-text' : '')">
                     {{ loader.content.value.title }}
                   </text>
                   <slot name="titleEnd" :content="loader.content.value" />
@@ -70,6 +70,7 @@ import type { DetailTabPageProps, DetailTabPageTabsArray } from "./DetailTabPage
 const props = withDefaults(defineProps<DetailTabPageProps>(), {
   extraTabs: () => [],
   showHead: true,
+  showDeadBox: false,
 })
 
 const emit = defineEmits([

+ 2 - 1
src/pages/article/data/CommonCategoryBlocks.ts

@@ -9,7 +9,7 @@ export interface CategoryDefine extends Omit<IHomeCommonCategoryListTabNestCateg
   content: CommonContentApi|IHomeCommonCategoryBlock|HomeCommonCategoryBlockProps|IHomeCommonCategoryDynamicDataDetailContent|null;
   type?: 'article'|'large-image2'|'horizontal-large'|'large-image'|'large-grid2'|'small-grid2'|'simple-text'
     |'default'
-    |'CalendarBlock'|'StatsBlock'|'MapBlock'|''
+    |'CalendarBlock'|'StatsBlock'|'MapBlock'|'AudioBlock'
     |undefined;
 }
 
@@ -25,4 +25,5 @@ export const CommonCategoryBlockType : CategoryDefine['type'][] = [
   'CalendarBlock',
   'StatsBlock',
   'MapBlock',
+  'AudioBlock',
 ];

+ 4 - 0
src/pages/article/data/CommonCategoryBlocks.vue

@@ -21,6 +21,9 @@
       <template v-else-if="category.type === 'MapBlock'">
         <MapCategoryBlock v-bind="category.blockProps" />
       </template>
+      <template v-else-if="category.type === 'AudioBlock'">
+        <AudioBlock v-bind="category.blockProps" />
+      </template>
       <!--通用列表-->
       <SimplePageContentLoader v-else-if="category.data" :loader="category.data" >
         <FlexCol>
@@ -182,6 +185,7 @@ import Image from '@/components/basic/Image.vue';
 import AppCofig from '@/common/config/AppCofig';
 import type { CategoryDefine } from './CommonCategoryBlocks';
 import type { IHomeCommonCategoryDynamicDataDetailContent } from './CommonCategoryDynamicData';
+import AudioBlock from '@/pages/blocks/AudioBlock.vue';
 
 const props = defineProps({
   /**

+ 11 - 2
src/pages/article/data/CommonCategoryDetail.vue

@@ -9,8 +9,9 @@
     <DetailTabPage
       v-else
       ref="pageRef"
-      v-bind="$attrs"
       :noInternalTabs="true"
+      :showHead="currentCommonCategoryContentDefine?.props.showHead"
+      :showDeadBox="currentCommonCategoryContentDefine?.props.showDeadBox"
       :load="load"
       :extraTabs="tabRenderDefinesArray"
       @loaded="onLoaded"
@@ -108,7 +109,7 @@
       </template>
       <template #titleEnd="{ content }">
         <Tag
-          v-if="content.levelText"
+          v-if="currentCommonCategoryContentDefine?.props.showTag && content.levelText"
           :text="StringUtils.cutString(content.levelText as string, 4)"
           size="small" scheme="light" type="primary"
           class="flex-shrink-0"
@@ -165,6 +166,14 @@ export interface CommonCategoryDetailProps extends DetailTabPageProps {
    * 简介下方块
    */
   introBlocks?: CommonCategoryDetailIntroBlocksDesc[];
+  /**
+   * 是否显示级别标签
+   */
+  showTag?: boolean;
+  /**
+   * 是否显示死亡框
+   */
+  showDeadBox?: boolean;
 }
 export interface CommonCategoryDetailIntroBlocksDesc {
   type: string;

+ 17 - 15
src/pages/article/data/DefaultCategory.json

@@ -323,6 +323,12 @@
                   "type": "",
                   "morePage": "/pages/article/data/list?pageConfigName=laws",
                   "visible": false
+                },
+                {
+                  "text": "音频",
+                  "showTitle": false,
+                  "type": "AudioBlock",
+                  "visible": true
                 }
               ]
             }
@@ -358,7 +364,7 @@
                     }
                   },
                   "morePage": "/pages/travel/fashion/list",
-                  "detailsPage": "/pages/article/data/details?pageConfigName=songs-details",
+                  "detailsPage": "/pages/article/data/details?pageConfigName=expand-details",
                   "type": "large-image"
                 },
                 {
@@ -379,7 +385,7 @@
                     }
                   },
                   "morePage": "/pages/travel/fashion/list",
-                  "detailsPage": "/pages/article/data/details?pageConfigName=songs-details",
+                  "detailsPage": "/pages/article/data/details?pageConfigName=expand-details",
                   "type": "large-image"
                 },
                 {
@@ -1439,10 +1445,6 @@
             {
               "label": "地址",
               "key": "address"
-            },
-            {
-              "label": "其他级别保护单位",
-              "key": "otherLevel"
             }
           ],
           "introBlocks": [],
@@ -1622,7 +1624,7 @@
             {
               "text": "非遗项目",
               "type": "list",
-              "key": "worksList",
+              "key": "associationMeList",
               "define": {
                 "props": {
                   "showTab": false,
@@ -1668,12 +1670,10 @@
                   ]
                 }
               }
-            },
-            {
-              "text": "地理位置",
-              "type": "map"
             }
-          ]
+          ],
+          "showTag": true,
+          "showDeadBox": true
         }
       }
     },
@@ -1734,13 +1734,15 @@
               "key": "prize",
               "width": 200
             }
-          ]
+          ],
+          "showTag": false,
+          "showDeadBox": false
         }
       }
     },
     {
-      "name": "songs-details",
-      "title": "双歌赛详情页",
+      "name": "expand-details",
+      "title": "拓展详情页",
       "content": {
         "type": "Details",
         "props": {

+ 23 - 0
src/pages/article/data/editor/components/DynamicDataEditor.vue

@@ -61,6 +61,16 @@
         </a-form-item>
       </template>
 
+      <template v-else-if="currentType === 'parentKey'">
+        
+        <a-form-item label="读取键">
+          <a-input
+            :value="(modelValue as IHomeCommonCategoryDynamicDataParentKey)?.key"
+            @change="(e: Event) => setParentKey((e.target as HTMLInputElement)?.value)"
+          />
+        </a-form-item>
+      </template>
+
       <template v-else-if="currentType === 'serializedApi'">
         <a-form-item label="序列化接口名称 (name)">
           <a-select
@@ -131,6 +141,7 @@ import type {
   IHomeCommonCategoryDynamicDataSerializedApi,
   IHomeCommonCategoryDynamicDataRequest,
   IHomeCommonCategoryDynamicDataDetailContent,
+  IHomeCommonCategoryDynamicDataParentKey,
 } from '@/pages/article/data/CommonCategoryDynamicData';
 import { SerializedApiMap } from '@/pages/article/data/CommonCategoryDynamicData';
 import KeyValueEditor from './KeyValueEditor.vue';
@@ -147,6 +158,7 @@ const typeOptions = [
   { value: 'commonContent', label: '通用内容 (commonContent)' },
   { value: 'detailContent', label: '详情内容 (detailContent)' },
   { value: 'serializedApi', label: '序列化接口 (serializedApi)' },
+  { value: 'parentKey', label: '从父键读 (parentKey)' },
   { value: 'request', label: '请求 (request)' },
 ];
 
@@ -217,6 +229,11 @@ function onTypeChange(type: 'commonContent' | 'serializedApi' | 'request') {
       params: { id: 0, modelId: 0 },
       otherParams: {},
     });
+  } else if (type === 'parentKey') {
+    emit('update:modelValue', {
+      type: 'parentKey',
+      key: '',
+    });
   }
 }
 
@@ -245,6 +262,12 @@ function setMainBodyColumnId(source: 'commonContent' | 'serializedApi', input: s
   }
 }
 
+function setParentKey(key: string) {
+  const cur = props.modelValue as IHomeCommonCategoryDynamicDataParentKey | undefined;
+  if (!cur || cur.type !== 'parentKey') return;
+  emit('update:modelValue', { ...cur, key });
+}
+
 function setSerializedApi(key: 'name'|'otherParams', value: any) {
   const cur = props.modelValue as IHomeCommonCategoryDynamicDataSerializedApi | undefined;
   if (!cur || cur.type !== 'serializedApi') return;

+ 6 - 0
src/pages/article/data/editor/editors/DetailPropsEditor.vue

@@ -6,6 +6,12 @@
           默认:显示
         </a-checkbox>
       </a-form-item>
+      <a-form-item label="显示级别标签">
+        <a-checkbox v-model:checked="props.props.showTag" />
+      </a-form-item>
+      <a-form-item label="显示死亡框">
+        <a-checkbox v-model:checked="props.props.showDeadBox"  />
+      </a-form-item>
       <a-form-item label="测试内容ID">
         <a-input-number 
           :value="props.testDetailId" 

+ 41 - 0
src/pages/blocks/AudioBlock.vue

@@ -0,0 +1,41 @@
+<template>
+  <view class="position-relative d-flex flex-row flex-wrap justify-between mt-3">
+    <Box1AudioPlay
+      class="w-100" 
+      :title="indexAudioPlayer.currentTitle.value"
+      :image="indexAudioPlayer.currentItem?.value?.image"
+      :playState="indexAudioPlayer.isPlaying.value"
+      :playTime="indexAudioPlayer.timeString.value"
+      @playPauseClick="indexAudioPlayer.playpause"
+      @arrowClick="handleGoAudioList"
+      @nextClick="indexAudioPlayer.next"
+      @prevClick="indexAudioPlayer.prev"
+      @click="handleGoAudioList"
+    />
+  </view> 
+</template>
+
+<script setup lang="ts">
+import { navTo } from '@/components/utils/PageAction';
+import { useSimpleListAudioPlayer } from '@/common/composeabe/SimpleAudioPlayer';
+import CommonContent, { GetContentListParams } from '@/api/CommonContent';
+import Box1AudioPlay from '@/pages/parts/Box1AudioPlay.vue';
+
+const indexAudioPlayer = useSimpleListAudioPlayer(async () => {
+  return (await CommonContent.getContentList(new GetContentListParams()
+    .setModelId(5)
+    .setMainBodyColumnId(321)
+  , 1, 10)).list.map((p) => {
+    return {
+      id: p.id,
+      title: p.title,
+      image: p.thumbnail || p.image,
+      src: p.audio as string, 
+    }
+  });
+})
+function handleGoAudioList() {
+  navTo('/pages/inhert/language/list') 
+}
+
+</script>

+ 0 - 44
src/pages/home/index.vue

@@ -40,28 +40,6 @@
       </view>
 
       <!-- 分栏 -->
-      <view class="bg-base p-3">
-        <!--
-          点击介绍
-          @click="navTo('introduction')"
-        -->
-           
-        <!-- <view class="position-relative d-flex flex-row flex-wrap justify-between mt-3">
-          <Box1AudioPlay
-            class="w-100" 
-            :title="indexAudioPlayer.currentTitle.value"
-            :image="indexAudioPlayer.currentItem?.value?.image"
-            :playState="indexAudioPlayer.isPlaying.value"
-            :playTime="indexAudioPlayer.timeString.value"
-            @playPauseClick="indexAudioPlayer.playpause"
-            @arrowClick="handleGoAudioList"
-            @nextClick="indexAudioPlayer.next"
-            @prevClick="indexAudioPlayer.prev"
-            @click="handleGoAudioList"
-          />
-        </view> -->
-      </view>
-
       <CommonCategoryBlocks :categoryDefine="categoryDefine" />
     </view>
   </view>
@@ -72,12 +50,9 @@
 import { computed } from 'vue';
 import { onShareTimeline, onShareAppMessage } from '@dcloudio/uni-app';
 import { navTo } from '@/components/utils/PageAction';
-import { useSimpleListAudioPlayer } from '@/common/composeabe/SimpleAudioPlayer';
 import { injectCommonCategory } from '../article/data/CommonCategoryGlobalLoader';
 import { CommonCategoryListTabNestCategoryDataToContent, type IHomeCommonCategoryHomeDefine } from '../article/data/CommonCategoryDefine';
-import CommonContent, { GetContentListParams } from '@/api/CommonContent';
 import Tabbar from '@/common/components/tabs/Tabbar.vue';
-import Box1AudioPlay from '@/pages/parts/Box1AudioPlay.vue';
 import Image from '@/components/basic/Image.vue';
 import HomeButton from '../parts/HomeButton.vue';
 import CommonCategoryBlocks from '../article/data/CommonCategoryBlocks.vue';
@@ -102,25 +77,6 @@ const categoryDefine = computed(() => pageContentDefine.value?.props.categorys
   })
 );
 
-const indexAudioPlayer = useSimpleListAudioPlayer(async () => {
-  return (await CommonContent.getContentList(new GetContentListParams()
-    .setModelId(5)
-    .setMainBodyColumnId(321)
-  , 1, 10)).list.map((p) => {
-    return {
-      id: p.id,
-      title: p.title,
-      image: p.thumbnail || p.image,
-      src: p.audio as string, 
-    }
-  });
-})
-function handleGoAudioList() {
-  navTo('/pages/inhert/language/list') 
-}
-
-
-
 onShareTimeline(() => {
   return {}; 
 })

+ 0 - 1
src/pages/inhert/inheritor/list.vue

@@ -31,7 +31,6 @@ async function loadData(
     keywords: searchText,
   }), page, pageSize));
   res.list.forEach((p) => {
-    p.titleBox = Boolean(p.deathBirth);
     p.desc = p.ichName as string;
     p.bottomTags = [
       p.levelText,