$(document).ready(function () { let url = window.location.search; let id; let data; let videoSrc; var theRequest = new Object(); if (url.indexOf("?") != -1) { var str = url.substr(1); strs = str.split("&"); for (var i = 0; i < strs.length; i++) { theRequest[strs[i].split("=")[0]] = unescape( decodeURI(strs[i].split("=")[1]) ); } } let tabId = theRequest.TabId || 1; // 上传文件-视频 let spFilesArr = []; let spInputFile1 = document.getElementById("uploadVideo1"); let spTheFile1; spInputFile1.onchange = function () { // 获取用户上传的文件对象 spTheFile1 = spInputFile1.files; // 回显 // 实例化一个文件读取器 let fileReader = new FileReader(); fileReader.onload = function () { spFilesArr.push(spTheFile1[0]); }; //读取文件 fileReader.readAsDataURL(spTheFile1[0]); fileReader.onprogress = updateProgress1; }; let spInputFile2 = document.getElementById("uploadVideo2"); let spTheFile2; spInputFile2.onchange = function () { // 获取用户上传的文件对象 spTheFile2 = spInputFile2.files; // 回显 // 实例化一个文件读取器 let fileReader = new FileReader(); fileReader.onload = function () { spFilesArr.push(spTheFile2[0]); }; //读取文件 fileReader.readAsDataURL(spTheFile2[0]); fileReader.onprogress = updateProgress2; }; let spInputFile3 = document.getElementById("uploadVideo3"); let spTheFile3; spInputFile3.onchange = function () { // 获取用户上传的文件对象 spTheFile3 = spInputFile3.files; // 回显 // 实例化一个文件读取器 let fileReader = new FileReader(); fileReader.onload = function () { spFilesArr.push(spTheFile3[0]); }; //读取文件 fileReader.readAsDataURL(spTheFile3[0]); fileReader.onprogress = updateProgress3; }; let spInputFile4 = document.getElementById("uploadVideo4"); let spTheFile4; spInputFile4.onchange = function () { // 获取用户上传的文件对象 spTheFile4 = spInputFile4.files; // 回显 // 实例化一个文件读取器 let fileReader = new FileReader(); fileReader.onload = function () { spFilesArr.push(spTheFile4[0]); }; //读取文件 fileReader.readAsDataURL(spTheFile4[0]); fileReader.onprogress = updateProgress4; }; let spInputFile5 = document.getElementById("uploadVideo5"); let spTheFile5; spInputFile5.onchange = function () { // 获取用户上传的文件对象 spTheFile5 = spInputFile5.files; // 回显 // 实例化一个文件读取器 let fileReader = new FileReader(); fileReader.onload = function () { spFilesArr.push(spTheFile5[0]); }; //读取文件 fileReader.readAsDataURL(spTheFile5[0]); fileReader.onprogress = updateProgress5; }; let spInputFile6 = document.getElementById("uploadVideo6"); let spTheFile6; spInputFile6.onchange = function () { // 获取用户上传的文件对象 spTheFile6 = spInputFile6.files; // 回显 // 实例化一个文件读取器 let fileReader = new FileReader(); fileReader.onload = function () { spFilesArr.push(spTheFile6[0]); }; //读取文件 fileReader.readAsDataURL(spTheFile6[0]); fileReader.onprogress = updateProgress6; }; let spInputFile7 = document.getElementById("uploadVideo7"); let spTheFile7; spInputFile7.onchange = function () { // 获取用户上传的文件对象 spTheFile7 = spInputFile7.files; // 回显 // 实例化一个文件读取器 let fileReader = new FileReader(); fileReader.onload = function () { spFilesArr.push(spTheFile7[0]); }; //读取文件 fileReader.readAsDataURL(spTheFile7[0]); fileReader.onprogress = updateProgress7; }; let spInputFile8 = document.getElementById("uploadVideo8"); let spTheFile8; spInputFile8.onchange = function () { // 获取用户上传的文件对象 spTheFile8 = spInputFile8.files; // 回显 // 实例化一个文件读取器 let fileReader = new FileReader(); fileReader.onload = function () { spFilesArr.push(spTheFile8[0]); }; //读取文件 fileReader.readAsDataURL(spTheFile8[0]); fileReader.onprogress = updateProgress8; }; let spInputFile9 = document.getElementById("uploadVideo9"); let spTheFile9; spInputFile9.onchange = function () { // 获取用户上传的文件对象 spTheFile9 = spInputFile9.files; // 回显 // 实例化一个文件读取器 let fileReader = new FileReader(); fileReader.onload = function () { spFilesArr.push(spTheFile9[0]); }; //读取文件 fileReader.readAsDataURL(spTheFile9[0]); fileReader.onprogress = updateProgress9; }; // 上传文件-图片 // let tpInputFile1 = document.getElementById("uploadImg1"); // let tpTheFile1; // tpInputFile1.onchange = function () { // // 获取用户上传的文件对象 // tpTheFile1 = tpInputFile1.files; // // 实例化一个文件读取器 // let fileReader = new FileReader(); // // 文件读取器方法执行完毕后调用函数 // fileReader.onload = function () { // $("#TPImg1").attr("src", fileReader.result); // tpFilesArr.push(tpTheFile1[0]); // }; // // 将用户上传的文件对象作为参数,传入文件读取器的方法readAsDateURL // fileReader.readAsDataURL(tpTheFile1[0]); // // 获取用户上传的文件对象 // tpTheFile1 = tpInputFile1.files; // //获取选择图片的个数 // let length = tpTheFileRevise.length; // // 回显 // for (let i = 0; i < length; i++) { // // 实例化一个文件读取器 // let fileReader = new FileReader(); // fileReader.onload = function () { // tpFilesNumRevise++; // let imgDataHtml = `
// //
删除
//
`; // $(".HoutaiContainerDialogLine3ReviseImg").before(imgDataHtml); // tpFilesArrRevise.push(tpTheFileRevise[i]); // console.log(tpFilesArrRevise); // // 功能-添加中删除-反差内容-视频 // $("#delImg" + tpFilesNumRevise).on("click", function () { // tpFilesArrRevise.splice($(this).parent().index(), 1); // console.log(tpFilesArrRevise); // $(this).parent().remove(); // }); // }; // //读取文件 // fileReader.readAsDataURL(tpTheFileRevise[i]); // } // }; // 上传文件-图片 let tpFilesNum = 0; let tpallUploaderNum = 0; let tpInputFile = document.getElementById("uploadImg1"); let tpTheFile; let tpFilesArr = []; let TpFilesArrChild = []; tpInputFile.addEventListener('change', function () { tpTheFile = []; // 获取用户上传的文件对象 tpTheFile = tpInputFile.files; //获取选择图片的个数 let length = tpTheFile.length; tpallUploaderNum += length; if (length > 9) { alert("超过图片上传最大数量"); return } else { for (let j = 0; j < tpTheFile.length; j++) { const file = tpTheFile[j]; TpFilesArrChild.push(file); }; // console.log(TpFilesArrChild); if (TpFilesArrChild.length > 9) { tpFilesArr = TpFilesArrChild.slice(-9); } else { tpFilesArr = TpFilesArrChild; } // console.log(tpFilesArr); $(".HoutaiContainerDialogLine3ImgFile").remove(); for (let i = 0; i < tpFilesArr.length; i++) { // 实例化一个文件读取器 let fileReader = new FileReader(); fileReader.onload = function () { // console.log(tpFilesArr.slice(0, 9)); // console.log(tpFilesArr.length); // console.log(tpallUploaderNum); // tpFilesNum++; // console.log(fileReader.result); // if (tpallUploaderNum > 9) { // tpFilesArr.splice(tpFilesNum % 9, 1, tpTheFile[i]); // $("#HoutaiContainerDialogTPImg" + tpFilesNum % 9).attr("src", fileReader.result); // }4 // console.log(tpFilesArr); // if (tpFilesArr.length >= 9) { // $("#uploaderImgContent").hide(); // } else { // tpFilesArr.push(tpTheFile[i]); let imgDataHtml = `
`; $(".uploadImgCard").before(imgDataHtml); // } // console.log(tpFilesArr); // 功能-添加中删除-反差内容-视频 // $("#delImg" + tpFilesNum).on("click", function () { // tpallUploaderNum-=1; // console.log(tpallUploaderNum); // tpFilesArr.splice($(this).parent().index(), 1); // console.log(tpFilesArr); // $(this).parent().remove(); // tpFilesArr.length<9?$("#uploaderImgContent").show():""; // }); }; //读取文件 fileReader.readAsDataURL(tpFilesArr[i]); } } // console.log(length); // 回显 // console.log(tpFilesArr, "names"); }); // let tpInputFile2 = document.getElementById("uploadImg2"); // let tpTheFile2; // tpInputFile2.onchange = function () { // // 获取用户上传的文件对象 // tpTheFile2 = tpInputFile2.files; // // 实例化一个文件读取器 // let fileReader = new FileReader(); // // 文件读取器方法执行完毕后调用函数 // fileReader.onload = function () { // $("#TPImg2").attr("src", fileReader.result); // tpFilesArr.push(tpTheFile2[0]); // }; // // 将用户上传的文件对象作为参数,传入文件读取器的方法readAsDateURL // fileReader.readAsDataURL(tpTheFile2[0]); // }; // 功能-上传视频-打开上传视频窗口 $("#SPImg1").on("click", function () { if (tpFilesArr.length > 0) { alert("不能同时添加,图片+视频,请重新上传"); } else { $("#uploadVideo1").click(); } }); // 功能-上传视频-打开上传视频窗口 $("#SPImg2").on("click", function () { if (tpFilesArr.length > 0) { alert("不能同时添加,图片+视频,请重新上传"); } else { $("#uploadVideo2").click(); } }); // 功能-上传视频-打开上传视频窗口 $("#SPImg3").on("click", function () { if (tpFilesArr.length > 0) { alert("不能同时添加,图片+视频,请重新上传"); } else { $("#uploadVideo3").click(); } }); // 功能-上传视频-打开上传视频窗口 $("#SPImg4").on("click", function () { if (tpFilesArr.length > 0) { alert("不能同时添加,图片+视频,请重新上传"); } else { $("#uploadVideo4").click(); } }); // 功能-上传视频-打开上传视频窗口 $("#SPImg5").on("click", function () { if (tpFilesArr.length > 0) { alert("不能同时添加,图片+视频,请重新上传"); } else { $("#uploadVideo5").click(); } }); // 功能-上传视频-打开上传视频窗口 $("#SPImg6").on("click", function () { if (tpFilesArr.length > 0) { alert("不能同时添加,图片+视频,请重新上传"); } else { $("#uploadVideo6").click(); } }); // 功能-上传视频-打开上传视频窗口 $("#SPImg7").on("click", function () { if (tpFilesArr.length > 0) { alert("不能同时添加,图片+视频,请重新上传"); } else { $("#uploadVideo7").click(); } }); // 功能-上传视频-打开上传视频窗口 $("#SPImg8").on("click", function () { if (tpFilesArr.length > 0) { alert("不能同时添加,图片+视频,请重新上传"); } else { $("#uploadVideo8").click(); } }); // 功能-上传视频-打开上传视频窗口 $("#SPImg9").on("click", function () { if (tpFilesArr.length > 0) { alert("不能同时添加,图片+视频,请重新上传"); } else { $("#uploadVideo9").click(); } }); // 功能-上传图片-打开上传图片窗口 $("#TPImg1").on("click", function () { if (spFilesArr.length > 0) { alert("不能同时添加,图片+视频,请重新上传"); } else { $("#uploadImg1").click(); } }); // // 功能-上传图片-打开上传图片窗口 // $("#TPImg2").on("click", function () { // $("#uploadImg2").click(); // }); // // 功能-上传图片-打开上传图片窗口 // $("#TPImg3").on("click", function () { // $("#uploadImg3").click(); // }); // // 功能-上传图片-打开上传图片窗口 // $("#TPImg4").on("click", function () { // $("#uploadImg4").click(); // }); // // 功能-上传图片-打开上传图片窗口 // $("#TPImg5").on("click", function () { // $("#uploadImg5").click(); // }); // // 功能-上传图片-打开上传图片窗口 // $("#TPImg6").on("click", function () { // $("#uploadImg6").click(); // }); // // 功能-上传图片-打开上传图片窗口 // $("#TPImg7").on("click", function () { // $("#uploadImg7").click(); // }); // // 功能-上传图片-打开上传图片窗口 // $("#TPImg8").on("click", function () { // $("#uploadImg8").click(); // }); // // 功能-上传图片-打开上传图片窗口 // $("#TPImg9").on("click", function () { // $("#uploadImg9").click(); // }); // 功能-修改图片-修改上传图片 $("#GTPImg1").on("click", function () { $("#uploadImg1").click(); }); // // 功能-修改图片-修改上传图片 // $("#GTPImg2").on("click", function () { // $("#uploadImg2").click(); // }); // // 功能-修改图片-修改上传图片 // $("#GTPImg3").on("click", function () { // $("#uploadImg3").click(); // }); // // 功能-修改图片-修改上传图片 // $("#GTPImg4").on("click", function () { // $("#uploadImg4").click(); // }); // // 功能-修改图片-修改上传图片 // $("#GTPImg5").on("click", function () { // $("#uploadImg5").click(); // }); // // 功能-修改图片-修改上传图片 // $("#GTPImg6").on("click", function () { // $("#uploadImg6").click(); // }); // // 功能-修改图片-修改上传图片 // $("#GTPImg7").on("click", function () { // $("#uploadImg7").click(); // }); // // 功能-修改图片-修改上传图片 // $("#GTPImg8").on("click", function () { // $("#uploadImg8").click(); // }); // // 功能-修改图片-修改上传图片 // $("#GTPImg9").on("click", function () { // $("#uploadImg9").click(); // }); // 更新进度条 function updateProgress1(e) { // e 是一个 ProgressEvent. if (e.lengthComputable) { var percentLoaded = Math.round((e.loaded / e.total) * 100); // 更新进度条长度 if (percentLoaded <= 100) { $(`#uploadNum1`).text(`进度: ${percentLoaded}%`); } if (percentLoaded == 100) { $("#uploadNum1").addClass("uploadDel"); $("#uploadNum1").text("删除"); // 功能-添加中删除-反差内容-视频 $("#uploadNum1").on("click", function () { console.log($(this).parent().index()); spFilesArr.splice($(this).parent().index(), 1); console.log(spFilesArr); $(this).text("进度: 0%"); $(this).removeClass("uploadDel"); }); } } } function updateProgress2(e) { // e 是一个 ProgressEvent. if (e.lengthComputable) { var percentLoaded = Math.round((e.loaded / e.total) * 100); // 更新进度条长度 if (percentLoaded <= 100) { $(`#uploadNum2`).text(`进度: ${percentLoaded}%`); } if (percentLoaded == 100) { $("#uploadNum2").addClass("uploadDel"); $("#uploadNum2").text("删除"); // 功能-添加中删除-反差内容-视频 $("#uploadNum2").on("click", function () { console.log($(this).parent().index()); spFilesArr.splice($(this).parent().index(), 1); console.log(spFilesArr); $(this).text("进度: 0%"); $(this).removeClass("uploadDel"); }); } } } function updateProgress3(e) { // e 是一个 ProgressEvent. if (e.lengthComputable) { var percentLoaded = Math.round((e.loaded / e.total) * 100); // 更新进度条长度 if (percentLoaded <= 100) { $(`#uploadNum3`).text(`进度: ${percentLoaded}%`); } if (percentLoaded == 100) { $("#uploadNum3").addClass("uploadDel"); $("#uploadNum3").text("删除"); // 功能-添加中删除-反差内容-视频 $("#uploadNum3").on("click", function () { // console.log($(this).parent().index()); spFilesArr.splice($(this).parent().index(), 1); // console.log(spFilesArr); $(this).text("进度: 0%"); $(this).removeClass("uploadDel"); }); } } } function updateProgress4(e) { // e 是一个 ProgressEvent. if (e.lengthComputable) { var percentLoaded = Math.round((e.loaded / e.total) * 100); // 更新进度条长度 if (percentLoaded <= 100) { $(`#uploadNum4`).text(`进度: ${percentLoaded}%`); } if (percentLoaded == 100) { $("#uploadNum4").addClass("uploadDel"); $("#uploadNum4").text("删除"); // 功能-添加中删除-反差内容-视频 $("#uploadNum4").on("click", function () { console.log($(this).parent().index()); spFilesArr.splice($(this).parent().index(), 1); console.log(spFilesArr); $(this).text("进度: 0%"); $(this).removeClass("uploadDel"); }); } } } function updateProgress5(e) { // e 是一个 ProgressEvent. if (e.lengthComputable) { var percentLoaded = Math.round((e.loaded / e.total) * 100); // 更新进度条长度 if (percentLoaded <= 100) { $(`#uploadNum5`).text(`进度: ${percentLoaded}%`); } if (percentLoaded == 100) { $("#uploadNum5").addClass("uploadDel"); $("#uploadNum5").text("删除"); // 功能-添加中删除-反差内容-视频 $("#uploadNum5").on("click", function () { console.log($(this).parent().index()); spFilesArr.splice($(this).parent().index(), 1); console.log(spFilesArr); $(this).text("进度: 0%"); $(this).removeClass("uploadDel"); }); } } } function updateProgress6(e) { // e 是一个 ProgressEvent. if (e.lengthComputable) { var percentLoaded = Math.round((e.loaded / e.total) * 100); // 更新进度条长度 if (percentLoaded <= 100) { $(`#uploadNum6`).text(`进度: ${percentLoaded}%`); } if (percentLoaded == 100) { $("#uploadNum6").addClass("uploadDel"); $("#uploadNum6").text("删除"); // 功能-添加中删除-反差内容-视频 $("#uploadNum6").on("click", function () { console.log($(this).parent().index()); spFilesArr.splice($(this).parent().index(), 1); console.log(spFilesArr); $(this).text("进度: 0%"); $(this).removeClass("uploadDel"); }); } } } function updateProgress7(e) { // e 是一个 ProgressEvent. if (e.lengthComputable) { var percentLoaded = Math.round((e.loaded / e.total) * 100); // 更新进度条长度 if (percentLoaded <= 100) { $(`#uploadNum7`).text(`进度: ${percentLoaded}%`); } if (percentLoaded == 100) { $("#uploadNum7").addClass("uploadDel"); $("#uploadNum7").text("删除"); // 功能-添加中删除-反差内容-视频 $("#uploadNum7").on("click", function () { console.log($(this).parent().index()); spFilesArr.splice($(this).parent().index(), 1); console.log(spFilesArr); $(this).text("进度: 0%"); $(this).removeClass("uploadDel"); }); } } } function updateProgress8(e) { // e 是一个 ProgressEvent. if (e.lengthComputable) { var percentLoaded = Math.round((e.loaded / e.total) * 100); // 更新进度条长度 if (percentLoaded <= 100) { $(`#uploadNum8`).text(`进度: ${percentLoaded}%`); } if (percentLoaded == 100) { $("#uploadNum8").addClass("uploadDel"); $("#uploadNum8").text("删除"); // 功能-添加中删除-反差内容-视频 $("#uploadNum8").on("click", function () { console.log($(this).parent().index()); spFilesArr.splice($(this).parent().index(), 1); console.log(spFilesArr); $(this).text("进度: 0%"); $(this).removeClass("uploadDel"); }); } } } function updateProgress9(e) { // e 是一个 ProgressEvent. if (e.lengthComputable) { var percentLoaded = Math.round((e.loaded / e.total) * 100); // 更新进度条长度 if (percentLoaded <= 100) { $(`#uploadNum9`).text(`进度: ${percentLoaded}%`); } if (percentLoaded == 100) { $("#uploadNum9").addClass("uploadDel"); $("#uploadNum9").text("删除"); // 功能-添加中删除-反差内容-视频 $("#uploadNum9").on("click", function () { console.log($(this).parent().index()); spFilesArr.splice($(this).parent().index(), 1); console.log(spFilesArr); $(this).text("进度: 0%"); $(this).removeClass("uploadDel"); }); } } } // 功能-新增-反差内容-弹窗展示 $(".SLHeaderCreate").on("click", function () { $(".HoutaiContainerDialogAdd").show(); }); // 功能-新增-反差内容-弹窗隐藏 $(".HoutaiContainerDialogLine5LeftAdd").on("click", function () { tpFilesArr = []; TpFilesArrChild = []; $(".HoutaiContainerDialogLine3ImgFile").remove(); $(".HoutaiContainerDialogAdd").hide(); }); // 功能-新增-反差内容-确认新增 $(".HoutaiContainerDialogLine5RightAdd").on("click", function () { console.log(tpFilesArr); if (!$("#inputtext1").val()) { alert("请输入标题"); } else if (spFilesArr.length == 0 && tpFilesArr.length == 0) { alert("请上传文件"); } else { if ($(this).text() == "正在上传中") { alert("正在上传中!请耐心等待!!!"); return; } $(this).text("正在上传中"); $(this).css("background", "#575f6e"); var formFile = new FormData(); formFile.append("title", $("#inputtext1").val()); formFile.append("uploader", "4"); formFile.append("token", "b8e3bb6ef8747d7"); console.log(spFilesArr); for (let i in spFilesArr) { formFile.append("mp4[]", spFilesArr[i]); console.log(spFilesArr[i]); } console.log(tpFilesArr); for (let i in tpFilesArr) { formFile.append("img[]", tpFilesArr[i]); console.log(tpFilesArr[i]); } for (let value of formFile.values()) { console.log(value); } $.ajax({ type: "post", url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/pengyouquan_add", dataType: "json", data: formFile, async: true, cache: false, contentType: false, processData: false, success: function (res) { // alert("添加成功"); console.log(res); window.location.reload(); }, }); } }); // 接口调用-数据获取-反差列表 function getData() { $.ajax({ type: "post", url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/take_photo_on_street_list", dataType: "json", data: { type: "4", page: tabId, }, success: function (res) { console.log(res); data = res.data; $(".SLHeader p").text(`牛逼( ${res.all_num} )`); let AppleListHTML = ""; $.each(data, function (index, value) { let splitImgArray = []; let splitTopImgArray = []; let splitVideoArray = []; let splitTopVideoArray = []; let TongjiLength; if (value.img_url) { if (value.img_url) { splitImgArray = value.img_url.split(","); } if (splitImgArray.length < 9) { TongjiLength = 9 - splitImgArray.length; } if (value.top_img) { splitTopImgArray = value.top_img.split(","); } for (let i = 0; i < TongjiLength; i++) { splitImgArray.push(""); splitTopImgArray.push(""); } } else if (value.m3u8_url) { if (value.m3u8_url != "") { splitVideoArray = value.m3u8_url.split(","); } if (splitVideoArray.length < 9) { TongjiLength = 9 - splitVideoArray.length; } if (value.top_img) { splitTopVideoArray = value.top_img.split(","); } else { for (let i = 0; i < 9; i++) { splitVideoArray.push(""); } } for (let i = 0; i < TongjiLength; i++) { splitVideoArray.push(""); splitTopVideoArray.push(""); } } AppleListHTML += `
`; AppleListHTML += `

${value.title}

`; // AppleListHTML += `

${value.down_num}

`; if (value.img_url) { if (value.top_img == "") { for (let i = 0; i < 9; i++) { AppleListHTML += `

`; } } else { $.each(splitTopImgArray, function (i, value1) { AppleListHTML += `

${value1 ? `` : "" }

`; }) } } else if (value.m3u8_url) { $.each(splitTopVideoArray, function (i, value1) { AppleListHTML += `

${value1 ? `` : "" }

`; }) } else { for (let i = 0; i < 9; i++) { AppleListHTML += `

`; } } if (value.type == "0") { AppleListHTML += `

待处理`; } else if (value.type == "1") { AppleListHTML += `

处理中`; } else { AppleListHTML += `

完成`; } AppleListHTML += `

删除

`; }); $("#AppleList").html(AppleListHTML); }, complete: function (res, status) { console.log(res); $("#page").paging({ pageNo: tabId, totalPage: Math.ceil(res.responseJSON.all_num / 50), callback: function (num) { window.location.href = "https://api.9169kkxstzsjkdd222.app/tabBtn16?TabId=" + num; }, }); // 看图||看视频 $(".HoutaiContainerBottomAppleListHeaderTP1").on("click", function () { let type = $(this).attr("type"); // if (type == 1) { if ($(this).attr("imgurl")) { $(".bannerImgBJ").show(); let imgurl = $(this).attr("imgurl"); $(".bannerImg").attr("src", imgurl); } }); $(".HoutaiContainerBottomAppleListHeaderVideo").on("click", function () { if ($(this).attr("m3u8")) { let url = $(this).attr("m3u8"); player(url); } // let type = $(this).attr("type"); }) $(".bannerImgBJ").on("click", function () { $(this).fadeOut(300); }); // 功能-删除-反差内容-弹窗展示 $(".HoutaiContainerBottomAppleListHeaderCZsc").on( "click", function () { id = $(this).parent().parent().attr("id"); $(".HoutaiContainerDialogSC").show(); } ); // 功能-删除-反差内容-取消删除 $(".HoutaiContainerDialogASCdvertLeft").on( "click", function () { $(".HoutaiContainerDialogSC").hide(); } ); // 功能-删除-反差内容-确定删除 $(".HoutaiContainerDialogSCAdvertRight").on( "click", function () { $.ajax({ type: "post", url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/delete_cowb_data", dataType: "json", data: { id: id, }, success: function (res) { console.log(res); window.location.reload(); }, }); } ); }, }); } getData(); function player(url) { let videoHTML = `

确认

`; $(".HoutaiContainerDialogDeputyCheck").html( videoHTML ); let videoSrc = url; let videoImg = ""; var md = new MuiPlayer({ container: "#h5", title: "", // autoplay: true, initFullFixed: true, autoplay: false, themeColor: "#FF6A00", lang: "en", poster: videoImg, src: videoSrc, // src: 'https://www.9169slck.com/video/414958811/test/test.m3u8', parse: { type: "hls", loader: Hls, config: { debug: false, }, }, videoAttribute: [ { attrKey: "webkit-playsinline", attrValue: "webkit-playsinline", }, { attrKey: "playsinline", attrValue: "playsinline", }, { attrKey: "x5-video-player-type", attrValue: "h5-page", }, ], // plugins: [ // new MuiPlayerMobilePlugin({ // key: "01F01D01G01I01F01H01H01K01C01J01F01J01D01H01K", // showMenuButton: true, // }), // ], }); md.on("ready", function () { $("#h5").show(); $(".quanquan").hide(); document.querySelector( ".mplayer-header" ).style.display = "none"; md.on("seek-progress", function (e) { // console.log("names"); md.video().play(); }); md.video().onended = function () { // console.log("播放完成"); $("#mui-player").remove(); }; $(".toogleImg").on("click", function (e) { e.stopPropagation(); console.log($(this).attr("src")); let toogleStatus = $(this).attr("src"); if ( toogleStatus == "./Public/Admin/img/end.png" ) { md.video().play(); $(".toogleImg").attr( "src", "./Public/Admin/img/star.png" ); } else { md.video().pause(); $(".toogleImg").attr( "src", "./Public/Admin/img/end.png" ); } }); md.video().addEventListener( "playing", function () { $(".toogleImg").attr( "src", "./Public/Admin/img/star.png" ); console.log("开始播放"); md.toggleControls(false); } ); md.video().addEventListener( "pause", function () { console.log("暂停播放"); md.video().pause(); $(".toogleImg").attr( "src", "./Public/Admin/img/end.png" ); } ); }); $(".HoutaiContainerDialogCheck").show(); // 功能-查看-反差内容-弹窗隐藏 $(".HoutaiContainerDialogLine4CheckBtn").on( "click", function () { $( ".HoutaiContainerDialogDeputyCheck" ).html(""); $(".HoutaiContainerDialogCheck").hide(); } ); } // } });