| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- // url生成二维码
- var qrcode = new QRCode(document.getElementById("qrcode"), {
- width: 100,
- height: 100
- });
- $(".download").click(function () {
- var p_text = $(this).find("#text-1").text();
- var p_title = $(this).find("#text-2").text();
- var p_page = $(this).find("#download-page").text();
- qrcode.makeCode(p_page);
- $('.az_hover a').attr('href', p_text);
- $('.download_popup p').html(p_title);
- });
- $(function () {
- $("#J_rank_list").load('/Layout/gameRankList');
- $(".public_nav li").removeClass('current_page');
- });
- var keyword = encodeURI('{$keyword}');
- var AjaxGamePage = function (page) {
- $.ajax({
- url: '/search/_getGameList' + '?keyword=' + keyword + '&page=' + page,
- type: 'post',
- dataType: 'json',
- data: { page: page },
- success: function (data) {
- var html = '';
- $.each(data.list.data, function (i, row) {
- html += '<div class="game_cont">'
- + '<div class="search_game_img">'
- + ' <a href="' + row.gameUrl + '" title="' + row.nickname + '" target="_blank" ><img src="' + row.icon + '" class="smallIcon" ></a>';
- if (row.libaonum) {
- html += '<a href="' + row.gameUrl + '" target="_blank" ><img class="havegift" src="/static/images/icon/gift.png"></a>';
- }
- html += '</div>'
- + '<h4><a href="' + row.gameUrl + '" title="' + row.nickname + '" target="_blank" >' + row.nickname + '</a></h4>'
- + '<p>' + row.size + '</p>'
- + '<p>' + row.subject + '<span>|</span>' + row.type + '</p>';
- if (row.download) {
- html += '<div class="download">';
- } else {
- html += '<div class="no_download">';
- }
- html += '<a href="javascript:">立即下载</a>'
- + '<span id="text-1" style="display: none;">' + row.download + '</span>'
- + '<span id="text-2" style="display: none;">' + row.nickname + '</span>'
- + '<span id="download-page" style="display: none;">http://wl.weilongwl.com/download/' + row.id + '.html</span></div></div>';
- });
- html += '<div class="page">' + data.page
- + '<div class="rows">共 <b>' + data.list.total + '</b>条 / <b>' + data.list.last_page + '</b>页 记录 </div></div>';
- $(".relate_game").html(html);
- }
- });
-
- // 调用js
- jsa();
- }
- var AjaxPage = function (page) {
- setTimeout(function () {
- $(".pagination li:first-child a").html('上一页');
- $(".pagination li:first-child span").html('上一页');
- $(".pagination li:last-child a").html('下一页');
- $(".pagination li:last-child span").html('下一页');
- $(".disabled").each(function () {
- var a = $(this).text();
- if (a = "...") {
- //修改父元素
- $(this).find("span").css("cssText", "background:#fff;color:#494949 !important;border:none;cursor: context-menu;");
- }
- });
- }, 300);
- $.ajax({
- url: '/search/_getNewsList' + '?keyword=' + keyword + '&page=' + page,
- type: 'get',
- dataType: 'json',
- success: function (data) {
- var html = '';
- $.each(data.list.data, function (i, row) {
- html += '<div class="game_detail">'
- + '<div class="content_left">'
- + '<a href="' + row.url + '" title="' + row.title + '" target="_blank"><img src="' + row.image + '"></a>'
- + '</div>'
- + '<div class="content_right">'
- + '<h4><a href="' + row.url + '" title="' + row.title + '" target="_blank">' + row.title + '</a> </h4>'
- + '<p><span>发布时间:' + row.createtime + '</span></p>'
- + '<div class="text"><p> ' + row.cutcontent + '</p></div>'
- + '</div>'
- + '</div>';
- });
- html += '<div class="page">' + data.page
- + '<div class="rows">共 <b>' + data.list.total + '</b>条 / <b>' + data.list.last_page + '</b>页 记录 </div></div>';
- $(".new_news").html(html);
- }
- });
- }
- // 输入框带值
- var keyword = $(".keyword").text();
- keyword = keyword.replace("\"", "").replace("\"", "");
- $("#search-input").val(keyword);
- $(document).ready(function () {
- var val = $('#search-input').val();
- val = val.replace(/\s*/g, "");
- var vala = $('#search-input').val();
- if (vala == "") {
- vala = $("#search-input").attr('placeholder');
- $("#search_ul").hide();
- } else if ($("#search_ul li").length > 0) {
- $("#search_ul").show();
- }
- if (!val.length || val.length == 0 || vala == " ") {
- $("#search_ul").hide();
- $("#search_ul").empty();
- return
- }
- $.ajax({
- type: 'POST',
- url: '/game/ajaxGameList',
- dataType: 'json',
- data: { keyword: val },
- success: function (json) {
- if ($.isEmptyObject(json)) {
- $("#search_ul").empty();
- $("#search_ul").hide();
- } else {
- var html = '',
- turl = '/game101';
- $.each(json, function (i, row) {
- toUrl = turl.replace('101', row.id)
- html += '<li><a href="' + toUrl + '" target="_blank">' + row.nickname + '</a></li>';
- });
- arrow = ' <div class="border-up-empty"> <span></span></div>'
- $("#search_ul").html(html + arrow);
- }
- }
- });
- });
- // 设置默认游戏icon
- $(".content_left img").error(function () {
- $(this).attr("src", "/static/images/icon/990-625.png");
- })
- // 异步加载js
- var jsa = function () {
- setTimeout(function () {
- $(".pagination li:first-child a").html('上一页');
- $(".pagination li:first-child span").html('上一页');
- $(".pagination li:last-child a").html('下一页');
- $(".pagination li:last-child span").html('下一页');
- $(".disabled").each(function () {
- var a = $(this).text();
- if (a = "...") {
- //修改父元素
- $(this).find("span").css("cssText", "background:#fff;color:#494949 !important;border:none;cursor: context-menu;");
- }
- });
- $(".download").click(function () {
- var p_text = $(this).find("#text-1").text();
- var p_title = $(this).find("#text-2").text();
- var p_page = $(this).find("#download-page").text();
- qrcode.makeCode(p_page);
- $('.az_hover a').attr('href', p_text);
- $('.download_popup p').html(p_title);
- });
- // 下载弹窗
- $(".az_code img").hover(function () {
- $(".download_popup .big_az_code").css("cssText", "display: block !important");
- }, function () {
- $(".download_popup .big_az_code").css("cssText", "display: none !important");
- });
- $(".download_popup .close").click(function () {
- $(".warp_download_popup").hide();
- });
- $(".download").click(function () {
- $(".warp_download_popup").show();
- });
- $(".tip .close,.determine,.cancel").click(function () {
- $(".warp_no_download_popup").hide();
- $(".warp_kf_popup").hide();
- });
- $(".no_download").click(function () {
- $(".warp_no_download_popup").show();
- });
- // 下载弹窗
- $(".small-code").hover(function () {
- $(".az_code_right .big_az_code").show();
- }, function () {
- $(".az_code_right .big_az_code").hide();
- });
- $(".rollBox").hover(function () {
- $(".manu_phone_left").show();
- $(".manu_phone_right").show();
- }, function () {
- $(".manu_phone_left").hide();
- $(".manu_phone_right").hide();
- });
- $(".az_hover").hover(function () {
- $(".az_hover img").attr("src", "/static/images/home/az-white.png");
- $(".az_hover span").css("cssText", "color:#fff !important");
- }, function () {
- $(".az_hover img").attr("src", "/static/images/home/SVG-07.png");
- $(".az_hover span").css("cssText", "color: #8cc63d !important");
- });
- }, 300);
- }
|