添加奖杯库
This commit is contained in:
24
src/views/TrophyUnit.ts
Normal file
24
src/views/TrophyUnit.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { config } from "../constants/config";
|
||||
import { StorageManager } from "../models/StorageManager";
|
||||
|
||||
const { regClass, property } = Laya;
|
||||
|
||||
@regClass()
|
||||
export class TrophyUnit extends Laya.Script {
|
||||
declare owner : Laya.Box;
|
||||
|
||||
@property(Laya.Image)
|
||||
public icon: Laya.Image;
|
||||
@property(Laya.Label)
|
||||
public label_count: Laya.Label;
|
||||
@property(Laya.Label)
|
||||
public label_month: Laya.Label;
|
||||
|
||||
public onInit(year: number, month: number): void {
|
||||
var user = StorageManager.getInstance().getUser()
|
||||
var starCount = user.get_doneCountBydate(year, month)
|
||||
this.label_count.text = `${starCount}/31`
|
||||
this.label_month.text = config.MONTH_ABBRS[month-1]
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user