|
@@ -0,0 +1,182 @@
|
|
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
|
+ <selfInput label_name="搜索剧集" @inputChange="onInputKeyword" />
|
|
7
|
+ </div>
|
|
8
|
+ <div class="right">
|
|
9
|
+ <!-- 占位 -->
|
|
10
|
+ </div>
|
|
11
|
+ </div>
|
|
12
|
+ <el-table :height="height" :data="playletList" tooltip-effect="dark" style="width: 100%;margin-top:10px">
|
|
13
|
+ <el-table-column label="剧名" prop="name" min-width="160" align="center" fixed="left">
|
|
14
|
+ <template slot-scope="{ row }">
|
|
15
|
+ <span class="playlet-name">{{ row.name }}</span>
|
|
16
|
+ </template>
|
|
17
|
+ </el-table-column>
|
|
18
|
+ <el-table-column label="封面" prop="name" min-width="160" align="center">
|
|
19
|
+ <template slot-scope="{ row }">
|
|
20
|
+ <el-image style="width: 60px;" src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" :preview-src-list="['https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg']" />
|
|
21
|
+ </template>
|
|
22
|
+ </el-table-column>
|
|
23
|
+ <el-table-column label="平台" prop="name" min-width="160" align="center" />
|
|
24
|
+ <el-table-column label="账号" prop="name" min-width="160" align="center" />
|
|
25
|
+ <el-table-column label="分类" prop="name" min-width="160" align="center" />
|
|
26
|
+ <el-table-column label="集数" prop="name" min-width="160" align="center" />
|
|
27
|
+ <el-table-column label="发布时间" prop="created_at" min-width="160" align="center" />
|
|
28
|
+ <el-table-column label="状态" min-width="160" align="center">
|
|
29
|
+ <template slot-scope="{ row }">
|
|
30
|
+ <span v-if="row.enable == 1" class="status">已完结</span>
|
|
31
|
+ <span v-else class="status">连载中</span>
|
|
32
|
+ </template>
|
|
33
|
+ </el-table-column>
|
|
34
|
+ <el-table-column label="操作" min-width="100" align="center" fixed="right">
|
|
35
|
+ <template slot-scope="{ row }">
|
|
36
|
+ <span class="btn" @click="onClickCreateGroupSend(row)">创建群发</span>
|
|
37
|
+ </template>
|
|
38
|
+ </el-table-column>
|
|
39
|
+ </el-table>
|
|
40
|
+ <div class="pagination" v-show="pagination.total > 0">
|
|
41
|
+ <el-pagination background :current-page="pagination.page" @current-change="handleCurrentChange" layout="prev, pager, next" :page-count="Number(pagination.pages)">
|
|
42
|
+ </el-pagination>
|
|
43
|
+ </div>
|
|
44
|
+
|
|
45
|
+ <!-- S 创建群发 -->
|
|
46
|
+ <playletSendDialog
|
|
47
|
+ :dialogVisible="playletSendDialogVisible"
|
|
48
|
+ :playletInfo="currentPlayletInfo"
|
|
49
|
+ @confirm="handlePlayletSendConfirm"
|
|
50
|
+ @cancel="handlePlayletSendCancel"
|
|
51
|
+ />
|
|
52
|
+ <!-- E 创建群发 -->
|
|
53
|
+ </div>
|
|
54
|
+</template>
|
|
55
|
+<script>
|
|
56
|
+import selfChannel from '@/components/assembly/screen/channel.vue'
|
|
57
|
+import selfInput from '@/components/assembly/screen/input.vue'
|
|
58
|
+import playletSendDialog from './dialog/playletSendDialog.vue'
|
|
59
|
+export default {
|
|
60
|
+ name: 'playletManage',
|
|
61
|
+ components: {
|
|
62
|
+ selfChannel,
|
|
63
|
+ selfInput,
|
|
64
|
+ playletSendDialog,
|
|
65
|
+ },
|
|
66
|
+ data () {
|
|
67
|
+ return {
|
|
68
|
+ height: '',
|
|
69
|
+ loading: false,
|
|
70
|
+ pagination: {
|
|
71
|
+ page: 1,
|
|
72
|
+ page_size: 20,
|
|
73
|
+ pages: 0,
|
|
74
|
+ total: 0,
|
|
75
|
+ },
|
|
76
|
+ filter: {
|
|
77
|
+ platform: '',
|
|
78
|
+ keyword: '',
|
|
79
|
+ },
|
|
80
|
+ playletList: [],
|
|
81
|
+
|
|
82
|
+ playletSendDialogVisible: false, // 控制"添加账号"弹框显示
|
|
83
|
+ currentPlayletInfo: {}, // 当前编辑的账号信息
|
|
84
|
+ }
|
|
85
|
+ },
|
|
86
|
+ created () {
|
|
87
|
+ this.height = document.documentElement.clientHeight - 200 > 400 ? document.documentElement.clientHeight - 200 : 400
|
|
88
|
+ this.handleGetPlaylet()
|
|
89
|
+ },
|
|
90
|
+ methods: {
|
|
91
|
+ // 获取列表数据
|
|
92
|
+ async handleGetPlaylet() {
|
|
93
|
+ try {
|
|
94
|
+ this.loading = true
|
|
95
|
+ const url = `${this.URL.BASEURL}${this.URL.pitcher_dramaList}`
|
|
96
|
+ const params = {
|
|
97
|
+ is_select: 0,
|
|
98
|
+ platform: this.filter.platform,
|
|
99
|
+ keyword: this.filter.keyword,
|
|
100
|
+ page: this.pagination.page,
|
|
101
|
+ page_size: this.pagination.page_size,
|
|
102
|
+ }
|
|
103
|
+ const { data: res = {} } = await this.$axios.get(url, { params })
|
|
104
|
+ if (res && res.errno == 0 && Array.isArray(res.rst.data)) {
|
|
105
|
+ this.playletList = res.rst.data;
|
|
106
|
+ this.pagination.total = res.rst.pageInfo.total;
|
|
107
|
+ this.pagination.pages = res.rst.pageInfo.pages;
|
|
108
|
+ } else if (res.errno != 4002) {
|
|
109
|
+ this.$message.warning(res.err)
|
|
110
|
+ this.playletList = [];
|
|
111
|
+ this.pagination.total = 0;
|
|
112
|
+ this.pagination.pages = 0;
|
|
113
|
+ }
|
|
114
|
+ } catch (error) {
|
|
115
|
+ console.log(error)
|
|
116
|
+ this.playletList = [];
|
|
117
|
+ this.pagination.total = 0;
|
|
118
|
+ this.pagination.pages = 0;
|
|
119
|
+ } finally {
|
|
120
|
+ this.loading = false
|
|
121
|
+ }
|
|
122
|
+ },
|
|
123
|
+ // 监听当前页数变化
|
|
124
|
+ handleCurrentChange(currentPage) {
|
|
125
|
+ this.pagination.page = currentPage
|
|
126
|
+ this.handleGetPlaylet()
|
|
127
|
+ },
|
|
128
|
+ // 监听"平台"筛选变化
|
|
129
|
+ onChangePlatform(val) {
|
|
130
|
+ this.filter.platform = val || ''
|
|
131
|
+ this.pagination.page = 1
|
|
132
|
+ this.handleGetPlaylet()
|
|
133
|
+ },
|
|
134
|
+ // 监听"搜索小程序"变化
|
|
135
|
+ onInputKeyword(val) {
|
|
136
|
+ this.filter.keyword = val || ''
|
|
137
|
+ this.pagination.page = 1
|
|
138
|
+ this.handleGetPlaylet()
|
|
139
|
+ },
|
|
140
|
+
|
|
141
|
+ // S 创建群发
|
|
142
|
+ // 监听点击"创建群发"
|
|
143
|
+ onClickCreateGroupSend(playletInfo) {
|
|
144
|
+ this.currentPlayletInfo = playletInfo
|
|
145
|
+ this.playletSendDialogVisible = true
|
|
146
|
+ },
|
|
147
|
+ // 创建群发 => 确定
|
|
148
|
+ handlePlayletSendConfirm() {
|
|
149
|
+ console.log('handlePlayletSendConfirm => ')
|
|
150
|
+ this.playletSendDialogVisible = false
|
|
151
|
+ this.handleGetPlaylet()
|
|
152
|
+ },
|
|
153
|
+ // 创建群发 => 取消
|
|
154
|
+ handlePlayletSendCancel() {
|
|
155
|
+ this.playletSendDialogVisible = false
|
|
156
|
+ },
|
|
157
|
+ // E 创建群发
|
|
158
|
+ }
|
|
159
|
+}
|
|
160
|
+</script>
|
|
161
|
+<style lang="scss" scoped>
|
|
162
|
+.screenBox {
|
|
163
|
+ background: #fff;
|
|
164
|
+ padding: 5px 20px;
|
|
165
|
+}
|
|
166
|
+.playletManage-wrap {
|
|
167
|
+ .playlet-name {
|
|
168
|
+ color: #32B38A;
|
|
169
|
+ // cursor: pointer;
|
|
170
|
+ }
|
|
171
|
+ .status {
|
|
172
|
+ margin: 2px auto;
|
|
173
|
+ padding: 0 6px;
|
|
174
|
+ color: #32B38A;
|
|
175
|
+ border: 1px solid #32B38A;
|
|
176
|
+ }
|
|
177
|
+ .btn {
|
|
178
|
+ color: #32B38A;
|
|
179
|
+ cursor: pointer;
|
|
180
|
+ }
|
|
181
|
+}
|
|
182
|
+</style>
|