b1d468f9
李宇
1
|
1
|
<template>
|
8db25941
李宇
2
|
2
3
4
5
6
|
<div>
<div style="display: flex;margin-bottom: 10px;">
<div v-for="item in typelist" style="width: 30%;margin-right: 3%;text-align: center;padding: 20px 0;border-radius: 3px;border: 2px solid #eee;">
<div style="font-size: 14px;color: #a8abb2;">{{item.type}}</div>
<div style="font-size: 22px;margin-top: 10px;color: rgb(63, 155, 106);">{{item.num}}</div>
|
b1d468f9
李宇
1
|
7
|
</div>
|
8db25941
李宇
2
|
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
</div>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="渠道领用" name="first">渠道领用</el-tab-pane>
<el-tab-pane label="用户领取" name="second">用户领取</el-tab-pane>
<el-tab-pane label="用户使用" name="third">用户使用</el-tab-pane>
<el-tab-pane label="商家补贴" name="fourth">商家补贴</el-tab-pane>
</el-tabs>
<!-- 搜索 -->
<div class="formSearch">
<!-- 搜索条件 -->
<el-form :inline="true" :model="query" class="demo-form-inline">
<el-form-item label="名称">
<el-input v-model="query.couponName" placeholder="请输入名称" />
</el-form-item>
</el-form>
<div>
<el-button style="background-color: #3F9B6A;color: #fff" @click="search">查询</el-button>
<el-button class="buttonHover"
style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" @click="clear">重置</el-button>
|
b1d468f9
李宇
1
|
27
|
</div>
|
8db25941
李宇
2
|
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
</div>
<!-- 表格 -->
<div class="tableBox">
<el-table
ref="multipleTable"
:data="tableData"
:header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#f5f8f9'}"
tooltip-effect="light"
>
<el-table-column label="编号" >
<template slot-scope="scope">{{ scope.row.id }}</template>
</el-table-column>
<el-table-column label="优惠券名称" >
<template slot-scope="scope">{{ scope.row.couponName }}</template>
</el-table-column>
<el-table-column label="类型">
<template slot-scope="scope">
<span v-if="scope.row.couponType == '1'">满减券</span>
<span v-else-if="scope.row.couponType == '2'">折扣券</span>
</template>
</el-table-column>
<el-table-column label="优惠内容">
<template slot-scope="scope">
<span v-if="scope.row.couponType == '1'">满{{ scope.row.maxDiscountAmount }}减{{ scope.row.discountContent }}</span>
<span v-else-if="scope.row.couponType == '2'">{{ scope.row.discountContent }}折 最高减{{ scope.row.maxDiscountAmount }}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right">
<template slot-scope="scope">
<div class="btnList">
<div class="tableBtn greens" @click="xq(scope.row)">查看详情</div>
<!-- <div class="tableBtn greens" @click="addcoupon(scope.row)">生成优惠券</div> -->
</div>
</template>
</el-table-column>
</el-table>
<div style="display: flex;justify-content: space-between;margin: 20px 0;">
<div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
<el-pagination
:current-page="query.pageNumber"
:page-sizes="[10, 20, 50, 100]"
:page-size="10"
background
small
layout="prev, pager, next"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange">
</el-pagination>
|
b1d468f9
李宇
1
|
77
78
|
</div>
</div>
|
8db25941
李宇
2
|
79
80
81
|
</div>
</template>
|
b1d468f9
李宇
1
|
82
|
|
8db25941
李宇
2
|
83
84
85
86
|
<script>
import { myCoupons}from '@/api/couponmanagement/couponlist.js'
import router from '@/router';
import coupon from './coupon.vue';
|
b1d468f9
李宇
1
|
87
|
|
8db25941
李宇
2
|
88
|
export default {
|
b1d468f9
李宇
1
|
89
|
|
8db25941
李宇
2
|
90
91
92
93
94
95
96
97
98
99
100
|
components:{
coupon
},
data () {
return {
activeName: 'second',
typelist:[
{
num:100,
type:'渠道领用',
color:'#ff5e5e'
|
b1d468f9
李宇
1
|
101
|
},
|
8db25941
李宇
2
|
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
{
num:100,
type:'用户领取',
color:'#ff883a'
},
{
num:100,
type:'用户使用',
color:'#ffc461'
},
{
num:100,
type:'商家补贴',
color:'#a467f0'
},
],
query: {
activityName: '', // 活动名称
// 活动状态 0-报名未开始 1-报名进行中 2-活动待开始 3-活动进行中 4-活动已结束
state: '',
pageNumber: 1,
pageSize: 10
},
total: 0,
tableData: [],
}
},
created () {
// this.getAll()
},
methods: {
int(e) {
this.fundPoolId = e
// this.clear()
},
handleClick(tab, event) {
console.log(tab, event);
},
xq(e) {
// 跳转路由
// router.push({
// path: '/other/coupon',
// query: {
// id: e.id
// }
// })
console.error(e.id)
// this.$emit('changecapitalpoolid',e.id)
},
async getAll () {
const res = await myCoupons(this.query)
console.error(res.data.content)
this.tableData = res.data.content
this.total = res.data.numberOfElements
|
b1d468f9
李宇
1
|
156
|
},
|
8db25941
李宇
2
|
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
|
handleSizeChange (val) {
this.query.pageSize = val
this.getAll()
},
handleCurrentChange (val) {
this.query.pageNumber = val
this.getAll()
},
search () {
this.total = 1
this.query.pageNumber = 1
this.getAll()
},
// 重置
clear () {
this.query = {
activityName: '',
state: '',
pageNumber: 1,
pageSize: 10
}
|
b1d468f9
李宇
1
|
178
179
|
this.getAll()
},
|
b1d468f9
李宇
1
|
180
|
|
b1d468f9
李宇
1
|
181
|
}
|
8db25941
李宇
2
|
182
183
|
}
</script>
|
b1d468f9
李宇
1
|
184
|
|
8db25941
李宇
2
|
185
186
187
188
189
190
191
192
193
194
|
<style scoped lang="scss">
::v-deep .el-form-item {
margin-bottom: 0;
}
::v-deep .el-tabs__content {
display: none;
}
::v-deep .el-tabs__item{
font-size: 16px;
font-family: "Alibaba PuHuiTi 2.0-55 Regular";
|
b1d468f9
李宇
1
|
195
|
}
|
8db25941
李宇
2
|
196
197
198
|
::v-deep .el-dialog__header{
border-bottom: 2px solid #eee;
background-color: #fff;
|
b1d468f9
李宇
1
|
199
|
}
|
8db25941
李宇
2
|
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
::v-deep .el-dialog__title {
color: #303133;
}
.footer{
font-size: 24px;
.btn_list {
display: flex;
flex-direction: row-reverse;
span {
padding: 0;
margin: 0;
width: 100px;
height:32px;
line-height:32px;
text-align: center;
display: inline-block;
font-size: 16px;
border-radius: 4px;
box-sizing: border-box;
&:hover {
cursor: pointer;
}
&:nth-child(1) {
background: rgba(255, 255, 255, 1);
order: 1px solid rgba(224, 229, 235, 1);
|
b1d468f9
李宇
1
|
225
|
|
8db25941
李宇
2
|
226
227
228
229
230
231
|
border: 1px solid rgba(224, 229, 235, 1);
}
&:nth-child(2) {
background: #3f9b6a;
color: #fff;
margin-right: 20px;
|
b1d468f9
李宇
1
|
232
233
234
|
}
}
}
|
8db25941
李宇
2
|
235
236
|
}
.couponPage{
|
b1d468f9
李宇
1
|
237
|
|
8db25941
李宇
2
|
238
239
240
|
padding: 0 20px 20px 20px;
min-height: calc(100vh - 50px - 20px);
background-color: #Fff;
|
b1d468f9
李宇
1
|
241
242
|
|
8db25941
李宇
2
|
243
244
245
246
|
.tableBox{
text-align: center;
.fenye{
// margin: 20px;
|
b1d468f9
李宇
1
|
247
248
|
}
}
|
8db25941
李宇
2
|
249
250
251
252
253
254
|
}
.couponDialogBox {
max-height: 600px;
overflow-y: auto;
}
.formSearch{
|
b1d468f9
李宇
1
|
255
|
|
8db25941
李宇
2
|
256
257
258
259
260
261
262
|
display: flex;
width: 100%;
font-size: 14px;
justify-content: space-between;
// padding-bottom: 10px;
align-items: center;
margin: 20px 0;
|
b1d468f9
李宇
1
|
263
|
|
8db25941
李宇
2
|
264
265
266
267
|
}
.tableBtn {
display: inline-block;
margin-right: 10px;
|
b1d468f9
李宇
1
|
268
|
}
|
b1d468f9
李宇
1
|
269
|
|
8db25941
李宇
2
|
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
|
.greens {
color: #3F9B6A;
}
::v-deep .buttonHover:hover{
color:#3f9b6a !important;
border-color: #c5e1d2 !important;
background-color: #ecf5f0 !important;
outline: none;
}
::v-deep .el-pagination__total {
position: absolute;
left: 10px;
}
::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active{
background-color:#3f9b6a;
}
</style>
|