// 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 += '
' + '
' + ' '; if (row.libaonum) { html += ''; } html += '
' + '

' + row.nickname + '

' + '

' + row.size + '

' + '

' + row.subject + '|' + row.type + '

'; if (row.download) { html += '
'; } else { html += '
'; } html += '立即下载' + '' + '' + '
'; }); html += '
' + data.page + '
' + data.list.total + '条 / ' + data.list.last_page + '页 记录
'; $(".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 += '
' + '
' + '' + '
' + '
' + '

' + row.title + '

' + '

发布时间:' + row.createtime + '

' + '

' + row.cutcontent + '

' + '
' + '
'; }); html += '
' + data.page + '
' + data.list.total + '条 / ' + data.list.last_page + '页 记录
'; $(".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 += '
  • ' + row.nickname + '
  • '; }); arrow = '
    ' $("#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); }