feat: 更新日期格式化方法,新增多个统计卡片组件
- 将日期格式化方法从 formatDate 更新为 formatDate2,提升日期处理的灵活性 - 新增会员概览、用户统计、会员终端和交易量趋势等统计卡片组件 - 在商城首页引入新组件以展示关键会员和交易数据 - 优化数据获取逻辑,提升用户体验
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { MallDataComparisonResp } from './common';
|
||||
|
||||
import { formatDate } from '@vben/utils';
|
||||
import { formatDate2 } from '@vben/utils';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
@@ -84,7 +84,10 @@ export function getMemberAnalyse(params: MallMemberStatisticsApi.AnalyseReq) {
|
||||
'/statistics/member/analyse',
|
||||
{
|
||||
params: {
|
||||
times: [formatDate(params.times[0]), formatDate(params.times[1])],
|
||||
times: [
|
||||
formatDate2(params.times[0] || new Date()),
|
||||
formatDate2(params.times[1] || new Date()),
|
||||
],
|
||||
},
|
||||
},
|
||||
);
|
||||
@@ -124,7 +127,7 @@ export function getMemberRegisterCountList(beginTime: Date, endTime: Date) {
|
||||
'/statistics/member/register-count-list',
|
||||
{
|
||||
params: {
|
||||
times: [formatDate(beginTime), formatDate(endTime)],
|
||||
times: [formatDate2(beginTime), formatDate2(endTime)],
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { MallDataComparisonResp } from './common';
|
||||
|
||||
import { formatDate } from '@vben/utils';
|
||||
import { formatDate, formatDate2 } from '@vben/utils';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
@@ -128,8 +128,8 @@ export function getOrderCountTrendComparison(
|
||||
>('/statistics/trade/order-count-trend', {
|
||||
params: {
|
||||
type,
|
||||
beginTime: formatDate(beginTime),
|
||||
endTime: formatDate(endTime),
|
||||
beginTime: formatDate2(beginTime),
|
||||
endTime: formatDate2(endTime),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user