rankScoreRank.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  6. <title>段位高手榜</title>
  7. <meta name="description" content="" />
  8. <meta name="keywords" content="" />
  9. <link rel="stylesheet" href="css/global.css" />
  10. <style>
  11. body { height: 527px; overflow: hidden; }
  12. .player-name{color:#408bcb;}
  13. </style>
  14. <!--[if IE 7]>
  15. <style>
  16. .heroRankCrumbs .fnMenu{margin-top:-23px;}
  17. .sever-select i{margin: -17px 9px 0!important;}
  18. </style>
  19. <![endif]-->
  20. <!--[if gt IE 6]><!-->
  21. <script type="text/javascript">
  22. !function(t){t.loadScript(["http://szhuodong.duowan.com/feq/lolbox/yy-f2e-header-lolbox.min"])}(function(){function t(t){var e=n(t);document.write(e)}function n(t){for(var n,r="",c=0;n=t[c];c++)r+=e(n);return r}function e(t){var n=[unescape("%3Cscript%20type%3D%22text/javascript%22%20src%3D%22"),"",unescape("%22%3E%3C/script%3E")],e=new Date;return e.setSeconds(0),e.setMilliseconds(0),e=e.getTime(),t+="?t_="+e,n[1]=t,n.join("")}return{loadScript:function(n){n&&n.length&&n instanceof Array&&t(n)}}}())
  23. </script>
  24. <!--<![endif]-->
  25. <script src="js/jquery-1.11.1.min.js"></script>
  26. <script src="js/jquery-migrate-1.2.1.min.js"></script>
  27. <script src="js/jquery.nicescroll.min.js"></script>
  28. </head>
  29. <body scroll="no" style="overflow:hidden;">
  30. <div class="heroRankCrumbs">
  31. <a href="playerSearch.html">战绩查询</a> &gt; 排位榜
  32. <div class="fnMenu">
  33. <a class="icons back" href="javascript:history.back();"><i></i></a>
  34. <a class="icons refresh" href="javascript:location.reload();"><i></i></a>
  35. </div>
  36. </div>
  37. <div class="box heroRanks-tc">
  38. <div class="box-bd">
  39. <div class="mod-tabs clearfix">
  40. <div class="mod-tabs-bd hero-rank">
  41. <div class="mod-tabs-content">
  42. <div class="choose-type">
  43. <ul class="mod-tabs-trigger">
  44. <li class="selected"><a class="stat-sign" stat-sign="master" href="rankScoreRank.html" stat-desc="点击/排位高手榜">排位榜</a></li>
  45. <li><a class="stat-sign" stat-sign="action list" href="zdlRank.html" stat-desc="点击/战斗力排行榜">战斗力榜</a></li>
  46. <!-- <li><a class="stat-sign" stat-sign="hero ace" href="heroesRank.html" stat-desc="点击/英雄高手榜">英雄玩家榜</a></li> -->
  47. </ul>
  48. <div class="fr">
  49. <div class="sever-select" id="serverFilter">
  50. <span>艾欧尼亚</span>
  51. <i></i>
  52. </div>
  53. <ul class="rank-ul server-ul" id="serverFilterUl">
  54. <li data-value="电信一" data-zone="dx1">艾欧尼亚</li>
  55. <li data-value="电信二" data-zone="dx2">祖安</li>
  56. <li data-value="电信三" data-zone="dx3">诺克萨斯</li>
  57. <li data-value="电信四" data-zone="dx4">班德尔城</li>
  58. <li data-value="电信五" data-zone="dx5">皮尔特沃夫</li>
  59. <li data-value="电信六" data-zone="dx6">战争学院</li>
  60. <li data-value="电信七" data-zone="dx7">巨神峰</li>
  61. <li data-value="电信八" data-zone="dx8">雷瑟守备</li>
  62. <li data-value="电信九" data-zone="dx9">裁决之地</li>
  63. <li data-value="电信十" data-zone="dx10">黑色玫瑰</li>
  64. <li data-value="电信十一" data-zone="dx11">暗影岛</li>
  65. <li data-value="电信十二" data-zone="dx12">钢铁烈阳</li>
  66. <li data-value="电信十三" data-zone="dx13">均衡教派</li>
  67. <li data-value="电信十四" data-zone="dx14">水晶之痕</li>
  68. <li data-value="电信十五" data-zone="dx15">影流</li>
  69. <li data-value="电信十六" data-zone="dx16">守望之海</li>
  70. <li data-value="电信十七" data-zone="dx17">征服之海</li>
  71. <li data-value="电信十八" data-zone="dx18">卡拉曼达</li>
  72. <li data-value="电信十九" data-zone="dx19">皮城警备</li>
  73. <li data-value="网通一" data-zone="wt1">比尔吉沃特</li>
  74. <li data-value="网通二" data-zone="wt2">德玛西亚</li>
  75. <li data-value="网通三" data-zone="wt3">弗雷尔卓德</li>
  76. <li data-value="网通四" data-zone="wt4">无畏先锋</li>
  77. <li data-value="网通五" data-zone="wt5">恕瑞玛</li>
  78. <li data-value="网通六" data-zone="wt6">扭曲丛林</li>
  79. <li data-value="网通七" data-zone="wt7">巨龙之巢</li>
  80. <li data-value="教育一" data-zone="jy1">教育网专区</li>
  81. <li data-value="全网一" data-zone="qw1">男爵领域</li>
  82. </ul>
  83. <!--<div class="search-input">
  84. <input class="text" type="text" value="搜索玩家名" onfocus="javascript:if(this.value=='搜索玩家名')this.value='';" id="searchKey">
  85. <i id="btnSearch"></i>
  86. </div>-->
  87. </div>
  88. </div>
  89. <!--<div style="width:100%;overflow:hidden;line-height:70px;text-align:center;font-size:14px;color:#666;">正在修复更新中,稍后开放</div>-->
  90. <div id="dataLists">
  91. <table cellspacing="0" cellpadding="0" border="0" width="100%">
  92. <thead>
  93. <th width="30">排名</th>
  94. <th width="150">玩家名称</th>
  95. <th width="150">服务器</th>
  96. <th width="100">段位/胜点</th>
  97. </thead>
  98. <tbody id="rankListBody" class="tbody">
  99. </tbody>
  100. </table>
  101. </div>
  102. <div id="pages" class="page-nav"></div>
  103. </div>
  104. <div class="mod-tabs-content hide">
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. <script type="text/template" id="dataListsTmpl">
  111. <%
  112. var zone = data.zone,
  113. sName = data.servername,
  114. sNickname = data.serverNickname;
  115. _.each(data.data, function(item, key){
  116. var player = item.player;
  117. var href = "generalRecord.html?userId=" + player.user_id + "&gameZone=" + zone + "&playerName=" + player.pn + "&serverName=" + sName;
  118. var rankVal = item.idx, rate = player.rate;
  119. var tierRank = player.tier_rank;
  120. %>
  121. <tr>
  122. <td align="center" class="type1">
  123. <% if(rankVal == 1){%>
  124. <i class="rank-type rank-1"></i>
  125. <%} else if(rankVal == 2){%>
  126. <i class="rank-type rank-2"></i>
  127. <%} else if(rankVal == 3) {%>
  128. <i class="rank-type rank-3"></i>
  129. <%} else {%>
  130. <%=rankVal%>
  131. <%}%>
  132. </td>
  133. <td align="middle" class="type2"><a class="player-name" href="<%=href%>"><%= player.pn %></a></td>
  134. <td align="center" class="type3"><%= sNickname %> <%= sName %></td>
  135. <td align="center" class="type4"><%= tierRank.tier.full_name_cn %>/<%= player.league_points %></td>
  136. </tr>
  137. <% }); %>
  138. </script>
  139. <script type="text/template" id="noDataTipsTmpl">
  140. <tr>
  141. <td colspan="4" class="errorTips">对不起,该玩家还没有上榜~~</td>
  142. </tr>
  143. </script>
  144. <script src="js/jquery-1.11.1.min.js"></script> <script src="js/jquery-migrate-1.2.1.min.js"></script>
  145. <script src="js/underscore.js"></script>
  146. <script type="text/javascript" src="http://sz.duowan.com/s/ya/ya.1.3.1-min.js"></script>
  147. <script src="js/new_stat.js"></script>
  148. <script src="js/jquery.nicescroll.min.js"></script>
  149. <script>
  150. var gPageIndex = 1;
  151. var gTotalItems = 0;
  152. var gTotalPages = 0;
  153. var ITEMS_PER_PAGE = 10;
  154. (function(exports){
  155. var App = function(){
  156. this.servername = '电信一';
  157. this.serverNickname = '艾欧尼亚';
  158. this.zone = 'dx1';
  159. this.page = 1;
  160. this.pageItems = 10;
  161. this.totalPages = 0;
  162. this.keywords = '';
  163. this.init();
  164. this.bindFilterEvent();
  165. }
  166. App.prototype.getData = function(){
  167. var baseUrl = "http://api.lolbox.duowan.com/api/v2/rank/ranked/";
  168. var url = baseUrl + this.zone +'?page_num=' + this.page + '&page_items=' + this.pageItems;
  169. return $.ajax({
  170. url: url,
  171. dataType: 'jsonp'
  172. });
  173. }
  174. App.prototype.process = function(playerName, page){
  175. page && (this.page = parseInt(page));
  176. if(page == 0) return;
  177. this.init();
  178. }
  179. App.prototype.init = function(){
  180. var self = this;
  181. this.getData().then(function(data){
  182. //初始化totalPages
  183. if(!self.totalPages) {
  184. gTotalPages = self.totalPages = Math.ceil(data.total_items / self.pageItems);
  185. }
  186. var list = data.results;
  187. if(list && list.length > 0) {
  188. self.render(list);
  189. } else {
  190. template = _.template($('#noDataTipsTmpl').html());
  191. gTotalPages = 0;
  192. $('#rankListBody').html(template({data: ''}));
  193. return;
  194. }
  195. });
  196. }
  197. App.prototype.render = function(data){
  198. var rData = {};
  199. rData.servername = this.servername;
  200. rData.serverNickname = this.serverNickname;
  201. rData.zone = this.zone;
  202. rData.page = this.page;
  203. rData.data = data;
  204. template = _.template($('#dataListsTmpl').html());
  205. $('#rankListBody').html(template({data: rData}));
  206. this.updatePaginator();
  207. }
  208. App.prototype.updatePaginator = function() {
  209. var output = '';
  210. if(gTotalPages){
  211. output += '<a>第' + gPageIndex + '/' + gTotalPages + '页</a>';
  212. if (gPageIndex > 1) {
  213. output += '<a title="上一页" class="pre-next" rel="prev" href="#" onclick="javascript:app.process(null, --gPageIndex);">上一页</a>';
  214. }
  215. if (gPageIndex < (gTotalPages - 1)) {
  216. output += '<a title="下一页" class="pre-next" rel="next" href="#" onclick="javascript:app.process(null, ++gPageIndex);">下一页</a>';
  217. }
  218. output += '<a class="current">第 <input type="text" id="go" size=1 value="' + (Number(gPageIndex)) + '"/>页 </a> <a href="#" onclick="javascript:paginatorJump();" class="page-go"> Go </a> ';
  219. }
  220. $('#pages').html(output);
  221. }
  222. App.prototype.bindFilterEvent = function(){
  223. var self = this;
  224. $("#serverFilter").on("click", function(e) {
  225. e.preventDefault();
  226. e.stopPropagation();
  227. $("#serverFilterUl").toggle();
  228. });
  229. $("#serverFilterUl>li").on('click', function(e) {
  230. e.preventDefault();
  231. var value = $(this).attr("data-value"),
  232. text = $(this).html(),
  233. zone = $(this).attr('data-zone');
  234. self.zone = zone;
  235. self.servername = value;
  236. self.serverNickname = text;
  237. self.page = 1;
  238. $('#serverFilter>span').html(text);
  239. $(this).parent().hide();
  240. self.init();
  241. });
  242. $('#searchKey').on('keyup', function(evt){
  243. if(evt.which == 13) {
  244. self.process(this.value);
  245. }
  246. });
  247. $('#btnSearch').click(function(){
  248. var keywords = $('#searchKey');
  249. var val = $('#searchKey').val();
  250. self.process(val);
  251. });
  252. $('.fnMenu')
  253. .on('click', '.refresh', function(evt){
  254. evt.preventDefault();
  255. window.location.reload();
  256. })
  257. .on('click', '.back', function(evt){
  258. evt.preventDefault();
  259. window.history.back();
  260. });
  261. $("#scrollUl,#serverFilterUl").niceScroll({cursorcolor:"#D9D9D9",cursorwidth:"8",cursoropacitymin:1,cursorborder:'none'});
  262. $('body').delegate('#go', 'keyup', function(evt){
  263. if(evt.which == 13) {
  264. paginatorJump();
  265. }
  266. });
  267. }
  268. function paginatorJump() {
  269. var index = Number(document.getElementById('go').value);
  270. if (index > 0 && index <= gTotalPages) {
  271. gPageIndex = index;
  272. app.process(null, gPageIndex);
  273. } else {
  274. $('#rankListBody').html('<tr><td colspan="6" class="errorTips">输入页数不正确</td></tr>');
  275. }
  276. }
  277. var app = new App;
  278. exports.app = app;
  279. exports.paginatorJump = paginatorJump;
  280. })(window);
  281. </script>
  282. <!--海度统计-->
  283. <script type="text/javascript">_hiido_no=0;_hiido_wid=["lbox"];</script>
  284. <script src="http://www.duowan.com/duowan.js" type="text/javascript"></script>
  285. <!--百度统计-->
  286. <script>
  287. var _hmt = _hmt || [];
  288. (function() {
  289. var hm = document.createElement("script");
  290. hm.src = "//hm.baidu.com/hm.js?72772dda37b1e926733138415981abcf";
  291. var s = document.getElementsByTagName("script")[0];
  292. s.parentNode.insertBefore(hm, s);
  293. })();
  294. </script>
  295. <!--[if gt IE 6]><!-->
  296. <script type="text/javascript">
  297. window.onerror = function(a,b,c){ return true};!function(t){t.loadScript(["http://szhuodong.duowan.com/feq/lolbox/yy-f2e-lolbox.min"])}(function(){function t(e,a){var n=a[e];if(n){e++;var o=document.createElement("script");o.type="text/javascript",o.setAttribute("async","async"),o.onload=o.onreadystatechange=function(){return o.readyState&&"complete"!==o.readyState&&"loaded"!==o.readyState?!1:(o.onload=o.onreadystatechange=null,void t(e,a))};var c=new Date;c.setSeconds(0),c.setMilliseconds(0),c=c.getTime(),o.async=!0,o.src=n+"?_="+c,document.getElementsByTagName("head")[0].appendChild(o)}}return{loadScript:function(e){e&&e.length&&e instanceof Array&&t(0,e)}}}());
  298. </script>
  299. <!--<![endif]-->
  300. </body>
  301. </html>