feat(mall): 商品 tab 计数跟随筛选条件

getTabsCount 传入 queryParams,使 tab 数量与列表筛选口径一致;首页统计卡片仍用无参版(全局总数)。
master
YunaiV 2026-06-22 09:16:43 -07:00
parent 8b2b93c92c
commit 2979bd99c1
2 changed files with 4 additions and 4 deletions

View File

@ -65,9 +65,9 @@ export const getSpuPage = (params: PageParam) => {
return request.get({ url: '/product/spu/page', params })
}
// 获得 Spu 列表 tabsCount
export const getTabsCount = () => {
return request.get({ url: '/product/spu/get-count' })
// 获得 Spu 列表 tabsCount(支持按 name/categoryId/createTime 筛选)
export const getTabsCount = (params?: any) => {
return request.get({ url: '/product/spu/get-count', params })
}
// 创建商品 Spu

View File

@ -311,7 +311,7 @@ const handleTabClick = (tab: TabsPaneContext) => {
/** 获得每个 Tab 的数量 */
const getTabsCount = async () => {
const res = await ProductSpuApi.getTabsCount()
const res = await ProductSpuApi.getTabsCount(queryParams.value)
for (let objName in res) {
tabsData.value[Number(objName)].count = res[objName]
}