ソースを参照

📦 列表页介绍页细节修改

imengyu 1 ヶ月 前
コミット
938c5e11b1
共有5 個のファイルを変更した108 個の追加26 個の削除を含む
  1. 15 7
      src/pages/article/details.vue
  2. 0 1
      src/pages/article/list.vue
  3. 56 4
      src/pages/home/introduction.vue
  4. 6 3
      src/pages/inhert/village/list.vue
  5. 31 11
      src/pages/video/details.vue

+ 15 - 7
src/pages/article/details.vue

@@ -1,14 +1,22 @@
 <template>
-  <view class="main">
+  <view class="d-flex flex-column bg-base">
     <SimplePageContentLoader :loader="loader">
       <template v-if="loader.content.value">
-        <view class="article">
-          <view class="title">{{ loader.content.value.title }}</view>
-          <view class="info">
-            <view class="author">{{ loader.content.value.author }}</view>
-            <view class="time">{{ DataDateUtils.formatDate(loader.content.value.publishAt, 'YYYY-MM-dd HH:ii:ss') }}</view>
+        <view class="d-flex flex-col">
+          <image 
+            v-if="loader.content.value.image"
+            class="w-100 radius-base"
+            :src="loader.content.value.image"
+            mode="widthFix"
+          />
+          <view class="d-flex flex-col p-3">
+            <view class="size-ll color-title-text">{{ loader.content.value.title }}</view>
+            <view class="d-flex flex-row mt-2">
+              <text class="size-s color-text-content-second">{{ loader.content.value.author }}</text>
+              <text class="size-s color-text-content-second">{{ DataDateUtils.formatDate(loader.content.value.publishAt, 'YYYY-MM-dd HH:ii:ss') }}</text>
+            </view>
           </view>
-          <view class="content">
+          <view class="p-3 radius-ll bg-light mt-3">
             <u-parse :content="loader.content.value.content" :tagStyle="commonParserStyle"></u-parse>
           </view>
         </view>

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

@@ -54,7 +54,6 @@ const listLoader = useSimplePageListLoader<{
     throw new Error("未传入参数,当前页面需要参数");
   const res = await CommonContent.getContentList(new GetContentListParams().setSelfValues({
     keywords: searchText.value,
-    type: GetContentListParams.TYPE_ARTICLE,
     modelId: params.modelId, 
     mainBodyColumnId: params.mainBodyColumnId ,
   }), page, pageSize);

+ 56 - 4
src/pages/home/introduction.vue

@@ -1,5 +1,5 @@
 <template>
-  <view class="home-container page-home-introduction d-flex flex-col bg-base">
+  <view class="home-container page-home-introduction d-flex flex-col bg-base" style="min-height:100vh">
     <u-navbar :autoBack="true" bgColor="transparent" />
     <image 
       class="w-100 position-absolute"
@@ -10,7 +10,7 @@
 
       <!-- 标题 -->
       <view class="font-songti color-title-text d-flex flex-col align-center justify-center p-3">
-        <text class="size-lll">闽南文化(厦门)生态保护区</text>
+        <text class="size-lll">闽南文化生态保护区<text class="size-ll">(厦门市)</text></text>
         <text class="size-base mt-2">世界闽南文化交流中心</text>
       </view>
 
@@ -20,26 +20,78 @@
           <u-parse :content="introdData.content.value" :tag-style="commonParserStyle"></u-parse>
         </SimplePageContentLoader>
       </view>
+
+      <view class="d-flex flex-col mt-3">
+        <view
+          v-for="item in listLoader.list.value"
+          :key="item.id"
+        >
+          <Box2LineImageRightShadow 
+            classNames="ml-2 mb-3"
+            titleColor="title-text"
+            :image="item.image"
+            :title="item.title"
+            @click="goDetail(item.id)"
+          />
+        </view>
+      </view>
+      <SimplePageListLoader :loader="listLoader" />
     </view>
   </view>
   <tabbar :current="0"></tabbar>
 </template>
 
 <script setup lang="ts">
-import { GetContentListParams } from '@/api/CommonContent';
 import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
+import CommonContent, { GetContentListParams } from '@/api/CommonContent';
+import SimplePageListLoader from '@/common/components/SimplePageListLoader.vue';
+import Box2LineImageRightShadow from '@/pages/parts/Box2LineImageRightShadow.vue';
 import NewsIndexContent from '@/api/news/NewsIndexContent';
 import Tabbar from '@/common/components/tabs/tabbar.vue';
 import commonParserStyle from '@/common/style/commonParserStyle';
 import SimplePageContentLoader from '@/common/components/SimplePageContentLoader.vue';
+import { useSimplePageListLoader } from '@/common/composeabe/SimplePageListLoader';
+import { DataDateUtils } from '@imengyu/js-request-transform';
+import { navTo } from '@/common/utils/PageAction';
+import { onMounted } from 'vue';
 
 const introdData = useSimpleDataLoader(async () => {
   return (await NewsIndexContent.getColumList(new GetContentListParams().setSelfValues({
-    modelId: 3,
+    modelId: 17,
     mainBodyColumnId: 234,
   }))).list[0]?.overview || '无内容!请添加内容!!';
 }, true);
 
+const listLoader = useSimplePageListLoader<{
+  id: number,
+  image: string,
+  title: string,
+  date: string
+}, {
+  modelId: number|undefined, 
+  mainBodyColumnId: number|undefined,
+}>(8, async (page, pageSize, params) => {
+  const res = await CommonContent.getContentList(new GetContentListParams().setSelfValues({
+    modelId: 17, 
+    mainBodyColumnId: '255,256,283,284',
+  }), page, pageSize);
+  return res.list.map((item) => {
+    return {
+      id: item.id,
+      image: item.image,
+      title: item.title,
+      date: DataDateUtils.formatDate(item.publishAt, 'YYYY-MM-dd'),
+    }
+  })
+});
+
+function goDetail(id: number) {
+  navTo('/pages/article/details', { id });
+}
+
+onMounted(() => {
+  listLoader.loadData(); 
+})
 </script>
 
 <style lang="scss">

+ 6 - 3
src/pages/inhert/village/list.vue

@@ -1,6 +1,5 @@
 <template>
-  <view class="d-flex flex-column bg-base">
-    <u-navbar title="特色村社" autoBack placeholder bgColor="transparent" />
+  <view class="d-flex flex-column bg-base" style="min-height: 100vh;">
     <view class="d-flex flex-col p-2">
       <uni-search-bar 
         v-model="searchValue"
@@ -32,7 +31,7 @@
 </template>
 
 <script setup lang="ts">
-import { ref, watch } from 'vue';
+import { onMounted, ref, watch } from 'vue';
 import { useSimplePageListLoader } from '@/common/composeabe/SimplePageListLoader';
 import { navTo } from '@/common/utils/PageAction';
 import SimplePageListLoader from '@/common/components/SimplePageListLoader.vue';
@@ -60,4 +59,8 @@ function doSearch() {
 function goDetails(id: number) {
   navTo('details', { id })
 }
+
+onMounted(() => {
+  doSearch();
+})
 </script>

+ 31 - 11
src/pages/video/details.vue

@@ -1,19 +1,38 @@
 <template>
-  <view class="video-details main">
+  <view class="video-details main bg-base">
     <SimplePageContentLoader :loader="loader">
       <template v-if="loader.content.value">
-        <video class="video" autoplay :src="loader.content.value.video" controls></video>
-        <view class="nested-content">
-          <view class="article">
-            <view class="title">{{ loader.content.value.title }}</view>
-            <view class="info">
-              <view class="author">{{ loader.content.value.author }}</view>
-              <view class="time">{{ loader.content.value.publishAt }}</view>
-            </view>
-            <view class="content">
-              <u-parse :content="loader.content.value.content" :tagStyle="commonParserStyle"></u-parse>
+        <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
+          :src="loader.content.value.audio"
+          controls
+        />
+        <video
+          v-else-if="loader.content.value.video"
+          class="video"
+          autoplay
+          :src="loader.content.value.video"
+          controls
+        />
+        <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>
+            <view class="d-flex flex-row mt-2">
+              <text class="size-s color-text-content-second">{{ loader.content.value.author }}</text>
+              <text class="size-s color-text-content-second">{{ DataDateUtils.formatDate(loader.content.value.publishAt, 'YYYY-MM-dd HH:ii:ss') }}</text>
             </view>
           </view>
+          <view class="content radius-l bg-light p-3">
+            <u-parse :content="loader.content.value.content" :tagStyle="commonParserStyle"></u-parse>
+          </view>
         </view>
         <view class="bottom-actions">
           <view class="action">
@@ -37,6 +56,7 @@ import NewsIndexContent from "@/api/news/NewsIndexContent";
 import commonParserStyle from "@/common/style/commonParserStyle";
 import SimplePageContentLoader from "@/common/components/SimplePageContentLoader.vue";
 import { useLoadQuerys } from "@/common/composeabe/LoadQuerys";
+import { DataDateUtils } from "@imengyu/js-request-transform";
 
 const loader = useSimplePageContentLoader<
   GetContentDetailItem,