123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983 |
- $(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 tpFilesArr = [];
- 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]);
- };
- 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]);
- };
- let tpInputFile3 = document.getElementById("uploadImg3");
- let tpTheFile3;
- tpInputFile3.onchange = function () {
- // 获取用户上传的文件对象
- tpTheFile3 = tpInputFile3.files;
- // 实例化一个文件读取器
- let fileReader = new FileReader();
- // 文件读取器方法执行完毕后调用函数
- fileReader.onload = function () {
- $("#TPImg3").attr("src", fileReader.result);
- tpFilesArr.push(tpTheFile3[0]);
- };
- // 将用户上传的文件对象作为参数,传入文件读取器的方法readAsDateURL
- fileReader.readAsDataURL(tpTheFile3[0]);
- };
- let tpInputFile4 = document.getElementById("uploadImg4");
- let tpTheFile4;
- tpInputFile4.onchange = function () {
- // 获取用户上传的文件对象
- tpTheFile4 = tpInputFile4.files;
- // 实例化一个文件读取器
- let fileReader = new FileReader();
- // 文件读取器方法执行完毕后调用函数
- fileReader.onload = function () {
- $("#TPImg4").attr("src", fileReader.result);
- tpFilesArr.push(tpTheFile4[0]);
- };
- // 将用户上传的文件对象作为参数,传入文件读取器的方法readAsDateURL
- fileReader.readAsDataURL(tpTheFile4[0]);
- };
- let tpInputFile5 = document.getElementById("uploadImg5");
- let tpTheFile5;
- tpInputFile5.onchange = function () {
- // 获取用户上传的文件对象
- tpTheFile5 = tpInputFile5.files;
- // 实例化一个文件读取器
- let fileReader = new FileReader();
- // 文件读取器方法执行完毕后调用函数
- fileReader.onload = function () {
- $("#TPImg5").attr("src", fileReader.result);
- tpFilesArr.push(tpTheFile5[0]);
- };
- // 将用户上传的文件对象作为参数,传入文件读取器的方法readAsDateURL
- fileReader.readAsDataURL(tpTheFile5[0]);
- };
- let tpInputFile6 = document.getElementById("uploadImg6");
- let tpTheFile6;
- tpInputFile6.onchange = function () {
- // 获取用户上传的文件对象
- tpTheFile6 = tpInputFile6.files;
- // 实例化一个文件读取器
- let fileReader = new FileReader();
- // 文件读取器方法执行完毕后调用函数
- fileReader.onload = function () {
- $("#TPImg6").attr("src", fileReader.result);
- tpFilesArr.push(tpTheFile6[0]);
- };
- // 将用户上传的文件对象作为参数,传入文件读取器的方法readAsDateURL
- fileReader.readAsDataURL(tpTheFile6[0]);
- };
- let tpInputFile7 = document.getElementById("uploadImg7");
- let tpTheFile7;
- tpInputFile7.onchange = function () {
- // 获取用户上传的文件对象
- tpTheFile7 = tpInputFile7.files;
- // 实例化一个文件读取器
- let fileReader = new FileReader();
- // 文件读取器方法执行完毕后调用函数
- fileReader.onload = function () {
- $("#TPImg7").attr("src", fileReader.result);
- tpFilesArr.push(tpTheFile7[0]);
- };
- // 将用户上传的文件对象作为参数,传入文件读取器的方法readAsDateURL
- fileReader.readAsDataURL(tpTheFile7[0]);
- };
- let tpInputFile8 = document.getElementById("uploadImg8");
- let tpTheFile8;
- tpInputFile8.onchange = function () {
- // 获取用户上传的文件对象
- tpTheFile8 = tpInputFile8.files;
- // 实例化一个文件读取器
- let fileReader = new FileReader();
- // 文件读取器方法执行完毕后调用函数
- fileReader.onload = function () {
- $("#TPImg8").attr("src", fileReader.result);
- tpFilesArr.push(tpTheFile8[0]);
- };
- // 将用户上传的文件对象作为参数,传入文件读取器的方法readAsDateURL
- fileReader.readAsDataURL(tpTheFile8[0]);
- };
- let tpInputFile9 = document.getElementById("uploadImg9");
- let tpTheFile9;
- tpInputFile9.onchange = function () {
- // 获取用户上传的文件对象
- tpTheFile9 = tpInputFile9.files;
- // 实例化一个文件读取器
- let fileReader = new FileReader();
- // 文件读取器方法执行完毕后调用函数
- fileReader.onload = function () {
- $("#TPImg9").attr("src", fileReader.result);
- tpFilesArr.push(tpTheFile9[0]);
- };
- // 将用户上传的文件对象作为参数,传入文件读取器的方法readAsDateURL
- fileReader.readAsDataURL(tpTheFile9[0]);
- };
- // 功能-上传视频-打开上传视频窗口
- $("#SPImg1").on("click", function () {
- $("#uploadVideo1").click();
- });
- // 功能-上传视频-打开上传视频窗口
- $("#SPImg2").on("click", function () {
- $("#uploadVideo2").click();
- });
- // 功能-上传视频-打开上传视频窗口
- $("#SPImg3").on("click", function () {
- $("#uploadVideo3").click();
- });
- // 功能-上传视频-打开上传视频窗口
- $("#SPImg4").on("click", function () {
- $("#uploadVideo4").click();
- });
- // 功能-上传视频-打开上传视频窗口
- $("#SPImg5").on("click", function () {
- $("#uploadVideo5").click();
- });
- // 功能-上传视频-打开上传视频窗口
- $("#SPImg6").on("click", function () {
- $("#uploadVideo6").click();
- });
- // 功能-上传视频-打开上传视频窗口
- $("#SPImg7").on("click", function () {
- $("#uploadVideo7").click();
- });
- // 功能-上传视频-打开上传视频窗口
- $("#SPImg8").on("click", function () {
- $("#uploadVideo8").click();
- });
- // 功能-上传视频-打开上传视频窗口
- $("#SPImg9").on("click", function () {
- $("#uploadVideo9").click();
- });
- // 功能-上传图片-打开上传图片窗口
- $("#TPImg1").on("click", function () {
- $("#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 () {
- $(".HoutaiContainerDialogAdd").hide();
- });
- // 功能-新增-反差内容-确认新增
- $(".HoutaiContainerDialogLine5RightAdd").on("click", function () {
- if ($(this).text() == "正在上传中") {
- alert("正在上传中!请耐心等待!!!");
- return;
- }
- $(this).text("正在上传中");
- $(this).css("background", "#575f6e");
- var formFile = new FormData();
- formFile.append("title", $("#inputtext1").val());
- formFile.append("uploader", "5");
- 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: "5",
- 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 = [];
- if (value.img_url) {
- splitImgArray = value.img_url.split(",");
- }
- console.log(splitImgArray);
- AppleListHTML += `
- <div id="${value.id}" class="HoutaiContainerBottomAppleListHeaders">`;
- AppleListHTML += `<p class="HoutaiContainerBottomAppleListHeaderBT">${value.title}</p>`;
- AppleListHTML += `<p class="HoutaiContainerBottomAppleListHeaderTP">${splitImgArray[0]
- ? `<img type="${value.type}" url="${value.m3u8_url}" imgurl="${splitImgArray[0]}" src="${splitImgArray[0]}" alt="">`
- : ""
- }</p>`;
- AppleListHTML += `<p class="HoutaiContainerBottomAppleListHeaderTP">${splitImgArray[1]
- ? `<img type="${value.type}" url="${value.m3u8_url}" imgurl="${splitImgArray[1]}" src="${splitImgArray[1]}" alt="">`
- : ""
- }</p>`;
- AppleListHTML += `<p class="HoutaiContainerBottomAppleListHeaderTP">${splitImgArray[2]
- ? `<img type="${value.type}" url="${value.m3u8_url}" imgurl="${splitImgArray[2]}" src="${splitImgArray[2]}" alt="">`
- : ""
- }</p>`;
- AppleListHTML += `<p class="HoutaiContainerBottomAppleListHeaderTP">${splitImgArray[3]
- ? `<img type="${value.type}" url="${value.m3u8_url}" imgurl="${splitImgArray[3]}" src="${splitImgArray[3]}" alt="">`
- : ""
- }</p>`;
- AppleListHTML += `<p class="HoutaiContainerBottomAppleListHeaderTP">${splitImgArray[4]
- ? `<img type="${value.type}" url="${value.m3u8_url}" imgurl="${splitImgArray[4]}" src="${splitImgArray[4]}" alt="">`
- : ""
- }</p>`;
- AppleListHTML += `<p class="HoutaiContainerBottomAppleListHeaderTP">${splitImgArray[5]
- ? `<img type="${value.type}" url="${value.m3u8_url}" imgurl="${splitImgArray[5]}" src="${splitImgArray[5]}" alt="">`
- : ""
- }</p>`;
- AppleListHTML += `<p class="HoutaiContainerBottomAppleListHeaderTP">${splitImgArray[6]
- ? `<img type="${value.type}" url="${value.m3u8_url}" imgurl="${splitImgArray[6]}" src="${splitImgArray[6]}" alt="">`
- : ""
- }</p>`;
- AppleListHTML += `<p class="HoutaiContainerBottomAppleListHeaderTP">${splitImgArray[7]
- ? `<img type="${value.type}" url="${value.m3u8_url}" imgurl="${splitImgArray[7]}" src="${splitImgArray[7]}" alt="">`
- : ""
- }</p>`;
- AppleListHTML += `<p class="HoutaiContainerBottomAppleListHeaderTP">${splitImgArray[8]
- ? `<img type="${value.type}" url="${value.m3u8_url}" imgurl="${splitImgArray[8]}" src="${splitImgArray[8]}" alt="">`
- : ""
- }</p>`;
- // }
- if (value.type == "0") {
- AppleListHTML += ` <p class="HoutaiContainerBottomAppleListHeaderNR chulizhong">待处理`;
- } else if (value.type == "1") {
- AppleListHTML += ` <p class="HoutaiContainerBottomAppleListHeaderNR chulizhong">处理中`;
- } else {
- AppleListHTML += `<p class="HoutaiContainerBottomAppleListHeaderNR">完成`;
- }
- AppleListHTML += `
- </p>
- <div class="HoutaiContainerBottomAppleListHeaderCZ">
- <p class="HoutaiContainerBottomAppleListHeaderCZsc">删除</p>
- </div>
- </div>
- `;
- });
- $("#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/tabBtn17?TabId=" + num;
- },
- });
- // 看图||看视频
- $(".HoutaiContainerBottomAppleListHeaderTP img").on(
- "click",
- function () {
- let type = $(this).attr("type");
- if (type == 1) {
- $(".bannerImgBJ").show();
- let imgurl = $(this).attr("imgurl");
- $(".bannerImg").attr("src", imgurl);
- } else {
- let url = $(this).attr("url");
- let type = $(this).attr("type");
- if (type == "2") {
- let videoHTML = `
- <div>
- <div id="h5">
- <img class="toogleImg" src="/Public/Admin/img/end.png" alt="">
- </div>
- </div>
- <div class="HoutaiContainerDialogLine4Check">
- <p class="HoutaiContainerDialogLine4CheckBtn btn checkbtn" id="qr">确认</p>
- </div>
- `;
- $(".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("播放完成");
- // if (ad.video.currentTime > '33') {//视频时间,单位’秒‘,建议减1秒
- $("#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();
- }
- );
- }
- }
- }
- );
- $(".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/Adminback/delete_take_photo",
- dataType: "json",
- data: {
- id: id,
- },
- success: function (res) {
- console.log(res);
- window.location.reload();
- },
- });
- }
- );
- },
- });
- }
- getData();
- });
|