Skip to content

Commit a7439ee

Browse files
author
puhui999
committed
完善 banner 管理
1 parent 6c6c2cb commit a7439ee

File tree

4 files changed

+30
-8
lines changed

4 files changed

+30
-8
lines changed

src/api/mall/market/banner/index.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,32 @@ export interface BannerVO {
66
picUrl: string
77
status: number
88
url: string
9+
position: number
910
sort: number
1011
memo: string
1112
}
1213

1314
// 查询Banner管理列表
1415
export const getBannerPage = async (params) => {
15-
return await request.get({ url: `/market/banner/page`, params })
16+
return await request.get({ url: `/promotion/banner/page`, params })
1617
}
1718

1819
// 查询Banner管理详情
1920
export const getBanner = async (id: number) => {
20-
return await request.get({ url: `/market/banner/get?id=` + id })
21+
return await request.get({ url: `/promotion/banner/get?id=` + id })
2122
}
2223

2324
// 新增Banner管理
2425
export const createBanner = async (data: BannerVO) => {
25-
return await request.post({ url: `/market/banner/create`, data })
26+
return await request.post({ url: `/promotion/banner/create`, data })
2627
}
2728

2829
// 修改Banner管理
2930
export const updateBanner = async (data: BannerVO) => {
30-
return await request.put({ url: `/market/banner/update`, data })
31+
return await request.put({ url: `/promotion/banner/update`, data })
3132
}
3233

3334
// 删除Banner管理
3435
export const deleteBanner = async (id: number) => {
35-
return await request.delete({ url: `/market/banner/delete?id=` + id })
36+
return await request.delete({ url: `/promotion/banner/delete?id=` + id })
3637
}

src/utils/dict.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ export enum DICT_TYPE {
184184
PROMOTION_CONDITION_TYPE = 'promotion_condition_type', // 营销的条件类型枚举
185185
PROMOTION_BARGAIN_RECORD_STATUS = 'promotion_bargain_record_status', // 砍价记录的状态
186186
PROMOTION_COMBINATION_RECORD_STATUS = 'promotion_combination_record_status', // 拼团记录的状态
187+
BANNER_POSITION = 'banner_position', // banner 定位
187188

188189
// ========== CRM - 客户管理模块 ==========
189190
CRM_RECEIVABLE_CHECK_STATUS = 'crm_receivable_check_status',

src/views/mall/promotion/banner/BannerForm.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@
4141
</el-radio-group>
4242
</el-form-item>
4343
</el-col>
44+
<el-col :span="24">
45+
<el-form-item label="定位" prop="position">
46+
<el-radio-group v-model="formData.position">
47+
<el-radio
48+
v-for="dict in getIntDictOptions(DICT_TYPE.BANNER_POSITION)"
49+
:key="dict.value"
50+
:label="dict.value"
51+
>
52+
{{ dict.label }}
53+
</el-radio>
54+
</el-radio-group>
55+
</el-form-item>
56+
</el-col>
4457
<el-col :span="24">
4558
<el-form-item label="描述" prop="memo">
4659
<el-input v-model="formData.memo" placeholder="请输入描述" type="textarea" />
@@ -70,6 +83,7 @@ const formData = ref({
7083
title: undefined,
7184
picUrl: undefined,
7285
status: 0,
86+
position: 1,
7387
url: undefined,
7488
sort: 0,
7589
memo: undefined
@@ -133,6 +147,7 @@ const resetForm = () => {
133147
title: undefined,
134148
picUrl: undefined,
135149
status: 0,
150+
position: 1,
136151
url: undefined,
137152
sort: 0,
138153
memo: undefined

src/views/mall/promotion/banner/index.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
重置
4949
</el-button>
5050
<el-button
51-
v-hasPermi="['market:banner:create']"
51+
v-hasPermi="['promotion:banner:create']"
5252
plain
5353
type="primary"
5454
@click="openForm('create')"
@@ -74,6 +74,11 @@
7474
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
7575
</template>
7676
</el-table-column>
77+
<el-table-column align="center" label="定位" prop="position">
78+
<template #default="scope">
79+
<dict-tag :type="DICT_TYPE.BANNER_POSITION" :value="scope.row.position" />
80+
</template>
81+
</el-table-column>
7782
<el-table-column align="center" label="跳转地址" prop="url" />
7883
<el-table-column
7984
:formatter="dateFormatter"
@@ -87,15 +92,15 @@
8792
<el-table-column align="center" label="操作">
8893
<template #default="scope">
8994
<el-button
90-
v-hasPermi="['market:banner:update']"
95+
v-hasPermi="['promotion:banner:update']"
9196
link
9297
type="primary"
9398
@click="openForm('update', scope.row.id)"
9499
>
95100
编辑
96101
</el-button>
97102
<el-button
98-
v-hasPermi="['market:banner:delete']"
103+
v-hasPermi="['promotion:banner:delete']"
99104
link
100105
type="danger"
101106
@click="handleDelete(scope.row.id)"

0 commit comments

Comments
 (0)