Commit c3ad28f9 authored by 神楽坂玲奈's avatar 神楽坂玲奈

修复观战滚动条,匹配时间显示在星光电脑上不正确的问题

parent cdf5af61
...@@ -184,6 +184,10 @@ form { ...@@ -184,6 +184,10 @@ form {
height: 440px; height: 440px;
} }
#game-replay-watch {
max-height: 500px;
}
#game-replay-watch table { #game-replay-watch table {
font-size: 14px; font-size: 14px;
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<span i18n *ngIf="matching_arena == 'athletic'">竞技匹配</span> <span i18n *ngIf="matching_arena == 'athletic'">竞技匹配</span>
<span i18n *ngIf="matching_arena == 'entertain'">娱乐匹配</span> <span i18n *ngIf="matching_arena == 'entertain'">娱乐匹配</span>
</span> </span>
<span class="input-group-addon"><span i18n>预计时间</span> 03:00</span><span class="input-group-addon"><span i18n>实际时间</span> {{match_time | date:'mm:ss'}}</span> <span class="input-group-addon"><span i18n>预计时间</span> 03:00</span><span class="input-group-addon"><span i18n>实际时间</span> {{match_time}}</span>
<span class="input-group-btn"><button class="btn btn-secondary" type="button" [disabled]="!match_cancelable" (click)="cancel_match()">取消</button></span> <span class="input-group-btn"><button class="btn btn-secondary" type="button" [disabled]="!match_cancelable" (click)="cancel_match()">取消</button></span>
</div> </div>
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
<!--</li>--> <!--</li>-->
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane active" id="game-replay-watch" role="tabpanel"> <div class="tab-pane active scroll" id="game-replay-watch" role="tabpanel">
<table class="table table-striped table-hover"> <table class="table table-striped table-hover">
<thead> <thead>
<tr> <tr>
......
...@@ -164,7 +164,7 @@ export class YGOProComponent implements OnInit, OnDestroy { ...@@ -164,7 +164,7 @@ export class YGOProComponent implements OnInit, OnDestroy {
matching: ISubscription | undefined; matching: ISubscription | undefined;
matching_arena: string | undefined; matching_arena: string | undefined;
match_time: number; match_time: string;
match_cancelable: boolean; match_cancelable: boolean;
match_interval: Timer | undefined; match_interval: Timer | undefined;
...@@ -581,8 +581,17 @@ export class YGOProComponent implements OnInit, OnDestroy { ...@@ -581,8 +581,17 @@ export class YGOProComponent implements OnInit, OnDestroy {
} }
refresh_match () { refresh_match () {
this.match_time = new Date().getTime() - match_started_at.getTime(); let match_time = Math.floor((new Date().getTime() - match_started_at.getTime()) / 1000);
this.match_cancelable = this.match_time <= 5000 || this.match_time >= 180000; let minute = Math.floor(match_time / 60).toString();
if (minute.length == 1) {
minute = '0' + minute;
}
let second = (match_time % 60).toString();
if (second.length == 1) {
second = '0' + second;
}
this.match_time = `${minute}:${second}`;
this.match_cancelable = match_time <= 5 || match_time >= 180;
} }
bilibili_loaded () { bilibili_loaded () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment