rankScoreRank.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  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. </ul>
  82. <div class="search-input">
  83. <input class="text" type="text" value="搜索英雄" onfocus="javascript:if(this.value=='搜索英雄')this.value='';" id="searchKey">
  84. <i id="btnSearch"></i>
  85. </div>
  86. </div>
  87. </div>
  88. <div id="dataLists">
  89. <table cellspacing="0" cellpadding="0" border="0" width="100%">
  90. <thead>
  91. <th width="30">排名</th>
  92. <th width="150">玩家名称</th>
  93. <th width="150">服务器</th>
  94. <th width="100">段位/胜点</th>
  95. </thead>
  96. <tbody id="rankListBody" class="tbody">
  97. </tbody>
  98. </table>
  99. </div>
  100. <div id="pages" class="page-nav"></div>
  101. </div>
  102. <div class="mod-tabs-content hide">
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. <script type="text/template" id="dataListsTmpl">
  109. <%
  110. var zone = data.zone,
  111. sName = data.servername,
  112. sNickname = data.serverNickname;
  113. _.each(data.data, function(item, key){
  114. var player = item.player;
  115. var href = "generalRecord.html?userId=" + player.user_id + "&gameZone=" + zone + "&playerName=" + player.pn + "&serverName=" + sName;
  116. var rankVal = item.idx, rate = player.rate;
  117. var tierRank = player.tier_rank;
  118. %>
  119. <tr>
  120. <td align="center" class="type1">
  121. <% if(rankVal == 1){%>
  122. <i class="rank-type rank-1"></i>
  123. <%} else if(rankVal == 2){%>
  124. <i class="rank-type rank-2"></i>
  125. <%} else if(rankVal == 3) {%>
  126. <i class="rank-type rank-3"></i>
  127. <%} else {%>
  128. <%=rankVal%>
  129. <%}%>
  130. </td>
  131. <td align="middle" class="type2"><a class="player-name" href="<%=href%>"><%= player.pn %></a></td>
  132. <td align="center" class="type3"><%= sNickname %> <%= sName %></td>
  133. <td align="center" class="type4"><%= tierRank.tier.full_name_cn %>/<%= player.league_points %></td>
  134. </tr>
  135. <% }); %>
  136. </script>
  137. <script type="text/template" id="noDataTipsTmpl">
  138. <tr>
  139. <td colspan="4" class="errorTips">对不起,该玩家还没有上榜~~</td>
  140. </tr>
  141. </script>
  142. <script src="js/jquery-1.11.1.min.js"></script> <script src="js/jquery-migrate-1.2.1.min.js"></script>
  143. <script src="js/underscore.js"></script>
  144. <script type="text/javascript" src="http://sz.duowan.com/s/ya/ya.1.3.1-min.js"></script>
  145. <script src="js/new_stat.js"></script>
  146. <script src="js/jquery.nicescroll.min.js"></script>
  147. <script>
  148. var gPageIndex = 1;
  149. var gTotalItems = 0;
  150. var gTotalPages = 0;
  151. var ITEMS_PER_PAGE = 10;
  152. (function(exports){
  153. var App = function(){
  154. this.servername = '电信一';
  155. this.serverNickname = '艾欧尼亚';
  156. this.zone = 'dx1';
  157. this.page = 1;
  158. this.pageItems = 10;
  159. this.totalPages = 0;
  160. this.keywords = '';
  161. this.init();
  162. this.bindFilterEvent();
  163. }
  164. App.prototype.getData = function(){
  165. var baseUrl = "http://api.lolbox.duowan.com/api/v2/rank/ranked/";
  166. var url = baseUrl + this.zone +'?page_num=' + this.page + '&page_items=' + this.pageItems;
  167. return $.ajax({
  168. url: url,
  169. dataType: 'jsonp'
  170. });
  171. }
  172. App.prototype.process = function(playerName, page){
  173. page && (this.page = parseInt(page));
  174. if(page == 0) return;
  175. this.init();
  176. }
  177. App.prototype.init = function(){
  178. var self = this;
  179. this.getData().then(function(data){
  180. //初始化totalPages
  181. if(!self.totalPages) {
  182. gTotalPages = self.totalPages = Math.ceil(data.total_items / self.pageItems);
  183. }
  184. var list = data.results;
  185. if(list && list.length > 0) {
  186. self.render(list);
  187. } else {
  188. template = _.template($('#noDataTipsTmpl').html());
  189. gTotalPages = 0;
  190. $('#rankListBody').html(template({data: ''}));
  191. return;
  192. }
  193. });
  194. }
  195. App.prototype.render = function(data){
  196. var rData = {};
  197. rData.servername = this.servername;
  198. rData.serverNickname = this.serverNickname;
  199. rData.zone = this.zone;
  200. rData.page = this.page;
  201. rData.data = data;
  202. template = _.template($('#dataListsTmpl').html());
  203. $('#rankListBody').html(template({data: rData}));
  204. this.updatePaginator();
  205. }
  206. App.prototype.updatePaginator = function() {
  207. var output = '';
  208. if(gTotalPages){
  209. output += '<a>第' + gPageIndex + '/' + gTotalPages + '页</a>';
  210. if (gPageIndex > 1) {
  211. output += '<a title="上一页" class="pre-next" rel="prev" href="#" onclick="javascript:app.process(null, --gPageIndex);">上一页</a>';
  212. }
  213. if (gPageIndex < (gTotalPages - 1)) {
  214. output += '<a title="下一页" class="pre-next" rel="next" href="#" onclick="javascript:app.process(null, ++gPageIndex);">下一页</a>';
  215. }
  216. 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> ';
  217. }
  218. $('#pages').html(output);
  219. }
  220. App.prototype.bindFilterEvent = function(){
  221. var self = this;
  222. $("#serverFilter").on("click", function(e) {
  223. e.preventDefault();
  224. e.stopPropagation();
  225. $("#serverFilterUl").toggle();
  226. });
  227. $("#serverFilterUl>li").on('click', function(e) {
  228. e.preventDefault();
  229. var value = $(this).attr("data-value"),
  230. text = $(this).html(),
  231. zone = $(this).attr('data-zone');
  232. self.zone = zone;
  233. self.servername = value;
  234. self.serverNickname = text;
  235. self.page = 1;
  236. $('#serverFilter>span').html(text);
  237. $(this).parent().hide();
  238. self.init();
  239. });
  240. $('#searchKey').on('keyup', function(evt){
  241. if(evt.which == 13) {
  242. self.process(this.value);
  243. }
  244. });
  245. $('#btnSearch').click(function(){
  246. var keywords = $('#searchKey');
  247. var val = $('#searchKey').val();
  248. self.process(val);
  249. });
  250. $('.fnMenu')
  251. .on('click', '.refresh', function(evt){
  252. evt.preventDefault();
  253. window.location.reload();
  254. })
  255. .on('click', '.back', function(evt){
  256. evt.preventDefault();
  257. window.history.back();
  258. });
  259. $("#scrollUl,#serverFilterUl").niceScroll({cursorcolor:"#D9D9D9",cursorwidth:"8",cursoropacitymin:1,cursorborder:'none'});
  260. $('body').delegate('#go', 'keyup', function(evt){
  261. if(evt.which == 13) {
  262. paginatorJump();
  263. }
  264. });
  265. }
  266. function paginatorJump() {
  267. var index = Number(document.getElementById('go').value);
  268. if (index > 0 && index <= gTotalPages) {
  269. gPageIndex = index;
  270. app.process(null, gPageIndex);
  271. } else {
  272. $('#rankListBody').html('<tr><td colspan="6" class="errorTips">输入页数不正确</td></tr>');
  273. }
  274. }
  275. var app = new App;
  276. exports.app = app;
  277. exports.paginatorJump = paginatorJump;
  278. })(window);
  279. </script>
  280. <!--海度统计-->
  281. <script type="text/javascript">_hiido_no=0;_hiido_wid=["lbox"];</script>
  282. <script src="http://www.duowan.com/duowan.js" type="text/javascript"></script>
  283. <!--百度统计-->
  284. <script>
  285. var _hmt = _hmt || [];
  286. (function() {
  287. var hm = document.createElement("script");
  288. hm.src = "//hm.baidu.com/hm.js?72772dda37b1e926733138415981abcf";
  289. var s = document.getElementsByTagName("script")[0];
  290. s.parentNode.insertBefore(hm, s);
  291. })();
  292. </script>
  293. <!--[if gt IE 6]><!-->
  294. <script type="text/javascript">
  295. 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)}}}());
  296. </script>
  297. <!--<![endif]-->
  298. </body>
  299. </html>