mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-23 23:59:19 +08:00
feat: 店铺概览页面标题显示店铺名称
- ShopOverviewStatisticsVO 增加 shopId 字段 - Service 层通过 shopService 查询店铺名写入响应 - 前端 OverviewStatistics 类型增加 shopId - Page title 改为「店铺经营概览(店铺名)」格式
This commit is contained in:
+6
@@ -15,6 +15,12 @@ import java.util.List;
|
||||
@Schema(description = "单店铺概览统计VO")
|
||||
public class ShopOverviewStatisticsVO {
|
||||
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
@Schema(description = "店铺ID", example = "1")
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
|
||||
+6
@@ -147,6 +147,12 @@ public class ShopOverviewStatisticsServiceImpl implements ShopOverviewStatistics
|
||||
|
||||
// 构建返回对象
|
||||
ShopOverviewStatisticsVO overviewVO = new ShopOverviewStatisticsVO();
|
||||
overviewVO.setShopId(queryDTO.getShopId());
|
||||
// 获取店铺名称
|
||||
ShopPO shopEntity = shopService.getById(queryDTO.getShopId());
|
||||
if (shopEntity != null) {
|
||||
overviewVO.setShopName(shopEntity.getName());
|
||||
}
|
||||
|
||||
// 1. 计算店铺总销售额
|
||||
BigDecimal totalSalesAmount = orders.stream()
|
||||
|
||||
@@ -107,6 +107,8 @@ export namespace ShopVO {
|
||||
|
||||
/** 店铺概览统计信息 */
|
||||
export interface OverviewStatistics {
|
||||
/** 店铺ID */
|
||||
shopId?: number;
|
||||
/** 店铺名称 */
|
||||
shopName: string;
|
||||
/** 店铺总销售额 */
|
||||
|
||||
@@ -694,7 +694,7 @@ onActivated(async () => {
|
||||
|
||||
<template>
|
||||
<Page
|
||||
:title="overviewData?.shopName || '店铺经营概览'"
|
||||
:title="overviewData?.shopName ? `店铺经营概览(${overviewData.shopName})` : '店铺经营概览'"
|
||||
auto-content-height
|
||||
class="bg-[#f8fafc]"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user