Parcourir la source

📦 对接部分栏目

imengyu il y a 1 mois
Parent
commit
7d3b12ca73

+ 5 - 0
src/api/CommonContent.ts

@@ -85,6 +85,11 @@ export class GetContentListParams extends DataModel<GetContentListParams> {
     return this; 
   }
 
+  static TYPE_ARTICLE = 1;
+  static TYPE_IMAGE = 4;
+  static TYPE_AUDIO = 2;
+  static TYPE_VIDEO = 3;
+
   modelId ?: number;
   /**
    * 主体栏目id

+ 14 - 15
src/pages/discover.vue

@@ -52,8 +52,7 @@
       </Box2LineRightSlot>
 
       <!-- 文化社区 -->
-      <HomeTitle title="文化社区" />
-      
+      <!-- <HomeTitle title="文化社区" />
       <SimplePageContentLoader :loader="communityData">
         <view class="d-flex w-100 flex-row flex-wrap align-center justify-between">
           <Box2LineLargeImageUserShadow 
@@ -68,7 +67,7 @@
             :comment="item.comment"
           />
         </view>
-      </SimplePageContentLoader>
+      </SimplePageContentLoader> -->
 
       <!-- 老照片 -->
       <HomeTitle title="老照片" showMore />
@@ -128,8 +127,8 @@ const categories = [
     icon: CategoryIcon1  , 
     onClick: () => navTo('/pages/article/common/list', {
       title: '民俗文化',
-      mainBodyColumnId: 0,
-      modelId: 0,
+      mainBodyColumnId: 245,
+      modelId: 4,
       itemType: 'article-common',
       detailsPage: '/pages/article/details',
     }) 
@@ -139,8 +138,8 @@ const categories = [
     icon: CategoryIcon2  , 
     onClick: () => navTo('/pages/article/common/list', {
       title: '建筑遗产',
-      mainBodyColumnId: 0,
-      modelId: 0,
+      mainBodyColumnId: 252,
+      modelId: 3,
       itemType: 'article-common',
       detailsPage: '/pages/article/details',
     }) 
@@ -150,8 +149,8 @@ const categories = [
     icon: CategoryIcon3  , 
     onClick: () => navTo('/pages/article/common/list', {
       title: '戏曲艺术',
-      mainBodyColumnId: 0,
-      modelId: 0,
+      mainBodyColumnId: 240,
+      modelId: 3,
       itemType: 'article-common',
       detailsPage: '/pages/article/details',
     }) 
@@ -161,19 +160,19 @@ const categories = [
     icon: CategoryIcon4 , 
     onClick: () => navTo('/pages/article/common/list', {
       title: '闽南美食',
-      mainBodyColumnId: 0,
-      modelId: 0,
+      mainBodyColumnId: 303,
+      modelId: 17,
       itemType: 'article-common',
       detailsPage: '/pages/article/details',
     })  
   },
   { 
-    name: '宗教信仰', 
+    name: '民俗信仰', 
     icon: CategoryIcon5  , 
     onClick: () => navTo('/pages/article/common/list', {
-      title: '宗教信仰',
-      mainBodyColumnId: 0,
-      modelId: 0,
+      title: '民俗信仰',
+      mainBodyColumnId: 248,
+      modelId: 4,
       itemType: 'article-common',
       detailsPage: '/pages/article/details',
     }) 

+ 38 - 9
src/pages/home.vue

@@ -49,7 +49,7 @@
             @click="tab.onClick"
           >
             <image class="width-100" :src="tab.icon" mode="widthFix" />
-            <text class="color-second-text mt-2 text-align-center">{{ tab.name }}</text>
+            <text class="color-second-text mt-2 size-base text-align-center">{{ tab.name }}</text>
           </view>
         </view>
       </view>
@@ -77,7 +77,7 @@
       </view> -->
 
       <!-- 近期活动 -->
-      <HomeTitle title="近期活动" />
+      <!-- <HomeTitle title="近期活动" />
       <SimplePageContentLoader :loader="activityLoader">
         <view 
           class="d-flex flex-col shadow-l radius-l bg-base p-3"
@@ -109,7 +109,7 @@
             </view>
           </view>
         </view>
-      </SimplePageContentLoader>
+      </SimplePageContentLoader> -->
 
       <!-- 精彩推荐 -->
       <HomeTitle title="精彩推荐" />
@@ -119,6 +119,7 @@
             v-for="(tab, k) in recommendLoader.content.value"
             :key="k"
             class="grid4-item position-relative mb-3"
+            @click="handleGoDetails(tab)"
           >
             <text 
               class="tag bg-mask-white color-primary radius-l p-2 position-absolute size-s"
@@ -126,9 +127,9 @@
               {{ tab.title }}
             </text> 
             <image
-              class="w-100 radius-base"
+              class="w-100 height-250 radius-base"
               :src="tab.image"
-              mode="widthFix"
+              mode="aspectFill"
             />
           </view>
         </view>
@@ -243,10 +244,38 @@ const activityLoader = useSimpleDataLoader(async () => {
   ]
 })
 const recommendLoader = useSimpleDataLoader(async () => {
-  return (await CommonContent.getContentList(new GetContentListParams().setSelfValues({
-    flag: 'recommend',
-  }), 1, 6)).list
+  const list = [];
+  list.push(...(await CommonContent.getContentList(new GetContentListParams()
+    .setModelId(1)
+  , 1, 6)).list.map((p) => {
+    p.itemType = 'artifact';
+    return p;
+  }))
+  list.push(...(await CommonContent.getContentList(new GetContentListParams()
+    .setModelId(16)
+  , 1, 6)).list.map((p) => {
+    p.itemType = 'intangible';
+    return p;
+  }))
+
+
+  return list;
 });
+
+function handleGoDetails(item: any) {
+  switch (item.itemType) {
+    case 'artifact': 
+      navTo('/pages/inhert/artifact/details', { id: item.id });
+      break;
+    case 'intangible': 
+      navTo('/pages/inhert/intangible/details', { id: item.id });
+      break;
+    default:
+      navTo('/pages/article/details', { id: item.id });
+      break;
+  }
+}
+
 </script>
 
 <style lang="scss">
@@ -289,7 +318,7 @@ const recommendLoader = useSimpleDataLoader(async () => {
     color: #432A04;
 
     .title {
-      font-size: 46rpx;
+      font-size: 40rpx;
     }
     text {
       font-size: 35rpx;

+ 5 - 5
src/pages/inhert.vue

@@ -214,8 +214,8 @@ const {
   goDetail: goSongsDetail,
 } = useHomePageMiniCommonListGoMoreAndGoDetail({
   title: '闽南语原创歌曲',
-  mainBodyColumnId: 0,
-  modelId: 0,
+  mainBodyColumnId: 189,
+  modelId: 16,
   itemType: 'article-common',
   detailsPage: '/pages/video/details',
 });
@@ -227,7 +227,7 @@ const {
 } = useHomePageMiniCommonListGoMoreAndGoDetail({
   title: '方言故事频率库',
   mainBodyColumnId: 0,
-  modelId: 0,
+  modelId: 5,
   itemType: 'article-common',
   detailsPage: '/pages/video/details',
 });
@@ -262,8 +262,8 @@ const {
   goDetail: goTopicsDetail,
 } = useHomePageMiniCommonListGoMoreAndGoDetail({
   title: '古早味知识百科',
-  mainBodyColumnId: 0,
-  modelId: 0,
+  mainBodyColumnId: 303,
+  modelId: 16,
   itemType: 'article-common',
   detailsPage: '/pages/article/details',
 });

+ 8 - 1
src/pages/inhert/artifact/details.vue

@@ -20,7 +20,7 @@
                   <text class="iconfont icon-navigation"></text>
                   <text>{{ loader.content.value.address }}</text>
                 </view>
-                <view class="link">
+                <view class="link" @click="handleNavTo">
                   去这里 <text class="iconfont icon-go"></text>
                 </view>
               </view>
@@ -106,6 +106,13 @@ const loader = useSimplePageContentLoader<
 
 useLoadQuerys({ id : 0, }, (p) => loader.loadData(p));
 
+
+function handleNavTo() {
+  navTo('../../travel/nav/navto', {
+    latitude: 0,  
+    longitude: 0,
+  }) 
+}
 function goDetails(item: any) {
   navTo('./details', { id: item.id })
 }

+ 18 - 1
src/pages/inhert/intangible/details.vue

@@ -3,11 +3,28 @@
     <SimplePageContentLoader :loader="loader">
       <template v-if="loader.content.value">
         <view class="d-flex flex-col p-3">
-          <ImageSwiper :images="loader.content.value.images" />
+          <video 
+            v-if="loader.content.value.audio"
+            class="video w-100"
+            autoplay
+            :poster="loader.content.value.image"
+            :src="loader.content.value.audio"
+            controls
+          />
+          <video
+            v-else-if="loader.content.value.video"
+            class="video w-100"
+            autoplay
+            :poster="loader.content.value.image"
+            :src="loader.content.value.video"
+            controls
+          />
+          <ImageSwiper v-else :images="loader.content.value.images" />
           <view class="d-flex flex-col text-align-center mt-3">
             <text class="size-lll font-bold color-text-content">{{ loader.content.value.title }}</text>
             <text class="size-base color-text-content-second mt-2">{{ loader.content.value.desc }}</text>
           </view>
+
           <view class="d-flex flex-col radius-l bg-light p-25 mt-3">
             <u-parse :content="loader.content.value.intro" :tagStyle="commonParserStyle"></u-parse>
             <u-parse :content="loader.content.value.content" :tagStyle="commonParserStyle"></u-parse>

+ 11 - 11
src/pages/travel.vue

@@ -63,10 +63,10 @@
               titleColor="title-text"
               :key="i"
               :title="item.title"
-              :desc="item.desc"
+              :desc="item.desc || item.title"
               :image="item.image"
-              :bottomLocate="'item.bottomLocate'"
-              :bottomScore="'item.bottomScore'"
+              :bottomLocate="item.district"
+              :bottomScore="'5.0'"
               @click="goRecommendDetail(item.id)"
             />
           </view>
@@ -92,7 +92,7 @@
       </SimplePageContentLoader>
 
       <!-- 近期活动 -->
-      <view class="d-flex flex-col wing-l">
+      <!-- <view class="d-flex flex-col wing-l">
         <HomeTitle title="近期活动" showMore />
         <SimplePageContentLoader :loader="activityData">
           <Box2LineRightShadow
@@ -110,7 +110,7 @@
             </template>
           </Box2LineRightShadow>
         </SimplePageContentLoader>
-      </view>
+      </view> -->
     </view>
 
 
@@ -203,8 +203,8 @@ const {
   goDetail: goRouteDetail,
 } = useHomePageMiniCommonListGoMoreAndGoDetail({
   title: '旅游路线',
-  mainBodyColumnId: 0,
-  modelId: 0,
+  mainBodyColumnId: 274,
+  modelId: 17,
   itemType: 'article-common',
   detailsPage: '/pages/article/details',
 });
@@ -215,8 +215,8 @@ const {
   goDetail: goRecommendDetail,
 } = useHomePageMiniCommonListGoMoreAndGoDetail({
   title: '文化景区',
-  mainBodyColumnId: 0,
-  modelId: 0,
+  mainBodyColumnId: 273,
+  modelId: 17,
   itemType: 'article-common',
   detailsPage: '/pages/article/details',
 });
@@ -227,8 +227,8 @@ const {
   goDetail: goCreativeDetail,
 } = useHomePageMiniCommonListGoMoreAndGoDetail({
   title: '文化产品',
-  mainBodyColumnId: 0,
-  modelId: 0,
+  mainBodyColumnId: 48,
+  modelId: 9,
   itemType: 'article-common',
   detailsPage: '/pages/article/details',
 });

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

@@ -2,16 +2,12 @@
   <view class="video-details main bg-base">
     <SimplePageContentLoader :loader="loader">
       <template v-if="loader.content.value">
-        <image 
-          v-if="loader.content.value.image"
-          class="w-100 radius-base"
-          :src="loader.content.value.image"
-          mode="widthFix"
-        />
+        
         <video 
           v-if="loader.content.value.audio"
           class="video"
           autoplay
+          :poster="loader.content.value.image"
           :src="loader.content.value.audio"
           controls
         />
@@ -19,9 +15,16 @@
           v-else-if="loader.content.value.video"
           class="video"
           autoplay
+          :poster="loader.content.value.image"
           :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>