瀏覽代碼

Live page scorecard data connection

master
kj1352 4 年之前
父節點
當前提交
6393fab92b
共有 2 個檔案被更改,包括 49 行新增1 行删除
  1. +47
    -1
      src/app/live/live.page.html
  2. +2
    -0
      src/app/live/live.page.ts

+ 47
- 1
src/app/live/live.page.html 查看文件

@@ -25,13 +25,59 @@


<section class="score-card" *ngIf="currentMatch.Innings"> <section class="score-card" *ngIf="currentMatch.Innings">
<div class="team" *ngFor="let inning of currentMatch.Innings"> <div class="team" *ngFor="let inning of currentMatch.Innings">
<header> <h5> {{ currentMatch.Teams[currentMatch.Matchdetail.Team_Home].Name_Short }} </h5> </header>
<header> <h5> {{ currentMatch.Teams[inning.Battingteam].Name_Short }} </h5> </header>
<div class="score"> {{ inning.Total }}/{{ inning.Wickets }} <span> ({{ inning.Overs }}) </span> </div> <div class="score"> {{ inning.Total }}/{{ inning.Wickets }} <span> ({{ inning.Overs }}) </span> </div>
</div> </div>
</section> </section>
</section> </section>


<ul class="statistical-pages"> <ul class="statistical-pages">
<li class="collapsible-card" [ngClass]="{'active' : showScoreCard}" *ngIf="currentMatch.Innings">
<header>
<label> Scorecard </label>
<button (click)="showScoreCard = !showScoreCard">
<span *ngIf="!showScoreCard"> + </span>
<span *ngIf="showScoreCard"> - </span>
</button>
</header>
<section class="card" *ngFor="let inning of currentMatch.Innings">
<table>
<thead>
<tr>
<th>
Player
</th>
<th>
Score
</th>
<th>
Balls
</th>
</tr>
</thead>
<tbody>
<ng-container *ngFor="let batsman of inning.Batsmen">
<tr *ngIf="batsman.Runs >= 0">
<td>
{{ currentMatch.Teams[inning.Battingteam].Players[Batsman].Name_Full }} <br>
<span> {{ batsman.Howout }} </span>
</td>
<td>
{{ batsman.Runs }}
</td>
<td>
{{ batsman.Balls }}
</td>
</tr>
</ng-container>
</tbody>
</table>
</section>
</li>

<li class="collapsible-card" [ngClass]="{'active' : showFixtures}"> <li class="collapsible-card" [ngClass]="{'active' : showFixtures}">
<header> <header>
<label> Fixtures </label> <label> Fixtures </label>


+ 2
- 0
src/app/live/live.page.ts 查看文件

@@ -261,6 +261,8 @@ export class LivePage implements OnInit {
}); });


closestMatch = this.fixtures[closestIndex]; closestMatch = this.fixtures[closestIndex];
this.slides.slideTo(closestIndex);


if (closestMatch) { if (closestMatch) {
this.matchService.getMatchDetails(closestMatch.match_id).then((match_data: RawMatchData) => { this.matchService.getMatchDetails(closestMatch.match_id).then((match_data: RawMatchData) => {


Loading…
取消
儲存