my-video.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  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. str += "<li class=\"col-lg-8 col-md-6 col-sm-4 col-xs-3\">" +
  159. " <div class=\"myui-vodlist__box\">" +
  160. " <a class=\"myui-vodlist__thumb lazyload\" title=\"\" style=\"background-image: url(&quot;apics/" + videoInfo.imgUrl + "&quot;);\">" +
  161. " <span class=\"bigpreview playvideo play hidden-xs\" imgUrl='" + videoInfo.imgUrl + "'></span>" +
  162. " <span class=\"pic-tag pic-tag-top\">" +
  163. " <span class=\"tag identificationCode\" title=\"https://www.javbus.com/" + videoInfo.identificationCode + "\" style=\"background-color: #FB7299;\">" + videoInfo.identificationCode + "</span>" +
  164. " <input type='hidden' javdbUrl='" + videoInfo.javdbUrl + "'>" +
  165. " <span class=\"tag identificationDate\" title=\"" + orginUrl + "\" style=\"background-color: #00C0FF;\">" + date + "</span>" +
  166. " </span>" +
  167. " <span class=\"pic-text text-right\" title='" + (videoInfo.comment === '' ? '暂无评论' : videoInfo.comment) + "'>" + scoreStr + "</span>" +
  168. " </a>" +
  169. " <div class=\"myui-vodlist__detail\">" +
  170. " <h4 class=\"videodetail title text-overflow\" identificationCode='" + videoInfo.identificationCode + "' orginUrl='" + orginUrl + "'><a title=\" " + videoInfo.name + " \">" + videoInfo.name + "</a></h4>" +
  171. " <p class=\"text text-overflow text-muted hidden-xs\" title='" + (videoInfo.maleCast === null ? videoInfo.mainWho : videoInfo.maleCast) + "'>直属:" + videoInfo.mainWho + "</p>" +
  172. " </div>" +
  173. " </div>" +
  174. "</li>";
  175. }
  176. $(".myui-vodlist").html(str);
  177. if (str == "") {
  178. $(".vodlistnone").attr("style", "padding: 50px;display: block;");
  179. $(".myui-page").html("");
  180. } else {
  181. $(".vodlistnone").attr("style", "padding: 50px;display: none;");
  182. $(".myui-page").pagination({
  183. pageSize: "10",
  184. pageNo: pageNo,
  185. total: data.total,
  186. callback: function (pageNo) {
  187. //$("#wd").val("");
  188. search(pageNo, false, false);
  189. }
  190. });
  191. }
  192. initContentEvent();
  193. } else {
  194. alert(data.message);
  195. }
  196. },
  197. beforeSend: function () {
  198. //请求前的处理
  199. if (startFlag) {
  200. $("#cover").css("display", "block");
  201. } else {
  202. $(".loading").css("display", "block");
  203. }
  204. },
  205. complete: function () {
  206. //请求完成的处理
  207. if (startFlag) {
  208. $("#cover").css("display", "none");
  209. } else {
  210. $(".loading").css("display", "none");
  211. }
  212. },
  213. error: function (data) {
  214. //请求出错处理
  215. alert('error:' + data);
  216. }
  217. });
  218. }
  219. /**
  220. * 查询头信息
  221. * @param bigType
  222. * @param startFlag
  223. */
  224. function getQueryHeaderInfo(bigType, startFlag, searchSelectFlag) {
  225. var infantryType = "";
  226. if (bigType == '步兵' && !searchSelectFlag) {
  227. infantryType = $(".leixingul").find(".btn-warm").text().replace("全部", "");
  228. }
  229. $.ajax({
  230. url: "queryHeader/getQueryHeaderInfo", //请求的url地址
  231. dataType: "json", //返回格式为json
  232. data: {"bigType": bigType, "infantryType": infantryType}, //参数值
  233. type: "post", //请求方式
  234. async: !startFlag, //请求是否异步,默认为异步,这也是ajax重要特性
  235. success: function (data) {
  236. if (bigType == '步兵') {
  237. $(".leixingli").css("display", "none");
  238. } else {
  239. $(".leixingli").css("display", "block");
  240. }
  241. if (searchSelectFlag) {
  242. $("ul.leixingul").find("a:eq(1)").addClass("btn-warm");
  243. $("ul.yanyuanul").find("a:eq(1)").addClass("btn-warm");
  244. $("ul.paixuul").find("a.btn-warm").removeClass("btn-warm");
  245. if (bigType == '足舐') {
  246. $("ul.paixuul").find("a:eq(3)").addClass("btn-warm");
  247. } else if (bigType == '码池') {
  248. $("ul.paixuul").find("a:eq(2)").addClass("btn-warm");
  249. } else {
  250. $("ul.paixuul").find("a:eq(1)").addClass("btn-warm");
  251. }
  252. }
  253. //请求成功时处理
  254. if (data != null && $.trim(data.data) != "" && data.success) {
  255. data = data.data;
  256. if ($.isEmptyObject(data)) {
  257. if ($(".displayli").length > 0) {
  258. $(".displayli").remove();
  259. }
  260. $(".vodlistnone").attr("style", "padding: 50px;display: block;");
  261. $(".myui-vodlist").html("");
  262. $(".myui-page").html("");
  263. return;
  264. }
  265. if ($(".displayli").length > 0) {
  266. $(".displayli").remove();
  267. }
  268. if (data.videoCastList.length > 0) {
  269. var videoCastList = data.videoCastList;
  270. var str = "";
  271. for (var i = 0; i < videoCastList.length; i++) {
  272. var videoCast = videoCastList[i];
  273. str += "<li class='displayli'><a class=\"btn searchbtn\" title='" + videoCast.count + "'>" + videoCast.name + "</a></li>";
  274. }
  275. $(".yanyuanul").append(str);
  276. }
  277. if (data.videoGenresList.length > 0) {
  278. var videoGenresList = data.videoGenresList;
  279. var str = "";
  280. for (var i = 0; i < videoGenresList.length; i++) {
  281. var videoGenres = videoGenresList[i];
  282. if (bigType == '步兵' && i == 0) {
  283. str += "<li class='displayli'><a class=\"btn btn-warm searchbtn\" title='" + videoGenres.count + "'>" + videoGenres.name + "</a></li>";
  284. } else {
  285. str += "<li class='displayli'><a class=\"btn searchbtn\" title='" + videoGenres.count + "'>" + videoGenres.name + "</a></li>";
  286. }
  287. }
  288. $(".leixingul").append(str);
  289. }
  290. if (searchSelectFlag && bigType != '步兵') {
  291. $("ul.leixingul").find("a.btn-warm").removeClass("btn-warm");
  292. if (bigType == '足舐') {
  293. $("ul.leixingul").find("a:eq(3)").addClass("btn-warm");
  294. } else if (bigType == '码池') {
  295. $("ul.leixingul").find("a:eq(1)").addClass("btn-warm");
  296. } else {
  297. $("ul.leixingul").find("a:eq(1)").addClass("btn-warm");
  298. }
  299. }
  300. $(".searchbtn").unbind("click");
  301. $(".searchbtn").click(function () {
  302. $(this).closest('ul').find(".searchbtn").removeClass("btn-warm");
  303. $(this).addClass("btn-warm");
  304. if ($(this).attr('order') != undefined) {
  305. var order = $(this).attr('order');
  306. if ("desc" == order) {
  307. $(this).attr("order", "asc");
  308. } else if ("asc" == order) {
  309. $(this).attr("order", "desc");
  310. }
  311. }
  312. $("#wd").val("");
  313. search(1, false, false);
  314. });
  315. } else {
  316. alert(data.message);
  317. }
  318. },
  319. beforeSend: function () {
  320. //请求前的处理
  321. if (!startFlag) {
  322. $(".loading-shaixuan").css("display", "block");
  323. }
  324. },
  325. complete: function () {
  326. //请求完成的处理
  327. if (!startFlag) {
  328. $(".loading-shaixuan").css("display", "none");
  329. }
  330. },
  331. error: function (data) {
  332. //请求出错处理
  333. alert('error:' + data);
  334. }
  335. });
  336. }
  337. /**
  338. * 初始化主内容事件
  339. */
  340. function initContentEvent() {
  341. var prepath = $("#bigType").attr("prepath");
  342. // $(".playvideo").dblclick(function () {
  343. // if (prepath == "machi") {
  344. // return;
  345. // }
  346. //
  347. // if ($("#playvideo").css("display") === 'none') {
  348. // $("#playvideo").css("display", "block");
  349. // $("#playvideo").find("video").attr("src", prepath + "/" + $(this).attr("videoUrl"));
  350. // $("#playvideo").find("video").prop('muted', true);
  351. // } else if ($("#playvideo").css("display") === 'block') {
  352. // $("#playvideo").css("display", "none");
  353. // $("#playvideo").find("video").attr("src", "");
  354. // }
  355. // });
  356. $(".videodetail").click(function () {
  357. var bigTypeText = $("#bigType").text();
  358. if (bigTypeText == '足舐') {
  359. var orginUrl = $(this).attr("orginUrl");
  360. let orginUrlArr = orginUrl.split(",");
  361. window.open(orginUrlArr[0]);
  362. } else {
  363. var type = $("#bigType").attr("prepath");
  364. var code = $(this).attr("identificationCode");
  365. window.open("voddetail.html?type=" + type + "&code=" + code, "_blank");
  366. }
  367. });
  368. $(".bigpreview").dblclick(function () {
  369. if ($("#bigpreview").css("display") === 'none') {
  370. $("#bigpreview").css("display", "block");
  371. $("#bigpreview").find("img").attr("src", "apics/" + $(this).attr("imgUrl"));
  372. } else if ($("#bigpreview").css("display") === 'block') {
  373. $("#bigpreview").css("display", "none");
  374. $("#bigpreview").find("img").attr("src", "");
  375. }
  376. });
  377. $(".identificationCode").dblclick(function () {
  378. let s = $(this).parent().find("input[type='hidden']");
  379. if ($(s).attr("javdbUrl") != null && $(s).attr("javdbUrl") !== "null") {
  380. window.open($(s).attr("javdbUrl"), "_blank");
  381. } else {
  382. window.open("https://www.javbus.com/" + $(this).text(), "_blank");
  383. }
  384. });
  385. $(".identificationDate").dblclick(function () {
  386. let title = $(this).attr("title");
  387. let orginUrlArr = title.split(",");
  388. if (orginUrlArr.length > 1) {
  389. window.open(orginUrlArr[1]);
  390. }
  391. });
  392. }