information.vue
3.77 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
<template>
<div
class="layout"
v-if="flag"
>
<div class="tips flex">请完善以下客户信息</div>
<template v-if="customerList.length > 0">
<scroll-view
class="content"
@ReachBottom="onReachBottom"
ref="scrollView"
>
<template v-for="(item, index) in customerList">
<div
:key="index"
class="item flex"
@click="openUserProfile(item)"
>
<div class="avatar">
<div class="sprite-icon icon-avatar">
<img
:src="item.avatar"
alt=""
v-if="item.avatar"
/>
<img
src="../../assets/images/user.png"
alt=""
v-else
/>
</div>
</div>
<div class="info">
<div class="phone flex name">{{ item.customerName }}</div>
<div
class="tags flex"
v-if="item.labels.length > 0"
>
<template v-for="(i, ind) in item.labels.slice(0, 3)">
<div
:key="ind"
class="tag text-center"
>{{ i.labelValue }}</div>
</template>
</div>
</div>
<div class="sprite-icon icon-arrow"></div>
</div>
</template>
</scroll-view>
</template>
<empty
v-else
description="暂无数据"
/>
</div>
</template>
<script type='text/ecmascript-6'>
import { groupCustomer, wxConfig } from '@/api'
export default {
name: '',
data() {
return {
customerList: [],
flag: false
}
},
created() {
this.init()
},
mounted() {
wxConfig.init(['openUserProfile']).then(() => {})
},
methods: {
onReachBottom() {
this.$refs.scrollView.loading = false
this.$refs.scrollView.finished = true
},
// 消息盒子-好友列表
init() {
this.showLoading()
let { taskId } = this.getQuery()
let search = {
taskId: taskId || 'a00052d7f63843a0b09f2d9ec8557c3b',
status: 0
}
groupCustomer.getCustomerList(search).then(res => {
this.hideLoading()
this.customerList = res || []
this.flag = true
})
},
//打开个人信息页
openUserProfile({ userid }) {
console.log(userid)
// this.$router.push({
// name: 'customer.detail',
// query: {
// id: userid
// }
// })
let seach = {
userid, //参与会话的企业成员列表,格式为userid1;userid2;...,用分号隔开。
type: 2
}
wxConfig.openUserProfile(seach).then(res => {
// console.log(res)
})
}
}
}
</script>
<style scoped lang='scss'>
@import '@/assets/css/customer.scss';
.layout {
.content {
height: calc(100vh - 40px);
.item {
min-height: 92px;
height: auto;
padding: 16px 16px 12px 16px;
box-sizing: border-box;
.name {
// width: 50px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.tags {
flex-wrap: wrap;
.tag {
padding: 0 12px;
height: 28px;
line-height: 28px;
background: rgba(57, 117, 198, 0.15);
border-radius: 14px;
margin: 0 4px 4px 0;
font-size: 14px;
font-weight: 400;
color: #3975c6;
width: 64px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
text-align: center;
&:last-child {
margin-right: 0;
}
}
}
}
}
}
</style>