格式化代码
This commit is contained in:
@@ -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()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user