follow.vue
4.97 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
<template>
<div class="follow-container" v-if="flag">
<div class="follow-statistics flex m-b-16">
<template v-for="(s, i) in statisticList">
<div class="follow-statistics-single" :key="i">
<div class="font-24 color-3 fw7 line-36">{{ s.value(solicitationFollowData) }}</div>
<div class="font-12 color-2f m-t-4">{{ s.text }}</div>
</div>
</template>
</div>
<tab-customer :list="['企微营销', '电话招揽']" @change="changeFollow" :index="follewIndex">
<scroll-view class="content" @ReachBottom="onReachBottom" ref="scrollView">
<template v-if="solicitationFollowData.weComMarketingList && solicitationFollowData.weComMarketingList.length > 0">
<div class="follow-content">
<div class="follow-content-item m-b-12" v-for="(item, index) in solicitationFollowData.weComMarketingList" :key="index">
<div class="follow-content-item-top">
<div class="font-16 color-3 fw5 text-hide">{{ item.groupName }}</div>
<div class="m-t-8 flex-between fw7">
<div class="font-24 line-36 color-3">
{{ item.groupWeComCustomerCount }}
<span class="font-12 color-2f m-l-8 fw4">个企微客户</span>
</div>
<div class="font-12 color-2f fw4">招揽月份:{{ item.solicitationMonth }}月</div>
</div>
</div>
<template v-if="follewIndex == 0">
<div class="flex">
<div class="color39 font-14 p52 nowrap" @click="goTo('solicit.marketing', item)">一键营销</div>
<div class="colord8">|</div>
<div class="color39 font-14 p52 nowrap" @click="goTo('solicit.statistic', item)">触达统计</div>
</div>
</template>
<template v-else>
<div class="follow-btn">
<div class="color39 font-14" @click="goTo('solicit.lookCustomer', item)">查看客户</div>
</div>
</template>
</div>
</div>
</template>
<template v-else>
<empty description="暂无数据" />
</template>
</scroll-view>
</tab-customer>
</div>
</template>
<script>
import { mapState, mapMutations, mapActions } from 'vuex'
import { solicitApi } from '@/api'
import { Toast } from 'vant'
import { Notify } from 'vant'
export default {
data() {
return {
flag: false,
solicitationFollowData: {
solicitationTotal: 20,
solicitationWeComCustomerCount: 30,
solicitationNotWeComCustomerCount: 20,
weComMarketingList: []
},
statisticList: []
}
},
computed: {
...mapState({
follewIndex: state => state.solicit.follewIndex,
activityId: state => state.solicit.activityId,
staffId: state => state.solicit.staffId
})
},
created() {
this.statisticList = this.$constants.STATICLIST
this.getFollowDataList()
this.solicitationFollow()
},
methods: {
...mapMutations({
SET_FOLLOW_INDEX: 'solicit/SET_FOLLOW_INDEX'
}),
...mapActions({
getFollowDataList: 'solicit/getFollowDataList'
}),
solicitationFollow() {
let params = {
activityId: this.activityId,
staffId: this.staffId
}
this.showLoading()
solicitApi.solicitationFollow(params).then(({ code, data, message }) => {
this.hideLoading()
if (code == '0') {
this.solicitationFollowData = data
} else {
Notify(message)
}
this.flag = true
})
},
goTo(name, item) {
let { groupId, groupName } = item
let query = { groupId }
if (name !== 'solicit.marketing') {
query.groupName = groupName
}
this.$router.push({
name,
query
})
},
changeFollow(index) {
this.SET_FOLLOW_INDEX({ follewIndex: index })
},
onReachBottom() {
this.$refs.scrollView.loading = false
this.$refs.scrollView.finished = true
}
}
}
</script>
<style lang="scss" scoped>
.follow-container {
.follow-statistics {
background: #fff;
height: 82px;
box-shadow: 0px 3px 10px 0px rgba(223, 228, 234, 0.81);
border-radius: 4px;
&-single {
padding: 12px 0;
width: 33.3%;
div {
text-align: center;
}
}
}
.content {
height: calc(100vh - 232px);
.follow-content {
padding: 16px 12px;
box-sizing: border-box;
&-item {
background: #f7f7f7;
border-radius: 8px;
height: 140px;
&-top {
padding: 16px 16px 0 16px;
border-bottom: 1px solid rgba(216, 216, 216, 0.3);
height: 96px;
box-sizing: border-box;
}
.follow-btn {
padding: 10px 52px;
box-sizing: border-box;
text-align: center;
}
}
}
}
.custom-image {
background: #fff;
height: 100%;
}
}
</style>