repair.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. <div id="app" v-cloak>
  2. <el-card shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  3. <div slot="header">
  4. <span>修复</span>
  5. </div>
  6. <div class="table-body">
  7. <el-form size="small" :inline="true" flex="dir:left cross:center">
  8. <video :src="detail.video_url" ref="videoPlayer" @loadedmetadata="handleMetadataLoaded"></video>
  9. </el-form>
  10. </div>
  11. </el-card>
  12. </div>
  13. <script>
  14. const app = new Vue({
  15. el: '#app',
  16. data: {
  17. page: 1,
  18. avatar: '',
  19. nickname: '',
  20. time: [], //本地存时间,请求时不发送
  21. search: {
  22. related_type: 0,
  23. video_title: null,
  24. user_nickname: null,
  25. start_time: null,
  26. end_time: null,
  27. },
  28. loading: false,
  29. activeName: '-1',
  30. list: [], //列表数据
  31. detail: [],
  32. pagination: null,
  33. select: {
  34. nickname: '',
  35. status: 'first',
  36. },
  37. pageCount: 1,
  38. },
  39. mounted() {
  40. // 获取列表首页数据
  41. this.loadData(this.page, this.search); //获取列表数据
  42. },
  43. methods: {
  44. // 0.0.1 一键复制
  45. copyText(id) {
  46. // var text = document.getElementById("goods").innerText;
  47. var input = document.getElementById("inputs");
  48. input.value = id; // 修改文本框的内容
  49. input.select(); // 选中文本
  50. document.execCommand("copy"); // 执行浏览器复制命令
  51. this.$message.success('已成功复制商品id');
  52. },
  53. //1.0 跳转详情
  54. toDetails(id, index) {
  55. this.$navigate({
  56. r: 'short-video/default/video-detail',
  57. video_id: id
  58. })
  59. },
  60. // 1.1 置顶与取消置顶
  61. goingTop(id, is_top, index) {
  62. let self = this;
  63. let top_data = is_top == 0 ? 1 : 0;
  64. let confirmTitle = is_top == 0 ? '将该视频置顶, 是否继续?' : '取消该视频的置顶, 是否继续?';
  65. self.$confirm(confirmTitle, '提示', {
  66. confirmButtonText: '确定',
  67. cancelButtonText: '取消',
  68. type: 'warning'
  69. }).then(() => {
  70. self.listLoading = true;
  71. console.log(id, '1111')
  72. request({
  73. params: {
  74. r: 'short-video/video/top',
  75. id: id,
  76. is_top: top_data,
  77. },
  78. method: 'get',
  79. }).then(e => {
  80. self.listLoading = false;
  81. if (e.data.code === 0) {
  82. self.$message.success(e.data.msg);
  83. let newTop = is_top == 0 ? 1 : 0;
  84. self.$set(self.list[index], `is_top`, newTop);
  85. // self.list.splice(index, 1);
  86. } else {
  87. self.$message.error(e.data.msg);
  88. }
  89. }).catch(e => {
  90. console.log(e);
  91. });
  92. }).catch(() => {
  93. self.$message.info('已取消')
  94. });
  95. },
  96. // 1.2 加入黑名单
  97. joinBlacklist(id, index) {
  98. let self = this;
  99. self.$confirm('将该视频加入黑名单, 是否继续', '提示', {
  100. confirmButtonText: '确定',
  101. cancelButtonText: '取消',
  102. type: 'warning'
  103. }).then(() => {
  104. self.listLoading = true;
  105. request({
  106. params: {
  107. r: 'short-video/video/join-blacklist',
  108. id: id,
  109. },
  110. method: 'get',
  111. }).then(e => {
  112. self.listLoading = false;
  113. if (e.data.code === 0) {
  114. self.$message.success(e.data.msg);
  115. self.list.splice(index, 1);
  116. } else {
  117. self.$message.error(e.data.msg);
  118. }
  119. }).catch(e => {
  120. console.log(e);
  121. });
  122. }).catch(() => {
  123. self.$message.info('已取消')
  124. });
  125. },
  126. // 1.0 获取视频列表
  127. loadData(page, others) {
  128. this.loading = true;
  129. request({
  130. method: 'get',
  131. params: {
  132. r: 'short-video/default/repair',
  133. },
  134. method: 'get'
  135. }).then(e => {
  136. this.loading = false;
  137. if (e.data.code === 0) {
  138. this.list = e.data.data;
  139. this.repairData();
  140. } else {
  141. this.$message.error(e.data.msg);
  142. }
  143. }).catch(e => {});
  144. },
  145. pageChange(page) {
  146. this.page = page;
  147. this.loadData(this.page, this.search);
  148. },
  149. handleClick(tab, event) {
  150. this.page = 1;
  151. this.search.status = this.activeName;
  152. this.loadData(this.page, this.search)
  153. },
  154. handleSelectionChange(val) {
  155. let self = this;
  156. self.choose_list = [];
  157. val.forEach(function(item) {
  158. self.choose_list.push(item.id);
  159. })
  160. },
  161. searchs() {
  162. this.page = 1;
  163. this.loadData(this.page, this.search);
  164. },
  165. clearSearchs() {
  166. this.search.related_type = 0;
  167. this.search.video_title = null;
  168. this.search.user_nickname = null;
  169. this.search.start_time = null;
  170. this.search.end_time = null;
  171. this.time = [];
  172. this.page = 1;
  173. this.loadData(this.page, this.search);
  174. },
  175. // 时间搜索选中
  176. selectedDateTime(val) {
  177. console.log(val);
  178. if (val) {
  179. this.search.start_time = val[0] / 1000;
  180. this.search.end_time = val[1] / 1000;
  181. } else {
  182. this.time = [];
  183. this.search.start_time = null;
  184. this.search.end_time = null;
  185. }
  186. this.loadData(1, this.search);
  187. },
  188. handleMetadataLoaded() {
  189. this.detail.duration_seconds = this.$refs.videoPlayer.duration;
  190. request({
  191. params: {
  192. r: 'short-video/default/video-detail',
  193. },
  194. method: 'post',
  195. data: {
  196. form: this.detail
  197. },
  198. }).then(e => {
  199. this.loading = false;
  200. this.integralMine = false;
  201. this.moneyMine = false;
  202. if (e.data.code === 0) {
  203. this.$message.success(e.data.msg);
  204. // 从新获取数据
  205. this.getDetails();
  206. } else {
  207. this.$message.error(e.data.msg);
  208. }
  209. }).catch(e => {});
  210. },
  211. repairData() {
  212. var i = 0;
  213. // this.detail = this.list[i];
  214. setInterval(() => {
  215. this.changeData(i);
  216. i++;
  217. // console.log('111', i);
  218. }, 2000);
  219. },
  220. changeData(i) {
  221. if (this.list[i] == null) {
  222. this.$message.error('已无可修复数据');
  223. }
  224. this.detail = this.list[i];
  225. }
  226. }
  227. });
  228. </script>
  229. <style>
  230. .el-tabs__header {
  231. font-size: 16px;
  232. }
  233. .table-body {
  234. padding: 20px;
  235. background-color: #fff;
  236. }
  237. .table-body .el-button {
  238. padding: 0 !important;
  239. border: 0;
  240. margin: 0 5px;
  241. }
  242. .input-item {
  243. width: 250px;
  244. margin: 0 0 20px;
  245. display: inline-block;
  246. }
  247. .input-item .el-input__inner {
  248. border-right: 0;
  249. }
  250. .input-item .el-input__inner:hover {
  251. border: 1px solid #dcdfe6;
  252. border-right: 0;
  253. outline: 0;
  254. }
  255. .input-item .el-input__inner:focus {
  256. border: 1px solid #dcdfe6;
  257. border-right: 0;
  258. outline: 0;
  259. }
  260. .input-item .el-input-group__append {
  261. background-color: #fff;
  262. border-left: 0;
  263. width: 10%;
  264. padding: 0;
  265. }
  266. .input-item .el-input-group__append .el-button {
  267. padding: 0;
  268. }
  269. .input-item .el-input-group__append .el-button {
  270. margin: 0;
  271. }
  272. .batch {
  273. margin: 0 0 20px;
  274. display: inline-block;
  275. }
  276. .batch .el-button {
  277. padding: 9px 15px !important;
  278. }
  279. .item-box {
  280. margin-right: 20px;
  281. }
  282. .item-box .label {
  283. margin-right: 8px;
  284. }
  285. .form-nickname {
  286. width: 180px;
  287. white-space: nowrap;
  288. overflow: hidden;
  289. text-overflow: ellipsis;
  290. }
  291. .index-video-url {
  292. width: 300px;
  293. }
  294. .index-video-url video {
  295. width: 100%;
  296. }
  297. .index-related-info {
  298. width: 500px;
  299. }
  300. .video-top {
  301. width: 100%;
  302. display: flex;
  303. align-items: flex-start;
  304. box-sizing: border-box;
  305. padding: 20px;
  306. /* opacity: .5; */
  307. background-color: #FFFFFF;
  308. }
  309. .video-top .top-right {
  310. line-height: 26px;
  311. }
  312. .video-top .top-right .top-title {
  313. font-size: 18px;
  314. white-space: nowrap;
  315. overflow: hidden;
  316. text-overflow: ellipsis;
  317. width: 360px;
  318. }
  319. .video-top .top-right .wrapper {
  320. display: flex;
  321. /* align-items: flex-start; */
  322. }
  323. .video-top .top-right .wrapper .to-copy {
  324. /* color: #03C5FF; */
  325. margin-left: 20px;
  326. }
  327. .video-top .top-right .detail-price {
  328. color: #BC0100;
  329. font-size: 18px;
  330. font-family: Microsoft YaHei;
  331. font-weight: bold;
  332. }
  333. /* .atooltip {
  334. background: #FFFFFF !important;
  335. border: none !important;
  336. } */
  337. .el-table th>.cell {
  338. color: #333;
  339. font-weight: bold;
  340. font-size: 14px;
  341. }
  342. .el-table__footer-wrapper,
  343. .el-table__header-wrapper {
  344. border-bottom: 1.4px solid #D6D6D6;
  345. }
  346. </style>