Commit d46d46e3 authored by haiyoucuv's avatar haiyoucuv

整理一下代码

parent 2e0a3401
......@@ -115,9 +115,9 @@ export class HomeScene extends Scene {
Tween.stopAllByTarget(this.startBtn);
}
if (rank === 0 || rank === -1) {
if (rank === 0) {
this.currentRankLabel.string = '-';
} else if (rank > 5000) {
} else if (rank > 5000 || rank === -1) {
this.currentRankLabel.string = '5000+';
} else {
this.currentRankLabel.string = `${rank}`;
......
......@@ -65,10 +65,10 @@ export class RankScene extends Scene {
/** 排名处理 */
rankIndexFormat(rank) {
if (rank > 5000) {
if (rank == -1 || rank > 5000) {
return "5000+";
}
if (rank == -1 || rank == 0 || !!!rank) {
if (rank == 0 || !!!rank) {
return "-";
}
return rank;
......
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