info.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. {extend name="layout/base" /}
  2. {block name="header"}
  3. <link rel="stylesheet" href="__STATIC__/css/mobile/game-info.css">
  4. <link rel="stylesheet" href="__STATIC__/css/mobile/swiper.min.css">
  5. <style>
  6. .swiper-container{
  7. visibility: hidden;
  8. }
  9. </style>
  10. {/block}
  11. {block name="content"}
  12. <!-- header start -->
  13. <header class="top">
  14. <div class="header">
  15. <a href="javascript:history.back(-1)"><img src="__STATIC__/images/mobile/icon/left.png" class="back"></a>
  16. <h1>{$detail.nickname|default="游戏详情页"}</h1>
  17. <div>
  18. <div class="search-icon"><a href="{:getMobileSearchUrl()}"><img src="__STATIC__/images/mobile/icon/search.png"></a></div>
  19. <div class="menu"><img src="__STATIC__/images/mobile/icon/menu-bar.png"></div>
  20. </div>
  21. </div>
  22. </header>
  23. <!-- header end -->
  24. <div class="top-half game-content">
  25. <img lazy-src="{$detail.icon}" src="__STATIC__/images/icon/150-150.png" class="smallIcon">
  26. <h2>{$detail.nickname}</h2>
  27. <p>{$detail.typename}<span>|</span>{$detail.subjectname}<span>|</span>{$detail.size}</p>
  28. {if($detail['publicity'])}<p>{$detail.publicity}</p> {/if}
  29. <div class="download">
  30. <a href="javascript:;">下载</a>
  31. <p class="android_down_url">{$detail.download}</p>
  32. <p class="ios_down_url">{$detail.ios_download}</p>
  33. </div>
  34. </div>
  35. <ul class="game-info-title">
  36. <li><a href="javascript:;" onclick="window.location.replace('{:getMobileGameUrl($detail['id'])}')" class="active">介绍</a></li>
  37. <li><a href="javascript:;" onclick="window.location.replace('{:getMobileGameNewsUrl($detail['id'])}')">资讯</a></li>
  38. <li><a href="javascript:;" onclick="window.location.replace('{:getMobileGameGiftUrl($detail['id'])}')">礼包</a></li>
  39. </ul>
  40. <!-- 游戏介绍 -->
  41. <div class="warp-game-introduce">
  42. {notempty name="$detail.description"}
  43. <div class="game-introduce">
  44. <div>
  45. {$detail.description}
  46. </div>
  47. </div>
  48. <p class="open-close open"><a href="javascript:;">展开</a></p>
  49. {/notempty}
  50. {notempty name="$detail.screenShot"}
  51. <!-- 小图 -->
  52. <div class="warp-screenshots">
  53. <div>
  54. <div class="screenshots">
  55. <?php $screenShot = $detail->screenShot; ?>
  56. {volist name="screenShot" id="bigimage"}
  57. <!-- <div class="{$key}"> -->
  58. <img lazy-src="{$bigimage}" src="__STATIC__/images/icon/625-990.png" class="info-img" id="{$key}"/>
  59. <!-- </div> -->
  60. {/volist}
  61. </div>
  62. </div>
  63. </div>
  64. <!-- Swiper 大图-->
  65. <div class="swiper-container">
  66. <div class="swiper-wrapper">
  67. {volist name="screenShot" id="bigimage"}
  68. <div class="swiper-slide"><img src="{$bigimage}"/></div>
  69. {/volist}
  70. </div>
  71. <!-- Add Pagination -->
  72. <div class="swiper-pagination"></div>
  73. </div>
  74. {/notempty}
  75. {empty name="$detail.description" and empty name="$detail.screenShot"}
  76. <div class="no-info">
  77. <img src="__STATIC__/images/mobile/icon/no-info.png">
  78. <p>暂无相关内容</p>
  79. </div>
  80. {/empty}
  81. </div>
  82. <!-- 开测 -->
  83. {notempty name="$kcServers"}
  84. <div class="game-kc">
  85. <div class="title">
  86. <h4><span></span>游戏开测</h4>
  87. <p>共<span>{$kcServerCnt}</span>条</p>
  88. </div>
  89. <div class="kc-info">
  90. <ul class="tab-title">
  91. <li>时间</li>
  92. <li>新服名</li>
  93. <li>预约</li>
  94. </ul>
  95. {volist name="kcServers" id="vo"}
  96. <ul class="kc-list">
  97. <li>{$vo.serverDate} {$vo.serverTime}</li>
  98. <li>{$vo.serverName}</li>
  99. <li>{if condition='$vo.subscribe eq 1'}<a href="javascript:kf_tip('{$vo.id}','kc');">预约</a>{/if}</li>
  100. </ul>
  101. {/volist}
  102. </div>
  103. <a href="javascript:;" class="kc-more">查看更多</a>
  104. <div class="weui-loadmore">
  105. <i class="weui-loading"></i>
  106. <span class="weui-loadmore__tips">数据加载中,请稍后</span>
  107. </div>
  108. {/notempty}
  109. </div>
  110. <!-- 开服 -->
  111. <div class="game-kf">
  112. <div class="title">
  113. <h4><span></span>游戏开服</h4>
  114. <p>共<span>{$kfServerCnt}</span>条</p>
  115. </div>
  116. {notempty name="$kfServers"}
  117. <div class="kf-info">
  118. <ul class="tab-title">
  119. <li>时间</li>
  120. <li>新服名</li>
  121. <li>预约</li>
  122. </ul>
  123. {volist name="kfServers" id="vo"}
  124. <ul class="kf-list">
  125. <li>{$vo.serverDate} {$vo.serverTime}</li>
  126. <li>{$vo.serverName}</li>
  127. <li>{if condition='$vo.subscribe eq 1'}<a href="javascript:kf_tip('{$vo.id}','kf');">预约</a>{/if}</li>
  128. </ul>
  129. {/volist}
  130. </div>
  131. <a href="javascript:;" class="kf-more">查看更多</a>
  132. <div class="weui-loadmore">
  133. <i class="weui-loading"></i>
  134. <span class="weui-loadmore__tips">数据加载中,请稍后</span>
  135. </div>
  136. {else/}
  137. <div class="no-info">
  138. <img src="__STATIC__/images/mobile/icon/empty.png">
  139. <p>暂无开服信息</p>
  140. </div>
  141. {/notempty}
  142. </div>
  143. <!-- 猜你喜欢 -->
  144. {notempty name="$relGameList"}
  145. <div class="new-game">
  146. <div class="title">
  147. <h4><span></span>猜你喜欢</h4>
  148. </div>
  149. <div class="new-game-list">
  150. {volist name="relGameList" id="vo"}
  151. <div class="new-game-info">
  152. <a href="{$vo.url}">
  153. <img lazy-src="{$vo.icon}" src="__STATIC__/images/icon/150-150.png" class="smallIcon">
  154. <h4>{$vo.nickname}</h4>
  155. <p>{$vo.size}</p>
  156. <p>{$vo.typename}<span>|</span>{$vo.subjectname}</p>
  157. </a>
  158. <div class="download">
  159. <a href="javascript:;">下载</a>
  160. <p class="android_down_url">{$vo.download}</p>
  161. <p class="ios_down_url">{$vo.ios_download}</p>
  162. </div>
  163. </div>
  164. {/volist}
  165. </div>
  166. </div>
  167. {/notempty}
  168. <!-- 相关信息 -->
  169. <div class="rela-info">
  170. <div class="title">
  171. <h4><span></span>相关信息</h4>
  172. </div>
  173. <div class="content">
  174. <p>游戏版本:<span>{$detail.version}</span></p>
  175. <p>发布时间:<span>{$detail.updatetime}</span></p>
  176. <div class="manufacture">
  177. 开发厂商:
  178. <div>
  179. <span>{$detail.developer}</span>
  180. </div>
  181. </div>
  182. </div>
  183. </div>
  184. <!-- 相关游戏 -->
  185. <div class="relate-game">
  186. <a href="{:getMobileGameUrl($detail['id'])}" style="float: left;">
  187. <img lazy-src="{$detail.icon}" src="__STATIC__/images/icon/150-150.png" class="smallIcon" />
  188. <div class="content">
  189. <h4>{$detail.nickname}</h4>
  190. <p>{$detail.typename}<span>|</span>{$detail.subjectname}<span>|</span>{$detail.size}</p>
  191. </div>
  192. </a>
  193. <div class="download" style="float: left;margin-top: 0.08rem;">
  194. <a href="javascript:;">下载</a>
  195. <p class="android_down_url">{$detail.download}</p>
  196. <p class="ios_down_url">{$detail.ios_download}</p>
  197. </div>
  198. <img src="__STATIC__/images/mobile/icon/close-white.png" class="close" />
  199. </div>
  200. {include file="layout/footer" /}
  201. {/block}
  202. {block name="detail_js"}
  203. <script src="__STATIC__/js/mobile/swiper.min.js"></script>
  204. <script>
  205. setTimeout(function(){
  206. var w =$(".screenshots>img:last-child").attr('id');
  207. var maxh = w*1.21+1.21;
  208. console.log(w)
  209. console.log(maxh)
  210. $(".screenshots").width(maxh+'rem')
  211. },500)
  212. // 游戏截图放大
  213. $(".info-img").error(function () {
  214. $(this).attr("src", "/static/images/icon/625_990.png");
  215. })
  216. var swiper = new Swiper('.swiper-container', {
  217. width: window.innerWidth,
  218. spaceBetween:20,
  219. pagination: {
  220. el: '.swiper-pagination',
  221. type: 'fraction',
  222. clickable: true
  223. }
  224. });
  225. $(".swiper-container").hide();
  226. $(".swiper-pagination").hide();
  227. $(".screenshots>img").click(function(){
  228. var num = $(this).attr('id');
  229. swiper.slideTo(num, 1000, false);
  230. $(".swiper-container").show();
  231. $(".swiper-pagination").show();
  232. $("body").css("overflow-y","hidden");
  233. $(".swiper-container").css("visibility","inherit");
  234. })
  235. $(".swiper-container").click(function(){
  236. $(".swiper-container").hide();
  237. $(".swiper-pagination").hide();
  238. $("body").css("overflow-y","auto");
  239. })
  240. // 显示隐藏
  241. $(".game-introduce").each(function() {
  242. var rowNum = Math.round($(this).height() / parseFloat($(this).css('line-height')));
  243. if (rowNum > 3) {
  244. $(this).next().show();
  245. $(this).css("height", "0.6rem")
  246. }
  247. })
  248. $(".open-close").click(function() {
  249. var H = $(this).prev().find("div").height();
  250. if ($(this).hasClass("open")) {
  251. $(this).prev().animate({
  252. height: H
  253. }, 500)
  254. $(this).removeClass("open");
  255. $(this).html("隐藏");
  256. } else {
  257. $(this).prev().animate({
  258. height: '0.6rem'
  259. }, 500)
  260. $(this).addClass("open");
  261. $(this).html("展开");
  262. }
  263. })
  264. //头部固定
  265. var hT = $('.game-info-title').offset().top,
  266. hh = $('header').height();
  267. $(window).scroll(function() {
  268. var wS = $(this).scrollTop();
  269. if (wS >= hT - hh) {
  270. // $('.relate-game').css("display","flex");
  271. if($(".relate-game").hasClass("hide")){
  272. }else{
  273. $(".relate-game").fadeIn(500);
  274. $('.game-info-title').addClass("fixed-top");
  275. }
  276. } else {
  277. $('.game-info-title').removeClass("fixed-top");
  278. $(".relate-game").fadeOut(500);
  279. }
  280. });
  281. $(".close").click(function(){
  282. $(".relate-game").fadeOut(500);
  283. setTimeout(function(){
  284. $(".relate-game").addClass("hide");
  285. })
  286. })
  287. // 点击开测的更多
  288. var currentPage = parseInt("{$kcServers->currentPage()}");
  289. var lastPage = parseInt("{$kcServers->lastPage()}");
  290. var total = parseInt("{$kcServers->total()}");
  291. if(total <= 5){
  292. $(".kc-more").hide();
  293. }
  294. var url = "{:getMobileGameUrl($detail['id'])}";
  295. var defaultImg = "__STATIC__/images/icon/150-150.png";
  296. $(".kc-more").click(function(){
  297. $(".kc-more").hide();
  298. $(".game-kc .weui-loadmore").show();
  299. if (currentPage + 1 > lastPage) {
  300. $(".kc-more").hide();
  301. $(".game-kc .weui-loadmore").hide();
  302. return false;
  303. }
  304. $(".game-kc .weui-loadmore").show();
  305. currentPage += 1;
  306. $.ajax({
  307. type: "POST",
  308. timeOut: 10000,
  309. url: url,
  310. data: {
  311. "page": currentPage,
  312. "serverType": 1
  313. },
  314. async: false,
  315. success: function(res) {
  316. console.log(res);
  317. var arr = res.data.data;
  318. arr.forEach(function(val, index) {
  319. var html='';
  320. html += '<ul class="kc-list">'+
  321. ' <li>'+val.serverDate+' '+val.serverTime+'</li>'+
  322. ' <li>'+val.serverName+'</li>';
  323. if(val.subscribe == 1){
  324. // html += '<li><a href="javascript:kf_tip('+val.id+',"kc");">预约</a></li>';
  325. html += "<li><a href=\"javascript:kf_tip("+val.id+",'kc');\">预约</a></li>";
  326. }
  327. html += '</ul>';
  328. $(".kc-info").append(html);
  329. });
  330. },
  331. error: function() {
  332. $.alert("网络错误,请刷新页面重试");
  333. }
  334. });
  335. $.getScript("/static/js/mobile/common.js");
  336. $(".game-kc .weui-loadmore").hide();
  337. if(currentPage >= lastPage){
  338. $(".kc-more").hide();
  339. }
  340. else{
  341. $(".kc-more").show();
  342. }
  343. $(".game-kc .weui-loadmore").hide();
  344. })
  345. // 点击开服更多
  346. var currentKfPage = parseInt("{$kfServers->currentPage()}");
  347. var lastKfPage = parseInt("{$kfServers->lastPage()}");
  348. var kfTotal = parseInt("{$kfServers->total()}");
  349. if(kfTotal <= 5){
  350. $(".kf-more").hide();
  351. }
  352. var kfUrl = "{:getMobileGameUrl($detail['id'])}";
  353. // var defaultImg = "__STATIC__/images/icon/150-150.png";
  354. $(".kf-more").click(function(){
  355. $(".kf-more").hide();
  356. $(".game-kf .weui-loadmore").show();
  357. if (currentKfPage + 1 > lastKfPage) {
  358. $(".kf-more").hide();
  359. $(".game-kf .weui-loadmore").hide();
  360. return false;
  361. }
  362. $(".game-kf .weui-loadmore").show();
  363. currentKfPage += 1;
  364. $.ajax({
  365. type: "POST",
  366. timeOut: 10000,
  367. url: url,
  368. data: {
  369. "page": currentKfPage,
  370. "serverType": 0
  371. },
  372. async: false,
  373. success: function(res) {
  374. console.log(res);
  375. var arr = res.data.data;
  376. arr.forEach(function(val, index) {
  377. var html='';
  378. html += '<ul class="kf-list">'+
  379. ' <li>'+val.serverDate+' '+val.serverTime+'</li>'+
  380. ' <li>'+val.serverName+'</li>';
  381. if(val.subscribe == 1){
  382. html += "<li><a href=\"javascript:kf_tip("+val.id+",'kf');\">预约</a></li>";
  383. }
  384. html += '</ul>';
  385. $(".kf-info").append(html);
  386. });
  387. },
  388. error: function() {
  389. $.alert("网络错误,请刷新页面重试");
  390. }
  391. });
  392. $.getScript("/static/js/mobile/common.js");
  393. $(".game-kf .weui-loadmore").hide();
  394. if(currentKfPage >= lastKfPage){
  395. $(".kf-more").hide();
  396. }
  397. else{
  398. $(".kf-more").show();
  399. }
  400. $(".game-kf .weui-loadmore").hide();
  401. })
  402. // 预约弹窗
  403. function kf_tip(id,kfkc){
  404. $.ajax({
  405. type: "POST",
  406. timeOut: 10000,
  407. url: '/service/subscribe',
  408. data: {
  409. "id": id,
  410. "type": kfkc
  411. },
  412. async: false,
  413. success: function (res) {
  414. // console.log(res);
  415. if (res.code == 1 || res.code == 4 || res.code == 5) {
  416. $.modal({
  417. title: "提示",
  418. text: res.msg,
  419. buttons: [{
  420. text: "确定",
  421. className: "pop-button",
  422. onClick: function() {}
  423. },
  424. {
  425. text: "关闭",
  426. className: "default",
  427. onClick: function() {}
  428. },
  429. ]
  430. });
  431. }
  432. else if (res.code == 2){
  433. window.location.href = res.data;
  434. }
  435. else if (res.code == 3){
  436. $.modal({
  437. title: "提示",
  438. text: res.msg,
  439. buttons: [{
  440. text: "去绑定",
  441. onClick: function() {
  442. // 跳转链接
  443. window.location.href = res.data;
  444. }
  445. },
  446. {
  447. text: "取消",
  448. className: "default",
  449. onClick: function() {}
  450. },
  451. ]
  452. });
  453. }else {
  454. alert(res.msg);
  455. }
  456. },
  457. error: function () {
  458. layer.msg('网络错误,请刷新页面重试');
  459. }
  460. });
  461. }
  462. </script>
  463. {/block}