From e1a72779d4f29455a83837495317e74ec9608a84 Mon Sep 17 00:00:00 2001 From: owen Date: Mon, 16 Oct 2023 13:00:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=EF=BC=9AReview=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/statistics/common.ts | 5 +++ src/api/mall/statistics/member.ts | 16 ++++----- src/api/mall/statistics/trade.ts | 27 ++++++-------- src/views/mall/home/index.vue | 10 +++--- .../member/components/MemberFunnelCard.vue | 14 ++++---- src/views/mall/statistics/member/index.vue | 4 +-- src/views/mall/statistics/trade/index.vue | 35 +++++++++---------- 7 files changed, 53 insertions(+), 58 deletions(-) create mode 100644 src/api/mall/statistics/common.ts diff --git a/src/api/mall/statistics/common.ts b/src/api/mall/statistics/common.ts new file mode 100644 index 00000000..3d964392 --- /dev/null +++ b/src/api/mall/statistics/common.ts @@ -0,0 +1,5 @@ +/** 数据对照 Response VO */ +export interface DataComparisonRespVO { + value: T + reference: T +} diff --git a/src/api/mall/statistics/member.ts b/src/api/mall/statistics/member.ts index e0d77e40..28d5a78c 100644 --- a/src/api/mall/statistics/member.ts +++ b/src/api/mall/statistics/member.ts @@ -1,6 +1,6 @@ import request from '@/config/axios' import dayjs from 'dayjs' -import { TradeStatisticsComparisonRespVO } from '@/api/mall/statistics/trade' +import { DataComparisonRespVO } from '@/api/mall/statistics/common' import { formatDate } from '@/utils/formatTime' /** 会员分析 Request VO */ @@ -10,17 +10,17 @@ export interface MemberAnalyseReqVO { /** 会员分析 Response VO */ export interface MemberAnalyseRespVO { - visitorCount: number + visitUserCount: number orderUserCount: number payUserCount: number atv: number - comparison: TradeStatisticsComparisonRespVO + comparison: DataComparisonRespVO } /** 会员分析对照数据 Response VO */ export interface MemberAnalyseComparisonRespVO { - userCount: number - activeUserCount: number + registerUserCount: number + visitUserCount: number rechargeUserCount: number } @@ -29,8 +29,8 @@ export interface MemberAreaStatisticsRespVO { areaId: number areaName: string userCount: number - orderCreateCount: number - orderPayCount: number + orderCreateUserCount: number + orderPayUserCount: number orderPayPrice: number } @@ -106,7 +106,7 @@ export const getMemberTerminalStatisticsList = () => { // 获得用户数量量对照 export const getUserCountComparison = () => { - return request.get>({ + return request.get>({ url: '/statistics/member/user-count-comparison' }) } diff --git a/src/api/mall/statistics/trade.ts b/src/api/mall/statistics/trade.ts index 76da08ca..ef2a2b2b 100644 --- a/src/api/mall/statistics/trade.ts +++ b/src/api/mall/statistics/trade.ts @@ -1,12 +1,7 @@ import request from '@/config/axios' import dayjs from 'dayjs' import { formatDate } from '@/utils/formatTime' - -/** 交易统计对照 Response VO */ -export interface TradeStatisticsComparisonRespVO { - value: T - reference: T -} +import { DataComparisonRespVO } from '@/api/mall/statistics/common' /** 交易统计 Response VO */ export interface TradeSummaryRespVO { @@ -24,11 +19,11 @@ export interface TradeTrendReqVO { /** 交易状况统计 Response VO */ export interface TradeTrendSummaryRespVO { time: string - turnover: number + turnoverPrice: number orderPayPrice: number rechargePrice: number expensePrice: number - balancePrice: number + orderWalletPayPrice: number brokerageSettlementPrice: number orderRefundPrice: number } @@ -65,31 +60,31 @@ export interface TradeOrderTrendRespVO { // 查询交易统计 export const getTradeStatisticsSummary = () => { - return request.get>({ + return request.get>({ url: '/statistics/trade/summary' }) } // 获得交易状况统计 export const getTradeTrendSummary = (params: TradeTrendReqVO) => { - return request.get>({ + return request.get>({ url: '/statistics/trade/trend/summary', params: formatDateParam(params) }) } // 获得交易状况明细 -export const getTradeTrendList = (params: TradeTrendReqVO) => { +export const getTradeStatisticsList = (params: TradeTrendReqVO) => { return request.get({ - url: '/statistics/trade/trend/list', + url: '/statistics/trade/list', params: formatDateParam(params) }) } // 导出交易状况明细 -export const exportTradeTrend = (params: TradeTrendReqVO) => { +export const exportTradeStatisticsExcel = (params: TradeTrendReqVO) => { return request.download({ - url: '/statistics/trade/trend/export-excel', + url: '/statistics/trade/export-excel', params: formatDateParam(params) }) } @@ -101,7 +96,7 @@ export const getOrderCount = async () => { // 获得交易订单数量对照 export const getOrderComparison = async () => { - return await request.get>({ + return await request.get>({ url: `/statistics/trade/order-comparison` }) } @@ -112,7 +107,7 @@ export const getOrderCountTrendComparison = ( beginTime: dayjs.ConfigType, endTime: dayjs.ConfigType ) => { - return request.get[]>({ + return request.get[]>({ url: '/statistics/trade/order-count-trend', params: { type, beginTime: formatDate(beginTime), endTime: formatDate(endTime) } }) diff --git a/src/views/mall/home/index.vue b/src/views/mall/home/index.vue index 95e2e1da..ede05bff 100644 --- a/src/views/mall/home/index.vue +++ b/src/views/mall/home/index.vue @@ -66,10 +66,8 @@