Skip to content

Commit 4870231

Browse files
committed
【代码优化】代码格式化
1 parent 40fe63a commit 4870231

File tree

7 files changed

+376
-345
lines changed

7 files changed

+376
-345
lines changed
Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,74 @@
11
import request from '@/config/axios'
2-
import {Sku, Spu} from '@/api/mall/product/spu'
2+
import { Sku, Spu } from '@/api/mall/product/spu'
33

44
export interface CombinationActivityVO {
5-
id?: number
6-
name?: string
7-
spuId?: number
8-
totalLimitCount?: number
9-
singleLimitCount?: number
10-
startTime?: Date
11-
endTime?: Date
12-
userSize?: number
13-
totalCount?: number
14-
successCount?: number
15-
orderUserCount?: number
16-
virtualGroup?: number
17-
status?: number
18-
limitDuration?: number
19-
products: CombinationProductVO[]
20-
spuName?: string
21-
picUrl?: string
22-
marketPrice?: number
5+
id?: number
6+
name?: string
7+
spuId?: number
8+
totalLimitCount?: number
9+
singleLimitCount?: number
10+
startTime?: Date
11+
endTime?: Date
12+
userSize?: number
13+
totalCount?: number
14+
successCount?: number
15+
orderUserCount?: number
16+
virtualGroup?: number
17+
status?: number
18+
limitDuration?: number
19+
products: CombinationProductVO[]
20+
spuName?: string
21+
picUrl?: string
22+
marketPrice?: number
2323
}
2424

2525
// 拼团活动所需属性
2626
export interface CombinationProductVO {
27-
spuId: number
28-
skuId: number
29-
combinationPrice: number // 拼团价格
27+
spuId: number
28+
skuId: number
29+
combinationPrice: number // 拼团价格
3030
}
3131

3232
// 扩展 Sku 配置
3333
export type SkuExtension = Sku & {
34-
productConfig: CombinationProductVO
34+
productConfig: CombinationProductVO
3535
}
3636

3737
export interface SpuExtension extends Spu {
38-
skus: SkuExtension[] // 重写类型
38+
skus: SkuExtension[] // 重写类型
3939
}
4040

4141
// 查询拼团活动列表
4242
export const getCombinationActivityPage = async (params) => {
43-
return await request.get({url: '/promotion/combination-activity/page', params})
43+
return await request.get({ url: '/promotion/combination-activity/page', params })
4444
}
4545

4646
// 查询拼团活动详情
4747
export const getCombinationActivity = async (id: number) => {
48-
return await request.get({url: '/promotion/combination-activity/get?id=' + id})
48+
return await request.get({ url: '/promotion/combination-activity/get?id=' + id })
4949
}
5050

5151
// 查询拼团活动详情列表
5252
export const getCombinationActivityDetailList = (ids: number[]) => {
53-
return request.get({url: `/promotion/combination-activity/detail-list?ids=${ids}`})
53+
return request.get({ url: `/promotion/combination-activity/detail-list?ids=${ids}` })
5454
}
5555

5656
// 新增拼团活动
5757
export const createCombinationActivity = async (data: CombinationActivityVO) => {
58-
return await request.post({url: '/promotion/combination-activity/create', data})
58+
return await request.post({ url: '/promotion/combination-activity/create', data })
5959
}
6060

6161
// 修改拼团活动
6262
export const updateCombinationActivity = async (data: CombinationActivityVO) => {
63-
return await request.put({url: '/promotion/combination-activity/update', data})
63+
return await request.put({ url: '/promotion/combination-activity/update', data })
6464
}
6565

6666
// 关闭拼团活动
6767
export const closeCombinationActivity = async (id: number) => {
68-
return await request.put({url: '/promotion/combination-activity/close?id=' + id})
68+
return await request.put({ url: '/promotion/combination-activity/close?id=' + id })
6969
}
7070

7171
// 删除拼团活动
7272
export const deleteCombinationActivity = async (id: number) => {
73-
return await request.delete({url: '/promotion/combination-activity/delete?id=' + id})
73+
return await request.delete({ url: '/promotion/combination-activity/delete?id=' + id })
7474
}
Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,96 @@
1-
import {ComponentStyle, DiyComponent} from '@/components/DiyEditor/util'
1+
import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util'
22

33
/** 拼团属性 */
44
export interface PromotionCombinationProperty {
5-
// 布局类型:单列 | 三列
6-
layoutType: 'oneColBigImg' | 'oneColSmallImg' | 'twoCol';
7-
// 商品字段
8-
fields: {
9-
// 商品名称
10-
name: PromotionCombinationFieldProperty
11-
// 商品简介
12-
introduction: PromotionCombinationFieldProperty
13-
// 商品价格
14-
price: PromotionCombinationFieldProperty
15-
// 市场价
16-
marketPrice: PromotionCombinationFieldProperty
17-
// 商品销量
18-
salesCount: PromotionCombinationFieldProperty
19-
// 商品库存
20-
stock: PromotionCombinationFieldProperty
21-
}
22-
// 角标
23-
badge: {
24-
// 是否显示
25-
show: boolean
26-
// 角标图片
27-
imgUrl: string
28-
}
29-
// 按钮
30-
btnBuy: {
31-
// 类型:文字 | 图片
32-
type: 'text' | 'img'
33-
// 文字
34-
text: string
35-
// 文字按钮:背景渐变起始颜色
36-
bgBeginColor: string
37-
// 文字按钮:背景渐变结束颜色
38-
bgEndColor: string
39-
// 图片按钮:图片地址
40-
imgUrl: string
41-
}
42-
// 上圆角
43-
borderRadiusTop: number
44-
// 下圆角
45-
borderRadiusBottom: number
46-
// 间距
47-
space: number
48-
// 拼团活动编号
49-
activityIds: number[]
50-
// 组件样式
51-
style: ComponentStyle
5+
// 布局类型:单列 | 三列
6+
layoutType: 'oneColBigImg' | 'oneColSmallImg' | 'twoCol'
7+
// 商品字段
8+
fields: {
9+
// 商品名称
10+
name: PromotionCombinationFieldProperty
11+
// 商品简介
12+
introduction: PromotionCombinationFieldProperty
13+
// 商品价格
14+
price: PromotionCombinationFieldProperty
15+
// 市场价
16+
marketPrice: PromotionCombinationFieldProperty
17+
// 商品销量
18+
salesCount: PromotionCombinationFieldProperty
19+
// 商品库存
20+
stock: PromotionCombinationFieldProperty
21+
}
22+
// 角标
23+
badge: {
24+
// 是否显示
25+
show: boolean
26+
// 角标图片
27+
imgUrl: string
28+
}
29+
// 按钮
30+
btnBuy: {
31+
// 类型:文字 | 图片
32+
type: 'text' | 'img'
33+
// 文字
34+
text: string
35+
// 文字按钮:背景渐变起始颜色
36+
bgBeginColor: string
37+
// 文字按钮:背景渐变结束颜色
38+
bgEndColor: string
39+
// 图片按钮:图片地址
40+
imgUrl: string
41+
}
42+
// 上圆角
43+
borderRadiusTop: number
44+
// 下圆角
45+
borderRadiusBottom: number
46+
// 间距
47+
space: number
48+
// 拼团活动编号
49+
activityIds: number[]
50+
// 组件样式
51+
style: ComponentStyle
5252
}
5353

5454
// 商品字段
5555
export interface PromotionCombinationFieldProperty {
56-
// 是否显示
57-
show: boolean
58-
// 颜色
59-
color: string
56+
// 是否显示
57+
show: boolean
58+
// 颜色
59+
color: string
6060
}
6161

6262
// 定义组件
6363
export const component = {
64-
id: 'PromotionCombination',
65-
name: '拼团',
66-
icon: 'mdi:account-group',
67-
property: {
68-
layoutType: 'oneColBigImg',
69-
fields: {
70-
name: {show: true, color: '#000'},
71-
introduction: {show: true, color: '#999'},
72-
price: {show: true, color: '#ff3000'},
73-
marketPrice: {show: true, color: '#c4c4c4'},
74-
salesCount: {show: true, color: '#c4c4c4'},
75-
stock: {show: false, color: '#c4c4c4'}
76-
},
77-
badge: {show: false, imgUrl: ''},
78-
btnBuy: {
79-
type: 'text',
80-
text: '去拼团',
81-
bgBeginColor: '#FF6000',
82-
bgEndColor: '#FE832A',
83-
imgUrl: ''
84-
},
85-
borderRadiusTop: 8,
86-
borderRadiusBottom: 8,
87-
space: 8,
88-
style: {
89-
bgType: 'color',
90-
bgColor: '',
91-
marginLeft: 8,
92-
marginRight: 8,
93-
marginBottom: 8
94-
} as ComponentStyle
95-
}
64+
id: 'PromotionCombination',
65+
name: '拼团',
66+
icon: 'mdi:account-group',
67+
property: {
68+
layoutType: 'oneColBigImg',
69+
fields: {
70+
name: { show: true, color: '#000' },
71+
introduction: { show: true, color: '#999' },
72+
price: { show: true, color: '#ff3000' },
73+
marketPrice: { show: true, color: '#c4c4c4' },
74+
salesCount: { show: true, color: '#c4c4c4' },
75+
stock: { show: false, color: '#c4c4c4' }
76+
},
77+
badge: { show: false, imgUrl: '' },
78+
btnBuy: {
79+
type: 'text',
80+
text: '去拼团',
81+
bgBeginColor: '#FF6000',
82+
bgEndColor: '#FE832A',
83+
imgUrl: ''
84+
},
85+
borderRadiusTop: 8,
86+
borderRadiusBottom: 8,
87+
space: 8,
88+
style: {
89+
bgType: 'color',
90+
bgColor: '',
91+
marginLeft: 8,
92+
marginRight: 8,
93+
marginBottom: 8
94+
} as ComponentStyle
95+
}
9696
} as DiyComponent<PromotionCombinationProperty>

0 commit comments

Comments
 (0)