| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389 |
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <span>修复</span>
- </div>
- <div class="table-body">
- <el-form size="small" :inline="true" flex="dir:left cross:center">
-
- <video :src="detail.video_url" ref="videoPlayer" @loadedmetadata="handleMetadataLoaded"></video>
- </el-form>
-
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data: {
- page: 1,
- avatar: '',
- nickname: '',
- time: [], //本地存时间,请求时不发送
- search: {
- related_type: 0,
- video_title: null,
- user_nickname: null,
- start_time: null,
- end_time: null,
- },
- loading: false,
- activeName: '-1',
- list: [], //列表数据
- detail: [],
- pagination: null,
- select: {
- nickname: '',
- status: 'first',
- },
- pageCount: 1,
- },
- mounted() {
- // 获取列表首页数据
- this.loadData(this.page, this.search); //获取列表数据
-
- },
- methods: {
- // 0.0.1 一键复制
- copyText(id) {
- // var text = document.getElementById("goods").innerText;
- var input = document.getElementById("inputs");
- input.value = id; // 修改文本框的内容
- input.select(); // 选中文本
- document.execCommand("copy"); // 执行浏览器复制命令
- this.$message.success('已成功复制商品id');
- },
- //1.0 跳转详情
- toDetails(id, index) {
- this.$navigate({
- r: 'short-video/default/video-detail',
- video_id: id
- })
- },
- // 1.1 置顶与取消置顶
- goingTop(id, is_top, index) {
- let self = this;
- let top_data = is_top == 0 ? 1 : 0;
- let confirmTitle = is_top == 0 ? '将该视频置顶, 是否继续?' : '取消该视频的置顶, 是否继续?';
- self.$confirm(confirmTitle, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- self.listLoading = true;
- console.log(id, '1111')
- request({
- params: {
- r: 'short-video/video/top',
- id: id,
- is_top: top_data,
- },
- method: 'get',
- }).then(e => {
- self.listLoading = false;
- if (e.data.code === 0) {
- self.$message.success(e.data.msg);
- let newTop = is_top == 0 ? 1 : 0;
- self.$set(self.list[index], `is_top`, newTop);
- // self.list.splice(index, 1);
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- console.log(e);
- });
- }).catch(() => {
- self.$message.info('已取消')
- });
- },
- // 1.2 加入黑名单
- joinBlacklist(id, index) {
- let self = this;
- self.$confirm('将该视频加入黑名单, 是否继续', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- self.listLoading = true;
- request({
- params: {
- r: 'short-video/video/join-blacklist',
- id: id,
- },
- method: 'get',
- }).then(e => {
- self.listLoading = false;
- if (e.data.code === 0) {
- self.$message.success(e.data.msg);
- self.list.splice(index, 1);
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- console.log(e);
- });
- }).catch(() => {
- self.$message.info('已取消')
- });
- },
- // 1.0 获取视频列表
- loadData(page, others) {
- this.loading = true;
- request({
- method: 'get',
- params: {
- r: 'short-video/default/repair',
- },
- method: 'get'
- }).then(e => {
- this.loading = false;
- if (e.data.code === 0) {
- this.list = e.data.data;
- this.repairData();
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {});
- },
- pageChange(page) {
- this.page = page;
- this.loadData(this.page, this.search);
- },
- handleClick(tab, event) {
- this.page = 1;
- this.search.status = this.activeName;
- this.loadData(this.page, this.search)
- },
- handleSelectionChange(val) {
- let self = this;
- self.choose_list = [];
- val.forEach(function(item) {
- self.choose_list.push(item.id);
- })
- },
- searchs() {
- this.page = 1;
- this.loadData(this.page, this.search);
- },
- clearSearchs() {
- this.search.related_type = 0;
- this.search.video_title = null;
- this.search.user_nickname = null;
- this.search.start_time = null;
- this.search.end_time = null;
- this.time = [];
- this.page = 1;
- this.loadData(this.page, this.search);
- },
- // 时间搜索选中
- selectedDateTime(val) {
- console.log(val);
- if (val) {
- this.search.start_time = val[0] / 1000;
- this.search.end_time = val[1] / 1000;
- } else {
- this.time = [];
- this.search.start_time = null;
- this.search.end_time = null;
- }
- this.loadData(1, this.search);
- },
- handleMetadataLoaded() {
- this.detail.duration_seconds = this.$refs.videoPlayer.duration;
- request({
- params: {
- r: 'short-video/default/video-detail',
- },
- method: 'post',
- data: {
- form: this.detail
- },
- }).then(e => {
- this.loading = false;
- this.integralMine = false;
- this.moneyMine = false;
- if (e.data.code === 0) {
- this.$message.success(e.data.msg);
- // 从新获取数据
- this.getDetails();
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {});
- },
- repairData() {
- var i = 0;
- // this.detail = this.list[i];
-
- setInterval(() => {
- this.changeData(i);
- i++;
- // console.log('111', i);
- }, 2000);
- },
- changeData(i) {
- if (this.list[i] == null) {
- this.$message.error('已无可修复数据');
- }
- this.detail = this.list[i];
- }
- }
- });
- </script>
- <style>
- .el-tabs__header {
- font-size: 16px;
- }
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .table-body .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- }
- .input-item {
- width: 250px;
- margin: 0 0 20px;
- display: inline-block;
- }
- .input-item .el-input__inner {
- border-right: 0;
- }
- .input-item .el-input__inner:hover {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input__inner:focus {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input-group__append {
- background-color: #fff;
- border-left: 0;
- width: 10%;
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- margin: 0;
- }
- .batch {
- margin: 0 0 20px;
- display: inline-block;
- }
- .batch .el-button {
- padding: 9px 15px !important;
- }
- .item-box {
- margin-right: 20px;
- }
- .item-box .label {
- margin-right: 8px;
- }
- .form-nickname {
- width: 180px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .index-video-url {
- width: 300px;
- }
- .index-video-url video {
- width: 100%;
- }
- .index-related-info {
- width: 500px;
- }
- .video-top {
- width: 100%;
- display: flex;
- align-items: flex-start;
- box-sizing: border-box;
- padding: 20px;
- /* opacity: .5; */
- background-color: #FFFFFF;
- }
- .video-top .top-right {
- line-height: 26px;
- }
- .video-top .top-right .top-title {
- font-size: 18px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- width: 360px;
- }
- .video-top .top-right .wrapper {
- display: flex;
- /* align-items: flex-start; */
- }
- .video-top .top-right .wrapper .to-copy {
- /* color: #03C5FF; */
- margin-left: 20px;
- }
- .video-top .top-right .detail-price {
- color: #BC0100;
- font-size: 18px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- }
- /* .atooltip {
- background: #FFFFFF !important;
- border: none !important;
- } */
- .el-table th>.cell {
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .el-table__footer-wrapper,
- .el-table__header-wrapper {
- border-bottom: 1.4px solid #D6D6D6;
- }
- </style>
|