格式化代码

This commit is contained in:
2025-05-28 18:47:51 +08:00
parent 6d44fc21b4
commit a7df8ec739
38 changed files with 2768 additions and 2840 deletions

View File

@@ -1,37 +1,35 @@
import type { TrophyRecord } from "../../types/global"
import { config } from "../../constants/config"
import { MONTH_LIST } from "../../models/DCManager"
import { config } from "../../constants/config";
import { MONTH_LIST } from "../../models/DCManager";
import { TrophyRecord } from "../../types/global";
const { regClass, property } = Laya;
const { regClass, property } = Laya
@regClass()
export class TrophyShow extends Laya.Script {
declare owner : Laya.Box;
declare owner: Laya.Box
@property(Laya.Image)
public icon: Laya.Image
@property(Laya.Image)
public icon: Laya.Image
@property(Laya.Label)
public label_date: Laya.Label
@property(Laya.Label)
public label_date: Laya.Label
@property(Laya.Box)
public btn_close: Laya.Box
@property(Laya.Box)
public btn_close: Laya.Box
public onSetShow(record: TrophyRecord): void {
for (var i=0; i<MONTH_LIST.length; i++) {
var obj = MONTH_LIST[i]
if (obj.year == record.year && obj.month == record.month) {
this.icon.skin = obj.icon_res
break
}
}
this.label_date.text = `${config.MONTH_ABBRS[record.month-1]} ${record.day},${record.year}`
this.btn_close.on(Laya.Event.CLICK, this, ()=>{
this.owner.destroy()
})
public onSetShow(record: TrophyRecord): void {
for (let i = 0; i < MONTH_LIST.length; i++) {
const obj = MONTH_LIST[i]
if (obj.year == record.year && obj.month == record.month) {
this.icon.skin = obj.icon_res
break
}
}
}
this.label_date.text = `${config.MONTH_ABBRS[record.month - 1]} ${record.day},${record.year}`
this.btn_close.on(Laya.Event.CLICK, this, () => {
this.owner.destroy()
})
}
}