Skip to content

Commit bb73a6e

Browse files
YunaiVgitee-org
authored andcommitted
!287 reward
Merge pull request !287 from Bluemark/dev
2 parents 826199d + 929fa9a commit bb73a6e

File tree

44 files changed

+3699
-369
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+3699
-369
lines changed

src/api/mall/product/spu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,5 @@ export const exportSpu = async (params) => {
104104

105105
// 获得商品 SPU 精简列表
106106
export const getSpuSimpleList = async () => {
107-
return request.get({ url: '/product/spu/get-simple-list' })
107+
return request.get({ url: '/product/spu/list-all-simple' })
108108
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import request from '@/config/axios'
2+
3+
export interface ArticleVO {
4+
id: number
5+
categoryId: number
6+
title: string
7+
author: string
8+
picUrl: string
9+
introduction: string
10+
browseCount: string
11+
sort: number
12+
status: number
13+
spuId: number
14+
recommendHot: boolean
15+
recommendBanner: boolean
16+
content: string
17+
}
18+
19+
// 查询文章管理列表
20+
export const getArticlePage = async (params) => {
21+
return await request.get({ url: `/promotion/article/page`, params })
22+
}
23+
24+
// 查询文章管理详情
25+
export const getArticle = async (id: number) => {
26+
return await request.get({ url: `/promotion/article/get?id=` + id })
27+
}
28+
29+
// 新增文章管理
30+
export const createArticle = async (data: ArticleVO) => {
31+
return await request.post({ url: `/promotion/article/create`, data })
32+
}
33+
34+
// 修改文章管理
35+
export const updateArticle = async (data: ArticleVO) => {
36+
return await request.put({ url: `/promotion/article/update`, data })
37+
}
38+
39+
// 删除文章管理
40+
export const deleteArticle = async (id: number) => {
41+
return await request.delete({ url: `/promotion/article/delete?id=` + id })
42+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import request from '@/config/axios'
2+
3+
export interface ArticleCategoryVO {
4+
id: number
5+
name: string
6+
picUrl: string
7+
status: number
8+
sort: number
9+
}
10+
11+
// 查询文章分类列表
12+
export const getArticleCategoryPage = async (params) => {
13+
return await request.get({ url: `/promotion/article-category/page`, params })
14+
}
15+
16+
// 查询文章分类精简信息列表
17+
export const getSimpleArticleCategoryList = async () => {
18+
return await request.get({ url: `/promotion/article-category/list-all-simple` })
19+
}
20+
21+
// 查询文章分类详情
22+
export const getArticleCategory = async (id: number) => {
23+
return await request.get({ url: `/promotion/article-category/get?id=` + id })
24+
}
25+
26+
// 新增文章分类
27+
export const createArticleCategory = async (data: ArticleCategoryVO) => {
28+
return await request.post({ url: `/promotion/article-category/create`, data })
29+
}
30+
31+
// 修改文章分类
32+
export const updateArticleCategory = async (data: ArticleCategoryVO) => {
33+
return await request.put({ url: `/promotion/article-category/update`, data })
34+
}
35+
36+
// 删除文章分类
37+
export const deleteArticleCategory = async (id: number) => {
38+
return await request.delete({ url: `/promotion/article-category/delete?id=` + id })
39+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import request from '@/config/axios'
2+
import { Sku, Spu } from '@/api/mall/product/spu'
3+
4+
export interface DiscountActivityVO {
5+
id?: number
6+
spuId?: number
7+
name?: string
8+
status?: number
9+
remark?: string
10+
startTime?: Date
11+
endTime?: Date
12+
products?: DiscountProductVO[]
13+
}
14+
// 限时折扣相关 属性
15+
export interface DiscountProductVO {
16+
spuId: number
17+
skuId: number
18+
discountType: number
19+
discountPercent: number
20+
discountPrice: number
21+
}
22+
23+
// 扩展 Sku 配置
24+
export type SkuExtension = Sku & {
25+
productConfig: DiscountProductVO
26+
}
27+
28+
export interface SpuExtension extends Spu {
29+
skus: SkuExtension[] // 重写类型
30+
}
31+
32+
// 查询限时折扣活动列表
33+
export const getDiscountActivityPage = async (params) => {
34+
return await request.get({ url: '/promotion/discount-activity/page', params })
35+
}
36+
37+
// 查询限时折扣活动详情
38+
export const getDiscountActivity = async (id: number) => {
39+
return await request.get({ url: '/promotion/discount-activity/get?id=' + id })
40+
}
41+
42+
// 新增限时折扣活动
43+
export const createDiscountActivity = async (data: DiscountActivityVO) => {
44+
return await request.post({ url: '/promotion/discount-activity/create', data })
45+
}
46+
47+
// 修改限时折扣活动
48+
export const updateDiscountActivity = async (data: DiscountActivityVO) => {
49+
return await request.put({ url: '/promotion/discount-activity/update', data })
50+
}
51+
52+
// 关闭限时折扣活动
53+
export const closeDiscountActivity = async (id: number) => {
54+
return await request.put({ url: '/promotion/discount-activity/close?id=' + id })
55+
}
56+
57+
// 删除限时折扣活动
58+
export const deleteDiscountActivity = async (id: number) => {
59+
return await request.delete({ url: '/promotion/discount-activity/delete?id=' + id })
60+
}

src/api/mall/statistics/common.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** 数据对照 Response VO */
2+
export interface DataComparisonRespVO<T> {
3+
value: T
4+
reference: T
5+
}

src/api/mall/statistics/member.ts

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import request from '@/config/axios'
22
import dayjs from 'dayjs'
3-
import { TradeStatisticsComparisonRespVO } from '@/api/mall/statistics/trade'
3+
import { DataComparisonRespVO } from '@/api/mall/statistics/common'
44
import { formatDate } from '@/utils/formatTime'
55

66
/** 会员分析 Request VO */
@@ -10,17 +10,17 @@ export interface MemberAnalyseReqVO {
1010

1111
/** 会员分析 Response VO */
1212
export interface MemberAnalyseRespVO {
13-
visitorCount: number
13+
visitUserCount: number
1414
orderUserCount: number
1515
payUserCount: number
1616
atv: number
17-
comparison: TradeStatisticsComparisonRespVO<MemberAnalyseComparisonRespVO>
17+
comparison: DataComparisonRespVO<MemberAnalyseComparisonRespVO>
1818
}
1919

2020
/** 会员分析对照数据 Response VO */
2121
export interface MemberAnalyseComparisonRespVO {
22-
userCount: number
23-
activeUserCount: number
22+
registerUserCount: number
23+
visitUserCount: number
2424
rechargeUserCount: number
2525
}
2626

@@ -29,8 +29,8 @@ export interface MemberAreaStatisticsRespVO {
2929
areaId: number
3030
areaName: string
3131
userCount: number
32-
orderCreateCount: number
33-
orderPayCount: number
32+
orderCreateUserCount: number
33+
orderPayUserCount: number
3434
orderPayPrice: number
3535
}
3636

@@ -54,6 +54,20 @@ export interface MemberTerminalStatisticsRespVO {
5454
userCount: number
5555
}
5656

57+
/** 会员数量统计 Response VO */
58+
export interface MemberCountRespVO {
59+
/** 用户访问量 */
60+
visitUserCount: string
61+
/** 注册用户数量 */
62+
registerUserCount: number
63+
}
64+
65+
/** 会员注册数量 Response VO */
66+
export interface MemberRegisterCountRespVO {
67+
date: string
68+
count: number
69+
}
70+
5771
// 查询会员统计
5872
export const getMemberSummary = () => {
5973
return request.get<MemberSummaryRespVO>({
@@ -72,20 +86,38 @@ export const getMemberAnalyse = (params: MemberAnalyseReqVO) => {
7286
// 按照省份,查询会员统计列表
7387
export const getMemberAreaStatisticsList = () => {
7488
return request.get<MemberAreaStatisticsRespVO[]>({
75-
url: '/statistics/member/get-area-statistics-list'
89+
url: '/statistics/member/area-statistics-list'
7690
})
7791
}
7892

7993
// 按照性别,查询会员统计列表
8094
export const getMemberSexStatisticsList = () => {
8195
return request.get<MemberSexStatisticsRespVO[]>({
82-
url: '/statistics/member/get-sex-statistics-list'
96+
url: '/statistics/member/sex-statistics-list'
8397
})
8498
}
8599

86100
// 按照终端,查询会员统计列表
87101
export const getMemberTerminalStatisticsList = () => {
88102
return request.get<MemberTerminalStatisticsRespVO[]>({
89-
url: '/statistics/member/get-terminal-statistics-list'
103+
url: '/statistics/member/terminal-statistics-list'
104+
})
105+
}
106+
107+
// 获得用户数量量对照
108+
export const getUserCountComparison = () => {
109+
return request.get<DataComparisonRespVO<MemberCountRespVO>>({
110+
url: '/statistics/member/user-count-comparison'
111+
})
112+
}
113+
114+
// 获得会员注册数量列表
115+
export const getMemberRegisterCountList = (
116+
beginTime: dayjs.ConfigType,
117+
endTime: dayjs.ConfigType
118+
) => {
119+
return request.get<MemberRegisterCountRespVO[]>({
120+
url: '/statistics/member/register-count-list',
121+
params: { times: [formatDate(beginTime), formatDate(endTime)] }
90122
})
91123
}

src/api/mall/statistics/pay.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import request from '@/config/axios'
2+
3+
/** 支付统计 */
4+
export interface PaySummaryRespVO {
5+
/** 充值金额,单位分 */
6+
rechargePrice: number
7+
}
8+
9+
/** 获取钱包充值金额 */
10+
export const getWalletRechargePrice = async () => {
11+
return await request.get<PaySummaryRespVO>({ url: `/statistics/pay/summary` })
12+
}

src/api/mall/statistics/trade.ts

Lines changed: 64 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import request from '@/config/axios'
22
import dayjs from 'dayjs'
33
import { formatDate } from '@/utils/formatTime'
4-
5-
/** 交易统计对照 Response VO */
6-
export interface TradeStatisticsComparisonRespVO<T> {
7-
value: T
8-
reference: T
9-
}
4+
import { DataComparisonRespVO } from '@/api/mall/statistics/common'
105

116
/** 交易统计 Response VO */
127
export interface TradeSummaryRespVO {
@@ -24,46 +19,100 @@ export interface TradeTrendReqVO {
2419
/** 交易状况统计 Response VO */
2520
export interface TradeTrendSummaryRespVO {
2621
time: string
27-
turnover: number
22+
turnoverPrice: number
2823
orderPayPrice: number
2924
rechargePrice: number
3025
expensePrice: number
31-
balancePrice: number
26+
walletPayPrice: number
3227
brokerageSettlementPrice: number
33-
orderRefundPrice: number
28+
afterSaleRefundPrice: number
29+
}
30+
31+
/** 交易订单数量 Response VO */
32+
export interface TradeOrderCountRespVO {
33+
/** 待发货 */
34+
undelivered?: number
35+
/** 待核销 */
36+
pickUp?: number
37+
/** 退款中 */
38+
afterSaleApply?: number
39+
/** 提现待审核 */
40+
auditingWithdraw?: number
41+
}
42+
43+
/** 交易订单统计 Response VO */
44+
export interface TradeOrderSummaryRespVO {
45+
/** 支付订单商品数 */
46+
orderPayCount?: number
47+
/** 总支付金额,单位:分 */
48+
orderPayPrice?: number
49+
}
50+
51+
/** 订单量趋势统计 Response VO */
52+
export interface TradeOrderTrendRespVO {
53+
/** 日期 */
54+
date: string
55+
/** 订单数量 */
56+
orderPayCount: number
57+
/** 订单支付金额 */
58+
orderPayPrice: number
3459
}
3560

3661
// 查询交易统计
3762
export const getTradeStatisticsSummary = () => {
38-
return request.get<TradeStatisticsComparisonRespVO<TradeSummaryRespVO>>({
63+
return request.get<DataComparisonRespVO<TradeSummaryRespVO>>({
3964
url: '/statistics/trade/summary'
4065
})
4166
}
4267

4368
// 获得交易状况统计
4469
export const getTradeTrendSummary = (params: TradeTrendReqVO) => {
45-
return request.get<TradeStatisticsComparisonRespVO<TradeTrendSummaryRespVO>>({
70+
return request.get<DataComparisonRespVO<TradeTrendSummaryRespVO>>({
4671
url: '/statistics/trade/trend/summary',
4772
params: formatDateParam(params)
4873
})
4974
}
5075

5176
// 获得交易状况明细
52-
export const getTradeTrendList = (params: TradeTrendReqVO) => {
77+
export const getTradeStatisticsList = (params: TradeTrendReqVO) => {
5378
return request.get<TradeTrendSummaryRespVO[]>({
54-
url: '/statistics/trade/trend/list',
79+
url: '/statistics/trade/list',
5580
params: formatDateParam(params)
5681
})
5782
}
5883

5984
// 导出交易状况明细
60-
export const exportTradeTrend = (params: TradeTrendReqVO) => {
85+
export const exportTradeStatisticsExcel = (params: TradeTrendReqVO) => {
6186
return request.download({
62-
url: '/statistics/trade/trend/export-excel',
87+
url: '/statistics/trade/export-excel',
6388
params: formatDateParam(params)
6489
})
6590
}
6691

92+
// 获得交易订单数量
93+
export const getOrderCount = async () => {
94+
return await request.get<TradeOrderCountRespVO>({ url: `/statistics/trade/order-count` })
95+
}
96+
97+
// 获得交易订单数量对照
98+
export const getOrderComparison = async () => {
99+
return await request.get<DataComparisonRespVO<TradeOrderSummaryRespVO>>({
100+
url: `/statistics/trade/order-comparison`
101+
})
102+
}
103+
104+
// 获得订单量趋势统计
105+
export const getOrderCountTrendComparison = (
106+
type: number,
107+
beginTime: dayjs.ConfigType,
108+
endTime: dayjs.ConfigType
109+
) => {
110+
return request.get<DataComparisonRespVO<TradeOrderTrendRespVO>[]>({
111+
url: '/statistics/trade/order-count-trend',
112+
params: { type, beginTime: formatDate(beginTime), endTime: formatDate(endTime) }
113+
})
114+
}
115+
67116
/** 时间参数需要格式化, 确保接口能识别 */
68117
const formatDateParam = (params: TradeTrendReqVO) => {
69118
return { times: [formatDate(params.times[0]), formatDate(params.times[1])] } as TradeTrendReqVO

0 commit comments

Comments
 (0)