完善每日挑战逻辑
This commit is contained in:
@@ -14,11 +14,19 @@ export class TrophyUnit extends Laya.Script {
|
||||
@property(Laya.Label)
|
||||
public label_month: Laya.Label;
|
||||
|
||||
public onInit(year: number, month: number): void {
|
||||
public onInit(info: any): 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]
|
||||
|
||||
var starCount = user.get_doneCountBydate(info.year, info.month)
|
||||
this.icon.skin = info.icon_res
|
||||
this.label_count.text = `${starCount}/${info.dayCount}`
|
||||
this.label_month.text = config.MONTH_ABBRS[info.month-1]
|
||||
if (starCount >= info.dayCount) {
|
||||
this.icon.gray = false
|
||||
this.label_month.color = "#2d3138"
|
||||
}
|
||||
else {
|
||||
this.icon.gray = true
|
||||
this.label_month.color = "#a7abb3"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user