123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826 |
- $(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 inputFileFM = document.getElementById("uploadAddFM");
- let theFileFM;
- inputFileFM.onchange = function () {
- // 获取用户上传的文件对象
- theFileFM = inputFileFM.files[0];
- // 实例化一个文件读取器
- let fileReader = new FileReader();
- // 将用户上传的文件对象作为参数,传入文件读取器的方法readAsDateURL
- fileReader.readAsDataURL(theFileFM);
- // 文件读取器方法执行完毕后调用函数
- fileReader.onload = function () {
- $("#FMImg").attr("src", fileReader.result);
- };
- };
- // 上传文件-图片
- let tpFilesNum = 0;
- let tpFilesArr = [];
- let tpInputFile = document.getElementById("uploadAddTP");
- let tpTheFile;
- tpInputFile.onchange = function () {
- // 获取用户上传的文件对象
- tpTheFile = tpInputFile.files;
- //获取选择图片的个数
- let length = tpTheFile.length;
- // 回显
- for (let i = 0; i < length; i++) {
- // 实例化一个文件读取器
- let fileReader = new FileReader();
- fileReader.onload = function () {
- tpFilesNum++;
- let imgDataHtml = `<div class="HoutaiContainerDialogLine3ImgFile">
- <img class="HoutaiContainerDialogTPImg" src="${fileReader.result}" alt="">
- <div class="delImg btn" id="delImg${tpFilesNum}">删除</div>
- </div>`;
- $(".HoutaiContainerDialogLine3AddImg").before(imgDataHtml);
- tpFilesArr.push(tpTheFile[i]);
- console.log(tpFilesArr);
- // 功能-添加中删除-反差内容-视频
- $("#delImg" + tpFilesNum).on("click", function () {
- tpFilesArr.splice($(this).parent().index(), 1);
- console.log(tpFilesArr);
- $(this).parent().remove();
- });
- };
- //读取文件
- fileReader.readAsDataURL(tpTheFile[i]);
- }
- };
- // 上传文件-视频
- let spFilesNum = 0;
- let spFilesArr = [];
- let spInputFile = document.getElementById("uploadAddSP");
- let spTheFile;
- spInputFile.onchange = function () {
- // 获取用户上传的文件对象
- spTheFile = spInputFile.files;
- //获取选择图片的个数
- let length = spTheFile.length;
- // 回显
- for (let i = 0; i < length; i++) {
- // 实例化一个文件读取器
- let fileReader = new FileReader();
- fileReader.onload = function () {
- spFilesNum++;
- let videoLineDataHtml = `<div class="HoutaiContainerDialogLine4VideoFile btn" id="HoutaiContainerDialogLine4VideoFile${spFilesNum}">
- <div class="videoFileName">视频文件 ${spTheFile[i].name}</div>
- <div class="delVideo">删除</div>
- </div>`;
- $(".HoutaiContainerDialogLine4RightAdd").append(
- videoLineDataHtml
- );
- spFilesArr.push(spTheFile[i]);
- // 功能-添加中删除-反差内容-视频
- $("#HoutaiContainerDialogLine4VideoFile" + spFilesNum).on(
- "click",
- function () {
- console.log($(this).index());
- spFilesArr.splice($(this).index() - 1, 1);
- console.log(spFilesArr);
- this.remove();
- }
- );
- };
- //读取文件
- fileReader.readAsDataURL(spTheFile[i]);
- }
- };
- // 修改上传文件-封面
- let inputFileFMRevise = document.getElementById("uploadReviseFM");
- let theFileFMRevise;
- inputFileFMRevise.onchange = function () {
- // 获取用户上传的文件对象
- theFileFMRevise = inputFileFMRevise.files[0];
- // 实例化一个文件读取器
- let fileReader = new FileReader();
- // 将用户上传的文件对象作为参数,传入文件读取器的方法readAsDateURL
- fileReader.readAsDataURL(theFileFMRevise);
- // 文件读取器方法执行完毕后调用函数
- fileReader.onload = function () {
- $("#RFMImg").attr("src", fileReader.result);
- };
- };
- // 修改上传文件-图片
- let tpFilesNumRevise = 0;
- let tpFilesArrRevise = [];
- let tpInputFileRevise = document.getElementById("uploadReviseTP");
- let tpTheFileRevise;
- tpInputFileRevise.onchange = function () {
- // 获取用户上传的文件对象
- tpTheFileRevise = tpInputFileRevise.files;
- //获取选择图片的个数
- let length = tpTheFileRevise.length;
- // 回显
- for (let i = 0; i < length; i++) {
- // 实例化一个文件读取器
- let fileReader = new FileReader();
- fileReader.onload = function () {
- tpFilesNumRevise++;
- let imgDataHtml = `<div class="HoutaiContainerDialogLine3ImgFile">
- <img class="HoutaiContainerDialogTPImg" src="${fileReader.result}" alt="">
- <div class="delImg btn" id="delImg${tpFilesNumRevise}">删除</div>
- </div>`;
- $(".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 spFilesNumRevise = 0;
- let spFilesArrRevise = [];
- let spInputFileRevise = document.getElementById("uploadReviseSP");
- let spTheFileRevise;
- spInputFileRevise.onchange = function () {
- // 获取用户上传的文件对象
- spTheFileRevise = spInputFileRevise.files;
- //获取选择图片的个数
- let length = spTheFileRevise.length;
- // 回显
- for (let i = 0; i < length; i++) {
- // 实例化一个文件读取器
- let fileReader = new FileReader();
- fileReader.onload = function () {
- spFilesNumRevise++;
- let videoLineDataHtml = `<div class="HoutaiContainerDialogLine4VideoFile btn" id="HoutaiContainerDialogLine4VideoFile${spFilesNumRevise}">
- <div class="videoFileName">视频文件 ${spTheFileRevise[i].name}</div>
- <div class="delVideo">删除</div>
- </div>`;
- $(".HoutaiContainerDialogLine4RightRevise").append(
- videoLineDataHtml
- );
- spFilesArrRevise.push(spTheFileRevise[i]);
- // 功能-添加中删除-反差内容-视频
- $("#HoutaiContainerDialogLine4VideoFile" + spFilesNumRevise).on(
- "click",
- function () {
- console.log($(this).index());
- spFilesArrRevise.splice($(this).index() - 1, 1);
- console.log(spFilesArrRevise);
- this.remove();
- }
- );
- };
- //读取文件
- fileReader.readAsDataURL(spTheFileRevise[i]);
- }
- };
- // 接口调用-数据获取-反差列表
- function getData() {
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackoneeight/facha_list",
- dataType: "json",
- data: {
- //async: false,
- token: "b8e3bb6ef8747d7",
- page: tabId,
- size: 50,
- },
- success: function (res) {
- console.log(res);
- data = res.data;
- $(".SLHeader p").text(`反差内容( ${res.amount} )`);
- let AppleListHTML = "";
- $.each(data, function (index, value) {
- AppleListHTML += `
- <div id="${value.id}" class="HoutaiContainerBottomAppleListHeaders">
- <p class="HoutaiContainerBottomAppleListHeaderFM">
- <img src="${value.head_img}" alt="">
-
- </p>
- <p class="HoutaiContainerBottomAppleListHeaderBT">${value.site}</p>
- <p class="HoutaiContainerBottomAppleListHeaderNR">
- `;
- let booklength =
- value.book.length > 4 ? 4 : value.book.length;
- for (let i = 0; i < booklength; i++) {
- AppleListHTML += `<img src="${value.book[i]}" alt="">`;
- }
- AppleListHTML += `
- </p>
- <div class="HoutaiContainerBottomAppleListHeaderCZ">
- <p class="HoutaiContainerBottomAppleListHeaderCZck">查看</p>
- <p class="HoutaiContainerBottomAppleListHeaderCZxg">修改</p>
- <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_count / 50),
- callback: function (num) {
- window.location.href =
- "https://api.9169kkxstzsjkdd222.app/contrast?TabId=" + num;
- },
- });
- let index;
- // 功能-删除-反差内容-弹窗展示
- $(".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/Adminbackoneeight/delete_fancha_list",
- dataType: "json",
- data: {
- token: "b8e3bb6ef8747d7",
- fc_id: id,
- },
- success: function (res) {
- console.log(res);
- window.location.reload();
- },
- });
- }
- );
- // 功能-修改-反差内容-弹窗展示
- $(".HoutaiContainerBottomAppleListHeaderCZxg").on(
- "click",
- function () {
- $(".HoutaiContainerDialogRevise").show();
- id = $(this).parent().parent().attr("id");
- index = $(this).parent().parent().index();
- // 修改弹窗-获取标题
- $(".HoutaiContainerDialogLine1RightRevise").val(
- data[index].site
- );
- // 修改弹窗-获取封面文件
- $("#RFMImg").attr("src", data[index].head_img);
- // 修改弹窗-获取图片文件
- console.log(data[index].book.length);
- for (let i = 0; i < data[index].book.length; i++) {
- tpFilesNumRevise++;
- let HoutaiContainerDialogLine2RightRevise = `<div class="HoutaiContainerDialogLine3ImgFile">
- <img class="HoutaiContainerDialogTPImg" src="${data[index].book[i]}" alt="">
- <div class="delImg btn" id="delImg${tpFilesNumRevise}">删除</div>
- </div>`;
- $(".HoutaiContainerDialogLine3ReviseImg").before(
- HoutaiContainerDialogLine2RightRevise
- );
- tpFilesArrRevise.push(data[index].book[i]);
- console.log(tpFilesArrRevise);
- // 功能-添加中删除-反差内容-视频
- $("#delImg" + tpFilesNumRevise).on(
- "click",
- function () {
- tpFilesArrRevise.splice(
- $(this).parent().index(),
- 1
- );
- console.log(tpFilesArrRevise);
- $(this).parent().remove();
- }
- );
- }
- // 修改弹窗-获取视频文件
- for (
- let i = 0;
- i < data[index].hj_video_url.length;
- i++
- ) {
- spFilesNumRevise++;
- let videoLineDataHtml = `<div class="HoutaiContainerDialogLine4VideoFile btn" id="HoutaiContainerDialogLine4VideoFileRevise${spFilesNumRevise}">
- <div class="videoFileName">视频文件 ${data[index].hj_video_url[i]}</div>
- <div class="delVideo">删除</div>
- </div>`;
- $(".HoutaiContainerDialogLine4RightRevise").append(
- videoLineDataHtml
- );
- spFilesArrRevise.push(data[index].hj_video_url[i]);
- // 功能-添加中删除-反差内容-视频
- $(
- "#HoutaiContainerDialogLine4VideoFileRevise" +
- spFilesNumRevise
- ).on("click", function () {
- console.log($(this).index());
- spFilesArrRevise.splice($(this).index() - 1, 1);
- console.log(spFilesArrRevise);
- this.remove();
- });
- }
- }
- );
- // 功能-修改-反差内容-弹窗隐藏
- $(".HoutaiContainerDialogLine5LeftRevise").on(
- "click",
- function () {
- tpFilesArrRevise = [];
- spFilesArrRevise = [];
- let HoutaiContainerDialogLine3RightReviseHTML = `
- <div class="HoutaiContainerDialogLine3ReviseImg btn">
- <img id="RTPImg" src="/Public/Admin/img/tttp.png" height="100%" width="100%">
- <input type="file" id="uploadReviseTP" multiple="multiple" />
- </div>`;
- $(".HoutaiContainerDialogLine3RightRevise").html(
- HoutaiContainerDialogLine3RightReviseHTML
- );
- let HoutaiContainerDialogLine4RightReviseHTML = `
- <div class="HoutaiContainerDialogLine4ReviseSP btn">
- <img id="RSPImg" src="/Public/Admin/img/tttp.png" height="100%" width="100%">
- <input type="file" id="uploadReviseSP" multiple />
- </div>`;
- $(".HoutaiContainerDialogLine4RightRevise").html(
- HoutaiContainerDialogLine4RightReviseHTML
- );
- $(".HoutaiContainerDialogRevise").hide();
- // 功能-修改封面-上传内容封面
- $(".HoutaiContainerDialogLine2RightRevise").on(
- "click",
- function () {
- $("#uploadReviseFM").click();
- }
- );
- // 功能-修改图片-打开上传图片窗口
- $("#RTPImg").on("click", function () {
- $("#uploadReviseTP").click();
- });
- // 功能-修改视频-打开上传视频窗口
- $("#RSPImg").on("click", function () {
- $("#uploadReviseSP").click();
- });
- // 修改上传文件-图片
- let tpInputFileRevise =
- document.getElementById("uploadReviseTP");
- let tpTheFileRevise;
- tpInputFileRevise.onchange = function () {
- // 获取用户上传的文件对象
- tpTheFileRevise = tpInputFileRevise.files;
- //获取选择图片的个数
- let length = tpTheFileRevise.length;
- // 回显
- for (let i = 0; i < length; i++) {
- // 实例化一个文件读取器
- let fileReader = new FileReader();
- fileReader.onload = function () {
- tpFilesNumRevise++;
- let imgDataHtml = `<div class="HoutaiContainerDialogLine3ImgFile">
- <img class="HoutaiContainerDialogTPImg" src="${fileReader.result}" alt="">
- <div class="delImg btn" id="delImg${tpFilesNumRevise}">删除</div>
- </div>`;
- $(
- ".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 spInputFileRevise =
- document.getElementById("uploadReviseSP");
- let spTheFileRevise;
- spInputFileRevise.onchange = function () {
- // 获取用户上传的文件对象
- spTheFileRevise = spInputFileRevise.files;
- //获取选择图片的个数
- let length = spTheFileRevise.length;
- // 回显
- for (let i = 0; i < length; i++) {
- // 实例化一个文件读取器
- let fileReader = new FileReader();
- fileReader.onload = function () {
- spFilesNumRevise++;
- let videoLineDataHtml = `<div class="HoutaiContainerDialogLine4VideoFile btn" id="HoutaiContainerDialogLine4VideoFile${spFilesNumRevise}">
- <div class="videoFileName">视频文件 ${spTheFileRevise[i].name}</div>
- <div class="delVideo">删除</div>
- </div>`;
- $(
- ".HoutaiContainerDialogLine4RightAdd"
- ).append(videoLineDataHtml);
- spFilesArrRevise.push(spTheFileRevise[i]);
- // 功能-添加中删除-反差内容-视频
- $(
- "#HoutaiContainerDialogLine4VideoFile" +
- spFilesNumRevise
- ).on("click", function () {
- console.log($(this).index());
- spFilesArrRevise.splice(
- $(this).index() - 1,
- 1
- );
- console.log(spFilesArrRevise);
- this.remove();
- });
- };
- //读取文件
- fileReader.readAsDataURL(spTheFileRevise[i]);
- }
- };
- }
- );
- // 功能-修改-反差内容-确认修改
- $(".HoutaiContainerDialogLine5RightRevise").on(
- "click",
- function () {
- let allTPFilesArr = tpFilesArrRevise;
- let uptheFileFMRevise = theFileFMRevise
- ? theFileFMRevise
- : $("#RFMImg").attr("src");
- allTPFilesArr.unshift(uptheFileFMRevise);
- var formFileRevise = new FormData();
- formFileRevise.append("fc_id", id);
- formFileRevise.append(
- "title",
- $(".HoutaiContainerDialogLine1RightRevise").val()
- );
- formFileRevise.append("token", "b8e3bb6ef8747d7");
- for (let i in allTPFilesArr) {
- formFileRevise.append("img[]", allTPFilesArr[i]);
- }
- for (let i in spFilesArrRevise) {
- formFileRevise.append("mp4[]", spFilesArrRevise[i]);
- }
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackoneeight/save_fancha_detail",
- dataType: "json",
- data: formFileRevise,
- async: true,
- cache: false,
- contentType: false,
- processData: false,
- success: function (res) {
- // alert("修改成功")
- console.log(res);
- // window.location.reload();
- },
- });
- }
- );
- // 功能-查看-反差内容-弹窗展示
- $(".HoutaiContainerBottomAppleListHeaderCZck").on(
- "click",
- function () {
- id = $(this).parent().parent().attr("id");
- index = $(this).parent().parent().index();
- $(".HoutaiContainerDialogTitleCheck").text(
- data[index].site
- );
- $(".HoutaiContainerDialogFMImg").attr(
- "src",
- data[index].head_img
- );
- let HoutaiContainerDialogLine2RightCheckHTML = "";
- for (let i = 0; i < data[index].book.length; i++) {
- HoutaiContainerDialogLine2RightCheckHTML += `<img class="HoutaiContainerDialogTPImg" src="${data[index].book[i]}" alt="">`;
- }
- $(".HoutaiContainerDialogLine2RightCheck").html(
- HoutaiContainerDialogLine2RightCheckHTML
- );
- let HoutaiContainerDialogLine3RightCheckHTML = "";
- for (
- let i = 0;
- i < data[index].hj_video_url.length;
- i++
- ) {
- HoutaiContainerDialogLine3RightCheckHTML += `<img class="HoutaiContainerDialogSPImg" src="Public/Admin/img/testimg.png" alt="">`;
- }
- $(".HoutaiContainerDialogLine3RightCheck").html(
- HoutaiContainerDialogLine3RightCheckHTML
- );
- // 交互-视频播放-展示弹窗
- $(".HoutaiContainerDialogSPImg").on(
- "click",
- function () {
- index = $(this).parent().parent().index();
- let videoArr = data[index].hj_video_url;
- videoSrc = videoArr[$(this).index()];
- let HoutaiContainerDialogVideoHTML = `<div class="HoutaiContainerDialogDeputyVideo">
- <img class="closeVideo" src="/Public/Admin/img/close.png" alt="">
- <div id="h5">
- <img class="toogleImg" src="/Public/Admin/img/end.png" alt="">
- </div>
- </div>`;
- $(".HoutaiContainerDialogVideo").html(
- HoutaiContainerDialogVideoHTML
- );
- // 交互-视频播放-关闭弹窗
- $(".closeVideo").on("click", function () {
- md = null;
- $(".HoutaiContainerDialogVideo").html("");
- $(".HoutaiContainerDialogVideo").hide();
- });
- $(".HoutaiContainerDialogVideo").show();
- var md = new MuiPlayer({
- container: "#h5",
- title: "",
- // autoplay: true,
- initFullFixed: true,
- autoplay: false,
- themeColor: "#FF6A00",
- lang: "en",
- poster: data[index].head_img,
- src: videoSrc,
- // src: 'https://look.slgj688.com/videos/one/WXTS/53045/394.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();
- $("#bj").show();
- $("#bj").on("click", function () {
- window.location.href =
- "service.html?uid=" + uid;
- });
- };
- $(".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 () {
- $(".HoutaiContainerDialogCheck").hide();
- }
- );
- },
- });
- }
- getData();
- // 功能-上传封面-上传内容封面
- $(".HoutaiContainerDialogLine2RightAdd").on("click", function () {
- $("#uploadAddFM").click();
- });
- // 功能-上传图片-打开上传图片窗口
- $("#TPImg").on("click", function () {
- $("#uploadAddTP").click();
- });
- // 功能-上传视频-打开上传视频窗口
- $("#SPImg").on("click", function () {
- $("#uploadAddSP").click();
- });
- // 功能-修改封面-上传内容封面
- $(".HoutaiContainerDialogLine2RightRevise").on("click", function () {
- $("#uploadReviseFM").click();
- });
- // 功能-修改图片-打开上传图片窗口
- $("#RTPImg").on("click", function () {
- $("#uploadReviseTP").click();
- });
- // 功能-修改视频-打开上传视频窗口
- $("#RSPImg").on("click", function () {
- $("#uploadReviseSP").click();
- });
- // 功能-新增-反差内容-弹窗展示
- $(".SLHeaderCreate").on("click", function () {
- $(".HoutaiContainerDialogAdd").show();
- });
- // 功能-新增-反差内容-弹窗隐藏
- $(".HoutaiContainerDialogLine5LeftAdd").on("click", function () {
- $(".HoutaiContainerDialogAdd").hide();
- });
- // 功能-新增-反差内容-确认新增
- $(".HoutaiContainerDialogLine5RightAdd").on("click", function () {
- let allTPFilesArr = tpFilesArr;
- allTPFilesArr.unshift(theFileFM);
- var formFile = new FormData();
- formFile.append(
- "title",
- $(".HoutaiContainerDialogLine1RightAdd").val()
- );
- formFile.append("token", "b8e3bb6ef8747d7");
- for (let i in allTPFilesArr) {
- formFile.append("img[]", allTPFilesArr[i]);
- }
- for (let i in spFilesArr) {
- formFile.append("mp4[]", spFilesArr[i]);
- }
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackoneeight/add_test_video",
- dataType: "json",
- data: formFile,
- async: true,
- cache: false,
- contentType: false,
- processData: false,
- success: function (res) {
- // alert("添加成功");
- console.log(res);
- window.location.reload();
- },
- });
- });
- });
|