index.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  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: 1200px;" 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" v-if="search.video_title || search.user_nickname || search.start_time || search.end_time">
  36. <el-button size="small" type="warning" style="padding: 9px 15px !important;" @click="clearSearchs">清除搜索条件
  37. </el-button>
  38. </div>
  39. </el-form>
  40. <el-tabs v-model="activeName" @tab-click="handleClick">
  41. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;" @selection-change="handleSelectionChange">
  42. <el-table-column prop="id" label="视频ID" width="80" align="center"></el-table-column>
  43. <el-table-column prop="avatar_url,nickname" label="会员" width="200" align="center">
  44. <template slot-scope="scope">
  45. <div class="table-info-img-text">
  46. <el-image class="table-info-img circle" :src="scope.row.avatar_url">
  47. <div slot="error" class="image-slot">
  48. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  49. </div>
  50. </el-image>
  51. <div class="table-info-text">
  52. <div v-if="scope.row.nickname">{{scope.row.nickname}} [ID: {{scope.row.user_id}}]</div>
  53. <div>{{scope.row.mobile}}</div>
  54. </div>
  55. </div>
  56. </template>
  57. </el-table-column>
  58. <!-- <el-table-column prop="nickname" label="会员" width="120"></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" align="left">
  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="related_type" label="关联类型" width="150" align="center">
  85. <template slot-scope="scope">
  86. <div v-if="scope.row.related_type==1">
  87. <template v-if="scope.row.goods_list.id">
  88. <el-tooltip placement="top" effect="light" popper-class="atooltip">
  89. <div class="index-related-info" slot="content">
  90. <div class="video-top">
  91. <div style="padding-right: 20px;">
  92. <image style="width: 70px;height: 70px;" mode="aspectFill" :src="scope.row.goods_list.cover_pic"></image>
  93. </div>
  94. <div class="top-right">
  95. <div class="top-title">{{scope.row.goods_list.name}}</div>
  96. <div class="wrapper">
  97. <div>商品id: </div>
  98. <div id="goods">{{scope.row.goods_list.id}}</div>
  99. <el-button type="primary" size="mini" class="to-copy" @click="copyText(scope.row.goods_list.id)">复制</el-button>
  100. </div>
  101. <div class="detail-price">¥{{scope.row.goods_list.price}}</div>
  102. </div>
  103. </div>
  104. </div>
  105. <div>商品</div>
  106. </el-tooltip>
  107. </template>
  108. <template v-else>
  109. <div>商品</div>
  110. </template>
  111. </div>
  112. <div v-if="scope.row.related_type==2">店铺</div>
  113. <div v-if="scope.row.related_type==3">地址</div>
  114. <div v-if="scope.row.related_type==4">暂无关联</div>
  115. </template>
  116. </el-table-column>
  117. <!-- <el-table-column prop="related_type" label="名称">
  118. <template slot-scope="scope">
  119. </template>
  120. </el-table-column> -->
  121. <el-table-column prop="usage_num" label="名称" align="center">
  122. <template slot-scope="scope">
  123. <div v-if="scope.row.related_type==1">{{scope.row.goods_list.name}}</div>
  124. <div v-else-if="scope.row.related_type==3">{{scope.row.related_detailed_address}}</div>
  125. <div v-else-if="scope.row.related_type==4">暂无关联</div>
  126. </template>
  127. </el-table-column>
  128. <el-table-column fixed="right" label="操作" width="200" align="center">
  129. <template slot-scope="scope">
  130. <el-button @click="inspectCheck(scope.row.id,scope.row.title,true, scope.$index)" type="text" size="small">审核通过</el-button>
  131. <el-button @click="inspectCheck(scope.row.id,scope.row.title,false, scope.$index)" type="text" size="small">审核驳回</el-button>
  132. </template>
  133. </el-table-column>
  134. </el-table>
  135. </el-tabs>
  136. <!-- 分页器 -->
  137. <div flex="box:last cross:center">
  138. <div></div>
  139. <div>
  140. <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">
  141. </el-pagination>
  142. </div>
  143. </div>
  144. </div>
  145. <!-- 这个是复制用的容器,已隐藏 -->
  146. <textarea id="inputs" style="opacity: 0;width: 0;height: 0;">这是幕后黑手</textarea>
  147. </el-card>
  148. <el-dialog :title="'视频ID: '+adoptId" :visible.sync="dialogTableVisible">
  149. <el-form :model="form">
  150. <el-form-item v-if="adoptFlag" label="该视频通过审核"></el-form-item>
  151. <el-form-item v-if="!adoptFlag" label="驳回原因">
  152. <el-input type="textarea" v-model="form.check_remark" :rows="5" style="width: 50%" placeholder="请填写驳回原因"></el-input>
  153. </el-form-item>
  154. </el-form>
  155. <div slot="footer" class="dialog-footer">
  156. <el-button @click="dialogTableVisible = false">取 消</el-button>
  157. <el-button type="primary" @click="postCheck">{{adoptFlag?'通 过':'驳 回'}}</el-button>
  158. </div>
  159. </el-dialog>
  160. </div>
  161. <script>
  162. const app = new Vue({
  163. el: '#app',
  164. data: {
  165. page: 1,
  166. nickname: '',
  167. time: [], //本地存时间,请求时不发送
  168. search: {
  169. related_type: 0,
  170. video_title: null,
  171. user_nickname: null,
  172. start_time: null,
  173. end_time: null,
  174. },
  175. loading: false,
  176. activeName: '-1',
  177. list: [], //列表数据
  178. pagination: null,
  179. form: {
  180. check_remark: '',
  181. },
  182. dialogTableVisible: false,
  183. adoptFlag: true, //默认通过审核
  184. adoptTitle: '', //标题
  185. adoptId: '', //id
  186. index: null, // 当前选中行索引
  187. pageCount: 1,
  188. },
  189. mounted() {
  190. this.loadData(this.page, this.search); //获取列表数据
  191. },
  192. methods: {
  193. // 0.0.1 一键复制
  194. copyText(id) {
  195. // var text = document.getElementById("goods").innerText;
  196. var input = document.getElementById("inputs");
  197. input.value = id; // 修改文本框的内容
  198. input.select(); // 选中文本
  199. document.execCommand("copy"); // 执行浏览器复制命令
  200. this.$message.success('已成功复制商品id');
  201. },
  202. // 审核操作
  203. inspectCheck(id, title, check_status, index) {
  204. this.dialogTableVisible = true;
  205. this.adoptId = id;
  206. this.adoptTitle = title;
  207. this.adoptFlag = check_status;
  208. this.index = index;
  209. },
  210. // 提交审核
  211. postCheck() {
  212. this.loading = true;
  213. let postData = {
  214. id: this.adoptId,
  215. }
  216. this.adoptFlag ? postData['check_status'] = 1 : postData['check_status'] = 2;
  217. if (!this.adoptFlag) {
  218. if (!this.form.check_remark) {
  219. this.$message.error('驳回原因不能为空');
  220. this.loading = false;
  221. return false;
  222. }
  223. postData['check_remark'] = this.form.check_remark
  224. }
  225. this.dialogTableVisible = false;
  226. request({
  227. method: 'post',
  228. params: {
  229. r: 'short-video/video/video-audit',
  230. },
  231. data: postData,
  232. }).then(e => {
  233. this.loading = false;
  234. if (e.data.code === 0) {
  235. this.$message.success(e.data.msg);
  236. this.list.splice(this.index, 1);
  237. } else {
  238. this.$message.error(e.data.msg);
  239. }
  240. }).catch(e => {});
  241. },
  242. // 1.0 获取审核管理列表
  243. loadData(page, others) {
  244. this.loading = true;
  245. request({
  246. params: {
  247. r: 'short-video/default/index',
  248. page: page,
  249. list_type: 2,
  250. ...others, //其他搜索字段
  251. },
  252. method: 'get',
  253. }).then(e => {
  254. this.loading = false;
  255. if (e.data.code === 0) {
  256. this.list = e.data.data.list;
  257. this.pagination = e.data.data.pagination;
  258. this.pageCount = e.data.data.page_count;
  259. } else {
  260. this.$message.error(e.data.msg);
  261. }
  262. }).catch(e => {});
  263. },
  264. pageChange(page) {
  265. this.page = page;
  266. this.loadData(this.page, this.search);
  267. },
  268. handleClick(tab, event) {
  269. this.page = 1;
  270. this.search.status = this.activeName;
  271. this.loadData(this.page, this.search)
  272. },
  273. handleSelectionChange(val) {
  274. let self = this;
  275. self.choose_list = [];
  276. val.forEach(function(item) {
  277. self.choose_list.push(item.id);
  278. })
  279. },
  280. searchs() {
  281. this.page = 1;
  282. this.loadData(this.page, this.search);
  283. },
  284. clearSearchs() {
  285. this.search.related_type = 0;
  286. this.search.video_title = null;
  287. this.search.user_nickname = null;
  288. this.search.start_time = null;
  289. this.search.end_time = null;
  290. this.time = [];
  291. this.page = 1;
  292. this.loadData(this.page, this.search);
  293. },
  294. // 时间搜索选中
  295. selectedDateTime(val) {
  296. if (val) {
  297. this.search.start_time = val[0];
  298. this.search.end_time = val[1];
  299. } else {
  300. this.time = [];
  301. this.search.start_time = null;
  302. this.search.end_time = null;
  303. }
  304. this.loadData(1, this.search);
  305. },
  306. }
  307. });
  308. </script>
  309. <style>
  310. .el-tabs__header {
  311. font-size: 16px;
  312. }
  313. .table-body {
  314. padding: 20px;
  315. background-color: #fff;
  316. }
  317. .table-body .el-button {
  318. /* padding: 0 !important; */
  319. border: 0;
  320. margin: 0 5px;
  321. }
  322. .input-item {
  323. width: 250px;
  324. margin: 0 0 20px;
  325. display: inline-block;
  326. }
  327. .input-item .el-input__inner {
  328. border-right: 0;
  329. }
  330. .input-item .el-input__inner:hover {
  331. border: 1px solid #dcdfe6;
  332. border-right: 0;
  333. outline: 0;
  334. }
  335. .input-item .el-input__inner:focus {
  336. border: 1px solid #dcdfe6;
  337. border-right: 0;
  338. outline: 0;
  339. }
  340. .input-item .el-input-group__append {
  341. background-color: #fff;
  342. border-left: 0;
  343. width: 10%;
  344. padding: 0;
  345. }
  346. .input-item .el-input-group__append .el-button {
  347. padding: 0;
  348. }
  349. .input-item .el-input-group__append .el-button {
  350. margin: 0;
  351. }
  352. .batch {
  353. margin: 0 0 20px;
  354. display: inline-block;
  355. }
  356. .batch .el-button {
  357. padding: 9px 15px !important;
  358. }
  359. .item-box {
  360. margin-right: 20px;
  361. }
  362. .item-box .label {
  363. margin-right: 8px;
  364. }
  365. .index-video-url {
  366. width: 300px;
  367. }
  368. .index-video-url video {
  369. width: 100%;
  370. }
  371. .index-related-info {
  372. width: 500px;
  373. }
  374. .video-top {
  375. width: 100%;
  376. display: flex;
  377. align-items: flex-start;
  378. box-sizing: border-box;
  379. padding: 20px;
  380. /* opacity: .5; */
  381. background-color: #FFFFFF;
  382. }
  383. .video-top .top-right {
  384. line-height: 26px;
  385. }
  386. .video-top .top-right .top-title {
  387. font-size: 18px;
  388. white-space: nowrap;
  389. overflow: hidden;
  390. text-overflow: ellipsis;
  391. width: 360px;
  392. }
  393. .video-top .top-right .wrapper {
  394. display: flex;
  395. /* align-items: flex-start; */
  396. }
  397. .video-top .top-right .wrapper .to-copy {
  398. /* color: #03C5FF; */
  399. margin-left: 20px;
  400. }
  401. .video-top .top-right .detail-price {
  402. color: #BC0100;
  403. font-size: 18px;
  404. font-family: Microsoft YaHei;
  405. font-weight: bold;
  406. }
  407. .el-table th>.cell {
  408. color: #333;
  409. font-weight: bold;
  410. font-size: 14px;
  411. }
  412. .el-table__footer-wrapper,
  413. .el-table__header-wrapper {
  414. border-bottom: 1.4px solid #D6D6D6;
  415. }
  416. </style>