123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- $(document).ready(function () {
- $('.logo').on('click', function() {
- localStorage.setItem('logo', true);
- $(location).attr("href", "index.html?logo=true");
- })
- let url = window.location.search;
- 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(
- decodeURIComponent(strs[i].split("=")[1])
- );
- }
- }
- console.log(theRequest)
- $('.back').on('click', function () {
- window.location.href = "index.html?labelname=" +
- theRequest.labelname +
- "&type=" +
- theRequest.type +
- "&videotype=" +
- theRequest.videotype +
- "&name=" +
- theRequest.name;
- })
- var uid = localStorage.getItem("uid");
- LanguageSwitching();
- // 获取收藏数据
- function getData() {
- $.ajax({
- type: "post",
- url: "https://www.bibidd.com/bibidd/Mediasix/shoucang_list_test",
- dataType: "json",
- data: {
- uid: uid,
- },
- success: function (res) {
- let dataArray = res.data;
- if(dataArray.length==0) {
- $('.bottomLoadContent').hide();
- $("#tip").show();
- var languageParameter = localStorage.getItem('language') || 'CN';
- if(languageParameter == 'CN') {
- $(".tiptext").text('暫無收藏數據');
- }else{
- $(".tiptext").text('The data you need is not found.');
- }
- }else{
- $("#tip").hide();
- }
- let videoHtml = "";
- $.each(dataArray, function (index, data) {
- if(data.top_img != 'https://www.bibidd.com/bibidd_testtest/A.jpg') {
- videoHtml += '<div id="videoContent' + index + '" class="videoContent">';
-
- videoHtml +=
- '<div class="lazy videoPhoto" data-original="' + data.top_img + '">';
- videoHtml +=
- ' <div class="videoTime">' + videoTime(data.time_chuo) + "</div>";
- videoHtml +=
- ' <div class="close">';
- videoHtml +=
- ' <img class="closeImg" src="/Public/bibidd/images/close.png"/>';
- videoHtml += " </div>";
- videoHtml += " </div>";
-
-
- videoHtml += ' <div class="videoTitle">' + data.title + "</div>";
- videoHtml += "</div>";
- }
- });
- $(".video").html(videoHtml);
- },
- complete: function (res) {
- let dataArray = res.responseJSON.data;
- var loadingUrl = "/Public/bibidd/images/loading.png";
- $(".lazy").lazyload({
- effect: 'show',
- placeholder: loadingUrl,
- failurelimit: 10,
- skip_invisible: false,
- });
- // 取消收藏
- $(".close").on("click", function (event) {
- event.stopPropagation();
- // 取消收藏
- let closetype =
- dataArray[$(this).parent().parent().index()].type;
- const id = dataArray[$(this).parent().parent().index()].id;
- if (closetype === 'novel') {
- // 取消收藏小说
- $.ajax({
- type: 'post',
- url: 'https://www.bibidd.com/bibidd/Nnovel/close_novel_shoucang',
- dataType: "json",
- data: {
- n_id: id,
- uid: uid
- },
- success: function (res) {
- },
- complete: function (res) {
- getData();
- }
- })
- } else {
- // 取消收藏视频或图片
- closetype =
- dataArray[$(this).parent().parent().index()].type === "imgs" ? "img" : "video";
- $.ajax({
- type: "post",
- url: "https://www.bibidd.com/bibidd/Mediasix/quxiao_shoucang",
- dataType: "json",
- data: {
- type: closetype,
- cid: id,
- uid: uid,
- },
- success: function (res) {
- },
- complete: function (res) {
- getData();
- },
- });
- }
- });
- // 查看收藏详情
- $(".videoContent").on("click", function () {
-
- $(location).attr("href", "videodetails.html?videoid=" +
- dataArray[$(this).index()].id +
- "&fabulous=" +
- dataArray[$(this).index()].thumbs_up +
- "&videoname=" +
- dataArray[$(this).index()].title +
- "&favorite=" +
- dataArray[$(this).index()].favorite +
- "labelname=" +
- theRequest.labelname +
- "&type=" +
- theRequest.type +
- "&videotype=" +
- theRequest.videotype +
- "&name=" +
- theRequest.name)
- });
- },
- });
- }
- getData();
- // 判断屏幕滚动高度是否超过1屏
- $(window).scroll(function () {
- var scrollT = $(document).scrollTop();
- var offsetT = $(".videopage").offset().top;
- if (scrollT >= offsetT) {
- $(".backToTop").show();
- } else {
- $(".backToTop").hide();
- }
- });
- // 返回顶部
- $(".backToTop").on("click", function () {
- $("html, body").animate(
- {
- scrollTop: 0,
- },
- 500
- );
- });
- function videoTime(time) {
- let timeStr = "";
- let h =
- Math.floor(time / 60 / 60) < 10
- ? "0" + Math.floor(time / 60 / 60)
- : Math.floor(time / 60 / 60);
- let m =
- Math.floor(Math.floor(time / 60) % 60) < 10
- ? "0" + Math.floor(Math.floor(time / 60) % 60)
- : Math.floor(Math.floor(time / 60) % 60);
- let s =
- Math.floor(time % 60) < 10
- ? "0" + Math.floor(time % 60)
- : Math.floor(time % 60);
- timeStr = h + ":" + m + ":" + s;
- return timeStr;
- }
-
- var languageIsLong = false;
- $('.language').on('click', function() {
- if(languageIsLong) {
- $('.language img').attr('src', '/Public/bibidd/images/shang.png');
- $(".languageWrap").css('height','50px');
- }else{
- $('.language img').attr('src', '/Public/bibidd/images/xia.png');
- $(".languageWrap").css('height','150px');
- window.scrollTo(0, 99999999999);
-
- }
- languageIsLong = !languageIsLong;
- })
- $('.languageText').on('click', function() {
- languageIsLong = !languageIsLong;
- $('.language img').attr('src', '/Public/bibidd/images/shang.png');
- $(".languageWrap").css('height','50px');
- if($(this).attr('id') == 'CN') {
- // 切换中文
- localStorage.setItem('language', 'CN');
- }else{
- // 切换英文
- localStorage.setItem('language', 'EN');
- }
- LanguageSwitching();
- })
-
- function LanguageSwitching() {
-
- var languageParameter = localStorage.getItem('language') || 'CN';
-
- if ( languageParameter == 'CN') {
- // 切换中文语言
- $(".tiptext").text('暫無收藏數據');
- $("h2").text('我的收藏');
-
- $('.language').find('p').eq(0).text('語言');
- $('.footerTitle').text('世界上最大的色情網站');
- $('.footerText').text("9169團隊每天都在更新和添加更多的色情視頻。 我們提供流媒體色情視頻、XXX相册和網絡上排名第一的免費性愛社區。 我們一直在努力新增更多的功能,讓你對色情的熱愛一直保持下去。");
- }else if (!languageParameter || languageParameter == 'EN'){
- // 切换英文语言
-
- $(".tiptext").text('The data you need is not found.');
- $("h2").text('My Collection');
-
- $('.language').find('p').eq(0).text('Language');
- $('.footerTitle').text("The world's largest pornographic website");
- $('.footerText').text("The 9169 team is always updating and adding more porn videos every day.We offer streaming porn videos, XXX photo albums, and the number 1 free sex community on the net. We’re always working towards adding more features that will keep your love for porno alive and well.");
- }
- }
-
- });
|