feat(shop): 商品列表组件重构并优化页面展示
- 新增 GoodsList.scss 样式文件,实现网格布局和商品卡片样式 - 重构 GoodsList.tsx 组件,使用新的样式结构和 ShopGoods 类型 - 移除 Share 图标依赖,简化购买按钮设计 - 注释掉首页的桶装水和水票套餐分类入口 - 更新政企采购专区跳转链接至正确分类ID - 在商品列表页面添加空状态显示组件 - 修改商品列表请求参数,增加状态过滤条件
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import Taro from '@tarojs/taro'
|
||||
import GoodsList from './components/GoodsList'
|
||||
import {useShareAppMessage} from "@tarojs/taro"
|
||||
import {Loading} from '@nutui/nutui-react-taro'
|
||||
import {Loading,Empty} from '@nutui/nutui-react-taro'
|
||||
import {useEffect, useState} from "react"
|
||||
import {useRouter} from '@tarojs/taro'
|
||||
import './index.scss'
|
||||
@@ -21,7 +21,7 @@ function Category() {
|
||||
// 1.加载远程数据
|
||||
const id = Number(params.id)
|
||||
const nav = await getCmsNavigation(id)
|
||||
const shopGoods = await pageShopGoods({categoryId: id})
|
||||
const shopGoods = await pageShopGoods({categoryId: id, status: 0})
|
||||
|
||||
// 2.处理业务逻辑
|
||||
setCategoryId(id)
|
||||
@@ -59,6 +59,12 @@ function Category() {
|
||||
)
|
||||
}
|
||||
|
||||
if(list.length == 0){
|
||||
return (
|
||||
<Empty description="暂无数据"/>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={'flex flex-col'}>
|
||||
|
||||
Reference in New Issue
Block a user