|
@@ -0,0 +1,248 @@
|
|
1
|
+<template>
|
|
2
|
+ <div class="main-contain">
|
|
3
|
+ <div class="position">
|
|
4
|
+ <bread-crumb :crumbs="crumbs"></bread-crumb>
|
|
5
|
+ </div>
|
|
6
|
+ <div class="app-container" style="padding-top: 0; background-color: #f6f8f9;">
|
|
7
|
+ <div class="base-info">
|
|
8
|
+ <div class="poster-photo">
|
|
9
|
+ <img :src="poster_photo" />
|
|
10
|
+ </div>
|
|
11
|
+ <div class="title-panel">
|
|
12
|
+ <p class="title">
|
|
13
|
+ <router-link :to="activity_url">{{ title }}</router-link>
|
|
14
|
+ </p>
|
|
15
|
+ <p class="date">活动日期:{{ activity_time }}</p>
|
|
16
|
+ </div>
|
|
17
|
+ <div class="action-panel">
|
|
18
|
+ <el-button type="primary" v-if="show_share_btn" @click="$router.push({ path: '/activity/share', query: { id: activity_id } })">再次分享</el-button>
|
|
19
|
+ <el-button type="primary" v-if="show_publish_btn">发布</el-button>
|
|
20
|
+ </div>
|
|
21
|
+ </div>
|
|
22
|
+ <div class="times-statistics">
|
|
23
|
+ <el-row :gutter="20">
|
|
24
|
+ <el-col :span="12">
|
|
25
|
+ <div class="item">
|
|
26
|
+ <span class="count">{{ read_times }}</span>
|
|
27
|
+ <p class="desc">展示次数</p>
|
|
28
|
+ </div>
|
|
29
|
+ </el-col>
|
|
30
|
+ <el-col :span="12">
|
|
31
|
+ <div class="item">
|
|
32
|
+ <span class="count">{{ join_count }}</span>
|
|
33
|
+ <p class="desc">参与人数</p>
|
|
34
|
+ </div>
|
|
35
|
+ </el-col>
|
|
36
|
+ </el-row>
|
|
37
|
+ </div>
|
|
38
|
+ <div class="signup-header">
|
|
39
|
+ <div class="input">
|
|
40
|
+ <el-input v-model="signup_keyword" placeholder="搜索报名人" style="width: 330px;"></el-input>
|
|
41
|
+ <el-button type="primary" icon="el-icon-search" :loading="loading_search" @click="fetchSignupUsers">搜索</el-button>
|
|
42
|
+ </div>
|
|
43
|
+ <div class="all-btn">
|
|
44
|
+ <router-link to="/">
|
|
45
|
+ <el-button type="primary">查看全部</el-button>
|
|
46
|
+ </router-link>
|
|
47
|
+ </div>
|
|
48
|
+ </div>
|
|
49
|
+ <div class="signup-table-panel">
|
|
50
|
+ <el-table :data="signup_users" empty-text="暂无人报名">
|
|
51
|
+ <el-table-column label="报名号" align="center" prop="id"></el-table-column>
|
|
52
|
+ <el-table-column label="手机号" align="center" prop="mobile"></el-table-column>
|
|
53
|
+ <el-table-column label="客户姓名" align="center" prop="real_name"></el-table-column>
|
|
54
|
+ <el-table-column label="报名时间" align="center">
|
|
55
|
+ <template slot-scope="scope">
|
|
56
|
+ <span>{{ parseTime(scope.row.ctime, "{y}-{m}-{d} {h}:{i}") }}</span>
|
|
57
|
+ </template>
|
|
58
|
+ </el-table-column>
|
|
59
|
+ </el-table>
|
|
60
|
+ </div>
|
|
61
|
+ </div>
|
|
62
|
+ </div>
|
|
63
|
+</template>
|
|
64
|
+
|
|
65
|
+<script>
|
|
66
|
+import BreadCrumb from "@/scrm_pages/components/bread-crumb"
|
|
67
|
+import { fetchActivityDetailViewData, fetchActivitySignupUsers } from "@/api/activity/activity"
|
|
68
|
+import { parseTime } from "@/utils"
|
|
69
|
+
|
|
70
|
+export default {
|
|
71
|
+ name: "ActivityDetail",
|
|
72
|
+ components: {
|
|
73
|
+ BreadCrumb,
|
|
74
|
+ },
|
|
75
|
+ data() {
|
|
76
|
+ return {
|
|
77
|
+ crumbs: [
|
|
78
|
+ { path: false, name: "营销工具" },
|
|
79
|
+ { path: false, name: "活动详情" },
|
|
80
|
+ ],
|
|
81
|
+
|
|
82
|
+ activity_id: 0,
|
|
83
|
+ activity: null,
|
|
84
|
+
|
|
85
|
+ signup_keyword: "",
|
|
86
|
+ signup_users: [],
|
|
87
|
+
|
|
88
|
+ loading_search: false,
|
|
89
|
+ }
|
|
90
|
+ },
|
|
91
|
+ computed: {
|
|
92
|
+ title: function() {
|
|
93
|
+ return this.activity == null ? "" : this.activity.title
|
|
94
|
+ },
|
|
95
|
+ poster_photo: function() {
|
|
96
|
+ return this.activity == null ? "/" : this.activity.poster_photo
|
|
97
|
+ },
|
|
98
|
+ activity_url: function() {
|
|
99
|
+ if (this.activity != null) {
|
|
100
|
+ return "/activity/preview?id=" + this.activity_id
|
|
101
|
+ }
|
|
102
|
+ return ""
|
|
103
|
+ },
|
|
104
|
+ activity_time: function() {
|
|
105
|
+ return this.activity == null ? "" : parseTime(this.activity.start_time, "{y}-{m}-{d} {h}:{i}")
|
|
106
|
+ },
|
|
107
|
+ show_share_btn: function() {
|
|
108
|
+ return this.activity == null ? false : (this.activity.status == 1)
|
|
109
|
+ },
|
|
110
|
+ show_publish_btn: function() {
|
|
111
|
+ return this.activity == null ? false : (this.activity.status == 4)
|
|
112
|
+ },
|
|
113
|
+ read_times: function() {
|
|
114
|
+ return this.activity == null ? 0 : this.activity.read_num
|
|
115
|
+ },
|
|
116
|
+ join_count: function() {
|
|
117
|
+ return this.activity == null ? 0 : this.activity.join_num
|
|
118
|
+ }
|
|
119
|
+ },
|
|
120
|
+ mounted() {
|
|
121
|
+ this.activity_id = this.$route.query.id
|
|
122
|
+
|
|
123
|
+ fetchActivityDetailViewData(this.activity_id).then(rs => {
|
|
124
|
+ var resp = rs.data
|
|
125
|
+ if (resp.state == 1) {
|
|
126
|
+ this.activity = resp.data.activity
|
|
127
|
+ this.signup_users = resp.data.users
|
|
128
|
+ } else {
|
|
129
|
+ this.$message.error(resp.msg)
|
|
130
|
+ }
|
|
131
|
+
|
|
132
|
+ }).catch(err => {
|
|
133
|
+ this.$message.error(err)
|
|
134
|
+ })
|
|
135
|
+ },
|
|
136
|
+ methods: {
|
|
137
|
+ parseTime,
|
|
138
|
+ fetchSignupUsers: function() {
|
|
139
|
+ this.loading_search = true
|
|
140
|
+ fetchActivitySignupUsers(this.activity_id, this.signup_keyword, 1).then(rs => {
|
|
141
|
+ this.loading_search = false
|
|
142
|
+ var resp = rs.data
|
|
143
|
+ if (resp.state == 1) {
|
|
144
|
+ this.signup_users = resp.data.users
|
|
145
|
+ } else {
|
|
146
|
+ this.$message.error(resp.msg)
|
|
147
|
+ }
|
|
148
|
+ }).catch(err => {
|
|
149
|
+ this.loading_search = false
|
|
150
|
+ this.$message.error(err)
|
|
151
|
+ })
|
|
152
|
+ }
|
|
153
|
+ },
|
|
154
|
+}
|
|
155
|
+</script>
|
|
156
|
+
|
|
157
|
+<style lang="scss" scoped>
|
|
158
|
+.base-info {
|
|
159
|
+ padding: 20px 25px;
|
|
160
|
+ display: flex;
|
|
161
|
+ justify-content: flex-end;
|
|
162
|
+ flex-wrap: nowrap;
|
|
163
|
+ align-items: center;
|
|
164
|
+ background-color: white;
|
|
165
|
+ box-shadow: 0 0 1px #dee2e5;
|
|
166
|
+
|
|
167
|
+ .poster-photo {
|
|
168
|
+ width: 120px;
|
|
169
|
+ height: 96px;
|
|
170
|
+ display: flex;
|
|
171
|
+ justify-content: center;
|
|
172
|
+ margin-right: 22px;
|
|
173
|
+
|
|
174
|
+ img {
|
|
175
|
+ width: 100%;
|
|
176
|
+ height: auto;
|
|
177
|
+ border-radius: 4px;
|
|
178
|
+ object-fit: cover;
|
|
179
|
+ object-position: center;
|
|
180
|
+ }
|
|
181
|
+ }
|
|
182
|
+ .title-panel {
|
|
183
|
+ flex: 3;
|
|
184
|
+ padding-right: 20px;
|
|
185
|
+
|
|
186
|
+ .title {
|
|
187
|
+ font-size: 18px;
|
|
188
|
+ color: #485b6d;
|
|
189
|
+ font-weight: 700;
|
|
190
|
+ word-break: break-all;
|
|
191
|
+ overflow: hidden;
|
|
192
|
+ text-overflow: ellipsis;
|
|
193
|
+ display: -webkit-box;
|
|
194
|
+ -webkit-line-clamp: 2;
|
|
195
|
+ -webkit-box-orient: vertical;
|
|
196
|
+ height: 70px;
|
|
197
|
+ line-height: 34px;
|
|
198
|
+ }
|
|
199
|
+ .date {
|
|
200
|
+ color: #7b8a97;
|
|
201
|
+ line-height: 20px;
|
|
202
|
+ font-size: 14px;
|
|
203
|
+ }
|
|
204
|
+ }
|
|
205
|
+ .action-panel {
|
|
206
|
+ flex: 1;
|
|
207
|
+ text-align: right;
|
|
208
|
+ }
|
|
209
|
+}
|
|
210
|
+.times-statistics {
|
|
211
|
+ margin-top: 20px;
|
|
212
|
+
|
|
213
|
+ .item {
|
|
214
|
+ padding: 40px 0 30px 0;
|
|
215
|
+ box-shadow: 0 0 1px #dee2e5;
|
|
216
|
+ background-color: white;
|
|
217
|
+ text-align: center;
|
|
218
|
+
|
|
219
|
+ .count {
|
|
220
|
+ font-size: 36px;
|
|
221
|
+ color: #58a2ec;
|
|
222
|
+ }
|
|
223
|
+ .desc {
|
|
224
|
+ margin-top: 5px;
|
|
225
|
+ font-size: 14px;
|
|
226
|
+ color: #485b6d;
|
|
227
|
+ }
|
|
228
|
+ }
|
|
229
|
+}
|
|
230
|
+.signup-header {
|
|
231
|
+ margin-top: 20px;
|
|
232
|
+ display: flex;
|
|
233
|
+ justify-content: space-between;
|
|
234
|
+
|
|
235
|
+ .input {
|
|
236
|
+ width: 500px;
|
|
237
|
+ display: block;
|
|
238
|
+ }
|
|
239
|
+ .all-btn {
|
|
240
|
+ display: block;
|
|
241
|
+ }
|
|
242
|
+}
|
|
243
|
+.signup-table-panel {
|
|
244
|
+ margin-top: 10px;
|
|
245
|
+}
|
|
246
|
+</style>
|
|
247
|
+
|
|
248
|
+
|