补充每日挑战UI细节

This commit is contained in:
2025-05-20 18:27:32 +08:00
parent 18785e7387
commit e1671a6b68
15 changed files with 77 additions and 31 deletions

View File

@@ -13,6 +13,8 @@ const { regClass, property } = Laya
export class Home extends Laya.Script {
declare owner : Laya.Box;
@property(Laya.Image)
public bg_dc: Laya.Image;
@property(Laya.Label)
public label_dc_title: Laya.Label;
@property(Laya.Sprite)
@@ -34,15 +36,19 @@ export class Home extends Laya.Script {
//组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次
onAwake(): void {
var user = StorageManager.getInstance().getUser()
var now = new Date()
var year = now.getFullYear()
var month = now.getMonth() + 1
var dayNow = new Date().getDate()
this.label_dc_title.text = `${config.MONTH_ABBRS[month-1]} ${dayNow}`
var stageID = `${year}-${month}-${dayNow}`
if (user.get_doneCountBydate(year, month) >= 31)
this.bg_dc.skin = respath.home_top_dc_bg_finish
else
this.bg_dc.skin = respath.home_top_dc_bg_normal
this.label_dc_title.text = `${config.MONTH_ABBRS[month-1]} ${dayNow}`
var progress = user.get_done(stageID)
if (progress <= 0) {
this.btn_play.visible = true