details.vue
17.3 KB
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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
<template>
<div style="">
<div style="height:58px;line-height:58px;background-color: #fff;padding: 0 10px;">
<div style="color:#0006"> <span>会员管理</span> <span style="padding:0 5px;">></span> <span style="color:#000000e6">会员详情</span></div>
</div>
<div class="custom_info_page">
<TitleWithCircle title="客户信息" style="margin-bottom: 15px;"/>
<div class="custom_info">
<div class="info_item">
<img :src="userObj.headImage" alt>
</div>
<div class="info_item">
<ul>
<li v-for="(item, index) in infoList" :key="index">
<p>
<span>{{ item.name }} :</span>
<span>{{ item.value }}</span>
</p>
</li>
</ul>
</div>
</div>
<div class="custom_tag">
<TitleWithCircle title="客户标签" style="margin-bottom: 15px;"/>
<div class="Tag">
<p v-for="(item, index) in tagList" :key="index" style="margin-right:10px">{{item}}</p>
<p @click="addTag">贴标签</p>
</div>
</div>
<div class="custom_data">
<TitleWithCircle title="消费数据" style="margin-bottom: 15px;"/>
<div class="data_list">
<p>
<span>
下 单 数:
<font>{{ userObj.orders }}</font>
</span>
支付成功数:
<font>{{ userObj.pays }}</font>
</p>
<p>
<span>
售后次数:
<font>{{ userObj.afters }}</font>
</span>
售后单数:
<font>{{ userObj.afterOrders }}</font>
</p>
</div>
<div class="tab_list">
<p
v-for="(item, index) in tabList"
:key="index"
:class="[{ active: componentName === item.componentName }]"
@click="changeTab(item)"
>{{ item.tabName }}</p>
</div>
</div>
<div v-if="componentName === 'order'">
<el-form :inline="true" :model="userForm" class="demo-form-inline">
<el-form-item label="订单编号">
<el-input v-model="userForm.orderFormid" placeholder="请输入订单编号" />
</el-form-item>
<el-form-item>
<el-button style="background-color: #3F9B6A;color: #fff" @click="searchOrders">查询</el-button>
</el-form-item>
</el-form>
<el-table
:data="userObj.orderList"
:header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
>
<el-table-column prop="orderFormid" label="订单编号" />
<el-table-column prop="shopName" label="店铺名称" />
<el-table-column prop="products" label="商品数量">
<template slot-scope="scope">
<span>{{scope.row.products}}</span>
</template>
</el-table-column>
<el-table-column prop="price" label="订单金额(元)" />
<el-table-column label="状态">
<template slot-scope="scope">
<span v-if="scope.row.state === 1">待付款</span>
<span v-if="scope.row.state === 2">待发货</span>
<span v-if="scope.row.state === 3">待收货</span>
<span v-if="scope.row.state === 4">已完成</span>
<span v-if="scope.row.state === 5">已关闭</span>
</template>
</el-table-column>
</el-table>
</div>
<div v-if="componentName === 'comment'">
<el-table
:data="userObj.comments"
:header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
>
<el-table-column prop="shopName" label="店铺名称" />
<el-table-column prop="productName" label="商品名称" />
<el-table-column prop="comments" label="评论">
<template slot-scope="scope">
<div class="tableBtn greens" @click="seeComment(scope.row.commentId)">查看</div>
</template>
</el-table-column>
</el-table>
</div>
<div v-if="componentName === 'addressInfo'">
<el-table
:data="userObj.receives"
:header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
>
<el-table-column prop="receiveName" label="姓名" />
<el-table-column prop="receivePhone" label="电话" />
<el-table-column prop="receiveAdress" label="地址">
<template slot-scope="scope">
<span>{{scope.row.receiveAdress}}{{scope.row.address}}</span>
</template>
</el-table-column>
</el-table>
</div>
<!-- *************对话框开始************* -->
<!-- 打标签 -->
<el-dialog
title="选择标签"
:visible.sync="addFormDialog"
width="30%"
append-to-body
center
:close-on-click-modal="false"
>
<div>
<!-- 表单搜索 -->
<el-form :inline="true" :model="tipsForm" class="demo-form-inline">
<el-form-item label="标签名称">
<el-input v-model="tipsForm.labelName" placeholder="请输入标签名称" />
</el-form-item>
<el-form-item>
<el-button @click="searchTips" style="background-color: #3F9B6A;color: #fff">查询</el-button>
</el-form-item>
<el-form-item>
<div class="tableBtn greens" @click="runTips">管理标签</div>
</el-form-item>
</el-form>
<!-- 多选 -->
<el-checkbox-group v-model="checkList">
<el-checkbox
v-for="(item, index) in tipsList"
:key="index"
class="checkBoxStyle"
:label="item.buyerLabelId"
>{{ item.labelName }}</el-checkbox>
</el-checkbox-group>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="addFormDialog = false" class="buttonHover"
style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取 消</el-button>
<el-button style="background-color: #3F9B6A;color: #fff" @click="saveTips">确定</el-button>
</span>
</el-dialog>
<!-- 查看评论弹框 -->
<el-dialog
title="评论详情"
:visible.sync="comDialogVisible"
:close-on-click-modal="false"
:before-close="handleClose"
width="60%"
center
:append-to-body="true"
>
<div class="pinStyle">
<div class="comment">
<div class="com_left">评论:</div>
<div class="com_right">{{ commentDetails.comment }}</div>
</div>
<div v-if="commentDetails.images.length != 0" class="comment_imgList">
<div class="img_left">图片:</div>
<div class="imgList">
<el-image
v-for="(item,index) in commentDetails.images"
:key="index"
:src="item"
:preview-src-list="commentDetails.images"
/>
</div>
</div>
<!-- <div class="comment">
<div v-if="commentDetails.addComment !=''" class="com_left">追评:</div>
<div class="com_right">{{ commentDetails.addComment }}</div>
</div>
<div v-if="commentDetails.addImages.length != 0" class="comment_imgList">
<div class="img_left">图片</div>
<div class="imgList">
<el-image
v-for="(item,index) in commentDetails.addImages"
:key="index"
:src="item"
:preview-src-list="commentDetails.addImages"
/>
</div>
</div> -->
</div>
<span slot="footer" class="dialog-footer">
<el-button v-if="comState" @click="toShow" style="background-color: #3F9B6A;color: #fff">允许展示</el-button>
<el-button v-else @click="noneShow" class="buttonHover"
style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">隐藏</el-button>
<el-button class="buttonHover"
style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" @click="delCom">删除</el-button>
</span>
</el-dialog>
<div style="margin-top: 10px;">
<el-button class="buttonHover"
style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" @click="doCancel">取消</el-button>
<!-- <el-button style="background-color: #3F9B6A;color: #fff" @click="doSubmit">确认</el-button> -->
</div>
</div>
</div>
</template>
<script>
import { customerMageGetById, getLabels, customerSaveUserLabel } from '@/api/customerMage'
import { commentSysGetById, commentSysUpdate, commentSysDelete, commentAllow } from '@/api/comment'
import TitleWithCircle from '@/components/top/index';
export default {
components: {
TitleWithCircle
},
props: {
// 声明接收的数据
message: {
type: Object, // 指定数据的类型
required: true, // 指定该数据是必需的
default: {}// 指定默认值
}
},
data () {
return {
visible: false,
infoList: [
{ name: '用户昵称', value: '', fields: 'name' },
{ name: '手 机 号', value: '', fields: 'phone' },
{ name: '性 别', value: '', fields: 'sex' },
{ name: '注册时间', value: '', fields: 'createTime' },
{ name: '生 日', value: '', fields: 'birthday' }
],
tagList: [],
tabList: [
{ tabName: 'TA的订单', componentName: 'order' },
{ tabName: 'TA的评论', componentName: 'comment' },
{ tabName: 'TA的收货地址', componentName: 'addressInfo' }
],
componentName: 'order',
customData: {},
dialog: {},
user: '',
userObj: {},
addFormDialog: false,
tipsForm: {
labelName: ''
},
userForm: {
orderFormid: ''
},
checkList: [],
tipsList: [],
comDialogVisible: false,
commentDetails: { images: [], addImages: [] },
commentId: '',
comState: 1 // 是否隐藏 1-是 0-否
}
},
mounted () {
this.getUser(this.message)
},
methods: {
// 允许展示
async toShow () {
const res = await commentAllow({
commentId: this.commentId,
state: 1
})
if (res.code === '') {
this.$message.success('成功')
this.comDialogVisible = false
this.comState = 0
this.getUser(this.user)
}
},
// 隐藏
async noneShow () {
const res = await commentSysUpdate({
commentId: this.commentId,
state: 0
})
if (res.code === '') {
this.comState = 1
this.$message.success('隐藏成功')
this.comDialogVisible = false
this.getUser(this.user)
}
},
// 删除
async delCom () {
const res = await commentSysDelete({
commentId: this.commentId
})
if (res.code === '') {
this.$message.success('删除成功')
this.comDialogVisible = false
this.getUser(this.user)
}
},
// 评论详情
async seeComment (commentId) {
this.comDialogVisible = true
const res = await commentSysGetById({ commentId: commentId })
this.commentId = commentId
this.commentDetails = res.data
},
handleClose () {
this.comDialogVisible = false
},
closeModalDetail () {
this.comState = 1
this.componentName = 'order'
},
// 贴标签
addTag () {
this.addFormDialog = true
this.getSelect({ labelName: this.tipsForm.labelName })
},
// 查询订单
searchOrders () {
this.user.orderFormid = this.userForm.orderFormid
this.getUser(this.user)
},
// 查询标签
searchTips () {
console.log('查询标签',this.tipsForm)
this.getSelect({ labelName: this.tipsForm.labelName })
},
// 跳转标签页面
runTips () {
this.$router.push({
path: '/member/tips'
})
},
// 打标签
async saveTips (row) {
console.log(this.checkList)
const res = await customerSaveUserLabel({
buyerUserId: this.user.buyerUserId,
buyerLabelIds: this.checkList
})
if (res.code === '') {
this.$message({
message: '成功',
type: 'success'
})
this.checkList = []
this.addFormDialog = false
this.getUser(this.user)
}
},
changeTab (item) {
this.componentName = item.componentName
},
// 客户详情
async getUser (obj) {
this.user = obj
const res = await customerMageGetById({
buyerUserId: obj.buyerUserId,
orderFormid: obj.orderFormid
})
this.userObj = res.data
this.visible = true
this.tagList = this.userObj.labels
this.getInfoList(this.userObj)
},
// 获取客户信息
getInfoList (ob) {
this.infoList.map(item => {
item.value = ob[item.fields] || ''
if (item.fields === 'sex') {
item.value = item.value === '1' ? '男' : '女'
}
})
},
// 初始化查询所有标签
async getSelect (name) {
const res = await getLabels(name)
this.tipsList = res.data
},
doCancel () {
this.visible = false
this.$emit('childMessage', this.visible);
},
doSubmit () {
this.visible = false
this.$emit('reset')
},
}
}
</script>
<style lang='scss' scoped>
// 评论详情
.comment_manage_page {
padding: 20px;
}
.pinStyle {
.comment {
margin-bottom: 20px;
display: flex;
align-items: center;
.com_left {
font-size: 20px;
color: #333333;
margin-right: 20px;
}
.com_right {
font-size: 18px;
color: #333333;
}
}
.comment_imgList {
display: flex;
margin-bottom: 20px;
align-items: flex-start;
.img_left {
font-size: 20px;
color: #333333;
margin-right: 20px;
width: 60px;
}
.imgList {
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
.el-image {
width: 200px;
height: 134px;
border-radius: 4px;
margin-right: 20px;
margin-bottom: 20px;
}
}
}
// .line {
// width: 890px;
// height: 1px;
// background: #e0e5eb;
// margin: 0 auto;
// margin-bottom: 33px;
// }
// .addComment {
// font-size: 20px;
// color: #3F9B6A;
// margin-bottom: 20px;
// }
}
//
h2 {
font-size: 24px;
font-weight: 500;
position: relative;
&::before {
content: "";
height: 24px;
width: 4px;
background-color: #3F9B6A;
position: absolute;
left: -10px;
top: 2px;
display: block;
}
}
.custom_info_page {
padding: 20px 40px;
background-color: #fff;
min-height: 500px;
.custom_info {
margin-bottom: 30px;
display: flex;
align-items: center;
.info_item {
&:nth-child(1) {
height: 180px;
width: 100px;
img {
width: 100px;
height: 100px;
border-radius: 50px;
text-align: center;
margin-top: 40px;
}
}
&:nth-child(2) {
margin-left: 100px;
ul {
overflow: hidden;
list-style: none;
li {
float: left;
width: 50%;
p {
font-size: 16px;
color: #333;
line-height: 40px;
span:nth-child(2) {
color: #666;
}
}
}
}
}
}
}
.custom_tag {
margin-bottom: 30px;
.Tag{
padding-top: 20px ;
}
p {
display: inline-block;
background-color: #d8e1fc;
font-size: 16px;
color: #333;
text-align: center;
// margin-right: 20px;
border-radius: 4px;
padding: 8px 15px;
&:last-child {
background-color: #fff;
color: #3F9B6A;
&:hover {
cursor: pointer;
}
}
}
}
.custom_data {
.data_list {
padding: 20px 0 40px 0;
p {
font-size: 16px;
line-height: 40px;
font {
color: #666;
}
span {
display: inline-block;
width: 200px;
}
}
}
.tab_list {
overflow: hidden;
margin-bottom: 20px;
p {
float: left;
padding: 0 50px;
font-size: 16px;
border: 1px #e0e5eb solid;
box-sizing: border-box;
color: #999999;
height: 48px;
line-height: 48px;
&:nth-child(-n + 2) {
border-right: 0;
}
&:nth-child(1) {
border-radius: 4px 0 0 4px;
}
&:nth-child(3) {
border-radius: 0 4px 4px 0;
}
&:hover {
cursor: pointer;
}
}
.active {
background-color: #3F9B6A;
color: #fff;
border: 0;
}
}
}
}
.tableBtn {
display: inline-block;
margin-right: 10px;
}
.greens {
color: #3F9B6A ;
}
::v-deep .buttonHover:hover{
color:#3f9b6a !important;
border-color: #c5e1d2 !important;
background-color: #ecf5f0 !important;
outline: none;
}
</style>