index.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. <?php
  2. /**
  3. * @link:http://www.goodmall.com/
  4. * @copyright: Copyright (c) 2020
  5. * 名片
  6. * Author: james
  7. * Date: 2020-07-10
  8. * Time: 15:48
  9. */
  10. ?>
  11. <div id="app" v-cloak>
  12. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  13. <div slot="header">
  14. <span>黑名单</span>
  15. </div>
  16. <div class="table-body">
  17. <el-form size="small" :inline="true" flex="dir:left cross:center">
  18. <div class="item-box" flex="dir:left cross:center">
  19. <div class="label">标题</div>
  20. <el-input size="small" style="width: 200px" v-model="search.video_title" placeholder="请输入标题"></el-input>
  21. </div>
  22. <div class="item-box" flex="dir:left cross:center">
  23. <div class="label">会员</div>
  24. <el-input size="small" style="width: 200px" v-model="search.user_nickname" placeholder="请输入会员呢称"></el-input>
  25. </div>
  26. <div class="item-box" flex="dir:left cross:center">
  27. <div class="label">创建时间</div>
  28. <el-date-picker @change="selectedDateTime" size="small" v-model="time" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
  29. </el-date-picker>
  30. </div>
  31. <div class="item-box" flex="dir:left cross:center">
  32. <el-button size="small" type="primary" style="padding: 9px 15px !important;" @click="searchs">搜索
  33. </el-button>
  34. </div>
  35. <div class="item-box" flex="dir:left cross:center"
  36. v-if="search.video_title || search.user_nickname || search.start_time || search.end_time">
  37. <el-button size="small" type="warning" style="padding: 9px 15px !important;" @click="clearSearchs">清除搜索条件
  38. </el-button>
  39. </div>
  40. </el-form>
  41. <el-tabs v-model="activeName" @tab-click="handleClick">
  42. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;" @selection-change="handleSelectionChange">
  43. <el-table-column prop="id" label="视频ID" width="80" align="center"></el-table-column>
  44. <el-table-column prop="avatar_url,nickname" label="会员" min-width="200">
  45. <template slot-scope="scope">
  46. <div class="table-info-img-text">
  47. <el-image class="table-info-img circle" :src="scope.row.avatar_url">
  48. <div slot="error" class="image-slot">
  49. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  50. </div>
  51. </el-image>
  52. <div class="table-info-text">
  53. <div v-if="scope.row.nickname">{{scope.row.nickname}} [ID: {{scope.row.user_id}}]</div>
  54. <div>{{scope.row.mobile}}</div>
  55. </div>
  56. </div>
  57. </template>
  58. </el-table-column>
  59. <el-table-column prop="title" label="标题" align="center">
  60. <template slot-scope="scope">
  61. <div>{{scope.row.title}}</div>
  62. </template>
  63. </el-table-column>
  64. <el-table-column prop="first_frame,video_url" label="发布视频" width="120">
  65. <template slot-scope="scope">
  66. <div flex="box:first">
  67. <div style="padding-right: 10px;">
  68. <el-tooltip placement="top" effect="light">
  69. <div class="index-video-url" slot="content">
  70. <video :src="scope.row.video_url" controls="controls">
  71. </video>
  72. </div>
  73. <com-image mode="aspectFill" :src="scope.row.first_frame"></com-image>
  74. </el-tooltip>
  75. </div>
  76. </div>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="发布时间" prop="created_at" width="160" align="center">
  80. <template slot-scope="scope">
  81. <div>{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  82. </template>
  83. </el-table-column>
  84. <el-table-column prop="usage_num" label="关联商品">
  85. <template slot-scope="scope">
  86. <div v-if="scope.row.related_type==1">
  87. <el-tooltip placement="top" effect="light" popper-class="atooltip">
  88. <div class="index-related-info" slot="content">
  89. <div class="video-top">
  90. <div style="padding-right: 20px;">
  91. <image style="width: 70px;height: 70px;" mode="aspectFill" :src="scope.row.goods_list.cover_pic"></image>
  92. </div>
  93. <div class="top-right">
  94. <div class="top-title">{{scope.row.goods_list.name}}</div>
  95. <div class="wrapper">
  96. <div>商品id: </div>
  97. <div id="goods">{{scope.row.goods_list.id}}</div>
  98. <el-button type="primary" size="mini" class="to-copy" @click="copyText(scope.row.goods_list.id)">复制</el-button>
  99. </div>
  100. <div class="detail-price">¥{{scope.row.goods_list.original_price}}</div>
  101. </div>
  102. </div>
  103. </div>
  104. <div>商品</div>
  105. </el-tooltip>
  106. </div>
  107. <div v-else-if="scope.row.related_type==3">{{scope.row.related_detailed_address}}</div>
  108. <div v-else-if="scope.row.related_type==4">暂无关联</div>
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="观看人数" prop="look_people_num" align="center">
  112. <template slot-scope="scope">
  113. <div>{{scope.row.look_people_num}}</div>
  114. </template>
  115. </el-table-column>
  116. <el-table-column label="分享/点击次数" prop="share_num" align="center" width="150">
  117. <template slot-scope="scope">
  118. <div>{{scope.row.share_num||0}}/{{scope.row.share_look_num||0}}</div>
  119. </template>
  120. </el-table-column>
  121. <el-table-column label="转化金额" prop="frequency" align="center">
  122. <template slot-scope="scope">
  123. <div>{{scope.row.conversion||0}}</div>
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="观看奖励金额" prop="frequency" align="center">
  127. <template slot-scope="scope">
  128. <div>{{scope.row.spend_money||0}}</div>
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="观看奖励积分" prop="frequency" align="center">
  132. <template slot-scope="scope">
  133. <div>{{scope.row.spend_integral||0}}</div>
  134. </template>
  135. </el-table-column>
  136. <el-table-column label="分红奖励" prop="dividend" align="center">
  137. <template slot-scope="scope">
  138. <div>{{scope.row.dividend||0}}</div>
  139. </template>
  140. </el-table-column>
  141. <el-table-column label="操作" width="200" align="center">
  142. <template slot-scope="scope">
  143. <el-button @click="toDetails(scope.row.id,scope.$index)" type="text" size="small">查看详情</el-button>
  144. <el-button @click="cancelBlacklist(scope.row.id,scope.$index)" type="text" size="small">取消黑名单</el-button>
  145. <el-button @click="videoDelete(scope.row.id,scope.$index)" type="text" size="small">删除</el-button>
  146. </template>
  147. </el-table-column><!-- fixed="right" -->
  148. </el-table>
  149. </el-tabs>
  150. <!-- 分页器 -->
  151. <div flex="box:last cross:center">
  152. <div></div>
  153. <div>
  154. <el-pagination v-if="list.length > 0" style="display: inline-block;float: right;" background :page-size="pagination.pageSize" @current-change="pageChange" layout="prev, pager, next" :current-page="pagination.current_page" :page-count="pageCount">
  155. </el-pagination>
  156. </div>
  157. </div>
  158. </div>
  159. <!-- 这个是复制用的容器,已隐藏 -->
  160. <textarea id="inputs" style="opacity: 0;width: 0;height: 0;">这是幕后黑手</textarea>
  161. </el-card>
  162. </div>
  163. <script>
  164. const app = new Vue({
  165. el: '#app',
  166. data: {
  167. page: 1,
  168. avatar: '',
  169. nickname: '',
  170. time: [], //本地存时间,请求时不发送
  171. search: {
  172. related_type: 0,
  173. video_title: null,
  174. user_nickname: null,
  175. start_time: null,
  176. end_time: null,
  177. },
  178. loading: false,
  179. activeName: '-1',
  180. list: [], //列表数据
  181. pagination: null,
  182. pageCount: 1,
  183. },
  184. mounted() {
  185. this.loadData(this.page, this.search); //获取列表数据
  186. },
  187. methods: {
  188. // 0.0.1 一键复制
  189. copyText(id) {
  190. // var text = document.getElementById("goods").innerText;
  191. var input = document.getElementById("inputs");
  192. input.value = id; // 修改文本框的内容
  193. input.select(); // 选中文本
  194. document.execCommand("copy"); // 执行浏览器复制命令
  195. this.$message.success('已成功复制商品id');
  196. },
  197. //1.0 跳转详情
  198. toDetails(id, index) {
  199. this.$navigate({
  200. r: 'short-video/default/video-detail',
  201. video_id: id
  202. })
  203. },
  204. // 1.2 取消黑名单
  205. cancelBlacklist(id, index) {
  206. let self = this;
  207. self.$confirm('在黑名单中取消该视频, 是否继续', '提示', {
  208. confirmButtonText: '确定',
  209. cancelButtonText: '取消',
  210. type: 'warning'
  211. }).then(() => {
  212. self.listLoading = true;
  213. request({
  214. params: {
  215. r: 'short-video/video/cancel-blacklist',
  216. id: id,
  217. },
  218. method: 'get',
  219. }).then(e => {
  220. self.listLoading = false;
  221. if (e.data.code === 0) {
  222. self.$message.success(e.data.msg);
  223. self.list.splice(index, 1);
  224. } else {
  225. self.$message.error(e.data.msg);
  226. }
  227. }).catch(e => {
  228. console.log(e);
  229. });
  230. }).catch(() => {
  231. // self.$message.info('已取消')
  232. });
  233. },
  234. //0.1 删除
  235. videoDelete(id, index) {
  236. let self = this;
  237. self.$confirm('删除该视频, 是否继续?', '提示', {
  238. confirmButtonText: '确定',
  239. cancelButtonText: '取消',
  240. type: 'warning'
  241. }).then(() => {
  242. self.listLoading = true;
  243. request({
  244. params: {
  245. r: 'short-video/video/delete',
  246. id: id,
  247. },
  248. method: 'get',
  249. }).then(e => {
  250. self.listLoading = false;
  251. if (e.data.code === 0) {
  252. self.$message.success(e.data.msg);
  253. self.list.splice(index, 1);
  254. } else {
  255. self.$message.error(e.data.msg);
  256. }
  257. }).catch(e => {
  258. console.log(e);
  259. });
  260. }).catch(() => {
  261. self.$message.info('已取消删除')
  262. });
  263. },
  264. // 1.0 获取视频黑名单列表
  265. loadData(page, others) {
  266. this.loading = true;
  267. request({
  268. params: {
  269. r: 'short-video/default/index',
  270. page: page,
  271. list_type: 3,
  272. ...others, //其他搜索字段
  273. },
  274. method: 'get',
  275. }).then(e => {
  276. this.loading = false;
  277. if (e.data.code === 0) {
  278. this.list = e.data.data.list;
  279. this.pagination = e.data.data.pagination;
  280. this.pageCount = e.data.data.page_count;
  281. } else {
  282. this.$message.error(e.data.msg);
  283. }
  284. }).catch(e => {});
  285. },
  286. pageChange(page) {
  287. this.page = page;
  288. this.loadData(this.page, this.search);
  289. },
  290. handleClick(tab, event) {
  291. this.page = 1;
  292. this.search.status = this.activeName;
  293. this.loadData(this.page, this.search)
  294. },
  295. handleSelectionChange(val) {
  296. let self = this;
  297. self.choose_list = [];
  298. val.forEach(function(item) {
  299. self.choose_list.push(item.id);
  300. })
  301. },
  302. searchs() {
  303. this.page = 1;
  304. this.loadData(this.page, this.search);
  305. },
  306. clearSearchs() {
  307. this.search.related_type = 0;
  308. this.search.video_title = null;
  309. this.search.user_nickname = null;
  310. this.search.start_time = null;
  311. this.search.end_time = null;
  312. this.time = [];
  313. this.page = 1;
  314. this.loadData(this.page, this.search);
  315. },
  316. // 时间搜索选中
  317. selectedDateTime(val) {
  318. if (val) {
  319. this.search.start_time = val[0];
  320. this.search.end_time = val[1];
  321. } else {
  322. this.time = [];
  323. this.search.start_time = null;
  324. this.search.end_time = null;
  325. }
  326. this.loadData(1, this.search);
  327. },
  328. }
  329. });
  330. </script>
  331. <style>
  332. .el-tabs__header {
  333. font-size: 16px;
  334. }
  335. .table-body {
  336. padding: 20px;
  337. background-color: #fff;
  338. }
  339. .table-body .el-button {
  340. padding: 0 !important;
  341. border: 0;
  342. margin: 0 5px;
  343. }
  344. .input-item {
  345. width: 250px;
  346. margin: 0 0 20px;
  347. display: inline-block;
  348. }
  349. .input-item .el-input__inner {
  350. border-right: 0;
  351. }
  352. .input-item .el-input__inner:hover {
  353. border: 1px solid #dcdfe6;
  354. border-right: 0;
  355. outline: 0;
  356. }
  357. .input-item .el-input__inner:focus {
  358. border: 1px solid #dcdfe6;
  359. border-right: 0;
  360. outline: 0;
  361. }
  362. .input-item .el-input-group__append {
  363. background-color: #fff;
  364. border-left: 0;
  365. width: 10%;
  366. padding: 0;
  367. }
  368. .input-item .el-input-group__append .el-button {
  369. padding: 0;
  370. }
  371. .input-item .el-input-group__append .el-button {
  372. margin: 0;
  373. }
  374. .batch {
  375. margin: 0 0 20px;
  376. display: inline-block;
  377. }
  378. .batch .el-button {
  379. padding: 9px 15px !important;
  380. }
  381. .item-box {
  382. margin-right: 20px;
  383. }
  384. .item-box .label {
  385. margin-right: 8px;
  386. }
  387. .index-related-info {
  388. width: 500px;
  389. }
  390. .video-top {
  391. width: 100%;
  392. display: flex;
  393. align-items: flex-start;
  394. box-sizing: border-box;
  395. padding: 20px;
  396. /* opacity: .5; */
  397. background-color: #FFFFFF;
  398. }
  399. .video-top .top-right {
  400. line-height: 26px;
  401. }
  402. .video-top .top-right .top-title {
  403. font-size: 18px;
  404. white-space: nowrap;
  405. overflow: hidden;
  406. text-overflow: ellipsis;
  407. width: 360px;
  408. }
  409. .video-top .top-right .wrapper {
  410. display: flex;
  411. /* align-items: flex-start; */
  412. }
  413. .video-top .top-right .wrapper .to-copy {
  414. /* color: #03C5FF; */
  415. margin-left: 20px;
  416. }
  417. .video-top .top-right .detail-price {
  418. color: #BC0100;
  419. font-size: 18px;
  420. font-family: Microsoft YaHei;
  421. font-weight: bold;
  422. }
  423. /* .atooltip {
  424. background: #FFFFFF !important;
  425. border: none !important;
  426. } */
  427. .index-video-url {
  428. width: 300px;
  429. }
  430. .index-video-url video {
  431. width: 100%;
  432. }
  433. .el-table th>.cell {
  434. color: #333;
  435. font-weight: bold;
  436. font-size: 14px;
  437. }
  438. .el-table__footer-wrapper,
  439. .el-table__header-wrapper {
  440. border-bottom: 1.4px solid #D6D6D6;
  441. }
  442. </style>