1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <% if(data.length > 0) { %>
- <ul class="recent-list">
- <%
- var matchHistory = data;
- for(var i=0;i<matchHistory.length;i++) {
- var item = matchHistory[i];
- var champion = item.champion;
- var imgSrc = staticImg + '/champions/' + champion.name + '_40x40.jpg';
-
- // 时间计算
- var localTime = moment.utc(item.created).toDate();
- localTime = moment(localTime).format('YYYY-MM-DD HH:mm:ss');
- var timeArr = localTime.split(' ');
- var monDayArr = timeArr[0].split('-');
- var hourMinArr = timeArr[1].split(':');
- var time = monDayArr[1] + '-' + monDayArr[2] + ' ' + hourMinArr[0] + ':' + hourMinArr[1];
- var winHtml = "";
- if(item.battle_result) {
- winHtml = '<em class="green">' + (item.lastday == 1 ? '算你狠' : '胜利') + '</em>';
- } else {
- winHtml = '<em class="red">' + (item.lastday == 0 ? '失败' : '失败') + '</em>';
- }
- var name = champion.display_name.concat(champion.title);
- %>
- <li data-id="<%=item.game_id%>" data-name="<%=name%>" data-enname="<%=champion.name%>">
- <%if (item.flag_mvp_carry == 1) {%>
- <i class='item--mvp'></i>
- <%} else if (item.flag_mvp_carry == 2) {%>
- <i class='item--stronger'></i>
- <%} %>
- <span class="avatar">
- <img src="<%=imgSrc%>" alt="<%=champion.name%>" title="<%=champion.title%>"/>
- </span>
- <p>
- <%=winHtml%>
- </p>
- <p class="info">
- <span class="game" style="width:48px;height:25px;overflow:hidden;text-align: left" title="<%=item.game_type.name_cn%>"><%=item.game_type.name_cn%></span><span style="padding-left:2px;"><%=time%></span>
- </p>
-
- <!-- <%
- if (data.isSelf) {
- if (!item.collected) {
- %>
- <i data-time="<%=item.time%>" class="add-fav fav-btn" data-id="<%=item.game_id%>" title="点击收藏比赛"></i>
- <% } else { %>
- <i data-time='<%=item.time%>' title="点击删除此收藏" class="fav fav-btn" data-id="<%=item.game_id%>"></i>
- <%}}%> -->
- </li>
- <%}%>
- </ul>
- <%
- var p = parseInt(data.p);
- var totalPage = data.totalPage;
- var prevClass = p == 1 ? "disable" : "";
- var nextClass = p == totalPage ? "disable" : "";
- var prevPage = p - 1;
- var nextPage = p + 1;
- %>
- <div class="zj-page">
- <a class="zj-prev zj-s <%=prevClass%>" title="上一页" data-page="<%=prevPage%>"></a> <input type="text" class="zj-cur"
- value="<%=p%>"> <span class="page-num"> / <%=totalPage%></span>
- <a class="go-page" style="cursor:pointer;">GO</a> <a class="zj-next zj-s <%=nextClass%>" title="下一页" data-page="<%=nextPage%>"></a>
- </div>
- <% } else { %>
- <%
- $('.box-bd').html('<p class="no-records">盒子没有保存过此玩家的对战记录。</p>');
- %>
- <%}%>
|