rankScoreRank.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  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>
  147. var gPageIndex = 1;
  148. var gTotalItems = 0;
  149. var gTotalPages = 0;
  150. var ITEMS_PER_PAGE = 10;
  151. (function(exports){
  152. var App = function(){
  153. this.servername = '电信一';
  154. this.serverNickname = '艾欧尼亚';
  155. this.zone = 'dx1';
  156. this.page = 1;
  157. this.pageItems = 10;
  158. this.totalPages = 0;
  159. this.keywords = '';
  160. this.init();
  161. this.bindFilterEvent();
  162. }
  163. App.prototype.getData = function(){
  164. var baseUrl = "http://api.lolbox.duowan.com/api/v2/rank/ranked/";
  165. var url = baseUrl + this.zone +'?page_num=' + this.page + '&page_items=' + this.pageItems;
  166. return $.ajax({
  167. url: url,
  168. dataType: 'jsonp'
  169. });
  170. }
  171. App.prototype.process = function(playerName, page){
  172. page && (this.page = parseInt(page));
  173. if(page == 0) return;
  174. this.init();
  175. }
  176. App.prototype.init = function(){
  177. var self = this;
  178. this.getData().then(function(data){
  179. //初始化totalPages
  180. if(!self.totalPages) {
  181. gTotalPages = self.totalPages = Math.ceil(data.total_items / self.pageItems);
  182. }
  183. var list = data.results;
  184. if(list && list.length > 0) {
  185. self.render(list);
  186. } else {
  187. template = _.template($('#noDataTipsTmpl').html());
  188. gTotalPages = 0;
  189. $('#rankListBody').html(template({data: ''}));
  190. return;
  191. }
  192. });
  193. }
  194. App.prototype.render = function(data){
  195. var rData = {};
  196. rData.servername = this.servername;
  197. rData.serverNickname = this.serverNickname;
  198. rData.zone = this.zone;
  199. rData.page = this.page;
  200. rData.data = data;
  201. template = _.template($('#dataListsTmpl').html());
  202. $('#rankListBody').html(template({data: rData}));
  203. this.updatePaginator();
  204. }
  205. App.prototype.updatePaginator = function() {
  206. var output = '';
  207. if(gTotalPages){
  208. output += '<a>第' + gPageIndex + '/' + gTotalPages + '页</a>';
  209. if (gPageIndex > 1) {
  210. output += '<a title="上一页" class="pre-next" rel="prev" href="#" onclick="javascript:app.process(null, --gPageIndex);">上一页</a>';
  211. }
  212. if (gPageIndex < (gTotalPages - 1)) {
  213. output += '<a title="下一页" class="pre-next" rel="next" href="#" onclick="javascript:app.process(null, ++gPageIndex);">下一页</a>';
  214. }
  215. 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> ';
  216. }
  217. $('#pages').html(output);
  218. }
  219. App.prototype.bindFilterEvent = function(){
  220. var self = this;
  221. $("#serverFilter").on("click", function(e) {
  222. e.preventDefault();
  223. e.stopPropagation();
  224. $("#serverFilterUl").toggle();
  225. });
  226. $("#serverFilterUl>li").on('click', function(e) {
  227. e.preventDefault();
  228. var value = $(this).attr("data-value"),
  229. text = $(this).html(),
  230. zone = $(this).attr('data-zone');
  231. self.zone = zone;
  232. self.servername = value;
  233. self.serverNickname = text;
  234. self.page = 1;
  235. $('#serverFilter>span').html(text);
  236. $(this).parent().hide();
  237. self.init();
  238. });
  239. $('#searchKey').on('keyup', function(evt){
  240. if(evt.which == 13) {
  241. self.process(this.value);
  242. }
  243. });
  244. $('#btnSearch').click(function(){
  245. var keywords = $('#searchKey');
  246. var val = $('#searchKey').val();
  247. self.process(val);
  248. });
  249. $('.fnMenu')
  250. .on('click', '.refresh', function(evt){
  251. evt.preventDefault();
  252. window.location.reload();
  253. })
  254. .on('click', '.back', function(evt){
  255. evt.preventDefault();
  256. window.history.back();
  257. });
  258. $("#scrollUl,#serverFilterUl").niceScroll({cursorcolor:"#D9D9D9",cursorwidth:"8",cursoropacitymin:1,cursorborder:'none'});
  259. $('body').delegate('#go', 'keyup', function(evt){
  260. if(evt.which == 13) {
  261. paginatorJump();
  262. }
  263. });
  264. }
  265. function paginatorJump() {
  266. var index = Number(document.getElementById('go').value);
  267. if (index > 0 && index <= gTotalPages) {
  268. gPageIndex = index;
  269. app.process(null, gPageIndex);
  270. } else {
  271. $('#rankListBody').html('<tr><td colspan="6" class="errorTips">输入页数不正确</td></tr>');
  272. }
  273. }
  274. var app = new App;
  275. exports.app = app;
  276. exports.paginatorJump = paginatorJump;
  277. })(window);
  278. </script>
  279. <!--海度统计-->
  280. <script type="text/javascript">_hiido_no=0;_hiido_wid=["lbox"];</script>
  281. <script src="http://www.duowan.com/duowan.js" type="text/javascript"></script>
  282. <!--百度统计-->
  283. <script>
  284. var _hmt = _hmt || [];
  285. (function() {
  286. var hm = document.createElement("script");
  287. hm.src = "//hm.baidu.com/hm.js?72772dda37b1e926733138415981abcf";
  288. var s = document.getElementsByTagName("script")[0];
  289. s.parentNode.insertBefore(hm, s);
  290. })();
  291. </script>
  292. <!--[if gt IE 6]><!-->
  293. <script type="text/javascript">
  294. 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)}}}());
  295. </script>
  296. <!--<![endif]-->
  297. </body>
  298. </html>