recordDetail.tmpl 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. <%
  2. data = data.player_game_list[0];
  3. var groupNameWinOrLose;
  4. var bannedHeroes = data.banned_champions;
  5. var userInfoClass = bannedHeroes.length > 0 ? '' : 'hide';
  6. var gameTypeObj = data.game_type_obj;
  7. var localTime = moment.utc(data.end_timestamp).toDate();
  8. localTime = moment(localTime).format('YYYY-MM-DD HH:mm:ss'),
  9. timeStrArr = localTime.split(' ')[1].split(':'),endTime = timeStrArr[0] + ':' + timeStrArr[1];
  10. var teamWin = data.team_win;
  11. var teamLose = data.team_lose;
  12. var killStat = parseInt(teamWin.total_killed) + '/' + parseInt(teamLose.total_killed);
  13. var goldStat = parseInt(teamWin.gold_earned_in_k) + '/' + parseInt(teamLose.gold_earned_in_k)+'K';
  14. // 游戏时长
  15. var game_time__min = parseInt(data.game_length % 86400 % 3600 / 60);
  16. var game_time__sec = parseInt(data.game_length % 86400 % 3600 % 60 % 60);
  17. %>
  18. <div class="r-top">
  19. <p><span>人头:<%=killStat%></span><span>金钱:<%=goldStat%></span><span>结束:<%=endTime%></span><span>时长:<%=game_time__min%>:<%=game_time__sec%></span></p>
  20. <a class="user-info <%=userInfoClass%>" href="javascript:void(0);"><i class="user-icon"></i>禁用英雄</a>
  21. <ul class="user-img <%=userInfoClass%>">
  22. <%_.each(bannedHeroes, function(item) {%>
  23. <li>
  24. <img
  25. src="<%= staticImg + '/champions/' + item.name + '_28x28.jpg' %>"
  26. alt="<%=item.title%>"
  27. title="<%=item.title%>"
  28. />
  29. </li>
  30. <%});%>
  31. </ul>
  32. </div>
  33. <div id="detailBattle" class="r-table tab-content">
  34. <table id="zj-table-top" cellSpacing=0 cellPadding=0 border="0">
  35. <tr>
  36. <th class="col1">
  37. <div class="match-result">
  38. <span><em class="zj-win"></em>胜利方</span>
  39. <!-- <span><em class="zj-fail"></em>失败方</span> -->
  40. </div>
  41. </th>
  42. <% if (data.queueType != 'ODIN_UNRANKED') { %>
  43. <th class="col2">金钱</th>
  44. <th class="col3">杀/死/助</th>
  45. <% } else { %>
  46. <th class="col3">夺/拔/助</th>
  47. <% } %>
  48. <th class="col4">
  49. <span class="sel-tab-link">
  50. <a href="javascript:;" class="chuzhuang-link link-on" data-type="chuzhuang" title="点击看出装">出装</a>
  51. <a href="javascript:;" class="early-data-link" data-type="early-data" title="点击看前10分钟数据" style="color:#666;">查看前10分钟数据</a>
  52. </span>
  53. </th>
  54. </tr>
  55. </table>
  56. <div class="zj-table">
  57. <% var idx = 1, zjClass = '';
  58. if (data.is_very_surprise_winner) {
  59. zjClass = "zj-table--big-changeover";
  60. } else {
  61. if (data.is_surprise_winner) {
  62. zjClass="zj-table--changeover";
  63. }
  64. }
  65. %>
  66. <div id="zj-table--A" class="<%=zjClass%>">
  67. <div class="team-flag"></div>
  68. <table>
  69. <%
  70. var winPlayers = data.team_win.player_champions;
  71. if (winPlayers.length > 0) {
  72. groupNameWinOrLose = "winner-group";
  73. _.each(winPlayers, function(player) {
  74. var leaverFlag, urlAvatar, summonerName,summonerTitle, pnTitle,urlDetail,totalLen,extraClass,sn,pn, GOLD_EARNED,KILL_DEATHS_ASSISTS;
  75. if (player.is_deserter) {
  76. leaverFlag = "<span class='red'>(逃)</span>";
  77. } else {
  78. leaverFlag = "";
  79. }
  80. var hoverPN;//英雄头像hover时传的playerName
  81. var champion = player.champion;
  82. var playerInfo = player.player;
  83. var serverName = data.game_zone.server_name;
  84. var pInfo = {
  85. userId: player.player.user_id,
  86. gameZone: data.game_zone.pinyin
  87. };
  88. if (player.is_bot) {
  89. urlAvatar = staticImg + '/champions/' + champion.name + '_40x40.jpg';
  90. summonerTitle = playerInfo.pn;
  91. summonerName = playerInfo.pn + leaverFlag;
  92. pnTitle = playerInfo.pn;
  93. urlDetail = null;
  94. hoverPN = '';
  95. } else {
  96. hoverPN = playerInfo.pn;
  97. summonerTitle = playerInfo.pn;
  98. summonerName = playerInfo.pn + leaverFlag;
  99. urlAvatar = staticImg + '/champions/' + champion.name + '_40x40.jpg';
  100. sn = encodeURIComponent(serverName);
  101. pn = encodeURIComponent(playerInfo.pn);
  102. urlDetail = "generalRecord.html?serverName="+sn +"&playerName="+pn + "&userId=" + pInfo.userId + "&gameZone=" + pInfo.gameZone;
  103. if( pInfo.userId ){
  104. urlDetail = "generalRecord.html?serverName="+sn +"&playerName="+pn + "&userId=" + pInfo.userId + "&gameZone=" + pInfo.gameZone;
  105. }else{
  106. urlDetail = "javascript:;";
  107. }
  108. }
  109. var strBoxTitle = '';
  110. if (player['honors'] && player['honors'].length > 0) {
  111. for(var i=0,len=player['honors'].length;i<len;i++) {
  112. var item = player['honors'][i], killClass = '';
  113. switch(item.name) {
  114. case 'brilliant_largest_killing_spree': killClass = 'brilliant_largestKillingSpree';break;
  115. case 'kill4': killClass = '4kill';break;
  116. case 'kill5': killClass = '5kill';break;
  117. case 'kill6': killClass = '6kill';break;
  118. default: killClass = item.name;
  119. }
  120. strBoxTitle += "<em class='zj-"+ killClass +" zj-s' title='" + item.desc + "' data-honour-key='" + item.name + "'></em>";
  121. }
  122. }
  123. KILL_DEATHS_ASSISTS = player.total_killed + '/' + player.total_death + '/' + player.total_assist;
  124. var strZB = '';
  125. var zhuang_bei_array = player['items'];
  126. if (zhuang_bei_array && zhuang_bei_array.length > 0) {
  127. for(var i=0,len=zhuang_bei_array.length;i<len;i++) {
  128. var item = zhuang_bei_array[i];
  129. var url_img = staticImg + '/items/' + item.id + '_40x40.jpg';
  130. strZB += '<li><img src="' + url_img + '" ' + 'title="' + item.name + ' ' + item.description + '" ' + 'alt="' + item.name + ' ' + item.description+ '" /></li>';
  131. }
  132. }
  133. var statDataIn10Min = player.kda_10;
  134. // MVP或者是大腿
  135. var isMVPOrHope = '';
  136. var flagMvpCarry = player.flag_mvp_carry;
  137. if (flagMvpCarry == 1) {
  138. isMVPOrHope = "team-name--stronger";
  139. } else if (flagMvpCarry == 2) {
  140. isMVPOrHope = "team-name--mvp";
  141. }
  142. var p = player.player;
  143. var pGameZone = data.game_zone.pinyin;
  144. var pUserId = p.user_id;
  145. %>
  146. <tr>
  147. <td class="col1">
  148. <div class="team-name <%=isMVPOrHope%>">
  149. <span class="flag"></span> <span data-indent="<%=idx%>" class="avatar" game-zone="<%=pGameZone%>" user-id="<%=pUserId%>">
  150. <img src="<%=urlAvatar%>" data-playerName="<%=hoverPN%>" data-serverName="<%=serverName%>" data-heroName="<%=champion.name%>" data-uid="<%=playerInfo.user_id%>"/>
  151. </span>
  152. <% if (urlDetail) { %>
  153. <a user-id="<%=pUserId%>" game-zone="<%=pGameZone%>" data-playerName="<%=hoverPN%>" href="<%=urlDetail%>" title="<%=summonerTitle%>"><%=summonerName%></a>
  154. <% } else { %>
  155. <span class="bot" title="<%=summonerTitle%>">
  156. <%=summonerName%>
  157. </span>
  158. <% } %>
  159. <i class="icon-mvp-carry"></i>
  160. <div class="em-content"><%=strBoxTitle%></div>
  161. </div>
  162. </td>
  163. <% if (data.queueType != 'ODIN_UNRANKED') { %>
  164. <td class="col2"><%=player['gold_earned_in_k']%>k</td>
  165. <% } %>
  166. <td class="col3"><%=KILL_DEATHS_ASSISTS%></td>
  167. <td class="col4">
  168. <div class="u-weapon">
  169. <ul class="chuzhuang">
  170. <%=strZB%>
  171. </ul>
  172. <ul class="early-data">
  173. <li><span class="minions-killed">
  174. 补兵:
  175. <%if (statDataIn10Min && statDataIn10Min['m'] >= 80) {%>
  176. <em style="font-weight: bold; color: #f19000">
  177. <%} else if (statDataIn10Min && statDataIn10Min['m'] >= 70) {%>
  178. <em style="font-weight: bold">
  179. <%}%>
  180. <%= (statDataIn10Min && statDataIn10Min['m'].toString()) || '-' %>
  181. <%if (statDataIn10Min && statDataIn10Min['m'] >= 70) {%>
  182. </em>
  183. <%}%>
  184. </span>
  185. 杀死助:<%=(statDataIn10Min && statDataIn10Min['k'].toString()) || '-'%>/<%=(statDataIn10Min && statDataIn10Min['d'].toString()) || '-'%>/<%=(statDataIn10Min && statDataIn10Min['a'].toString()) || '-'%>
  186. </li>
  187. </ul>
  188. </div>
  189. </td>
  190. </tr>
  191. <%
  192. idx++;});
  193. for (var i = winPlayers.length; i < 5; i ++) {
  194. %>
  195. <tr><td class='col1'></td><td class='col2'></td><td class='col3'></td><td class='col4'></td></tr>
  196. <% }
  197. }
  198. %>
  199. </table>
  200. </div>
  201. <div class="river-chu"></div>
  202. <div id="zj-table--B">
  203. <div class="team-flag"></div>
  204. <table>
  205. <%
  206. var loserPlayers = data.team_lose.player_champions;
  207. if (loserPlayers.length > 0) {
  208. groupNameWinOrLose = "fail-group";
  209. _.each(loserPlayers, function(player) {
  210. var leaverFlag, urlAvatar, summonerName, summonerTitle, pnTitle,urlDetail,totalLen,extraClass,sn,pn, GOLD_EARNED,KILL_DEATHS_ASSISTS;
  211. if (player.is_deserter) {
  212. leaverFlag = "<span class='red'>(逃)</span>";
  213. } else {
  214. leaverFlag = "";
  215. }
  216. var hoverPN;//英雄头像hover时传的playerName
  217. var champion = player.champion;
  218. var playerInfo = player.player;
  219. var serverName = data.game_zone.server_name;
  220. var pInfo = {
  221. userId: player.player.user_id,
  222. gameZone: data.game_zone.pinyin
  223. };
  224. if (player.is_bot) {
  225. urlAvatar = staticImg + '/champions/' + champion.name + '_40x40.jpg';
  226. summonerTitle = playerInfo.pn;
  227. summonerName = playerInfo.pn + leaverFlag;
  228. pnTitle = playerInfo.pn;
  229. urlDetail = null;
  230. hoverPN = '';
  231. } else {
  232. hoverPN = playerInfo.pn;
  233. summonerTitle = playerInfo.pn;
  234. summonerName = playerInfo.pn + leaverFlag;
  235. urlAvatar = staticImg + '/champions/' + champion.name + '_40x40.jpg';
  236. sn = encodeURIComponent(serverName);
  237. pn = encodeURIComponent(playerInfo.pn);
  238. /*userId为null或者0时不跳转*/
  239. if( pInfo.userId ){
  240. urlDetail = "generalRecord.html?serverName="+sn +"&playerName="+pn + "&userId=" + pInfo.userId + "&gameZone=" + pInfo.gameZone;
  241. }else{
  242. urlDetail = "javascript:;";
  243. }
  244. }
  245. var strBoxTitle = '';
  246. if (player['honors'] && player['honors'].length > 0) {
  247. for(var i=0,len=player['honors'].length;i<len;i++) {
  248. var item = player['honors'][i], killClass = '';
  249. switch(item.name) {
  250. case 'brilliant_largest_killing_spree': killClass = 'brilliant_largestKillingSpree';break;
  251. case 'kill4': killClass = '4kill';break;
  252. case 'kill5': killClass = '5kill';break;
  253. case 'kill6': killClass = '6kill';break;
  254. default: killClass = item.name;
  255. }
  256. strBoxTitle += "<em class='zj-"+ killClass +" zj-s' title='" + item.desc + "' data-honour-key='" + item.name + "'></em>";
  257. }
  258. }
  259. KILL_DEATHS_ASSISTS = player.total_killed + '/' + player.total_death + '/' + player.total_assist;
  260. var strZB = '';
  261. var zhuang_bei_array =player['items'];
  262. if (zhuang_bei_array && zhuang_bei_array.length > 0) {
  263. for(var i=0,len=zhuang_bei_array.length;i<len;i++) {
  264. var item = zhuang_bei_array[i];
  265. var url_img = staticImg + '/items/' + item.id + '_40x40.jpg'
  266. strZB += '<li><img src="' + url_img + '" ' + 'title="' + item.name + ' ' + item.description + '" ' + 'alt="' + item.name + ' ' + item.description+ '" /></li>';
  267. }
  268. }
  269. var statDataIn10Min = player.kda_10;
  270. // MVP或者是大腿
  271. var isMVPOrHope = '';
  272. var flagMvpCarry = player.flag_mvp_carry;
  273. if (flagMvpCarry == 1) {
  274. isMVPOrHope = "team-name--stronger";
  275. } else if (flagMvpCarry == 2) {
  276. isMVPOrHope = "team-name--mvp";
  277. }
  278. var p = player.player;
  279. var pGameZone = data.game_zone.pinyin;
  280. var pUserId = p.user_id;
  281. %>
  282. <tr>
  283. <td class="col1">
  284. <div class="team-name <%=isMVPOrHope%>">
  285. <span class="flag"></span> <span data-indent="<%=idx%>"
  286. class="avatar" game-zone="<%=pGameZone%>" user-id="<%=pUserId%>">
  287. <img src="<%=urlAvatar%>" data-playerName="<%=hoverPN%>" data-serverName="<%=serverName%>" data-heroName="<%=champion.name%>" data-uid="<%=playerInfo.user_id%>"/>
  288. </span>
  289. <% if (urlDetail) { %>
  290. <a user-id="<%=pUserId%>" game-zone="<%=pGameZone%>" data-playerName="<%=hoverPN%>" href="<%=urlDetail%>" title="<%=summonerTitle%>"><%=summonerName%></a>
  291. <% } else { %>
  292. <span class="bot" title="<%=summonerTitle%>">
  293. <%=summonerName%>
  294. </span>
  295. <% } %>
  296. <i class="icon-mvp-carry"></i>
  297. <div class="em-content"><%=strBoxTitle%></div>
  298. </div>
  299. </td>
  300. <% if (data.queueType != 'ODIN_UNRANKED') { %>
  301. <td class="col2"><%=player['gold_earned_in_k']%>k</td>
  302. <% } %>
  303. <td class="col3"><%=KILL_DEATHS_ASSISTS%></td>
  304. <td class="col4">
  305. <div class="u-weapon">
  306. <ul class="chuzhuang">
  307. <%=strZB%>
  308. </ul>
  309. <ul class="early-data">
  310. <li><span class="minions-killed">
  311. 补兵:
  312. <%if (statDataIn10Min && statDataIn10Min['m'] >= 80) {%>
  313. <em style="font-weight: bold; color: #f19000">
  314. <%} else if (statDataIn10Min && statDataIn10Min['m'] >= 70) {%>
  315. <em style="font-weight: bold">
  316. <%}%>
  317. <%= (statDataIn10Min && statDataIn10Min['m'].toString()) || '-' %>
  318. <%if (statDataIn10Min && statDataIn10Min['m'] >= 70) {%>
  319. </em>
  320. <%}%>
  321. </span>
  322. 杀死助:<%=(statDataIn10Min && statDataIn10Min['k'].toString()) || '-'%>/<%=(statDataIn10Min && statDataIn10Min['d'].toString()) || '-'%>/<%=(statDataIn10Min && statDataIn10Min['a'].toString()) || '-'%>
  323. </li>
  324. </ul>
  325. </div>
  326. </td>
  327. </tr>
  328. <% idx++;});
  329. for (var i = loserPlayers.length; i < 5; i ++) {
  330. %>
  331. <tr><td class='col1'></td><td class='col2'></td><td class='col3'></td><td class='col4'></td></tr>
  332. <%}}%>
  333. </table>
  334. </div>
  335. </div>
  336. </div>
  337. <div id="mod-tips-s1" class="mod-tips-s1">
  338. <div class="mod-tips-bg">
  339. <div class="mod-tips-content"></div>
  340. </div>
  341. <i class="arrow l"></i>
  342. </div>