|
@@ -0,0 +1,284 @@
|
|
1
|
+<template>
|
|
2
|
+ <div v-loading="loading" class="playletManage-wrap">
|
|
3
|
+ <div class="screenBox flex">
|
|
4
|
+ <div class="flex">
|
|
5
|
+ <selfChannel title="平台" type="platform" labelWidth @channelDefine="onChangePlatform" />
|
|
6
|
+ <div class="flex" style="margin-left: 30px;">
|
|
7
|
+ <span style="font-size: 14px; color: #666; margin-right: 8px;">账号</span>
|
|
8
|
+ <el-select class="select-cls" v-model="filter.account_id" size="small" placeholder="平台账号" clearable filterable :style="{width: '210px'}" @change="onChangeAccountId">
|
|
9
|
+ <el-option v-for="item in accountOptions" :key="item.account_id" :label="item.account" :value="item.account_id" />
|
|
10
|
+ </el-select>
|
|
11
|
+ </div>
|
|
12
|
+ <selfInput label_name="搜索剧集" @inputChange="onInputKeyword" />
|
|
13
|
+ </div>
|
|
14
|
+ <div class="right">
|
|
15
|
+ <el-badge :value="9" :hidden="false">
|
|
16
|
+ <el-button type="primary" plain size="mini">创建组</el-button>
|
|
17
|
+ </el-badge>
|
|
18
|
+ </div>
|
|
19
|
+ </div>
|
|
20
|
+ <el-table ref="tableDom" :height="height" :data="playletList" tooltip-effect="dark" style="width: 100%;margin-top:10px">
|
|
21
|
+ <el-table-column label="剧名" prop="name" min-width="160" align="center" fixed="left" />
|
|
22
|
+ <el-table-column label="封面" min-width="160" align="center">
|
|
23
|
+ <template slot-scope="{ row }">
|
|
24
|
+ <el-image style="width: 40px; height: 60px;" :src="row.cover_url" :preview-src-list="[row.cover_url]" />
|
|
25
|
+ </template>
|
|
26
|
+ </el-table-column>
|
|
27
|
+ <el-table-column label="平台" prop="platform_name" min-width="160" align="center">
|
|
28
|
+ <template slot-scope="{ row }">
|
|
29
|
+ <span>{{ row.platform_name }}</span>
|
|
30
|
+ </template>
|
|
31
|
+ </el-table-column>
|
|
32
|
+ <el-table-column label="账号" prop="account" min-width="160" align="center" />
|
|
33
|
+ <el-table-column label="分类" prop="category" min-width="160" align="center">
|
|
34
|
+ <template slot-scope="{ row }">
|
|
35
|
+ <span>{{ row.category || '-' }}</span>
|
|
36
|
+ </template>
|
|
37
|
+ </el-table-column>
|
|
38
|
+ <el-table-column label="集数" prop="section_count" min-width="160" align="center" />
|
|
39
|
+ <el-table-column label="发布时间" prop="create_date" min-width="160" align="center" />
|
|
40
|
+ <el-table-column label="状态" min-width="160" align="center">
|
|
41
|
+ <template slot-scope="{ row }">
|
|
42
|
+ <span v-if="row.finish_state == 1" class="status">已完结</span>
|
|
43
|
+ <span v-else class="status">连载中</span>
|
|
44
|
+ </template>
|
|
45
|
+ </el-table-column>
|
|
46
|
+ <el-table-column label="操作" min-width="210" align="center" fixed="right">
|
|
47
|
+ <template slot-scope="{ row }">
|
|
48
|
+ <span class="btn" @click="onClickCreateGroupSend(row, { type: 'employee_bulk_messaging_log' })">创建群发</span>
|
|
49
|
+ <span class="btn" @click="onClickCreateGroupSend(row, { type: 'welcom_message_create' })">创建欢迎语</span>
|
|
50
|
+ <template>
|
|
51
|
+ <span v-if="true" class="btn">加入剧组</span>
|
|
52
|
+ <span v-else class="btn disabled">已加入</span>
|
|
53
|
+ </template>
|
|
54
|
+ </template>
|
|
55
|
+ </el-table-column>
|
|
56
|
+ </el-table>
|
|
57
|
+ <div class="pagination" v-show="pagination.total > 0">
|
|
58
|
+ <el-pagination background :current-page="pagination.page" @current-change="handleCurrentChange" layout="prev, pager, next" :page-count="Number(pagination.pages)">
|
|
59
|
+ </el-pagination>
|
|
60
|
+ </div>
|
|
61
|
+
|
|
62
|
+ <!-- S 创建群发 -->
|
|
63
|
+ <playletSendDialog
|
|
64
|
+ :dialogVisible="playletSendDialogVisible"
|
|
65
|
+ :playletInfo="currentPlayletInfo"
|
|
66
|
+ @confirm="handlePlayletSendConfirm"
|
|
67
|
+ @cancel="handlePlayletSendCancel"
|
|
68
|
+ />
|
|
69
|
+ <!-- E 创建群发 -->
|
|
70
|
+ </div>
|
|
71
|
+</template>
|
|
72
|
+<script>
|
|
73
|
+import selfChannel from '@/components/assembly/screen/channel.vue'
|
|
74
|
+import selfInput from '@/components/assembly/screen/input.vue'
|
|
75
|
+import playletSendDialog from './dialog/playletSendDialog.vue'
|
|
76
|
+import { pageFromType } from '@/assets/js/staticTypes'
|
|
77
|
+export default {
|
|
78
|
+ name: 'playletManage',
|
|
79
|
+ components: {
|
|
80
|
+ selfChannel,
|
|
81
|
+ selfInput,
|
|
82
|
+ playletSendDialog,
|
|
83
|
+ },
|
|
84
|
+ data () {
|
|
85
|
+ return {
|
|
86
|
+ height: '',
|
|
87
|
+ loading: false,
|
|
88
|
+ pagination: {
|
|
89
|
+ page: 1,
|
|
90
|
+ page_size: 20,
|
|
91
|
+ pages: 0,
|
|
92
|
+ total: 0,
|
|
93
|
+ },
|
|
94
|
+ filter: {
|
|
95
|
+ platform_id: '',
|
|
96
|
+ account_id: '',
|
|
97
|
+ keyword: '',
|
|
98
|
+ },
|
|
99
|
+ playletList: [],
|
|
100
|
+ accountOptions: [], // 账号选项
|
|
101
|
+
|
|
102
|
+ playletSendDialogVisible: false, // 控制"添加账号"弹框显示
|
|
103
|
+ currentPlayletInfo: {}, // 当前编辑的账号信息
|
|
104
|
+ currentCreateType: '', // 当前创建类型 创建群发 & 创建欢迎语
|
|
105
|
+ }
|
|
106
|
+ },
|
|
107
|
+ created () {
|
|
108
|
+ this.height = document.documentElement.clientHeight - 200 > 400 ? document.documentElement.clientHeight - 200 : 400
|
|
109
|
+ this.handleGetPlaylet()
|
|
110
|
+ },
|
|
111
|
+ methods: {
|
|
112
|
+ // 获取列表数据
|
|
113
|
+ async handleGetPlaylet() {
|
|
114
|
+ try {
|
|
115
|
+ this.loading = true
|
|
116
|
+ const url = `${this.URL.BASEURL}${this.URL.playletManage_playletList}`
|
|
117
|
+ const params = {
|
|
118
|
+ platform_id: this.filter.platform_id,
|
|
119
|
+ keyword: this.filter.keyword,
|
|
120
|
+ account_id: this.filter.account_id,
|
|
121
|
+ page: this.pagination.page,
|
|
122
|
+ page_size: this.pagination.page_size,
|
|
123
|
+ }
|
|
124
|
+ const { data: res = {} } = await this.$axios.get(url, { params })
|
|
125
|
+ if (res && res.errno == 0 && Array.isArray(res.rst.data)) {
|
|
126
|
+ this.playletList = res.rst.data;
|
|
127
|
+ this.pagination.total = res.rst.pageInfo.total;
|
|
128
|
+ this.pagination.pages = res.rst.pageInfo.pages;
|
|
129
|
+ this.$refs.tableDom.bodyWrapper.scrollTop = 0
|
|
130
|
+ } else if (res.errno != 4002) {
|
|
131
|
+ this.$message.warning(res.err)
|
|
132
|
+ this.playletList = [];
|
|
133
|
+ this.pagination.total = 0;
|
|
134
|
+ this.pagination.pages = 0;
|
|
135
|
+ }
|
|
136
|
+ } catch (error) {
|
|
137
|
+ console.log(error)
|
|
138
|
+ this.playletList = [];
|
|
139
|
+ this.pagination.total = 0;
|
|
140
|
+ this.pagination.pages = 0;
|
|
141
|
+ } finally {
|
|
142
|
+ this.loading = false
|
|
143
|
+ }
|
|
144
|
+ },
|
|
145
|
+ // 监听当前页数变化
|
|
146
|
+ handleCurrentChange(currentPage) {
|
|
147
|
+ this.pagination.page = currentPage
|
|
148
|
+ this.handleGetPlaylet()
|
|
149
|
+ },
|
|
150
|
+ // 监听"平台"筛选变化
|
|
151
|
+ async onChangePlatform(val) {
|
|
152
|
+ this.filter.platform_id = val || ''
|
|
153
|
+
|
|
154
|
+ // 清空“账号”筛选值 => 根据最新平台值 获取 账号选项
|
|
155
|
+ this.filter.account_id = ''
|
|
156
|
+ this.accountOptions = []
|
|
157
|
+ if (this.filter.platform_id) {
|
|
158
|
+ this.handleGetAccountOptions()
|
|
159
|
+ }
|
|
160
|
+
|
|
161
|
+ await this.$nextTick()
|
|
162
|
+ this.pagination.page = 1
|
|
163
|
+ this.handleGetPlaylet()
|
|
164
|
+ },
|
|
165
|
+ // 监听"账号"筛选变化
|
|
166
|
+ onChangeAccountId(val) {
|
|
167
|
+ this.filter.account_id = val || ''
|
|
168
|
+ this.pagination.page = 1
|
|
169
|
+ this.handleGetPlaylet()
|
|
170
|
+ },
|
|
171
|
+ // 监听"搜索剧集"变化
|
|
172
|
+ onInputKeyword(val) {
|
|
173
|
+ this.filter.keyword = val || ''
|
|
174
|
+ this.pagination.page = 1
|
|
175
|
+ this.handleGetPlaylet()
|
|
176
|
+ },
|
|
177
|
+ // 获取账号选项列表
|
|
178
|
+ async handleGetAccountOptions() {
|
|
179
|
+ const { data: res = {} } = await this.$axios.post(this.URL.BASEURL + this.URL.playletManage_accountList, {
|
|
180
|
+ platform_id: this.filter.platform_id
|
|
181
|
+ })
|
|
182
|
+ if (res && res.errno == 0) {
|
|
183
|
+ this.accountOptions = res.rst
|
|
184
|
+ } else if (res.errno != 4002) {
|
|
185
|
+ this.$message.warning(res.err)
|
|
186
|
+ }
|
|
187
|
+ },
|
|
188
|
+
|
|
189
|
+ // S 创建群发
|
|
190
|
+ // 监听点击"创建群发"
|
|
191
|
+ onClickCreateGroupSend(playletInfo, { type }) {
|
|
192
|
+ this.currentPlayletInfo = playletInfo
|
|
193
|
+ this.currentCreateType = type
|
|
194
|
+ this.playletSendDialogVisible = true
|
|
195
|
+ },
|
|
196
|
+ // 创建群发 => 确定
|
|
197
|
+ handlePlayletSendConfirm({ miniProPath, miniProAppId, miniProDesc, miniProCover, h5Path, h5Desc, h5Cover }) {
|
|
198
|
+ console.log('handlePlayletSendConfirm => ')
|
|
199
|
+ this.playletSendDialogVisible = false
|
|
200
|
+ this.handleGetPlaylet()
|
|
201
|
+ // 跳转"客户群发" && 新建群发
|
|
202
|
+ if (this.currentPlayletInfo.platform_id == 4) { // 嘉书(新)平台 H5推广链接
|
|
203
|
+ const path = this.$router.resolve({
|
|
204
|
+ path: '/employee_bulk_messaging_log',
|
|
205
|
+ query: {
|
|
206
|
+ from: pageFromType.PLAYLET_LINK_H5,
|
|
207
|
+ h5Path: encodeURIComponent(h5Path),
|
|
208
|
+ h5Desc: encodeURIComponent(h5Desc),
|
|
209
|
+ h5Cover: encodeURIComponent(h5Cover),
|
|
210
|
+ }
|
|
211
|
+ })
|
|
212
|
+ window.open(path.href, '_blank')
|
|
213
|
+ } else { // 其他平台 小程序链接
|
|
214
|
+ const path = this.$router.resolve({
|
|
215
|
+ path: '/employee_bulk_messaging_log',
|
|
216
|
+ query: {
|
|
217
|
+ from: pageFromType.PLAYLET_LINK_MINIAPP,
|
|
218
|
+ miniProPath: encodeURIComponent(miniProPath),
|
|
219
|
+ miniProAppId: encodeURIComponent(miniProAppId),
|
|
220
|
+ miniProDesc: encodeURIComponent(miniProDesc),
|
|
221
|
+ miniProCover: encodeURIComponent(miniProCover),
|
|
222
|
+ }
|
|
223
|
+ })
|
|
224
|
+ window.open(path.href, '_blank')
|
|
225
|
+ }
|
|
226
|
+ },
|
|
227
|
+ // 创建群发 => 取消
|
|
228
|
+ handlePlayletSendCancel() {
|
|
229
|
+ this.playletSendDialogVisible = false
|
|
230
|
+ },
|
|
231
|
+ // E 创建群发
|
|
232
|
+ }
|
|
233
|
+}
|
|
234
|
+</script>
|
|
235
|
+<style lang="scss" scoped>
|
|
236
|
+.screenBox {
|
|
237
|
+ background: #fff;
|
|
238
|
+ padding: 5px 20px;
|
|
239
|
+ .right {
|
|
240
|
+ padding-right: 14px;
|
|
241
|
+ }
|
|
242
|
+}
|
|
243
|
+/deep/ .el-select .el-input.is-focus .el-input__inner,
|
|
244
|
+/deep/ .el-select .el-input__inner:focus {
|
|
245
|
+ border-color: #DCDFE6;
|
|
246
|
+}
|
|
247
|
+.playletManage-wrap {
|
|
248
|
+ .select-cls {
|
|
249
|
+ /deep/ .el-input__suffix {
|
|
250
|
+ border-top-right-radius: 4px;
|
|
251
|
+ border-bottom-right-radius: 4px;
|
|
252
|
+ border: 1px solid #DCDFE6;
|
|
253
|
+ right: 0;
|
|
254
|
+ width: 30px;
|
|
255
|
+ background-color: #F1F1F1;
|
|
256
|
+ .el-input__icon {
|
|
257
|
+ color: #909399;
|
|
258
|
+ }
|
|
259
|
+ }
|
|
260
|
+ }
|
|
261
|
+ .playlet-name {
|
|
262
|
+ color: #32B38A;
|
|
263
|
+ // cursor: pointer;
|
|
264
|
+ }
|
|
265
|
+ .status {
|
|
266
|
+ margin: 2px auto;
|
|
267
|
+ padding: 0 6px;
|
|
268
|
+ color: #32B38A;
|
|
269
|
+ border: 1px solid #32B38A;
|
|
270
|
+ }
|
|
271
|
+ .btn {
|
|
272
|
+ color: #32B38A;
|
|
273
|
+ cursor: pointer;
|
|
274
|
+ margin-right: 4px;
|
|
275
|
+ &.disabled {
|
|
276
|
+ color: #999;
|
|
277
|
+ cursor: not-allowed;
|
|
278
|
+ }
|
|
279
|
+ &:last-child {
|
|
280
|
+ margin-right: 0;
|
|
281
|
+ }
|
|
282
|
+ }
|
|
283
|
+}
|
|
284
|
+</style>
|