<template>
	<el-tabs v-model="activeName" @tab-click="handleClick">
		<el-tab-pane label="微信短剧列表" name="first">
			<div style="position: relative;display: inline-block;margin: 5px;">
				<span>短剧名称：</span>
				<el-input style="width: 200px;" @keydown.enter.native="select" placeholder="请输入短剧名称" v-model="contentT">
				</el-input>&nbsp;&nbsp;
			</div>
			<div style="position: relative;display: inline-block;margin: 5px;">
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="select">查询
				</el-button>
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cleans">重置
				</el-button>
				<el-button style="margin-left:15px;" size="mini" type="warning" icon="document" @click="tongbuBtn">同步短剧
				</el-button>
			</div>
			<el-table v-loading="tableDataLoading" :data="tableData.list" height="600px">
				<el-table-column prop="courseId" label="编号" fixed="left" width="80"></el-table-column>
				<el-table-column prop="title" label="短剧名称" width="180" fixed="left"></el-table-column>
				<el-table-column prop="titleImg" label="封面图" width="150">
					<template slot-scope="scope">
						<el-popover placement="top-start" title="" trigger="hover">
							<img style="width: 50px; height: 50px" :src="scope.row.titleImg" alt="" slot="reference">
							<img style="width: 200px; height: 200px" :src="scope.row.titleImg" alt="">
						</el-popover>
					</template>
				</el-table-column>
				<el-table-column prop="wxCourseId" label="微信短剧ID"></el-table-column>
				<!-- <el-table-column prop="dyImgId" label="微信封面图ID" width="160"></el-table-column>
				<el-table-column prop="keyRecordNum" label="重点备案号" width="160"></el-table-column>
				<el-table-column prop="ordinaryRecordNum" label="普通备案号" width="160"></el-table-column>
				<el-table-column prop="registrationNum" label="登记号" width="160"></el-table-column>
				<el-table-column prop="licenseNum" label="许可证号" width="160"></el-table-column>
				<el-table-column prop="dyVersion" label="当前版本号" width="160"></el-table-column>
				<el-table-column prop="dyStatusContent" label="微信审核内容"></el-table-column>
				<el-table-column fixed="right" prop="dyStatus" label="提审状态" width="100">
					<template slot-scope="scope">
						<span style="color: #4f9dec;" v-if="scope.row.dyStatus === 1 ">已提交</span>
						<span v-if="scope.row.dyStatus === 2 ">已通过</span>
						<span v-if="scope.row.dyStatus === 3 ">已拒绝</span>
						<span v-if="scope.row.dyStatus === 4 ">已上线</span>
					</template>
				</el-table-column> -->
				<el-table-column prop="isPrice" label="是否收费" width="100">
					<template slot-scope="scope">
						<span v-if="scope.row.isPrice == 1 ">是</span>
						<span v-else>免费</span>
				
					</template>
				</el-table-column>
				<el-table-column prop="courseLabel" label="短剧标签" width="160"></el-table-column>
				<el-table-column prop="price" label="购买剧价格" width="100"></el-table-column>
				<el-table-column prop="payNum" label="购买次数" width="60"></el-table-column>
				
				<el-table-column prop="viewCounts" label="播放量" width="60"></el-table-column>
				<el-table-column prop="updateTime" label="更新时间" width="160"></el-table-column>
				<el-table-column fixed="right" label="操作" width="150" align="center">
					<template slot-scope="scope">
						<el-button class="btns" size="mini" type="primary" @click="refund1(scope.row)">剧集资源
						</el-button>
						<!-- <el-button class="btns" size="mini" type="primary" plain :disabled="!isAuth('missionWx:shangchuan')"
							@click="shangchuan(scope.row)">短剧上传</el-button>
						<el-button class="btns" size="mini" type="warning" :disabled="!isAuth('missionWx:songshen')"
							@click="songshen(scope.row)">短剧送审</el-button>
						<el-button class="btns" size="mini" type="warning" plain :disabled="!isAuth('missionWx:shangxian')"
							@click="shangxian(scope.row)">短剧上线</el-button>
						<el-button class="btns" size="mini" type="danger" :disabled="!isAuth('missionWx:update')"
							@click="xiugai(scope.row)">设置备案号</el-button> -->
					</template>
				</el-table-column>
			</el-table>
			<div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
					:page-sizes="[10, 20, 30, 40, 100, 200, 500]" :page-size="limit" :current-page="page"
					layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
				</el-pagination>
			</div>
			<!-- 设置备案号 -->
			<el-dialog title="设置备案号" :visible.sync="dialogFormVisible1" center width="80%">
				<div style="margin-bottom: 10px;">
					<span style="width: 200px;display: inline-block;text-align: right;">重点备案号：</span>
					<el-input v-model="keyRecordNum" style="width:50%;" placeholder="请输入重点备案号"></el-input>
				</div>
				<div style="margin-bottom: 10px;">
					<span style="width: 200px;display: inline-block;text-align: right;">普通备案号：</span>
					<el-input v-model="ordinaryRecordNum" style="width:50%;" placeholder="请输入普通备案号"></el-input>
				</div>
				<div style="margin-bottom: 10px;">
					<span style="width: 200px;display: inline-block;text-align: right;">登记号：</span>
					<el-input v-model="registrationNum" style="width:50%;" placeholder="请输入登记号"></el-input>
				</div>
				<div style="margin-bottom: 10px;">
					<span style="width: 200px;display: inline-block;text-align: right;">许可证号：</span>
					<el-input v-model="licenseNum" style="width:50%;" placeholder="请输入许可证号"></el-input>
				</div>
				<div slot="footer" class="dialog-footer">
					<el-button @click="dialogFormVisible1 = false">取 消</el-button>
					<el-button type="primary" @click="addDetails()">确 定</el-button>
				</div>
			</el-dialog>
			<!-- 视频详情列表 -->
			<el-dialog title="剧集资源列表" :visible.sync="dialogVisible" width="90%" center="">
				<div style="display: inline-block;">
					<!-- <div style="display: inline-block;">
						<span>是否推荐：</span>
						<el-select v-model="goods" style="width:150px;margin-left: 10px;" @change="chaxun()">
							<el-option v-for="item in goodsList" :key="item.classificationId"
								:label="item.classificationName" :value="item.classificationId">
							</el-option>
						</el-select>&nbsp;&nbsp;&nbsp;&nbsp;
					</div> -->
					<el-button style="margin-left:15px;" size="mini" type="primary" icon="document"
						@click="chaxun">刷新</el-button>
				</div>
				<el-table v-loading="tableDataLoadingJj" :data="curriList.list">
					<!-- <el-table-column type="selection"> @selection-change="changeFun"
					</el-table-column> -->
					<el-table-column prop="wxCourseDetailsId" label="微信视频ID" width="80" fixed="left"></el-table-column>
					<el-table-column prop="courseDetailsName" label="名称" fixed="left"></el-table-column>
					<el-table-column prop="titleImg" label="封面图">
						<template slot-scope="scope">
							<el-popover placement="top-start" title="" trigger="hover">
								<img style="width: 50px; height: 50px" :src="scope.row.titleImg" alt=""
									slot="reference">
								<img style="width: 200px; height: 200px" :src="scope.row.titleImg" alt="">
							</el-popover>
						</template>
					</el-table-column>
					<el-table-column prop="content" label="介绍" width="200"></el-table-column>
					<el-table-column prop="videoUrl" label="视频链接" width="150">
						<template slot-scope="scope">
							<el-button size="mini" type="primary" :disabled="!isAuth('mission:update')"
								style="margin: 5px;" @click="playVideo(scope.row.videoUrl)">播放视频
							</el-button>
						</template>
					</el-table-column>
					<el-table-column prop="goodNum" label="点赞数"></el-table-column>
					<el-table-column prop="price" label="集价格"></el-table-column>
					<el-table-column prop="isPrice" label="是否收费" align="center">
						<template slot-scope="scope">
							<div v-if="scope.row.isPrice == 1 ">是</div>
							<div v-else>免费</div>
							<el-switch v-model="scope.row.isPrice" @change="changeD(scope.row)"
								:active-value="openValue1" :inactive-value="closeValue1" active-color="#13ce66"
								inactive-color="#ff4949">
							</el-switch>
						</template>
					</el-table-column>
					<!-- <el-table-column label="操作" width="120" fixed="right">
						<template slot-scope="scope">
							<el-button size="mini" type="primary" :disabled="!isAuth('missionWx:shangchuan')"
								style="margin: 5px;" @click="shangchuanD(scope.row)">单集上传
							</el-button>
						</template>
					</el-table-column> -->
				</el-table>
				<div style="text-align: center;margin-top: 10px;">
					<el-pagination @size-change="handleSizeChange3" @current-change="handleCurrentChange3"
						:page-sizes="[10, 20, 30, 40, 100, 200, 500]" :page-size="limitS" :current-page="pageS"
						layout="total,sizes, prev, pager, next,jumper" :total="curriList.totalCount">
					</el-pagination>
				</div>
			</el-dialog>
			<!-- 添加视频 -->
			<el-dialog title="添加视频" :visible.sync="dialogFormVisible3" width="80%" center="">
				<div style="margin-bottom: 10px;">
					<span style="width: 200px;display: inline-block;text-align: right;">标题：</span>
					<el-input v-model="title" style="width:50%;" placeholder="请输入视频标题"></el-input>
				</div>
				<div style="margin-bottom: 10px;display:flex;">
					<span style="width: 200px;display: inline-block;text-align: right;">封面图：</span>
					<div
						style=" width:148px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;">
						<el-upload class="avatar-uploader" v-model="titleImg" :action="$http.adornUrl('alioss/upload')"
							:show-file-list="false" :on-success="handleAvatarSuccess5">
							<img v-if="titleImg" :src="titleImg" class="avatar"
								style="border-radius: 6px;width: 148px;height: 148px;" />
							<i v-else class="el-icon-plus avatar-uploader-icon iconss"></i>
						</el-upload>
					</div>
				</div>
				<div style="margin-bottom: 10px;display:flex;">
					<span style="width: 200px;display: inline-block;text-align: right;">上传视频：</span>
					<div
						style=" width:200px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;">
						<el-upload class="avatar-uploader" v-model="url" :action="$http.adornUrl('alioss/upload')"
							:show-file-list="false" multiple :on-success="handleAvatarSuccess3"
							:before-upload="beforeUploadVideo" :on-progress="beforeUpload">
							<video v-if="url" :src="url" class="avatar" controls="controls"
								style="width: 200px;height:148px;">您的浏览器不支持视频播放</video>
							<i v-else class="el-icon-plus avatar-uploader-icon iconss"></i>
							<el-progress type="circle" v-if="percentage>0 && percentage<=100" :percentage="percentage"
								color="#efefef"></el-progress>
						</el-upload>
					</div>
				</div>
				<div style="margin-bottom: 10px;">
					<span style="width: 200px;display: inline-block;text-align: right;">视频链接：</span>
					<el-input v-model="url" style="width:50%;" placeholder="请输入视频链接"></el-input>
				</div>

				<div style="margin-bottom: 10px;">
					<span style="width: 200px;display: inline-block;text-align: right;">集价格：</span>
					<el-input v-model="price" type="number" style="width:50%;" placeholder="请输入集价格"></el-input>
				</div>
				<div style="margin-bottom: 10px;">
					<span style="width: 200px;display: inline-block;text-align: right;">点赞数：</span>
					<el-input v-model="goodNum" type="number" style="width:50%;" placeholder="请输入点赞数"></el-input>
				</div>
				<div style="margin-bottom: 10px;">
					<span style="width: 200px;display: inline-block;text-align: right;">是否收费：</span>
					<el-radio-group v-model="isPrice">
						<el-radio :label="1">是</el-radio>
						<el-radio :label="2">免费</el-radio>
					</el-radio-group>
				</div>
				<div style="margin-bottom: 10px;">
					<span style="width: 200px;display: inline-block;text-align: right;">视频介绍：</span>
					<el-input v-model="content" style="width:50%;display: none;" placeholder="请输入视频介绍"></el-input>
					<quill-editor ref="myTextEditor" v-model="content" :options="quillOption"
						style="padding-bottom: 50px;height: 300px;width: 50%;display: inline-table;margin-bottom: 60px;">
					</quill-editor>
				</div>
				<div slot="footer" class="dialog-footer">
					<el-button @click="dialogFormVisible3 = false">取 消</el-button>
					<el-button type="primary" @click="addVideos()">确 定</el-button>
				</div>
			</el-dialog>
			<!-- 视频弹框 -->
			<el-dialog title="视频" :visible.sync="tableDateUrl" center width="600px">
				<video v-if="videoUrls!=''" :src="videoUrls" ref="videoRef" width="400" controls
					style="margin: 30px 70px;"></video>
				<video v-else ref="videoRef" width="400" style="margin: 30px 70px;" type="audio/wav"
					controls="controls"></video>
				<div slot="footer" class="dialog-footer">
					<el-button @click="tableDateUrl = false">取 消</el-button>
				</div>
			</el-dialog>
		</el-tab-pane>
	</el-tabs>
</template>

<script>
	import {
		quillEditor
	} from 'vue-quill-editor'
	import 'quill/dist/quill.core.css'
	import 'quill/dist/quill.snow.css'
	import 'quill/dist/quill.bubble.css'
	import quillConfig from '../locality/quill-config.js'
	// import videojs from "video.js";
	// import "video.js/dist/video-js.css";
	import Hls from 'hls.js';
	export default {
		components: {
			quillEditor
		},
		data() {
			return {
				openValue: 1,
				closeValue: 0,
				openValue1: 1,
				closeValue1: 2,
				contentT: '',
				courseType: 1, //资源类型 1:资源 2:链接
				isRecommend: 0, //是否推荐 1：推荐 0：不推荐
				statusType: 1, //上下架 1：上架 2：下架
				remark: '', //资源网盘地址
				title: '', //资源列表名称
				titleImg: '', //资源列表图片

				img: [], //详情图合集
				bannerImg: [], //轮播图
				privilege: [], //标签集合
				bq: '', //标签
				price: '', //价格
				payNum: '', //购买次数
				viewCounts: 0, //播放量
				details: '', //短剧介绍
				courseId: '', //短剧id
				curriList: {}, //短剧详情
				url: '', //视频链接
				isPrice: 1, //是否收费
				goodNum: '', //点赞数
				content: '', //视频简介
				over: 2,
				videoId: '',
				quillOption: quillConfig,
				fenleiId: '',
				fenleiIdT: '',
				fenleiId1: '',
				fenleiId2: '',
				limit: 10,
				page: 1,
				limitS: 10,
				pageS: 1,
				goods: '',
				goodsList: [{
						classificationName: '全部',
						classificationId: ''
					},
					{
						classificationName: '推荐',
						classificationId: 1
					}, {
						classificationName: '不推荐',
						classificationId: 2
					}
				],
				phone: '',
				status: 0,
				statesnum: [{ //短剧管理分类
					classificationName: '全部',
					classificationId: ''
				}],
				statesnum1: [],
				statesnum2: [],
				isRecommends: -1,
				isRecommendNum: [ //短剧管理分类
					{
						classificationName: '全部',
						classificationId: -1
					},
					{
						classificationName: '推荐',
						classificationId: 1
					}, {
						classificationName: '普通',
						classificationId: 0
					}
				],
				statuss: 0,
				statusNum: [ //上下架分类
					{
						classificationName: '全部',
						classificationId: 0
					},
					{
						classificationName: '上架',
						classificationId: 1
					}, {
						classificationName: '下架',
						classificationId: 2
					}
				],
				classificationId: '', //分类id
				content: '', //短剧搜索标题 拒绝理由
				classificationName: '', //分类名称
				formLabelWidth: '200px',
				activeName: 'first',
				dialogVisible: false,
				tableDataLoading: false,
				dialogFormVisible: false,
				dialogFormVisible1: false,
				dialogFormVisible2: false,
				dialogFormVisible3: false,
				tableData: {}, //短剧信息集合
				form: {
					classificationId: '',
					classificationName: ''
				},
				classifyData: [], //分类管理集合
				xg: 0,
				classifyId: 0,
				userIds: [], //用户列表
				nickName: '',
				percentage: 0,
				titles: '',
				types: '',
				tableDataLoadingUrl: false,
				dialogFormVisiblePl: false,
				urlList: [],
				show: false,
				// ------
				tableDateUrl: false,
				videoUrls: '',
				checkBoxData: [], //多选框选择的值
				dialogFormVisiblePltk: false,
				dialogFormVisiblePlsxj: false,

				dialogVisibleTj: false,
				tongjidata: {},
				tongjiListdata: {},
				info: {
					stockDate: this.getNowTime(), //日期
				},
				flag: 3,
				flags: [{
					value: 1,
					label: '按天查询'
				}, {
					value: 2,
					label: '按月查询'
				}, {
					value: 3,
					label: '按年查询'
				}],
				totalMoney: 0,
				tableDataLoadingJj: false,
				tableDataLoadingSr: false,
				isPriceT: '',
				overT: '',
				isPriceName: [{
						classificationName: '全部',
						classificationId: ''
					},
					{
						classificationName: '是',
						classificationId: 1
					}, {
						classificationName: '否',
						classificationId: 2
					}
				],
				keyRecordNum: '',
				ordinaryRecordNum: '',
				registrationNum: '',
				licenseNum: '',
				dyVersion: '',
			}
		},
		methods: {
			//处理默认选中当前日期
			getNowTime() {
				var now = new Date();
				var year = now.getFullYear(); //得到年份
				var month = now.getMonth(); //得到月份
				var date = now.getDate(); //得到日期
				var hh = now.getHours() < 10 ? "0" + now.getHours() : now.getHours();
				var mm = now.getMinutes() < 10 ? "0" + now.getMinutes() : now.getMinutes();
				var ss = now.getSeconds() < 10 ? "0" + now.getSeconds() : now.getSeconds();
				month = month + 1;
				month = month.toString().padStart(2, "0");
				date = date.toString().padStart(2, "0");
				var defaultDate = `${year}-${month}-${date}`;
				return defaultDate;
				this.$set(this.info, "stockDate", defaultDate);
			},
			// 详情跳转
			updates(row) {
				if (row.userId) {
					this.$router.push({
						path: '/userDetail',
						query: {
							userId: row.userId
						}
					})
				}

			},
			handleSizeChange(val) {
				this.limit = val
				this.dataSelect()
			},
			handleCurrentChange(val) {
				this.page = val
				this.dataSelect()
			},
			handleSizeChange2(val) {
				this.limit = val
				this.classifySelect()
			},
			handleCurrentChange2(val) {
				this.page = val
				this.classifySelect()
			},
			handleSizeChange3(val) {
				this.limitS = val
				this.curriculumList(this.courseId);
			},
			handleCurrentChange3(val) {
				this.pageS = val
				this.curriculumList(this.courseId);
			},

			handleSizeChangeTjlist(val) {
				this.limitS = val
				this.shourutongjiList(this.courseId);
			},
			handleCurrentChangeTjlist(val) {
				this.pageS = val
				this.shourutongjiList(this.courseId);
			},
			handleSizeChange5(val) {
				this.limit = val
				this.userClass();
			},
			handleCurrentChange5(val) {
				this.page = val
				this.userClass();
			},
			// tabs切换
			handleClick(tab, event) {
				if (tab._props.label == '微信短剧列表') {
					this.page = 1
					this.limit = 10
					this.dataSelect()
				}
			},
			// 查询短剧列表
			select() {
				this.page = 1
				this.limit = 10
				this.dataSelect()
			},
			// 重置短剧列表
			cleans() {
				this.phone = ''
				this.status = 0
				this.contentT = ''
				this.fenleiIdT = ''
				this.isRecommends = -1
				this.isPriceT = ''
				this.statuss = ''
				this.overT = ''
				this.dataSelect()
			},
			// 添加短剧列表
			tianjia() {
				this.titles = '添加短剧'
				this.xg = 0
				this.fenleiId1 = '';
				this.privilege = []
				this.img = []
				this.bannerImg = []
				this.details = '';
				this.viewCounts = 0
				this.isPrice = 2
				this.over = 2
				this.payNum = '';
				this.price = '';
				this.fenleiId2 = '';
				this.title = '';
				this.titleImg = '';
				this.courseId = ''
				this.remark = ''
				this.courseType = 1





				this.keyRecordNum = ''
				this.ordinaryRecordNum = ''
				this.registrationNum = ''
				this.licenseNum = ''
				this.dialogFormVisible1 = true
				this.classifySelect1()

			},
			// 修改资源列表
			xiugai(row) {
				this.titles = '修改资源'
				this.xg = 1
				console.log(row)
				this.fenleiId1 = row.classifyId;
				if (row.bannerId) {
					this.fenleiId2 = row.bannerId;
				}
				if (row.courseLabel) {
					this.privilege = row.courseLabel.split(',');
				}
				if (row.img) {
					this.img = row.img.split(',');
				}
				if (row.bannerImg) {
					this.bannerImg = row.bannerImg.split(',');
				} else {
					this.bannerImg = []
				}
				this.courseType = row.courseType
				this.remark = row.remark
				this.isRecommend = row.isRecommend
				this.statusType = row.status
				this.details = row.details;
				this.viewCounts = row.viewCounts;

				this.payNum = row.payNum;
				if (row.isPrice) {
					this.isPrice = row.isPrice
				} else {
					this.isPrice = 2
				}
				if (row.over) {
					this.over = row.over
				} else {
					this.over = 2
				}

				this.price = row.price;
				this.title = row.title;
				this.titleImg = row.titleImg;
				this.courseId = row.courseId



				if (row.keyRecordNum) {
					this.keyRecordNum = row.keyRecordNum
				} else {
					this.keyRecordNum = ''
				}
				if (row.ordinaryRecordNum) {
					this.ordinaryRecordNum = row.ordinaryRecordNum
				} else {
					this.ordinaryRecordNum = ''
				}
				if (row.registrationNum) {
					this.registrationNum = row.registrationNum
				} else {
					this.registrationNum = ''
				}
				if (row.licenseNum) {
					this.licenseNum = row.licenseNum
				} else {
					this.licenseNum = ''
				}



				this.dialogFormVisible1 = true
				// this.curriculumList(row.courseId)
				// this.classifySelect1()
			},
			// 封面图片上传
			handleAvatarSuccess5(file) {
				this.titleImg = file.data;
			},
			// 详情图片上传
			handleRemove(file) {
				console.log(file, this.img)
				this.img.push(file.data);
			},
			// 轮播图上传
			handleRemoveB(file) {
				console.log(file, this.bannerImg)
				this.bannerImg.push(file.data);
			},

			// 上传文档
			handleAvatarSuccessWd(file) {
				this.remark = file.data;
			},
			// 删除标签
			dels2(index) {
				this.privilege.splice(index, 1);
				console.log(this.privilege)
			},
			// 添加标签
			btnTj() {
				if (this.bq == '' || this.bq == ' ') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '请输入标签',
						type: 'warning'
					});
					return
				} else {
					console.log('this.bq', this.bq)
					this.privilege.push(this.bq)
					this.bq = ''
				}
			},
			// 确认添加列表
			addDetails() {
				// if (this.courseType == 2) {
				// 	if (this.remark == '') {
				// 		this.$notify({
				// 			title: '提示',
				// 			duration: 1800,
				// 			message: '请输入链接备注',
				// 			type: 'warning'
				// 		})
				// 		return
				// 	}
				// }

				if (this.keyRecordNum === '' && this.ordinaryRecordNum === '' && this.registrationNum === '' && this
					.licenseNum === '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '不能同时为空',
						type: 'warning'
					})
					return
				}

				this.$http({
					url: this.$http.adornUrl('course/updateDyCourse'),
					method: 'post',
					data: this.$http.adornData({
						'courseId': this.courseId,
						'keyRecordNum': this.keyRecordNum,
						'ordinaryRecordNum': this.ordinaryRecordNum,
						'registrationNum': this.registrationNum,
						'licenseNum': this.licenseNum,
					})
				}).then(({
					data
				}) => {
					var that = this
					if (data.code == 0) {

						that.$message({
							message: '操作成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								that.dialogFormVisible1 = false
								that.dataSelect()
							}
						})
					} else {
						that.$message({
							message: data.msg,
							type: 'warning',
							duration: 1500,
							onClose: () => {}
						})
					}

				})
			},
			// select选择事件
			animeDat(state) {
				this.page = 1
				console.log(state)
				this.dataSelect()
			},
			animeDat1(state) {
				this.fenleiId2 = state
			},
			animeDat2(state) {
				this.page = 1
				this.isRecommends = state
				this.dataSelect()
			},
			animeDat3(state) {
				this.page = 1
				this.statuss = state
				this.dataSelect()
			},
			// 获取派单数据列表
			dataSelect() {
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl('course/selectCourse'),
					method: 'get',
					params: this.$http.adornParams({
						'page': this.page,
						'limit': this.limit,
						'classifyId': this.fenleiIdT,
						'title': this.contentT,
						'isRecommend': this.isRecommends,
						'status': this.statuss,
						'isPrice': this.isPriceT,
						'over': this.overT,
						'wxCourse':1,
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data

					this.tableData = returnData
					console.log(this.tableData)
				})
			},
			// 删除短剧列表
			deles(row) {
				let delid = row.courseId
				this.$confirm(`确定删除此条信息?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl(`course/updateDelete/?id=${delid}`),
						method: 'get',
						params: this.$http.adornParams({})
					}).then(({
						data
					}) => {
						this.$message({
							message: '删除成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.dataSelect()
							}
						})
					})
				}).catch(() => {})
			},
			// 查看资源详情
			refund1(row) {
				this.pageS = 1
				this.types = row.courseType
				this.courseId = row.courseId
				this.curriculumList(this.courseId);
				this.dialogVisible = true

			},

			// 查询
			chaxun() {
				this.pageS = 1
				this.curriculumList(this.courseId);
			},
			// 获取短剧详情列表
			curriculumList(id) {
				this.tableDataLoadingJj = true
				this.$http({
					url: this.$http.adornUrl('course/selectCourseById'),
					method: 'get',
					params: this.$http.adornParams({
						'id': id,
						'page': this.pageS,
						'limit': this.limitS,
						'good': this.goods
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.tableDataLoadingJj = false
						this.curriList = data.data
						this.remark = data.data.list[0].videoUrl
						this.videoId = data.data.list[0].courseDetailsId
					}

				})
			},
			// 添加视频
			addVideo() {
				this.title = ''
				this.url = ''
				this.videoId = ''
				this.price = ''
				this.titleImg = ''
				this.goodNum = ''
				this.content = ''
				this.isPrice = 1
				this.dialogFormVisible3 = true
			},
			// 修改视频
			compileVideo(row) {
				this.title = row.courseDetailsName
				this.url = row.videoUrl
				this.videoId = row.courseDetailsId
				this.isPrice = row.isPrice
				this.price = row.price
				this.titleImg = row.titleImg
				this.goodNum = row.goodNum
				this.content = row.content

				this.dialogFormVisible3 = true
			},
			// 确认添加视频
			addVideos() {
				if (this.title == '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '请输入视频标题',
						type: 'warning'
					})
					return
				}
				if (this.url == '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '请上传视频',
						type: 'warning'
					})
					return
				}
				if (this.isPrice == 1) {
					if (Number(this.price) === '' || Number(this.price) <= 0) {
						this.$notify({
							title: '提示',
							duration: 1800,
							message: '集价格不能为空或不能小于0',
							type: 'warning'
						})
						return
					}
				} else {
					if (Number(this.price) === '') {
						this.$notify({
							title: '提示',
							duration: 1800,
							message: '集价格不能为空',
							type: 'warning'
						})
						return
					}
				}
				if (Number(this.goodNum) < 0) {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '点赞数不能小于0',
						type: 'warning'
					})
					return
				}
				if (this.videoId == '') {
					var urls = 'courseDetails/insertCourseDetails'
				} else {
					var urls = 'courseDetails/updateCourseDetails'
				}
				this.$http({
					url: this.$http.adornUrl(urls),
					method: 'post',
					data: this.$http.adornData({
						'courseId': this.courseId,
						'courseDetailsName': this.title,
						'videoUrl': this.url,
						'courseDetailsId': this.videoId,
						'isPrice': this.isPrice,
						'price': this.price,
						'titleImg': this.titleImg,
						'goodNum': this.goodNum,
						'content': this.content,
					})
				}).then(({
					data
				}) => {
					console.log('添加短剧视频', data)
					if (data.code == 0) {
						this.$message({
							message: '添加成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.title = ''
								this.url = ''
								this.videoId = ''
								this.dialogFormVisible3 = false
								this.curriculumList(this.courseId);
							}
						})
					} else {
						this.$notify({
							title: '提示',
							duration: 1800,
							message: data.msg,
							type: 'warning'
						})
					}

				})
			},
			// 删除视频
			deleteVideo(row) {
				let delid = row.courseDetailsId.toString()
				this.$confirm(`确定删除此条信息?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl(`courseDetails/deleteCourseDetails?ids=${delid}`),
						method: 'post',
						params: this.$http.adornParams({})
					}).then(({
						data
					}) => {
						if (data.code == 0) {
							this.$message({
								message: '删除成功',
								type: 'success',
								duration: 1500,
								onClose: () => {
									this.curriculumList(this.courseId)
								}
							})
						} else {
							this.$notify({
								title: '提示',
								duration: 1800,
								message: data.msg,
								type: 'warning'
							})
						}
					})
				}).catch(() => {})
			},
			// 视频上传
			handleAvatarSuccess3(file) {
				this.url = file.data;
				this.percentage = 0
			},
			// 限制上传格式
			beforeUploadVideo(file) {
				const isLt10M = file.size / 1024 / 1024 < 1024;
				if (['video/mp4', 'video/ogg', 'video/flv', 'video/avi', 'video/wmv', 'video/rmvb'].indexOf(file.type) == -
					1) {
					this.$message.error('请上传正确的视频格式');
					return false;
				}
				if (!isLt10M) {
					this.$message.error('上传视频大小不能超过1G哦!');
					return false;
				}
			},
			beforeUpload(file) {
				this.url = ''
				this.percentage = Math.ceil(file.percent)
			},
			// 批量导入视频弹框
			addVideoPl() {
				this.dialogFormVisiblePl = true
			},
			handleAvatarSuccessPl(file) {
				console.log('多个视频', file)
				this.urlList.push(file.data)
			},
			// 分类管理
			classifySelect() {
				this.$http({
					url: this.$http.adornUrl('courseClassification/selectCourseClassification'),
					method: 'get',
					params: this.$http.adornParams({
						'page': this.page,
						'limit': this.limit,
						'classificationName': ''
					})
				}).then(({
					data
				}) => {
					let returnData = data.data
					this.classifyData = returnData
					this.statesnum1 = data.data.list
					if (this.statesnum.length == 1) {
						for (var i in data.data.list) {
							this.statesnum.push(data.data.list[i])
						}
					}
				})
			},
			classifySelect1() {
				this.$http({
					url: this.$http.adornUrl('banner/selectBannerList'),
					method: 'get',
					params: this.$http.adornParams({
						'state': -1,
						'classify': 2,
					})
				}).then(({
					data
				}) => {
					let returnData = data.data
					this.classifyData = returnData
					this.statesnum2 = data.data

				})
			},
			// 添加分类弹框
			classifyStair() {
				this.dialogFormVisible = true
			},
			// 添加分类确定
			StairNoticeTo() {
				if (this.classificationName == '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '请输入分类名称',
						type: 'warning'
					})
					return
				}
				this.$http({
					url: this.$http.adornUrl('courseClassification/insertCourseClassification'),
					method: 'post',
					data: this.$http.adornData({
						'classificationName': this.classificationName
					})
				}).then(({
					data
				}) => {
					this.dialogFormVisible = false
					this.$message({
						message: '分类添加成功',
						type: 'success',
						duration: 1500,
						onClose: () => {
							this.classificationName = ''
							this.classifySelect()
						}
					})
				})
			},
			// 修改分类
			compile(index, rows) {
				this.dialogFormVisible2 = true
				this.form.classificationId = rows.classificationId
				this.form.classificationName = rows.classificationName
			},
			// 修改分类确定
			CompileNoticeTo() {
				if (this.form.classificationName == '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '请输入分类名称',
						type: 'warning'
					})
					return
				}
				this.$http({
					url: this.$http.adornUrl('courseClassification/updateCourseClassification'),
					method: 'post',
					data: this.$http.adornData({
						'classificationId': this.form.classificationId,
						'classificationName': this.form.classificationName
					})
				}).then(({
					data
				}) => {
					this.dialogFormVisible2 = false
					this.$message({
						message: '操作成功',
						type: 'success',
						duration: 1500,
						onClose: () => {
							this.classifySelect()
						}
					})
				})
			},
			//删除分类
			deleteStair(row) {
				let delid = row.classificationId
				this.$confirm(`确定删除此条信息?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl(`courseClassification/updateDelete?id=${delid}`),
						method: 'get',
						params: this.$http.adornParams({})
					}).then(({
						data
					}) => {
						this.$message({
							message: '删除成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.name = ''
								this.classifySelect()
							}
						})
					})
				}).catch(() => {})
			},



			handleSuccess(file) {
				console.log(file)
				this.url = file.data;
				console.log(file.data, this.url)
				this.tableDataLoadingUrl = false
			},
			handlePreview(file) {
				this.tableDataLoadingUrl = true
			},
			// 验证只能上传音频
			beforeAvatarUpload(file) {
				var testmsg = file.name.substring(file.name.lastIndexOf('.') + 1)
				const extension = testmsg === 'mp3'
				if (!extension) {
					this.$message({
						message: "上传文件只能是mp3格式！",
						type: 'error'
					})
				}
				return extension;
			},
			// 是否免费
			changeD(row) {
				if (row.price != null) {
					var price = row.price
				} else {
					var price = 0
				}

				if (row.isPrice == 1 && price == 0) {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '当前集价格为空或者为0，设置为收费前，请先设置集价格',
						type: 'warning'
					})
					this.curriculumList(this.courseId)
					return
				}
				this.$http({
					url: this.$http.adornUrl('courseDetails/updateCourseDetails'),
					method: 'post',
					data: this.$http.adornData({
						'courseId': row.courseId,
						'courseDetailsName': row.courseDetailsName,
						'videoUrl': row.videoUrl,
						'courseDetailsId': row.courseDetailsId,
						'isPrice': row.isPrice,
						'price': row.price,
						'titleImg': row.titleImg,
						'goodNum': row.goodNum,
						'content': row.content,
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.$message({
							message: '操作成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.curriculumList(this.courseId)
							}
						})
					} else {
						this.$message({
							message: data.msg,
							type: 'warning',
							duration: 1500,
							onClose: () => {
								this.curriculumList(this.courseId)
							}
						})
					}

				})
			},
			// 是否推荐
			changeT(row) {
				if (row.isPrice == 1 && row.good == 1) {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '推荐视频应为免费观看，请先设置视频为免费',
						type: 'warning'
					})
					this.curriculumList(this.courseId)
					return
				}
				this.$http({
					url: this.$http.adornUrl('courseDetails/updateCourseDetails'),
					method: 'post',
					data: this.$http.adornData({
						'courseDetailsId': row.courseDetailsId,
						'good': row.good,
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.$message({
							message: '操作成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.curriculumList(this.courseId)
							}
						})
					} else {
						this.$message({
							message: data.msg,
							type: 'warning',
							duration: 1500,
							onClose: () => {
								this.curriculumList(this.courseId)
							}
						})
					}

				})
			},
			// 是否完结
			changeW(row) {
				this.$http({
					url: this.$http.adornUrl('course/updateCourse'),
					method: 'post',
					data: this.$http.adornData({
						// params: this.$http.adornParams({
						'over': row.over,
						'courseId': row.courseId
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.$message({
							message: '操作成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.dataSelect()

							}
						})
					} else {
						this.$message({
							message: data.msg,
							type: 'warning',
							duration: 1500,
							onClose: () => {
								this.dataSelect()
							}
						})
					}

				})
			},
			// 是否展示同步短剧按钮
			xianshi() {
				this.$http({
					url: this.$http.adornUrl('common/type/247'),
					method: 'get',
					data: this.$http.adornData({})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						if (data.data.value == '是') {
							this.show = true
						}
					}
				})
			},
			// 同步短剧
			tongbu() {
				this.$confirm(`确定要同步短剧?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl('course/synCourse'),
						method: 'get',
						params: this.$http.adornParams({})
					}).then(({
						data
					}) => {
						if (data.code == 0) {
							this.$message({
								message: '操作成功',
								type: 'success',
								duration: 1500,
								onClose: () => {
									this.dataSelect()
								}
							})
						} else {
							this.$message({
								message: data.msg,
								type: 'warning',
								duration: 1500,
								onClose: () => {}
							})
						}

					})
				}).catch(() => {})
			},

			playVideo(url) {
				this.videoUrls = ''
				if (url.indexOf("m3u8") != -1) {
					var hls = new Hls();
					hls.loadSource(url);
					hls.attachMedia(this.$refs.videoRef);
					hls.on(Hls.Events.MANIFEST_PARSED, function() {
						this.$refs.videoRef.play();
					});
					this.tableDateUrl = true
				} else {
					this.tableDateUrl = true
					this.videoUrls = url;
				}
			},
			// 多选
			changeFun(val) {
				console.log('val---------', val)
				this.checkBoxData = val
			},
			// 批量修改弹框
			transferClcik(id) {
				this.price = ''
				this.content = ''
				this.titleImg = ''
				this.dialogFormVisiblePltk = true

			},
			// 批量修改
			updateVideos() {
				if (this.price === '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '请输入集价格',
						type: 'warning'
					})
					return
				}
				// if (Number(this.price)<0) {
				// 	this.$notify({
				// 		title: '提示',
				// 		duration: 1800,
				// 		message: '集价格不能小于0',
				// 		type: 'warning'
				// 	})
				// 	return
				// }
				var ids = this.checkBoxData.map(item => {
					return item.courseDetailsId
				})
				var datas = {
					ids: ids.toString(),
					price: this.price,
					titleImg: this.titleImg,
					content: this.content
				}
				if (this.titleImg === '') {
					datas.titleImg = null
				}
				if (this.content === '') {
					datas.content = null
				}
				this.$http({
					url: this.$http.adornUrl('course/updateCourseDetails'),
					method: 'post',
					params: this.$http.adornParams(datas)
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.$message({
							message: '操作成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.curriculumList(this.courseId)
								this.dialogFormVisiblePltk = false
							}
						})
					} else {
						this.$message({
							message: data.msg,
							type: 'warning',
							duration: 1500,
							onClose: () => {}
						})
					}
				})
			},
			// 批量上下架弹框
			shangxiajiaClcik() {
				this.isPrice = ''
				this.dialogFormVisiblePlsxj = true
			},
			// 批量上下架
			updateVideosSxj() {
				var ids = this.checkBoxData.map(item => {
					return item.courseId
				})
				this.$http({
					url: this.$http.adornUrl('course/updateCourseStatus'),
					method: 'post',
					params: this.$http.adornParams({
						'ids': ids.toString(),
						'status': this.isPrice,
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.$message({
							message: '操作成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.dataSelect()
								this.dialogFormVisiblePlsxj = false
							}
						})
					} else {
						this.$message({
							message: data.msg,
							type: 'warning',
							duration: 1500,
							onClose: () => {}
						})
					}
				})
			},
			// 批量删除
			deleteClcik() {
				var ids = this.checkBoxData.map(item => {
					return item.courseId
				})
				this.$confirm(`确定要批量删除信息?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl('course/deleteCourseByIds'),
						method: 'post',
						params: this.$http.adornParams({
							'ids': ids.toString(),
						})
					}).then(({
						data
					}) => {
						if (data.code == 0) {
							this.$message({
								message: '操作成功',
								type: 'success',
								duration: 1500,
								onClose: () => {
									this.dataSelect()
								}
							})
						} else {
							this.$message({
								message: data.msg,
								type: 'warning',
								duration: 1500,
								onClose: () => {}
							})
						}
					})
				}).catch(() => {})
			},
			// 批量删除剧集
			deleteClcikJj() {
				var ids = this.checkBoxData.map(item => {
					return item.courseDetailsId
				})
				this.$confirm(`确定要批量删除剧集?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl('course/deleteCourseDetailsByIds'),
						method: 'post',
						params: this.$http.adornParams({
							'ids': ids.toString(),
						})
					}).then(({
						data
					}) => {
						if (data.code == 0) {
							this.$message({
								message: '操作成功',
								type: 'success',
								duration: 1500,
								onClose: () => {
									this.curriculumList(this.courseId)
								}
							})
						} else {
							this.$message({
								message: data.msg,
								type: 'warning',
								duration: 1500,
								onClose: () => {}
							})
						}
					})
				}).catch(() => {})
			},
			// 查看收入统计
			shouru(row) {
				this.pageS = 1
				this.flag = 3
				this.types = row.courseType
				this.courseId = row.courseId
				this.shourutongji();
				this.shourutongjiList()
				this.dialogVisibleTj = true

			},
			// 获取短剧收入统计
			shourutongji(id) {
				this.$http({
					url: this.$http.adornUrl('order/selectCourseOrdersMoneyCount'),
					method: 'get',
					params: this.$http.adornParams({
						'courseId': this.courseId,
						// 'page': this.pageS,
						// 'limit': this.limitS,
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.tongjidata = data.data
					}
				})
			},
			// 获取短剧收入统计列表
			shourutongjiList(id) {
				this.totalMoney = 0
				this.tableDataLoadingSr = true
				this.$http({
					url: this.$http.adornUrl('order/selectOrders'),
					method: 'get',
					params: this.$http.adornParams({
						'courseId': this.courseId,
						'page': this.pageS,
						'limit': this.limitS,
						'time': this.info.stockDate,
						'flag': this.flag,
						'status': 1
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.tableDataLoadingSr = false
						for (var i in data.data.list) {
							if (data.data.list[i].payMoney) {
								this.totalMoney = this.totalMoney + Number(data.data.list[i].payMoney)
							}
						}
						this.tongjiListdata = data.data
					}
				})
			},
			chaxunTj() {
				this.pageS = 1
				this.shourutongjiList()
			},
			// 短剧上传
			shangchuan(row) {
				if (row.keyRecordNum) {
					this.keyRecordNum = row.keyRecordNum
				} else {
					this.keyRecordNum = ''
				}
				if (row.ordinaryRecordNum) {
					this.ordinaryRecordNum = row.ordinaryRecordNum
				} else {
					this.ordinaryRecordNum = ''
				}
				if (row.registrationNum) {
					this.registrationNum = row.registrationNum
				} else {
					this.registrationNum = ''
				}
				if (row.licenseNum) {
					this.licenseNum = row.licenseNum
				} else {
					this.licenseNum = ''
				}
				if (this.keyRecordNum === '' && this.ordinaryRecordNum === '' && this.registrationNum === '' && this
					.licenseNum === '') {
					this.$confirm(`当前短剧未设置备案号，是否前往设置?`, '提示', {
						confirmButtonText: '去设置备案号',
						cancelButtonText: '暂不设置，继续上传',
						type: 'warning'
					}).then(() => {
						this.dialogFormVisible1 = true
					}).catch(() => {
						this.$http({
							url: this.$http.adornUrl('course/dyVideoUpload'),
							method: 'post',
							params: this.$http.adornParams({
								'courseId': row.courseId
							})
						}).then(({
							data
						}) => {
							if (data.code == 0) {
								this.$message({
									message: '上传成功',
									type: 'success',
									duration: 1500,
									onClose: () => {
										this.dataSelect()
									}
								})
							} else {
								this.$message({
									message: data.msg,
									type: 'warning',
									duration: 1500,
									onClose: () => {}
								})
							}
						})
					})
					return
				} else {
					this.$confirm(`确定上传短剧?`, '提示', {
						confirmButtonText: '确定',
						cancelButtonText: '取消',
						type: 'warning'
					}).then(() => {
						this.$http({
							url: this.$http.adornUrl('course/dyVideoUpload'),
							method: 'post',
							params: this.$http.adornParams({
								'courseId': row.courseId
							})
						}).then(({
							data
						}) => {
							if (data.code == 0) {
								this.$message({
									message: '上传成功',
									type: 'success',
									duration: 1500,
									onClose: () => {
										this.dataSelect()
									}
								})
							} else {
								this.$message({
									message: data.msg,
									type: 'warning',
									duration: 1500,
									onClose: () => {}
								})
							}

						})
					}).catch(() => {})
				}

			},
			// 短剧送审
			songshen(row) {
				this.$confirm(`确定送审短剧?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl('course/dyVideoAudit'),
						method: 'post',
						params: this.$http.adornParams({
							'courseId': row.courseId
						})
					}).then(({
						data
					}) => {
						if (data.code == 0) {
							this.$message({
								message: '操作成功',
								type: 'success',
								duration: 1500,
								onClose: () => {
									this.dataSelect()
								}
							})
						} else {
							this.$message({
								message: data.msg,
								type: 'warning',
								duration: 1500,
								onClose: () => {}
							})
						}

					})
				}).catch(() => {})
			},
			// 短剧上线
			shangxian(row) {
				this.$confirm(`确定上线短剧?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl('course/dyVideoUp'),
						method: 'post',
						params: this.$http.adornParams({
							'courseId': row.courseId
						})
					}).then(({
						data
					}) => {
						if (data.code == 0) {
							this.$message({
								message: '操作成功',
								type: 'success',
								duration: 1500,
								onClose: () => {
									this.dataSelect()
								}
							})
						} else {
							this.$message({
								message: data.msg,
								type: 'warning',
								duration: 1500,
								onClose: () => {}
							})
						}

					})
				}).catch(() => {})
			},
			// 单集上传
			shangchuanD(row) {
				this.$confirm(`确定上传此集?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl('course/uploadCourseDetails'),
						method: 'post',
						params: this.$http.adornParams({
							'courseDetailsId': row.courseDetailsId
						})
					}).then(({
						data
					}) => {
						if (data.code == 0) {
							this.$message({
								message: '上传成功',
								type: 'success',
								duration: 1500,
								onClose: () => {
									this.curriculumList(this.courseId);
								}
							})
						} else {
							this.$message({
								message: data.msg,
								type: 'warning',
								duration: 1500,
								onClose: () => {}
							})
						}

					})
				}).catch(() => {})
			},
			// 同步短剧
			tongbuBtn(){
				this.$confirm(`确定同步短剧?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl('course/sysWxCourse'),
						method: 'get',
						params: this.$http.adornParams({})
					}).then(({
						data
					}) => {
						if (data.code == 0) {
							this.$message({
								message: '操作成功',
								type: 'success',
								duration: 1500,
								onClose: () => {
									this.dataSelect()
								}
							})
						} else {
							this.$message({
								message: data.msg,
								type: 'warning',
								duration: 1500,
								onClose: () => {}
							})
						}
				
					})
				}).catch(() => {})
			},
		},
		mounted() {
			this.classifySelect()
			this.classifySelect1()
			this.dataSelect()
			this.xianshi()

		}
	}
</script>

<style  scoped>
	.el-dialog {
		/* width: 65% !important; */
	}

	.imgs {
		position: relative;
		border-radius: 6px;
		width: 148px;
		height: 148px;
		margin-right: 10px;
		display: inline-block;
	}

	.dels {
		position: absolute;
		top: 0;
		left: 0;
		display: none;
	}

	.dels .el-icon-delete {
		line-height: 148px;
		padding-left: 58px;
		font-size: 25px;
		color: #fff;
	}

	.imgs:hover .dels {
		width: 100%;
		height: 100%;
		background: #000;
		display: block;
		opacity: 0.5;
	}

	.bqList {
		padding: 4px 14px;
		margin: 4px;
		border: 1px solid #efefef;
		font-size: 12px;
		color: #999;
		border-radius: 4px;
		margin-right: 15px;
	}

	.delss {
		display: none;
		position: relative;
	}

	.delss .el-icon-delete {
		position: absolute;
		top: 0;
	}

	.bqList:hover .delss {
		display: initial;
		opacity: 0.5;

	}

	.tj {
		padding: 4px;
		margin: 4px;
		font-size: 12px;
		border: 1px solid #ccc;
		border-radius: 4px;
	}

	.btns {
		margin: 4px 0 !important;
	}


	.video-box {
		width: 100%;
		max-width: 500px;
		max-height: 500px;
	}

	::v-deep .video-js .vjs-big-play-button {
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
	}

	.box {
		padding: 44px;
		border: 1px solid #eee;
		margin: 15px 10px;
	}

	.box_num {
		font-size: 14px;
		color: #66b1ff;
	}

	.box_num .box_color {
		color: #333;
		font-size: 14px;
		margin-bottom: 15px;
	}

	.box_num div span {
		font-size: 20px;
		margin-left: 5px;
	}

	.text_color {
		color: #4f9dec;
	}

	.text_color span {
		margin-right: 5px;
	}
</style>