my-video.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. $(function () {
  2. if (getCookie("flag") == "1") {
  3. initOther();
  4. search(1, true, false);
  5. }
  6. });
  7. /**
  8. * 初始化其他操作
  9. */
  10. function initOther() {
  11. $(".slideDown-btn").click(function () {
  12. var display = $('.slideDown-box');
  13. if (display.css('display') == 'block') {
  14. display.slideUp("slow");
  15. $(this).html('展开 <i class="fa fa-angle-down"></i>');
  16. } else {
  17. display.slideDown("slow");
  18. $(this).html('收起 <i class="fa fa-angle-up"></i>');
  19. }
  20. });
  21. $("#searchbutton").click(function () {
  22. search(1, false, false);
  23. });
  24. $("#shaixuan").click(function () {
  25. $("#wd").val("");
  26. search(1, false, false);
  27. });
  28. $("#wd").keydown(function (e) {
  29. if (e.keyCode == 13) {
  30. search(1, false, false);
  31. }
  32. });
  33. $(".dropdown-box").find("li").click(function () {
  34. $("#bigType").text($(this).text());
  35. $("#bigType").attr("prepath", $(this).attr("prepath"));
  36. $(".dropdown-box").attr("style", "display: none;");
  37. if ($(this).text() == '足舐') {
  38. $(".lovefoot").attr("style", "display: block;");
  39. } else {
  40. $(".lovefoot").attr("style", "display: none;");
  41. }
  42. getQueryHeaderInfo($("#bigType").text(), false, true);
  43. search(1, false, true);
  44. });
  45. $(".dropdown-hover").mouseover(function () {
  46. $(".dropdown-box").attr("style", "display: block;");
  47. });
  48. $(".dropdown-hover").mouseout(function () {
  49. $(".dropdown-box").attr("style", "display: none;");
  50. });
  51. $(".clearAll").click(function () {
  52. $("#playvideo").find("video").attr("src", "");
  53. $("#bigpreview").find("img").attr("src", "");
  54. $("#playvideo").css("display", "none");
  55. $("#bigpreview").css("display", "none");
  56. });
  57. }
  58. /**
  59. * 多条件搜索
  60. * @param pageNo
  61. */
  62. function search(pageNo, startFlag, searchSelectFlag) {
  63. var genres = "";
  64. var cast = "";
  65. var keyword = "";
  66. if (searchSelectFlag) {
  67. $("#wd").val("");
  68. }
  69. if (!startFlag) {
  70. genres = $(".leixingul").find(".btn-warm").text().replace("全部", "");
  71. cast = $(".yanyuanul").find(".btn-warm").text().replace("全部", "");
  72. keyword = $("#wd").val();
  73. }
  74. var orderField = $(".paixuul").find(".btn-warm").attr("orderField");
  75. var order = $(".paixuul").find(".btn-warm").attr("order");
  76. var bigType = $("#bigType").text();
  77. var prepath = $("#bigType").attr("prepath");
  78. if (searchSelectFlag) {
  79. genres = "";
  80. cast = "";
  81. if (bigType == '足舐') {
  82. genres = "待审查";
  83. orderField = "vi.update_date";
  84. } else if (bigType == '码池') {
  85. orderField = "vi.modify_time";
  86. } else {
  87. orderField = "vi.issue_date";
  88. }
  89. order = "desc";
  90. }
  91. $.ajax({
  92. url: "videoInfo/getVideoInfoPage", //请求的url地址
  93. dataType: "json", //返回格式为json
  94. data: JSON.stringify({
  95. "pageNo": pageNo,
  96. "pageSize": 10,
  97. "genres": genres,
  98. "cast": cast,
  99. "orderField": orderField,
  100. "order": order,
  101. "keyword": keyword,
  102. "bigType": bigType
  103. }), //参数值
  104. type: "post", //请求方式
  105. contentType: "application/json;charset=utf-8",
  106. async: true, //请求是否异步,默认为异步,这也是ajax重要特性
  107. success: function (data) {
  108. //请求成功时处理
  109. if (data != null && $.trim(data) != "" && data.success) {
  110. if (startFlag) {
  111. getQueryHeaderInfo($("#bigType").text(), startFlag, false);
  112. }
  113. data = data.data;
  114. var videoInfoList = data.list;
  115. var str = "";
  116. for (var i = 0; i < videoInfoList.length; i++) {
  117. var videoInfo = videoInfoList[i];
  118. var date = videoInfo.issueDate + "|" + videoInfo.modifyTime;
  119. if (orderField == 'vi.modify_time') {
  120. date = videoInfo.modifyTime + "|" + videoInfo.issueDate;
  121. } else if (orderField == 'vi.update_date') {
  122. date = videoInfo.updateDate + "|" + videoInfo.issueDate;
  123. }
  124. var scoreStr = '';
  125. var orginUrl= '';
  126. if (bigType == '骑兵') {
  127. scoreStr += videoInfo.resolutionRatio + '|';
  128. scoreStr += (videoInfo.original === null ? '?' : (videoInfo.original == 1 ? '原档' : '非原档')) + '|';
  129. scoreStr += (videoInfo.subtitle === null ? '?' : (videoInfo.subtitle == 1 ? '字幕' : '无字幕')) + '|';
  130. scoreStr += (videoInfo.recoding === null ? '?' : (videoInfo.recoding == 1 ? '压缩' : '未压缩')) + '|';
  131. scoreStr += videoInfo.score;
  132. } else if (bigType == '码池') {
  133. scoreStr += (videoInfo.videoInfoFlag === 'false' ? '' : '骑兵|');
  134. scoreStr += (videoInfo.videoLoveFootFlag === 'false' ? '' : '足舐|');
  135. scoreStr += (videoInfo.type === 1 ? '待审查' : (videoInfo.type === 2 ? '审查中' : (videoInfo.type === 3 ? '审查已通过' : '审查未通过'))) + '|';
  136. scoreStr += videoInfo.score;
  137. } else if (bigType == '足舐') {
  138. scoreStr += (videoInfo.orginAvnoashiUrl === null ? '' : 'avnoashi|');
  139. scoreStr += (videoInfo.orginJpfootUrl === null ? '' : 'jpfoot|');
  140. scoreStr += (videoInfo.orginFeetpassionUrl === null ? '' : 'feetpassion|');
  141. scoreStr += (videoInfo.videoInfoFlag === 'false' ? '' : '骑兵|');
  142. if (videoInfo.videoInfoPoolFlag === 'false') {
  143. scoreStr += '';
  144. } else {
  145. scoreStr += '码池(' + (videoInfo.videoInfoPoolType === 1 ? '待审查' : (videoInfo.videoInfoPoolType === 2 ? '审查中' : (videoInfo.videoInfoPoolType === 3 ? '审查已通过' : '审查未通过'))) + ')|';
  146. }
  147. scoreStr += (videoInfo.type === 1 ? '爬取失败' : (videoInfo.type === 2 ? '待审查' : (videoInfo.type === 3 ? '审查已通过' : '审查未通过'))) + '|';
  148. scoreStr += videoInfo.score;
  149. orginUrl += videoInfo.orginAvnoashiUrl === null ? '' : videoInfo.orginAvnoashiUrl;
  150. orginUrl += (videoInfo.orginAvnoashiUrl != null && videoInfo.orginJpfootUrl != null) ? ',' : '';
  151. orginUrl += videoInfo.orginJpfootUrl === null ? '' : videoInfo.orginJpfootUrl;
  152. if (orginUrl === '') {
  153. orginUrl += videoInfo.orginFeetpassionUrl;
  154. }
  155. } else {
  156. scoreStr = videoInfo.score;
  157. }
  158. var str2 = "";
  159. if (bigType == '骑兵') {
  160. str2 = " <span class=\"pic-tag pic-text\">" +
  161. " <span class='tag xp' + identificationCode='" + videoInfo.identificationCode + "' title='" + videoInfo.javdbUrl + "' style=\"background-color: rgba(0,0,0,0);\">" + videoInfo.xpCount + "</span>" +
  162. " <input type='hidden' commentFirst='" + videoInfo.commentFirst + "'>" +
  163. " <input type='hidden' commentTwo='" + videoInfo.comment + "'>" +
  164. " <input type='hidden' commentXp='" + videoInfo.commentXp + "'>" +
  165. " <input type='hidden' commentScore='" + videoInfo.score + "'>" +
  166. " <input type='hidden' bigType='骑兵'>" +
  167. " <span class=\"text-right\" style='float:right' title='" + (videoInfo.comment === '' ? '暂无评论' : videoInfo.comment) + "'>" + scoreStr + "</span>" +
  168. " </span>";
  169. } else {
  170. str2 = " <span class=\"pic-text text-right\" title='" + (videoInfo.comment === '' ? '暂无评论' : videoInfo.comment) + "'>" + scoreStr + "</span>";
  171. }
  172. str += "<li class=\"col-lg-8 col-md-6 col-sm-4 col-xs-3\">" +
  173. " <div class=\"myui-vodlist__box\">" +
  174. " <a class=\"myui-vodlist__thumb lazyload\" title=\"\" style=\"background-image: url(&quot;apics/" + videoInfo.imgUrl + "&quot;);\">" +
  175. " <span class=\"bigpreview playvideo play hidden-xs\" imgUrl='" + videoInfo.imgUrl + "'></span>" +
  176. " <span class=\"pic-tag pic-tag-top\">" +
  177. " <span class=\"tag identificationCode\" title=\"https://www.javbus.com/" + videoInfo.identificationCode + "\" style=\"background-color: #FB7299;\">" + videoInfo.identificationCode + "</span>" +
  178. " <input type='hidden' javdbUrl='" + videoInfo.javdbUrl + "'>" +
  179. " <span class=\"tag identificationDate\" title=\"" + orginUrl + "\" style=\"background-color: #00C0FF;\">" + date + "</span>" +
  180. " </span>" +
  181. str2 +
  182. " </a>" +
  183. " <div class=\"myui-vodlist__detail\">" +
  184. " <h4 class=\"videodetail title text-overflow\" identificationCode='" + videoInfo.identificationCode + "' orginUrl='" + orginUrl + "'><a title=\" " + videoInfo.name + " \">" + videoInfo.name + "</a></h4>" +
  185. " <p class=\"text text-overflow text-muted hidden-xs\" title='" + (videoInfo.maleCast === null ? videoInfo.mainWho : videoInfo.maleCast) + "'>直属:" + videoInfo.mainWho + "</p>" +
  186. " </div>" +
  187. " </div>" +
  188. "</li>";
  189. }
  190. $(".myui-vodlist").html(str);
  191. if (str == "") {
  192. $(".vodlistnone").attr("style", "padding: 50px;display: block;");
  193. $(".myui-page").html("");
  194. } else {
  195. $(".vodlistnone").attr("style", "padding: 50px;display: none;");
  196. $(".myui-page").pagination({
  197. pageSize: "10",
  198. pageNo: pageNo,
  199. total: data.total,
  200. callback: function (pageNo) {
  201. //$("#wd").val("");
  202. search(pageNo, false, false);
  203. }
  204. });
  205. }
  206. initContentEvent();
  207. } else {
  208. alert(data.message);
  209. }
  210. },
  211. beforeSend: function () {
  212. //请求前的处理
  213. if (startFlag) {
  214. $("#cover").css("display", "block");
  215. } else {
  216. $(".loading").css("display", "block");
  217. }
  218. },
  219. complete: function () {
  220. //请求完成的处理
  221. if (startFlag) {
  222. $("#cover").css("display", "none");
  223. } else {
  224. $(".loading").css("display", "none");
  225. }
  226. },
  227. error: function (data) {
  228. //请求出错处理
  229. alert('error:' + data);
  230. }
  231. });
  232. }
  233. /**
  234. * 查询头信息
  235. * @param bigType
  236. * @param startFlag
  237. */
  238. function getQueryHeaderInfo(bigType, startFlag, searchSelectFlag) {
  239. var infantryType = "";
  240. if (bigType == '步兵' && !searchSelectFlag) {
  241. infantryType = $(".leixingul").find(".btn-warm").text().replace("全部", "");
  242. }
  243. $.ajax({
  244. url: "queryHeader/getQueryHeaderInfo", //请求的url地址
  245. dataType: "json", //返回格式为json
  246. data: {"bigType": bigType, "infantryType": infantryType}, //参数值
  247. type: "post", //请求方式
  248. async: !startFlag, //请求是否异步,默认为异步,这也是ajax重要特性
  249. success: function (data) {
  250. if (bigType == '步兵') {
  251. $(".leixingli").css("display", "none");
  252. } else {
  253. $(".leixingli").css("display", "block");
  254. }
  255. if (searchSelectFlag) {
  256. $("ul.leixingul").find("a:eq(1)").addClass("btn-warm");
  257. $("ul.yanyuanul").find("a:eq(1)").addClass("btn-warm");
  258. $("ul.paixuul").find("a.btn-warm").removeClass("btn-warm");
  259. if (bigType == '足舐') {
  260. $("ul.paixuul").find("a:eq(3)").addClass("btn-warm");
  261. } else if (bigType == '码池') {
  262. $("ul.paixuul").find("a:eq(2)").addClass("btn-warm");
  263. } else {
  264. $("ul.paixuul").find("a:eq(1)").addClass("btn-warm");
  265. }
  266. }
  267. //请求成功时处理
  268. if (data != null && $.trim(data.data) != "" && data.success) {
  269. data = data.data;
  270. if ($.isEmptyObject(data)) {
  271. if ($(".displayli").length > 0) {
  272. $(".displayli").remove();
  273. }
  274. $(".vodlistnone").attr("style", "padding: 50px;display: block;");
  275. $(".myui-vodlist").html("");
  276. $(".myui-page").html("");
  277. return;
  278. }
  279. if ($(".displayli").length > 0) {
  280. $(".displayli").remove();
  281. }
  282. if (data.videoCastList.length > 0) {
  283. var videoCastList = data.videoCastList;
  284. var str = "";
  285. for (var i = 0; i < videoCastList.length; i++) {
  286. var videoCast = videoCastList[i];
  287. str += "<li class='displayli'><a class=\"btn searchbtn\" title='" + videoCast.count + "'>" + videoCast.name + "</a></li>";
  288. }
  289. $(".yanyuanul").append(str);
  290. }
  291. if (data.videoGenresList.length > 0) {
  292. var videoGenresList = data.videoGenresList;
  293. var str = "";
  294. for (var i = 0; i < videoGenresList.length; i++) {
  295. var videoGenres = videoGenresList[i];
  296. if (bigType == '步兵' && i == 0) {
  297. str += "<li class='displayli'><a class=\"btn btn-warm searchbtn\" title='" + videoGenres.count + "'>" + videoGenres.name + "</a></li>";
  298. } else {
  299. str += "<li class='displayli'><a class=\"btn searchbtn\" title='" + videoGenres.count + "'>" + videoGenres.name + "</a></li>";
  300. }
  301. }
  302. $(".leixingul").append(str);
  303. }
  304. if (searchSelectFlag && bigType != '步兵') {
  305. $("ul.leixingul").find("a.btn-warm").removeClass("btn-warm");
  306. if (bigType == '足舐') {
  307. $("ul.leixingul").find("a:eq(3)").addClass("btn-warm");
  308. } else if (bigType == '码池') {
  309. $("ul.leixingul").find("a:eq(1)").addClass("btn-warm");
  310. } else {
  311. $("ul.leixingul").find("a:eq(1)").addClass("btn-warm");
  312. }
  313. }
  314. $(".searchbtn").unbind("click");
  315. $(".searchbtn").click(function () {
  316. $(this).closest('ul').find(".searchbtn").removeClass("btn-warm");
  317. $(this).addClass("btn-warm");
  318. if ($(this).attr('order') != undefined) {
  319. var order = $(this).attr('order');
  320. if ("desc" == order) {
  321. $(this).attr("order", "asc");
  322. } else if ("asc" == order) {
  323. $(this).attr("order", "desc");
  324. }
  325. }
  326. $("#wd").val("");
  327. search(1, false, false);
  328. });
  329. } else {
  330. alert(data.message);
  331. }
  332. },
  333. beforeSend: function () {
  334. //请求前的处理
  335. if (!startFlag) {
  336. $(".loading-shaixuan").css("display", "block");
  337. }
  338. },
  339. complete: function () {
  340. //请求完成的处理
  341. if (!startFlag) {
  342. $(".loading-shaixuan").css("display", "none");
  343. }
  344. },
  345. error: function (data) {
  346. //请求出错处理
  347. alert('error:' + data);
  348. }
  349. });
  350. }
  351. /**
  352. * 初始化主内容事件
  353. */
  354. function initContentEvent() {
  355. var prepath = $("#bigType").attr("prepath");
  356. // $(".playvideo").dblclick(function () {
  357. // if (prepath == "machi") {
  358. // return;
  359. // }
  360. //
  361. // if ($("#playvideo").css("display") === 'none') {
  362. // $("#playvideo").css("display", "block");
  363. // $("#playvideo").find("video").attr("src", prepath + "/" + $(this).attr("videoUrl"));
  364. // $("#playvideo").find("video").prop('muted', true);
  365. // } else if ($("#playvideo").css("display") === 'block') {
  366. // $("#playvideo").css("display", "none");
  367. // $("#playvideo").find("video").attr("src", "");
  368. // }
  369. // });
  370. $(".videodetail").click(function () {
  371. var bigTypeText = $("#bigType").text();
  372. if (bigTypeText == '足舐') {
  373. var orginUrl = $(this).attr("orginUrl");
  374. let orginUrlArr = orginUrl.split(",");
  375. window.open(orginUrlArr[0]);
  376. } else {
  377. var type = $("#bigType").attr("prepath");
  378. var code = $(this).attr("identificationCode");
  379. window.open("voddetail.html?type=" + type + "&code=" + code, "_blank");
  380. }
  381. });
  382. $(".bigpreview").dblclick(function () {
  383. if ($("#bigpreview").css("display") === 'none') {
  384. $("#bigpreview").css("display", "block");
  385. $("#bigpreview").find("img").attr("src", "apics/" + $(this).attr("imgUrl"));
  386. } else if ($("#bigpreview").css("display") === 'block') {
  387. $("#bigpreview").css("display", "none");
  388. $("#bigpreview").find("img").attr("src", "");
  389. }
  390. });
  391. $(".identificationCode").dblclick(function () {
  392. let s = $(this).parent().find("input[type='hidden']");
  393. if ($(s).attr("javdbUrl") != null && $(s).attr("javdbUrl") !== "null") {
  394. window.open($(s).attr("javdbUrl"), "_blank");
  395. } else {
  396. window.open("https://www.javbus.com/" + $(this).text(), "_blank");
  397. }
  398. });
  399. $(".identificationDate").dblclick(function () {
  400. let title = $(this).attr("title");
  401. let orginUrlArr = title.split(",");
  402. if (orginUrlArr.length > 1) {
  403. window.open(orginUrlArr[1]);
  404. }
  405. });
  406. initOther4Popup();
  407. }
  408. function initOther4Popup(){
  409. let clickTimer = null;
  410. // 打开弹窗
  411. $("span.xp").unbind("click");
  412. $("span.xp").on("click", function (e) {
  413. clearTimeout(clickTimer);
  414. clickTimer = setTimeout(() => {
  415. let parent = $(this).parent();
  416. var commentfirst = parent.find("input[type='hidden']").eq(0).attr("commentfirst");
  417. var commenttwo = parent.find("input[type='hidden']").eq(1).attr("commenttwo");
  418. var commentxp = parent.find("input[type='hidden']").eq(2).attr("commentxp");
  419. var commentscore = parent.find("input[type='hidden']").eq(3).attr("commentscore");
  420. var bigtype = parent.find("input[type='hidden']").eq(4).attr("bigtype");
  421. var identificationCode = $(this).attr("identificationCode");
  422. var javdbUrl = $(this).attr("title");
  423. quietPop(bigtype, identificationCode, commentfirst, commenttwo, commentxp, commentscore, javdbUrl);
  424. $(".popup-video").fadeIn();
  425. centerPopup(); // 调用居中函数
  426. }, 300); // 300ms 是判断单击和双击的时间间隔
  427. });
  428. $("span.xp").off("dblclick");
  429. $("span.xp").dblclick(function (e) {
  430. clearTimeout(clickTimer);
  431. let javdbUrl = $(this).attr("title");
  432. if (javdbUrl != null) {
  433. window.open(javdbUrl, "_blank");
  434. }
  435. });
  436. // 关闭弹窗
  437. $(".close-btn").unbind("click");
  438. $(".close-btn").on("click", function () {
  439. $(".popup-video").fadeOut();
  440. });
  441. // 阻止表单默认提交行为
  442. $(".popup-video form").on("submit", function (e) {
  443. e.preventDefault();
  444. var nameEn = $("#popup-form-hidden-nameEn").val();
  445. if (nameEn === '骑兵') {
  446. insertOrUpdateQibingSubmit();
  447. }
  448. });
  449. // 实现拖动功能
  450. let isDragging = false;
  451. let offsetX, offsetY;
  452. $("#draggable-popup h2").on("mousedown", function (e) {
  453. // 判断如果点击在 input 或 select 上,不触发拖动
  454. if ($(e.target).closest("input, select, label").length) {
  455. return; // 如果按在 input 或 select 上,不启动拖动
  456. }
  457. isDragging = true;
  458. offsetX = e.clientX - $(this).offset().left;
  459. offsetY = e.clientY - $(this).offset().top;
  460. $(this).css("cursor", "grabbing"); // 改变鼠标指针样式
  461. });
  462. $(document).on("mousemove", function (e) {
  463. if (isDragging) {
  464. const left = e.clientX - offsetX;
  465. const top = e.clientY - offsetY;
  466. $("#draggable-popup").css({
  467. left: `${left}px`,
  468. top: `${top}px`,
  469. });
  470. }
  471. });
  472. $(document).on("mouseup", function () {
  473. isDragging = false;
  474. $("#draggable-popup").css("cursor", "move"); // 恢复鼠标指针样式
  475. });
  476. // 重置按钮的功能
  477. $("#reset-button").on("click", function () {
  478. $("#result-container").fadeOut(); // 隐藏请求结果区域
  479. $(".loading-icon").fadeOut(); // 重置时隐藏加载图标
  480. });
  481. }
  482. // 显示加载图标
  483. function showLoading() {
  484. $("#result-content").text(""); // 清空内容
  485. $("#result-container").hide(); // 使用 hide() 快速隐藏
  486. $("#loading-icon").fadeIn(); // 显示加载图标
  487. }
  488. // 计算并设置弹窗居中位置
  489. function centerPopup() {
  490. const popup = $("#draggable-popup");
  491. const windowWidth = $(window).width();
  492. const windowHeight = $(window).height();
  493. const popupWidth = popup.outerWidth();
  494. const popupHeight = popup.outerHeight();
  495. // 计算弹窗的位置
  496. const left = (windowWidth - popupWidth) / 2;
  497. const top = (windowHeight - popupHeight) / 4;
  498. // 设置弹窗的位置
  499. popup.css({
  500. left: `${left}px`,
  501. top: `${top}px`,
  502. });
  503. }
  504. function quietPop(bigtype, identificationCode, commentfirst, commenttwo, commentxp, commentscore, javdburl) {
  505. if (bigtype === '骑兵') {
  506. let formContent = "";
  507. formContent += '<div class="form-item"><label for="identificationCode">code:</label><input readonly type="text" name="identificationCode" style="border:revert;" value="' + identificationCode + '"></div>';
  508. formContent += '<div class="form-item"><label for="commentfirst">commentfirst:</label><textarea rows="5" cols="100" style="background: antiquewhite;width: 100%;height: 100%;" name="commentfirst">' + commentfirst + '</textarea></div>';
  509. formContent += '<div class="form-item"><label for="commenttwo">commenttwo:</label><textarea rows="5" cols="100" style="background: antiquewhite;width: 100%;height: 100%;" name="commenttwo">' + commenttwo + '</textarea></div>';
  510. formContent += '<div class="form-item"><label for="commentxp">commentxp:</label><textarea rows="6" cols="100" style="background: antiquewhite;width: 100%;height: 100%;" name="commentxp">' + commentxp +'</textarea></div>';
  511. formContent += '<div class="form-item"><label for="commentscore">commentscore:</label><input type="text" name="commentscore" placeholder="可为空" style="border:revert;" value="' + commentscore + '"></div>';
  512. formContent += '<div class="form-item"><label for="javdbUrl">javdburl:</label><input type="text" name="javdburl" placeholder="可为空" style="border:revert;" value="' + javdburl + '"></div>';
  513. $("#form-container-2").html(formContent);
  514. $("#popup-form-hidden-nameEn").val(bigtype);
  515. $("#draggable-popup > h2").text("InsertOrUpdate4Qibing");
  516. }
  517. }
  518. function insertOrUpdateQibingSubmit(){
  519. var formData = new FormData($("#popup-form")[0]);
  520. formData.append("userName", getCookie('username'));
  521. $.ajax({
  522. url: "videoInfo/insertOrUpdateQibing", //请求的url地址
  523. dataType: "json", //返回格式为json
  524. data: formData, //参数值
  525. type: "post", //请求方式
  526. processData: false,// 告诉jQuery不要去处理发送的数据
  527. contentType: false,// 告诉jQuery不要去设置Content-Type请求头
  528. async: true, //请求是否异步,默认为异步,这也是ajax重要特性
  529. success: function (data) {
  530. //$(".popup > .watchlist-loading").css("display", "none");
  531. //请求成功时处理
  532. if (data != null && $.trim(data) != "" && data.success) {
  533. $("#searchbutton").click();
  534. } else {
  535. //$("#insertOrUpdateAlert").html(data.message);
  536. }
  537. // 在请求成功后填充数据到结果区域
  538. $("#result-content").text(JSON.stringify(data, null, 2));
  539. $("#loading-icon").fadeOut();
  540. $("#result-container").fadeIn(); // 显示结果区域
  541. },
  542. beforeSend: function () {
  543. //$(".popup > .watchlist-loading").css("display", "block");
  544. showLoading(); // 显示加载状态
  545. },
  546. complete: function () {
  547. },
  548. error: function (data) {
  549. //请求出错处理
  550. console.log("insertOrUpdateQibing-submit error," + data);
  551. }
  552. });
  553. }