Skip to content

Commit 95337b9

Browse files
committed
feat(maimai2): festa page show all circle rank
1 parent d097c9a commit 95337b9

File tree

3 files changed

+88
-8
lines changed

3 files changed

+88
-8
lines changed

src/app/sega/maimai2/maimai2-festa/maimai2-festa.component.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@
111111
overflow: hidden;
112112
}
113113

114+
.form-check-input {
115+
width: 0.9em;
116+
height: 0.9em;
117+
}
118+
114119
.festa-progress-segment {
115120
display: flex;
116121
align-items: center;

src/app/sega/maimai2/maimai2-festa/maimai2-festa.component.html

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ <h6>队伍排名</h6>
156156
{{ userFestaInfo?.userFestaData?.placeId }}
157157
</p>
158158
<p>
159-
<strong>所属队伍与队内排名:</strong>
159+
<strong>所属队伍与同队排名:</strong>
160160
<span
161161
[style.color]="
162162
getFestaSideColor(userFestaInfo.userFestaData.festaSideId)
@@ -205,7 +205,26 @@ <h6>队伍排名</h6>
205205
<div class="row mt-4">
206206
<div class="col-md-6">
207207
<div class="card" *ngIf="sameSideCircleRankInfoList?.length > 0">
208-
<div class="card-header"><span>同队排行</span></div>
208+
<div
209+
class="card-header d-flex align-items-center justify-content-between"
210+
>
211+
<span>同队排行榜</span>
212+
<div class="form-check align-items-center d-flex">
213+
<input
214+
class="form-check-input me-1"
215+
type="checkbox"
216+
[(ngModel)]="isShowSameSideWithoutPlaceIdFilter"
217+
(change)="refreshSameSideCircleRankInfo()"
218+
id="checkDefault"
219+
/>
220+
<label
221+
class="form-check-label small mb-0 mt-0"
222+
for="checkDefault"
223+
>
224+
全服
225+
</label>
226+
</div>
227+
</div>
209228
<div class="card-body">
210229
<div
211230
*ngFor="let item of sameSideCircleRankInfoList"
@@ -226,7 +245,12 @@ <h6>队伍排名</h6>
226245
getFestaSideColor(item.circleFestaData.festaSideId)
227246
"
228247
>
229-
{{ item.circleFestaData.circleName }}
248+
{{
249+
formatCircleIfShowPlaceId(
250+
item.circleFestaData,
251+
isShowSameSideWithoutPlaceIdFilter
252+
)
253+
}}
230254
</span>
231255
<span
232256
class="score"
@@ -244,7 +268,26 @@ <h6>队伍排名</h6>
244268
</div>
245269
<div class="col-md-6">
246270
<div class="card" *ngIf="allSideCircleRankInfoList?.length > 0">
247-
<div class="card-header"><span>总排行</span></div>
271+
<div
272+
class="card-header d-flex align-items-center justify-content-between"
273+
>
274+
<span>总排行榜</span>
275+
<div class="form-check align-items-center d-flex">
276+
<input
277+
class="form-check-input me-1"
278+
type="checkbox"
279+
[(ngModel)]="isShowAllSideWithoutPlaceIdFilter"
280+
(change)="refreshAllSideCircleRankInfo()"
281+
id="checkDefault2"
282+
/>
283+
<label
284+
class="form-check-label small mb-0 mt-0"
285+
for="checkDefault2"
286+
>
287+
全服
288+
</label>
289+
</div>
290+
</div>
248291
<div class="card-body">
249292
<div
250293
*ngFor="let item of allSideCircleRankInfoList"
@@ -265,7 +308,12 @@ <h6>队伍排名</h6>
265308
getFestaSideColor(item.circleFestaData.festaSideId)
266309
"
267310
>
268-
{{ item.circleFestaData.circleName }}
311+
{{
312+
formatCircleIfShowPlaceId(
313+
item.circleFestaData,
314+
isShowAllSideWithoutPlaceIdFilter
315+
)
316+
}}
269317
</span>
270318
<span
271319
class="score"

src/app/sega/maimai2/maimai2-festa/maimai2-festa.component.ts

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { Maimai2UserFestaInfo } from '../model/Maimai2UserFestaInfo';
2323
import { Maimai2GameFesta } from '../model/Maimai2GameFesta';
2424
import { Maimai2UserFestaData } from '../model/Maimai2UserFestaData';
2525
import { Maimai2CircleFestaRankInfo } from '../model/Maimai2CircleFestaRankInfo';
26+
import { Maimai2CircleFestaData } from '../model/Maimai2CircleFestaData';
2627

2728
@Component({
2829
selector: 'app-maimai2-festa',
@@ -50,7 +51,10 @@ export class Maimai2FestaComponent implements OnInit {
5051
userCircleInfo: Maimai2UserCircleInfo = null;
5152

5253
sameSideCircleRankInfoList: Maimai2CircleFestaRankInfo[] = null;
54+
isShowSameSideWithoutPlaceIdFilter = false;
55+
5356
allSideCircleRankInfoList: Maimai2CircleFestaRankInfo[] = null;
57+
isShowAllSideWithoutPlaceIdFilter = false;
5458

5559
ngOnInit() {
5660
this.aimeId = String(this.userService.currentUser.defaultCard.extId);
@@ -83,7 +87,7 @@ export class Maimai2FestaComponent implements OnInit {
8387
.set('aimeId', this.aimeId)
8488
.set('openEventId', userFestaData.eventId)
8589
.set('filterFestaSideId', userFestaData.festaSideId)
86-
.set('placeId', userFestaData.placeId)
90+
.set('placeId', this.isShowSameSideWithoutPlaceIdFilter ? -1 : userFestaData.placeId)
8791
.set('page', 0)
8892
.set('size', 10);
8993

@@ -106,7 +110,7 @@ export class Maimai2FestaComponent implements OnInit {
106110
.set('aimeId', this.aimeId)
107111
.set('openEventId', userFestaData.eventId)
108112
.set('filterFestaSideId', -1)
109-
.set('placeId', userFestaData.placeId)
113+
.set('placeId', this.isShowAllSideWithoutPlaceIdFilter ? -1 : userFestaData.placeId)
110114
.set('page', 0)
111115
.set('size', 10);
112116

@@ -263,13 +267,36 @@ export class Maimai2FestaComponent implements OnInit {
263267
case 2: { postfix = "nd"; break; };
264268
case 3: { postfix = "rd"; break; };
265269
}
266-
270+
267271
return rank.toString() + postfix;
268272
}
269273

270274
getVotedFestaSideId() {
271275
return this.userFestaInfo?.userFestaData?.festaSideId ?? 0;
272276
}
273277

278+
refreshAllSideCircleRankInfo() {
279+
if (this.userFestaInfo.userFestaData) {
280+
this.loadAllSideCircleRankInfo(this.userFestaInfo.userFestaData);
281+
}
282+
}
283+
284+
refreshSameSideCircleRankInfo() {
285+
if (this.userFestaInfo.userFestaData) {
286+
this.loadSameSideCircleRankInfo(this.userFestaInfo.userFestaData);
287+
}
288+
}
289+
290+
formatCircleIfShowPlaceId(circleFestaData: Maimai2CircleFestaData, isShowPlaceId: boolean) {
291+
if (!isShowPlaceId)
292+
return circleFestaData.circleName;
293+
294+
var formatPostfix = ` #${circleFestaData.placeId}`;
295+
var result = circleFestaData.circleName;
296+
if (!circleFestaData.circleName.endsWith(formatPostfix))
297+
result += formatPostfix;
298+
return result;
299+
}
300+
274301
protected readonly length = length;
275302
}

0 commit comments

Comments
 (0)