|
@@ -0,0 +1,245 @@
|
|
1
|
+<template>
|
|
2
|
+ <div class="main-contain">
|
|
3
|
+ <div class="position">
|
|
4
|
+ <bread-crumb :crumbs='crumbs'></bread-crumb>
|
|
5
|
+ <el-button style="float:right;" type="primary" size="small" icon="el-icon-circle-plus-outline">添加会员</el-button>
|
|
6
|
+ </div>
|
|
7
|
+ <div class="app-container">
|
|
8
|
+ <div style="margin-bottom: 10px">
|
|
9
|
+ <el-row :gutter="24">
|
|
10
|
+ <el-col :span="8">
|
|
11
|
+ <el-input style="width: 300px" v-model="listQuery.search" placeholder="请输入您需要搜索的内容"></el-input>
|
|
12
|
+ <el-button type="primary" icon="el-icon-search" @click="changeKey">搜索</el-button>
|
|
13
|
+ </el-col>
|
|
14
|
+ </el-row>
|
|
15
|
+ </div>
|
|
16
|
+ <div class="cell clearfix">
|
|
17
|
+ <label class="title"> <span class="name">创建时间</span>: </label>
|
|
18
|
+ <el-date-picker v-model="listQuery.start_time" prefix-icon="el-icon-date" @change="changeTime" :editable="false" style="width: 196px;" type="date" placeholder="选择日期时间"
|
|
19
|
+ align="right" format="yyyy-MM-dd" value-format="yyyy-MM-dd" ></el-date-picker>
|
|
20
|
+ <span class>-</span>
|
|
21
|
+ <el-date-picker v-model="listQuery.end_time" prefix-icon="el-icon-date" @change="changeTime" :editable="false" style="width: 196px;" type="date" placeholder="选择日期时间"
|
|
22
|
+ align="right" format="yyyy-MM-dd" value-format="yyyy-MM-dd" ></el-date-picker>
|
|
23
|
+ </div>
|
|
24
|
+ <div class="cell clearfix">
|
|
25
|
+ <label class="title"><span class="name">等级</span>:</label>
|
|
26
|
+ <div class="time">
|
|
27
|
+ <ul class="">
|
|
28
|
+ <li :class="0==levelType?'active':''" @click="selectLevel(0)">全部</li>
|
|
29
|
+ <li :class="item.id==levelType?'active':''" v-for="item in levelCards" :key="item.id" @click="selectLevel(item.id)">{{item.card_name}}</li>
|
|
30
|
+ </ul>
|
|
31
|
+ </div>
|
|
32
|
+ </div>
|
|
33
|
+ <div class="cell clearfix">
|
|
34
|
+ <label class="title"><span class="name">来源方式</span>:</label>
|
|
35
|
+ <div class="time">
|
|
36
|
+ <ul class="">
|
|
37
|
+ <li :class="0==sourceType?'active':''" @click="selectSource(0)">全部</li>
|
|
38
|
+ <li :class="item.id==sourceType?'active':''" v-for="item in sourceOptions" :key="item.id" @click="selectSource(item.id)">{{item.name}}</li>
|
|
39
|
+ </ul>
|
|
40
|
+ </div>
|
|
41
|
+ </div>
|
|
42
|
+ <div class="cell clearfix">
|
|
43
|
+ <label class="title"><span class="name">标签</span>:</label>
|
|
44
|
+ <div class="time">
|
|
45
|
+ <ul class="">
|
|
46
|
+ <li :class="0==tagType?'active':''" @click="selectTag(0)">全部</li>
|
|
47
|
+ <li :class="item.id==tagType?'active':''" v-for="item in tagOptions" :key="item.id" @click="selectTag(item.id)">{{item.tag_name}}</li>
|
|
48
|
+ </ul>
|
|
49
|
+ </div>
|
|
50
|
+ </div>
|
|
51
|
+ <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
|
|
52
|
+ <el-checkbox style="width: 30px" >全选</el-checkbox>
|
|
53
|
+ <el-button size="small" icon="el-icon-delete" >删除</el-button>
|
|
54
|
+ <el-button size="small" icon="el-icon-delete" >删除</el-button>
|
|
55
|
+ </div>
|
|
56
|
+ <el-table ref="multipleTable" :cell-class-name="cellStyleName" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :data="membersData" border fit highlight-current-row style="width: 100%;margin-top: 10px;">
|
|
57
|
+ <el-table-column
|
|
58
|
+ align="center"
|
|
59
|
+ type="selection"
|
|
60
|
+ width="55">
|
|
61
|
+ </el-table-column>
|
|
62
|
+ <el-table-column label="会员" align="center">
|
|
63
|
+ <template slot-scope="scope">
|
|
64
|
+ <img :src="memberAvatar(scope.row)" alt="" srcset="" style="width:50px;height:50px; border-radius:50%" >
|
|
65
|
+ <span>{{scope.row.name}}</span>
|
|
66
|
+ </template>
|
|
67
|
+ </el-table-column>
|
|
68
|
+ <el-table-column label="文章标题" align="center">
|
|
69
|
+ <template slot-scope="scope">
|
|
70
|
+
|
|
71
|
+ </template>
|
|
72
|
+ </el-table-column>
|
|
73
|
+ <el-table-column label="阅读量" align="center">
|
|
74
|
+ <template slot-scope="scope">
|
|
75
|
+
|
|
76
|
+ </template>
|
|
77
|
+ </el-table-column>
|
|
78
|
+ <el-table-column label="评论数" align="center">
|
|
79
|
+ <template slot-scope="scope">
|
|
80
|
+
|
|
81
|
+ </template>
|
|
82
|
+ </el-table-column>
|
|
83
|
+ <el-table-column label="点赞数" align="center">
|
|
84
|
+ <template slot-scope="scope">
|
|
85
|
+
|
|
86
|
+ </template>
|
|
87
|
+ </el-table-column>
|
|
88
|
+ <el-table-column label="操作" align="center">
|
|
89
|
+ <template slot-scope="scope">
|
|
90
|
+ <el-tooltip class="item" effect="dark" content="编辑" placement="top">
|
|
91
|
+ <el-button
|
|
92
|
+ size="mini"
|
|
93
|
+ type="primary"
|
|
94
|
+ icon="el-icon-edit-outline"
|
|
95
|
+ >
|
|
96
|
+ </el-button>
|
|
97
|
+ </el-tooltip>
|
|
98
|
+ </template>
|
|
99
|
+ </el-table-column>
|
|
100
|
+ </el-table>
|
|
101
|
+ <el-pagination
|
|
102
|
+ @size-change="handleSizeChange"
|
|
103
|
+ @current-change="handleCurrentChange"
|
|
104
|
+ :page-sizes="[10,20,50,100]"
|
|
105
|
+ :page-size="10"
|
|
106
|
+ background
|
|
107
|
+ style="margin-top:20px;float: right"
|
|
108
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
109
|
+ :total="total">
|
|
110
|
+ </el-pagination>
|
|
111
|
+ </div>
|
|
112
|
+ </div>
|
|
113
|
+</template>
|
|
114
|
+
|
|
115
|
+<script>
|
|
116
|
+ import {GetMembers} from "@/api/member/member";
|
|
117
|
+ import BreadCrumb from '../components/bread-crumb'
|
|
118
|
+ export default {
|
|
119
|
+ name: 'commentList',
|
|
120
|
+ components:{
|
|
121
|
+ BreadCrumb
|
|
122
|
+ },
|
|
123
|
+ data(){
|
|
124
|
+ return{
|
|
125
|
+ crumbs: [
|
|
126
|
+ { path: false, name: '会员管理' },
|
|
127
|
+ { path: false, name: '会员列表' }
|
|
128
|
+ ],
|
|
129
|
+ time: '',
|
|
130
|
+ active: true,
|
|
131
|
+ levelType: 0,
|
|
132
|
+ levelCards:[],
|
|
133
|
+ sourceType: 0,
|
|
134
|
+ sourceOptions:{},
|
|
135
|
+ tagType: 0,
|
|
136
|
+ tagOptions:[],
|
|
137
|
+ membersData:[],
|
|
138
|
+ total:0,
|
|
139
|
+ listQuery:{
|
|
140
|
+ page:1,
|
|
141
|
+ limit:10,
|
|
142
|
+ search:'',
|
|
143
|
+ start_time:'',
|
|
144
|
+ end_time:'',
|
|
145
|
+ source:0,
|
|
146
|
+ tag:0,
|
|
147
|
+ level:0,
|
|
148
|
+ init:1,
|
|
149
|
+ },
|
|
150
|
+ }
|
|
151
|
+ },
|
|
152
|
+ methods:{
|
|
153
|
+ GetMembers(){
|
|
154
|
+ GetMembers(this.listQuery).then(response=>{
|
|
155
|
+ var res = response.data;
|
|
156
|
+ if(res.state == 1) {
|
|
157
|
+ this.membersData = res.data.members;
|
|
158
|
+ this.total = res.data.total;
|
|
159
|
+ if(typeof(res.data.cards) != 'undefined') {
|
|
160
|
+ this.levelCards = res.data.cards;
|
|
161
|
+ }
|
|
162
|
+ if(typeof(res.data.tags) != 'undefined') {
|
|
163
|
+ this.tagOptions = res.data.tags;
|
|
164
|
+ }
|
|
165
|
+ this.listQuery.init = 0;
|
|
166
|
+ }else {
|
|
167
|
+ this.$message.error(res.msg);
|
|
168
|
+ }
|
|
169
|
+ }).catch(e=>{});
|
|
170
|
+ },
|
|
171
|
+ memberAvatar(row) {
|
|
172
|
+ if(typeof(row.avatar) == "undefined" || !row.avatar || row.avatar.length==0) {
|
|
173
|
+ if(row.gender == 2) {
|
|
174
|
+ return 'https://images.shengws.com/201809182128222.png';
|
|
175
|
+ }else {
|
|
176
|
+ return 'https://images.shengws.com/201809182128111.png';
|
|
177
|
+ }
|
|
178
|
+ }else {
|
|
179
|
+ return row.avatar
|
|
180
|
+ }
|
|
181
|
+ },
|
|
182
|
+ cellStyleName({row, column, rowIndex, columnIndex}){
|
|
183
|
+ if (columnIndex===1) {
|
|
184
|
+ return 'member-name-box';
|
|
185
|
+ }
|
|
186
|
+ return '';
|
|
187
|
+ },
|
|
188
|
+ selectSource(id) {
|
|
189
|
+ this.listQuery.source = id;
|
|
190
|
+ this.sourceType = id;
|
|
191
|
+ this.GetMembers();
|
|
192
|
+ },
|
|
193
|
+ selectLevel(id) {
|
|
194
|
+ this.listQuery.level = id;
|
|
195
|
+ this.levelType = id;
|
|
196
|
+ this.GetMembers();
|
|
197
|
+ },
|
|
198
|
+ selectTag(id) {
|
|
199
|
+ this.listQuery.tag = id;
|
|
200
|
+ this.tagType = id;
|
|
201
|
+ this.GetMembers();
|
|
202
|
+ },
|
|
203
|
+ changeKey(){
|
|
204
|
+ this.GetMembers();
|
|
205
|
+ },
|
|
206
|
+ changeTime(){
|
|
207
|
+ this.GetMembers();
|
|
208
|
+ },
|
|
209
|
+ handleSizeChange(limit) {
|
|
210
|
+ this.listQuery.limit = limit;
|
|
211
|
+ this.GetMembers();
|
|
212
|
+ },
|
|
213
|
+ handleCurrentChange(page) {
|
|
214
|
+ this.listQuery.page = page;
|
|
215
|
+ this.GetMembers();
|
|
216
|
+ }
|
|
217
|
+ },
|
|
218
|
+ created(){
|
|
219
|
+ this.sourceOptions = this.$store.getters.sources;
|
|
220
|
+ this.GetMembers();
|
|
221
|
+ }
|
|
222
|
+ }
|
|
223
|
+</script>
|
|
224
|
+
|
|
225
|
+<style scoped>
|
|
226
|
+ /*.app-container .cell.clearfix .time ul li {*/
|
|
227
|
+ /*float: left;*/
|
|
228
|
+ /*list-style: none;*/
|
|
229
|
+ /*cursor: pointer;*/
|
|
230
|
+ /*padding: 6px 20px;*/
|
|
231
|
+ /*color: #606266;*/
|
|
232
|
+ /*border-radius: 4px;*/
|
|
233
|
+ /*margin: 0 8px 0 0;*/
|
|
234
|
+ /*font-size: 14px;*/
|
|
235
|
+ /*text-align: center;*/
|
|
236
|
+ /*}*/
|
|
237
|
+</style>
|
|
238
|
+
|
|
239
|
+<style>
|
|
240
|
+
|
|
241
|
+.member-name-box .cell{
|
|
242
|
+ float: left;
|
|
243
|
+ text-align: left;
|
|
244
|
+};
|
|
245
|
+</style>
|