From 1ffdab93586183d24c6582281a4a8c7726df8331 Mon Sep 17 00:00:00 2001 From: liu <2302563948@qq.com> Date: Tue, 11 Aug 2026 10:47:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=90=E9=A1=B9=E6=A0=B7=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home.ts | 4 +++- src/pages/category/index.less | 21 ++++++++++++--------- src/pages/category/index.tsx | 29 ++++++++++++++++++----------- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/src/api/home.ts b/src/api/home.ts index ef5f1d8..e95de5b 100644 --- a/src/api/home.ts +++ b/src/api/home.ts @@ -36,7 +36,9 @@ export interface HomeData { } /** 分类链接项(结构与 HomeLinkItem 相同,但不含 link_type / category_id,均为纯链接) */ -export type CategoryLinkItem = Omit +export type CategoryLinkItem = Omit & { + tag: string[] +} // ==================== API ==================== diff --git a/src/pages/category/index.less b/src/pages/category/index.less index ef7bf79..1e53496 100644 --- a/src/pages/category/index.less +++ b/src/pages/category/index.less @@ -24,20 +24,23 @@ background: rgb(255 255 255); border-radius: 20px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06); - padding-bottom: 24px; + padding: 20px 20px 30px; - .van-grid-item__content { - padding-top: 24px; - padding-bottom: 0; + .grid-item { + display: flex; + margin-bottom: 10px; + padding: 20px; + border-bottom: 1px solid #ddd; } - .van-icon--image { - width: 60px !important; - height: 60px !important; + .grid-item-title { + } - .van-grid-item__text { - font-size: 22px; + .grid-item-image { + margin-right: 30px; + width: 100px; + height: 100px; } } } diff --git a/src/pages/category/index.tsx b/src/pages/category/index.tsx index 51970a7..d0726e3 100644 --- a/src/pages/category/index.tsx +++ b/src/pages/category/index.tsx @@ -1,5 +1,5 @@ import { View, Text } from '@tarojs/components' -import { Grid, GridItem, Loading } from '@antmjs/vantui' +import {Image, Loading, Tag} from '@antmjs/vantui' import { useState, useEffect } from 'react' import Taro from '@tarojs/taro' import { getCategoryLinks } from '@/api/home' @@ -49,16 +49,23 @@ export default function Category() { ) : links.length > 0 ? ( // 宫格链接(与首页宫格导航样式一致) - - {links.map((item) => ( - navigateToLink(item.link)} - /> - ))} - + {links.map((item) => ( + navigateToLink(item.link)} + > + + + {item.title} + + { item.tag.length > 0 && item.tag.map((tag, index) => ( + {tag} + ))} + + + + ))} ) : ( // 空状态