1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<template>
<div class="app-container">
<div class="filter-container">
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-edit"
@click="handleCreate">创建
</el-button>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="list"
border
fit
highlight-current-row
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column align="center" label="文案ID ">
<template slot-scope="scope">
<router-link :to="'/advertise/edit/'+scope.row.id" class="link-type">
<span>{{ scope.row.id }}</span>
</router-link>
</template>
</el-table-column>
<el-table-column align="center" label="文案内容">
<template slot-scope="scope">
<span>{{ scope.row.content }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="邀请人数要求">
<template slot-scope="scope">
<span>{{ scope.row.invitees_num }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="每次解锁数">
<template slot-scope="scope">
<span>{{ scope.row.unlocks_num }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="创建时间">
<template slot-scope="scope">
<span>{{ scope.row.create_time }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="更新时间">
<template slot-scope="scope">
<span>{{ scope.row.update_time }}</span>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { fetchList } from '@/api/advertise'
import waves from '@/directive/waves'
export default {
name: 'AdvertiseList',
components: { },
directives: { waves },
data() {
return {
list: null,
total: 0,
listLoading: true,
multipleSelection: [],
del_list: [],
listQuery: {
page: 0,
limit: 10
}
}
},
created() {
this.getList()
},
methods: {
getList() {
this.listLoading = true
fetchList(this.listQuery).then(response => {
console.log(response.data.data)
this.list = response.data.data.data
this.total = response.data.data.total
this.listLoading = false
})
},
handleCreate() {
this.$router.push('/advertise/create')
}
}
}
</script>
<style scoped>
.edit-input {
padding-right: 100px;
}
.cancel-btn {
position: absolute;
right: 15px;
top: 10px;
}
</style>