feat: 店铺详情页重构 — 四卡片布局(月度目标/推广费/刷单费/店铺订单),筛选栏移至标题行,图标替换为Lucide

This commit is contained in:
小蟑螂
2026-04-30 15:57:32 +08:00
parent 00377bdc63
commit b063f65568
21 changed files with 1211 additions and 961 deletions
@@ -106,3 +106,10 @@ export async function exportCompanyOverviewApi(params: {
responseType: 'blob',
});
}
/**
* 获取店铺详情看板数据
*/
export async function getShopDetailsApi(params: ShopDTO.DetailQuery) {
return requestClient.post<ShopVO.Dashboard>('/ec/shop/details', params);
}
@@ -56,4 +56,14 @@ export namespace ShopDTO {
/** 税率(默认0.04,即4%) */
taxRate?: number;
}
/** 店铺详情看板查询参数 */
export interface DetailQuery {
/** 店铺ID */
shopId: number;
/** 开始日期(不传默认为当月1号) */
startDate?: string;
/** 结束日期(不传默认为今天) */
endDate?: string;
}
}
@@ -260,4 +260,72 @@ export namespace ShopVO {
/** 各品类汇总列表 */
categories: CategoryComparison[];
}
// ========== 店铺详情看板 ==========
/** 店铺基本信息 */
export interface ShopInfo {
id: number;
name: string;
logo?: string;
platformName?: string;
}
/** 月度目标KPI */
export interface MonthlyTargetKpi {
/** 年度目标总额 */
totalTargetAmount: number;
/** 目标单量合计 */
totalOrderCount: number;
/** 本月目标销售额 */
thisMonthTargetAmount: number;
/** 本月目标单量 */
thisMonthTargetOrderCount: number;
/** 当前达成率(百分比) */
achievementRate: number;
}
/** 推广费KPI */
export interface PromotionFeeKpi {
/** 累计推广费 */
totalFeeAmount: number;
/** 本月推广费 */
thisMonthFee: number;
/** 日均推广费 */
avgDailyFee: number;
}
/** 刷单费KPI */
export interface BrushOrderKpi {
/** 累计刷单费 */
totalBrushAmount: number;
/** 本月刷单次数 */
thisMonthCount: number;
/** 平均刷单金额 */
avgAmount: number;
}
/** 店铺订单KPI */
export interface ShopOrderKpi {
/** 累计实收金额 */
totalReceivedAmount: number;
/** 累计佣金 */
totalCommission: number;
/** 累计订单数 */
totalOrderCount: number;
}
/** 店铺详情看板数据 */
export interface Dashboard {
/** 店铺基本信息 */
shopInfo: ShopInfo;
/** 月度目标看板数据 */
monthlyTarget: MonthlyTargetKpi;
/** 推广费看板数据 */
promotionFee: PromotionFeeKpi;
/** 刷单费看板数据 */
brushOrder: BrushOrderKpi;
/** 店铺订单看板数据 */
shopOrder: ShopOrderKpi;
}
}