Skip to content

Commit 16369c0

Browse files
YunaiVgitee-org
authored andcommitted
!197 同步商城实现
Merge pull request !197 from 芋道源码/dev
2 parents c3a8479 + 7bf3e41 commit 16369c0

File tree

29 files changed

+1326
-755
lines changed

29 files changed

+1326
-755
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import request from '@/config/axios'
2+
import { Sku, Spu } from '@/api/mall/product/spu'
3+
4+
export interface BargainActivityVO {
5+
id?: number
6+
name?: string
7+
startTime?: Date
8+
endTime?: Date
9+
status?: number
10+
spuId?: number
11+
userSize?: number // 达到该人数,才能砍到低价
12+
bargainCount?: number // 最大帮砍次数
13+
totalLimitCount?: number // 最大购买次数
14+
stock?: number // 活动总库存
15+
randomMinPrice?: number // 用户每次砍价的最小金额,单位:分
16+
randomMaxPrice?: number // 用户每次砍价的最大金额,单位:分
17+
successCount?: number // 砍价成功数量
18+
products?: BargainProductVO[]
19+
}
20+
21+
// 砍价活动所需属性
22+
export interface BargainProductVO {
23+
spuId: number
24+
skuId: number
25+
bargainFirstPrice: number // 砍价起始价格,单位分
26+
bargainPrice: number // 砍价底价
27+
stock: number // 活动库存
28+
}
29+
30+
// 扩展 Sku 配置
31+
export type SkuExtension = Sku & {
32+
productConfig: BargainProductVO
33+
}
34+
35+
export interface SpuExtension extends Spu {
36+
skus: SkuExtension[] // 重写类型
37+
}
38+
39+
// 查询砍价活动列表
40+
export const getBargainActivityPage = async (params: any) => {
41+
return await request.get({ url: '/promotion/bargain-activity/page', params })
42+
}
43+
44+
// 查询砍价活动详情
45+
export const getBargainActivity = async (id: number) => {
46+
return await request.get({ url: '/promotion/bargain-activity/get?id=' + id })
47+
}
48+
49+
// 新增砍价活动
50+
export const createBargainActivity = async (data: BargainActivityVO) => {
51+
return await request.post({ url: '/promotion/bargain-activity/create', data })
52+
}
53+
54+
// 修改砍价活动
55+
export const updateBargainActivity = async (data: BargainActivityVO) => {
56+
return await request.put({ url: '/promotion/bargain-activity/update', data })
57+
}
58+
59+
// 删除砍价活动
60+
export const deleteBargainActivity = async (id: number) => {
61+
return await request.delete({ url: '/promotion/bargain-activity/delete?id=' + id })
62+
}

src/api/mall/promotion/combination/combinationActivity.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export interface CombinationActivityVO {
1010
startTime?: Date
1111
endTime?: Date
1212
userSize?: number
13-
totalNum?: number
14-
successNum?: number
13+
totalCount?: number
14+
successCount?: number
1515
orderUserCount?: number
1616
virtualGroup?: number
1717
status?: number
@@ -23,7 +23,7 @@ export interface CombinationActivityVO {
2323
export interface CombinationProductVO {
2424
spuId: number
2525
skuId: number
26-
activePrice: number // 拼团价格
26+
combinationPrice: number // 拼团价格
2727
}
2828

2929
// 扩展 Sku 配置

src/api/mall/promotion/seckill/seckillConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const getSeckillConfig = async (id: number) => {
2020
}
2121

2222
// 获得所有开启状态的秒杀时段精简列表
23-
export const getListAllSimple = async () => {
23+
export const getSimpleSeckillConfigList = async () => {
2424
return await request.get({ url: '/promotion/seckill-config/list-all-simple' })
2525
}
2626

src/hooks/web/useCrudSchemas.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { TableColumn } from '@/types/table'
99
import { DescriptionsSchema } from '@/types/descriptions'
1010
import { ComponentOptions, ComponentProps } from '@/types/components'
1111
import { DictTag } from '@/components/DictTag'
12+
import { cloneDeep } from 'lodash-es'
1213

1314
export type CrudSchema = Omit<TableColumn, 'children'> & {
1415
isSearch?: boolean // 是否在查询显示
@@ -306,3 +307,12 @@ const filterOptions = (options: Recordable, labelField?: string) => {
306307
return v
307308
})
308309
}
310+
311+
// 将 tableColumns 指定 fields 放到最前面
312+
export const sortTableColumns = (tableColumns: TableColumn[], field: string) => {
313+
const fieldIndex = tableColumns.findIndex((item) => item.field === field)
314+
const fieldColumn = cloneDeep(tableColumns[fieldIndex])
315+
tableColumns.splice(fieldIndex, 1)
316+
// 添加到开头
317+
tableColumns.unshift(fieldColumn)
318+
}

src/views/bpm/group/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<el-form-item label="创建时间" prop="createTime">
3131
<el-date-picker
3232
v-model="queryParams.createTime"
33-
value-format="yyyy-MM-dd HH:mm:ss"
33+
value-format="YYYY-MM-DD HH:mm:ss"
3434
type="daterange"
3535
start-placeholder="开始日期"
3636
end-placeholder="结束日期"

src/views/infra/apiAccessLog/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<el-form-item label="请求时间" prop="beginTime">
4747
<el-date-picker
4848
v-model="queryParams.beginTime"
49-
value-format="yyyy-MM-dd HH:mm:ss"
49+
value-format="YYYY-MM-DD HH:mm:ss"
5050
type="daterange"
5151
start-placeholder="开始日期"
5252
end-placeholder="结束日期"

src/views/infra/apiErrorLog/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<el-form-item label="异常时间" prop="exceptionTime">
4747
<el-date-picker
4848
v-model="queryParams.exceptionTime"
49-
value-format="yyyy-MM-dd HH:mm:ss"
49+
value-format="YYYY-MM-DD HH:mm:ss"
5050
type="daterange"
5151
start-placeholder="开始日期"
5252
end-placeholder="结束日期"

src/views/infra/codegen/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
end-placeholder="结束日期"
3838
start-placeholder="开始日期"
3939
type="daterange"
40-
value-format="YYYY-MM-dd HH:mm:ss"
40+
value-format="YYYY-MM-DD HH:mm:ss"
4141
/>
4242
</el-form-item>
4343
<el-form-item>

0 commit comments

Comments
 (0)