Parcourir la source

🎨 按要求修改细节问题

快乐的梦鱼 il y a 2 mois
Parent
commit
3ab7ca50d8

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

@@ -6,7 +6,7 @@
       hasBg ? 'bg-base p-3' : ''
     ]"
   >
-    <view v-if="tabs" class="top-tab bg-base">
+    <view v-if="showTab && tabs" class="top-tab bg-base">
       <Tabs
         :tabs="tabs" 
         :width="700"
@@ -177,6 +177,13 @@ const props = defineProps({
     default: true,
   },
   /**
+   * 是否显示Tab
+   */
+  showTab: {
+    type: Boolean,
+    default: true,
+  },
+  /**
    * 显示总数
    */
   showTotal: {

+ 21 - 23
src/pages/home.vue

@@ -54,24 +54,22 @@
       <SimplePageContentLoader :loader="statsLoader">
         <view v-if="statsLoader.content.value" class="d-flex flex-col mt-3 pt-3 b-3 b-0order-all-light-light-primary">
           
-          <view class="d-flex flex-row">
-            <StatsText
-              class="w-50 border-right-forth"
-              width="calc(50%)"
-              :title="statsLoader.content.value[0].title" 
-              :data="statsLoader.content.value[0].datas" 
-            />
-            <StatsText 
-              class="w-50"
-              width="calc(50%)"
-              :title="statsLoader.content.value[1].title" 
-              :data="statsLoader.content.value[1].datas" 
-            />
-          </view>
+          <StatsText
+            :title="statsLoader.content.value[0].title" 
+            :data="statsLoader.content.value[0].datas" 
+            :type="statsLoader.content.value[0].type" 
+          />
+          <StatsText 
+            class="border-top-forth pt-2 mt-3"
+            :title="statsLoader.content.value[1].title" 
+            :data="statsLoader.content.value[1].datas" 
+            :type="statsLoader.content.value[1].type" 
+          />
           <StatsText
             class="border-top-forth pt-2 mt-3"
             width="calc(33%)"
             :data="statsLoader.content.value[2].datas" 
+            :type="statsLoader.content.value[2].type" 
           />
         </view>
       </SimplePageContentLoader>
@@ -314,12 +312,12 @@ const statsLoader = useSimpleDataLoader(async () => {
   return [
     {
       title: '非遗项目',
-      type: '1',
+      type: 'text',
       datas: data.ichData.filter((p: any) => [ '国家级', '省级', '市级' ].includes(p.level_text)).map((item: any) => {
         sumProject += item.total;
         return {
-          title: item.level_text + (item.level_text == '国家级' ? `(其中含${topLevelProject}项为人类非遗)` : ''),
-          value: item.total,
+          title: item.level_text,
+          value: item.total + ' 项' + (item.level_text == '国家级' ? ` (其中含${topLevelProject}项为人类非遗)` : ''),
           long: item.level_text == '国家级',
           onClick: () => navTo('/pages/inhert/intangible/list', { tab: 0, level: item.level }),
         }
@@ -333,12 +331,12 @@ const statsLoader = useSimpleDataLoader(async () => {
     },
     {
       title: '非遗传承人',
-      type: '2',
+      type: 'text',
       datas: data.inheritorData.filter((p: any) => [ '国家级', '省级', '市级' ].includes(p.title)).map((item: any) => {
         sumInheritor += item.total;
         return {
           title: item.title,
-          value: item.total,
+          value: item.total + ' 人',
           onClick: () => navTo('/pages/inhert/inheritor/list', { level: item.level }),
         }
       }).concat([
@@ -375,7 +373,7 @@ const statsLoader = useSimpleDataLoader(async () => {
     },
     {
       title: '不可移动文物',
-      type: '3',
+      type: 'none',
       datas: data.crData.map((item: any) => {
         return {
           title: item.title,
@@ -385,7 +383,7 @@ const statsLoader = useSimpleDataLoader(async () => {
     },
     {
       title: '闽南文化重要相关文物古迹',
-      type: '2',
+      type: 'none',
       datas: data.minnanCr.map((item: any) => {
         return {
           title: item.title,
@@ -395,7 +393,7 @@ const statsLoader = useSimpleDataLoader(async () => {
     },
     {
       title: '重要相关历史风貌区',
-      type: '1',
+      type: 'none',
       datas: data.historyData.map((item: any) => {
         return {
           title: item.title,
@@ -405,7 +403,7 @@ const statsLoader = useSimpleDataLoader(async () => {
     },
     {
       title: '传习中心',
-      type: '3',
+      type: 'none',
       datas: data.ichCenter.map((item: any) => {
         return {
           title: item.title,

+ 2 - 3
src/pages/inhert/old/list.vue

@@ -1,6 +1,6 @@
 <template>
   <CommonListPage 
-    title="老字号"
+    title="重要相关老字号"
     itemType="article-common"
     detailsPage="/pages/inhert/intangible/details"
     :showTotal="false"
@@ -9,7 +9,6 @@
       mainBodyColumnId: 312,
       modelId: 17,
     }"
-
     :load="loadData" 
   />
 </template>
@@ -36,7 +35,7 @@ async function loadData(
     })
   , page, pageSize));
   res.list.forEach((p) => {
-    p.desc = p.ichName as string;
+    p.desc = `认定类型: ${p.brandType || ''}\n 字号名称: ${p.fontName || ''}`;
     p.bottomTags = [
       p.levelText, 
       p.batchText,

+ 2 - 0
src/pages/introduction/food/list.vue

@@ -16,6 +16,8 @@
       }
     ]"
     showTotal
+    :startTabIndex="1"
+    :showTab="false"
     :dropDownNames="dropdownNames"
     :load="loadData"
     :tabs="[

+ 1 - 1
src/pages/parts/Box2LineImageRightShadow.vue

@@ -32,7 +32,7 @@
             titleBox ? 'border-all-text' : '',
           ]">{{ title }}</text>
         </view> 
-        <text class="size-s color-second text-lines-2 mt-2">{{ desc }}</text>
+        <text :class="'size-s color-second text-lines-3 mt-2' + (tags ? 'text-lines-2' : '')">{{ desc }}</text>
         <RoundTags v-if="tags" :tags="tags" small />
       </view>
     </view>

+ 41 - 3
src/pages/parts/StatsText.vue

@@ -2,7 +2,8 @@
   <view 
     :class="[
       'main-stats-text',
-      title ? '' : 'no-title'
+      title ? '' : 'no-title',
+      type,
     ]"
   >
     <text class="title">{{ title }}</text>
@@ -10,8 +11,10 @@
       <view
         v-for="(item, i) in data"
         :key="i"
-        class="item"
-        :style="{ width: item.long ? 'calc(100%)' : width }"
+        :class="[
+          'item',
+          item.long ? 'long' : ''
+        ]"
         @click="item.onClick"
       >
         <text class="number">{{ item.value }}</text>
@@ -29,10 +32,15 @@ defineProps({
     type: String,
     default: ''
   },
+  type: {
+    type: String,
+    default: 'stat'
+  },
   data : {
     type: Object as PropType<{
       title: string,
       value: string,
+      suffix?: string,
       long?: boolean,
       onClick?: () => void
     }[]>,
@@ -76,6 +84,11 @@ $color-text: map.get($colors, "text");
       flex-direction: column;
       text-align: center;
       margin: 10rpx 0;
+      width: calc(50%);
+
+      &.long {
+        width: calc(100%);
+      }
 
       .sub-title {
         font-size: 24rpx;
@@ -99,5 +112,30 @@ $color-text: map.get($colors, "text");
       }
     }
   }
+
+  &.text {
+    .stats {
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+      justify-content: space-around;
+      flex-wrap: wrap;
+      color: $color-text;
+
+      .item {
+        flex-direction: row-reverse;
+        justify-content: flex-end;
+        align-items: center;
+
+        .sub-title {
+          font-size: 28rpx;
+        }
+        .number {
+          font-size: 30rpx;
+          margin: 0 4rpx;
+        }
+      }
+    }
+  }
 }
 </style>