info-server.js 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. var qrcode = new QRCode(document.getElementById("qrcode"), {
  2. width: 100,
  3. height: 100
  4. });
  5. // url生成二维码
  6. if($(".az_code_right").length>0){
  7. var qrcode_title = new QRCode(document.getElementById("qrcode_title"), {
  8. width : 100,
  9. height : 100
  10. });
  11. }
  12. $(function () {
  13. var p_text1 = $("#code_url").text();
  14. if($(".az_code_right").length>0){
  15. qrcode_title.makeCode(p_text1);
  16. }
  17. $(".public_nav li").removeClass('current_page').eq(1).addClass('current_page');
  18. $("#J_rank_list").load('/Layout/gameRankList');
  19. });
  20. // 安卓下载按钮
  21. $(".az_code_right .az_ed_download").hover(function () {
  22. $(".az_ed_download img").attr("src", "/static/images/home/az-white.png");
  23. }, function () {
  24. $(".az_ed_download img").attr("src", "/static/images/home/SVG-07.png");
  25. });
  26. $(".az_no_link .az_no_download").hover(function () {
  27. $(".az_no_download img").attr("src", "/static/images/home/az-white.png");
  28. }, function () {
  29. $(".az_no_download img").attr("src", "/static/images/home/SVG-19.png");
  30. });
  31. $(".az_no_download").click(function () {
  32. $(".warp_no_download_popup").show();
  33. })
  34. // 手游排行控件显示隐藏
  35. $(function () {
  36. $('.rank_list>div').eq(0).find('.big').show()
  37. $('.rank_list>div').eq(0).find('.small').hide()
  38. $('.rank_list').hover(function () {
  39. $('.rank_list>div').hover(function () {
  40. $(this).find('.big').show().parent().siblings().find('.big').hide();
  41. $(this).find('.small').hide().parent().siblings().find('.small').show();
  42. });
  43. });
  44. })
  45. var AjaxTestPage = function(page){
  46. setTimeout(function(){
  47. $(".pagination li:first-child a").html('上一页');
  48. $(".pagination li:first-child span").html('上一页');
  49. $(".pagination li:last-child a").html('下一页');
  50. $(".pagination li:last-child span").html('下一页');
  51. $(".disabled").each(function(){
  52. var a = $(this).text();
  53. if(a="..."){
  54. $(this).find("span").css("cssText", "background:#fff;color:#494949 !important;border:none;cursor: context-menu;");
  55. }
  56. });
  57. },200);
  58. $.ajax({
  59. url:'/Game/getGameServer' + '?game_id='+game_id+'&type=1&page='+page,
  60. type:'post',
  61. dataType:'json',
  62. data: {page:page},
  63. success:function(data){
  64. var html = '';
  65. $.each(data.list.data, function(i,row){
  66. html += '<ul class="service_content">';
  67. if ( row.serverDate) {
  68. html += '<li class="service_date">'
  69. + ' <img src="/static/images/home/Assistor.png">'
  70. + '<p><span>'+row.serverDate+'</span></p>'
  71. + '</li>';
  72. }
  73. html += '<li>'
  74. + '<p>'+row.serverTime+'</p>'
  75. + '<p>'+row.serverName+'</p>'
  76. + '<P>';
  77. if (row.subscribe) {
  78. html += '<a class="kf_tip" onclick="kf_tip('+row.id+',\'kc\')">预约</a>';
  79. }
  80. html += '</P>'
  81. + '</li>'
  82. + '</ul>';
  83. });
  84. html += '<div class="page">' + data.page
  85. + '<div class="rows">共 <b>'+ data.list.total +'</b>条 / <b>'+ data.list.last_page + '</b>页 记录 </div></div>';
  86. $("#open_test").html(html);
  87. }
  88. });
  89. }
  90. var AjaxServicePage = function(page){
  91. setTimeout(function(){
  92. $(".pagination li:first-child a").html('上一页');
  93. $(".pagination li:first-child span").html('上一页');
  94. $(".pagination li:last-child a").html('下一页');
  95. $(".pagination li:last-child span").html('下一页');
  96. $(".disabled").each(function(){
  97. var a = $(this).text();
  98. if(a="..."){
  99. $(this).find("span").css("cssText", "background:#fff;color:#494949 !important;border:none;cursor: context-menu;");
  100. }
  101. });
  102. },200);
  103. $.ajax({
  104. url:'/Game/getGameServer' + '?game_id='+game_id+'&type=0&page='+page,
  105. type:'post',
  106. dataType:'json',
  107. data: {page:page},
  108. success:function(data){
  109. var html = '';
  110. $.each(data.list.data, function(i,row){
  111. html += '<ul class="service_content">';
  112. if ( row.serverDate) {
  113. html += '<li class="service_date">'
  114. + ' <img src="/static/images/home/Assistor.png">'
  115. + '<p><span>'+row.serverDate+'</span></p>'
  116. + '</li>';
  117. }
  118. html += '<li>'
  119. + '<p>'+row.serverTime+'</p>'
  120. + '<p>'+row.serverName+'</p>'
  121. + '<P>';
  122. if (row.subscribe) {
  123. html += '<a class="kf_tip" onclick="kf_tip('+row.id+',\'kf\')">预约</a>';
  124. }
  125. html += '</P>'
  126. + '</li>'
  127. + '</ul>';
  128. });
  129. html += '<div class="page">' + data.page
  130. + '<div class="rows">共 <b>'+ data.list.total +'</b>条 / <b>'+ data.list.last_page + '</b>页 记录 </div></div>';
  131. $("#open_service").html(html);
  132. }
  133. });
  134. }
  135. // 预约弹窗
  136. function kf_tip(id,kfkc){
  137. $.ajax({
  138. type: "POST",
  139. timeOut: 10000,
  140. url: '/service/subscribe',
  141. data: {
  142. "id": id,
  143. "type": kfkc
  144. },
  145. async: false,
  146. success: function (res) {
  147. // console.log(res);
  148. if (res.code == 1 || res.code == 4 || res.code == 5) {
  149. $(".success").show();
  150. $("#success_txt").text(res.msg)
  151. }
  152. else if (res.code == 2){
  153. window.location.href = res.data;
  154. }
  155. else if (res.code == 3){
  156. $("#bind_phone_href").attr('href',res.data);
  157. $("#bind_phone_txt").text(res.msg)
  158. $("#bind_phone_href").text("去绑定");
  159. $(".bind_phone").show();
  160. }/*else if (res.code == 4){
  161. $(".order").show();
  162. }else if (res.code == 5){
  163. $(".overtime").show();
  164. }*/else {
  165. alert(res.msg);
  166. }
  167. },
  168. error: function () {
  169. layer.msg('网络错误,请刷新页面重试');
  170. }
  171. });
  172. }