refactor(category):重构文章分类页面结构和加载逻辑

- 调整文章列表组件路径并优化渲染逻辑
- 添加骨架屏加载效果提升用户体验
- 完善错误处理机制增强页面稳定性- 更新页面配置文件路径引用
- 移除冗余的页面配置和组件引用
-优化首页Banner组件加载状态处理
- 增强热销商品Tab切换功能和空状态展示- 调整用户经销商组件调试日志- 修改全局应用配置中的页面路径引用
- 调整主题处理逻辑执行时机
This commit is contained in:
2025-09-26 12:45:07 +08:00
parent 915c06ecab
commit b8e13fdc68
15 changed files with 263 additions and 171 deletions

View File

@@ -1,5 +1,5 @@
import {useEffect, useState} from "react";
import {Image} from '@nutui/nutui-react-taro'
import {Image, Tabs, Empty} from '@nutui/nutui-react-taro'
import {Share} from '@nutui/icons-react-taro'
import {View, Text} from '@tarojs/components';
import Taro from "@tarojs/taro";
@@ -7,6 +7,7 @@ import {ShopGoods} from "@/api/shop/shopGoods/model";
import {pageShopGoods} from "@/api/shop/shopGoods";
const BestSellers = () => {
const [tab1value, setTab1value] = useState<string | number>('0')
const [list, setList] = useState<ShopGoods[]>([])
const [goods, setGoods] = useState<ShopGoods>()
@@ -57,8 +58,29 @@ const BestSellers = () => {
return (
<>
<View className={'py-3'}>
{/* Tabs切换组件 */}
<Tabs
value={tab1value}
className={'w-full mb-4'}
onChange={(value) => {
setTab1value(value)
}}
style={{
backgroundColor: 'transparent',
}}
activeType="smile"
>
<Tabs.TabPane title="今日主推">
</Tabs.TabPane>
<Tabs.TabPane title="即将到期">
</Tabs.TabPane>
<Tabs.TabPane title="活动预告">
</Tabs.TabPane>
</Tabs>
<View className={'flex flex-col justify-between items-center rounded-lg px-2'}>
{list?.map((item, index) => {
{/* 今日主推 */}
{tab1value == '0' && list?.map((item, index) => {
return (
<View key={index} className={'flex flex-col rounded-lg bg-white shadow-sm w-full mb-5'}>
<Image src={item.image} mode={'aspectFit'} lazyLoad={false}
@@ -95,6 +117,28 @@ const BestSellers = () => {
</View>
)
})}
{/* 即将到期 */}
{tab1value == '1' && (
<Empty
size={'small'}
description="暂无即将到期的商品"
style={{
background: 'transparent',
}}
/>
)}
{/* 活动预告 */}
{tab1value == '2' && (
<Empty
size={'small'}
description="暂无活动预告"
style={{
background: 'transparent',
}}
/>
)}
</View>
</View>
</>