24 lines
714 B
TypeScript
24 lines
714 B
TypeScript
|
|
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]
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|