Compare commits

..

4 Commits

Author SHA1 Message Date
xinadmin ef2d4758f2 子项样式修改 2026-08-13 00:24:00 +08:00
xinadmin f86e9dee75 子项样式修改 2026-08-11 10:56:49 +08:00
xinadmin 075136efb1 子项样式修改 2026-08-11 10:53:06 +08:00
xinadmin 1ffdab9358 子项样式修改 2026-08-11 10:47:12 +08:00
4 changed files with 41 additions and 37 deletions
+3 -1
View File
@@ -36,7 +36,9 @@ export interface HomeData {
} }
/** 分类链接项(结构与 HomeLinkItem 相同,但不含 link_type / category_id,均为纯链接) */ /** 分类链接项(结构与 HomeLinkItem 相同,但不含 link_type / category_id,均为纯链接) */
export type CategoryLinkItem = Omit<HomeLinkItem, 'link_type' | 'category_id'> export type CategoryLinkItem = Omit<HomeLinkItem, 'link_type' | 'category_id'> & {
tag: string[]
}
// ==================== API ==================== // ==================== API ====================
+15 -20
View File
@@ -1,9 +1,9 @@
.category { .category {
min-height: 100vh; min-height: 100vh;
background: #f7f8fa; background: #fff;
padding-top: 16px; padding: 30px;
// 加载 / 空状态 // 加载
.category-state { .category-state {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -18,26 +18,21 @@
} }
} }
// 宫格链接(与首页宫格导航样式一致) .grid-item {
.grid-wrapper { display: flex;
margin: 16px 32px 20px; margin-bottom: 10px;
background: rgb(255 255 255); padding: 14px 0;
border-radius: 20px; border-bottom: 1px solid #ddd;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
padding-bottom: 24px;
.van-grid-item__content {
padding-top: 24px;
padding-bottom: 0;
} }
.van-icon--image { .grid-item-title {
width: 60px !important;
height: 60px !important;
} }
.van-grid-item__text { .grid-item-image {
font-size: 22px; margin-right: 30px;
} width: 100px;
height: 100px;
} }
} }
+14 -7
View File
@@ -1,5 +1,5 @@
import { View, Text } from '@tarojs/components' import { View, Text } from '@tarojs/components'
import { Grid, GridItem, Loading } from '@antmjs/vantui' import {Image, Loading, Space, Tag} from '@antmjs/vantui'
import { useState, useEffect } from 'react' import { useState, useEffect } from 'react'
import Taro from '@tarojs/taro' import Taro from '@tarojs/taro'
import { getCategoryLinks } from '@/api/home' import { getCategoryLinks } from '@/api/home'
@@ -49,16 +49,23 @@ export default function Category() {
) : links.length > 0 ? ( ) : links.length > 0 ? (
// 宫格链接(与首页宫格导航样式一致) // 宫格链接(与首页宫格导航样式一致)
<View className='grid-wrapper'> <View className='grid-wrapper'>
<Grid columnNum={5} border={false} gutter={12} iconSize={48}>
{links.map((item) => ( {links.map((item) => (
<GridItem <View
className='grid-item'
key={item.id} key={item.id}
icon={item.image.preview_url}
text={item.title}
onClick={() => navigateToLink(item.link)} onClick={() => navigateToLink(item.link)}
/> >
<Image className='grid-item-image' src={item.image.preview_url}></Image>
<Text className='grid-item-title'>
<View>{item.title}</View>
<Space>
{ item.tag && item.tag.length > 0 && item.tag.map((tag, index) => (
<Tag type='danger' key={index}>{tag}</Tag>
))}
</Space>
</Text>
</View>
))} ))}
</Grid>
</View> </View>
) : ( ) : (
// 空状态 // 空状态
+1 -1
View File
@@ -111,7 +111,7 @@ export default function Index() {
paginationVisible paginationVisible
paginationColor='#ffffff' paginationColor='#ffffff'
duration={500} duration={500}
height={220} height={180}
> >
{carousel.map((item) => ( {carousel.map((item) => (
<SwiperItem key={item.id}> <SwiperItem key={item.id}>