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Q,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;kEACtB;IAE1C;QADC,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;2DACxB;IAE/B;QADC,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;4DACxB;IAEhC;QADC,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;kEACtB;IAT7B,oBAAoB;QADxC,OAAO;OACa,oBAAoB,CAiCxC;IAAD,2BAAC;KAAA;kBAjCoB,oBAAoB","file":"","sourceRoot":"/","sourcesContent":["import { DummyNode, DummyRichText, DummySprite } from \"../../common/CCDummyObjects\";\nimport { ResUtils } from \"../../common/utils/ResUtils\";\nimport { ActivitiesItemModelManager } from \"../model/ActivitiesItemModelManager\";\n\nconst { ccclass, property } = cc._decorator;\n\n@ccclass\nexport default class ActivitiesNoticeItem extends cc.Component {\n\n    @property({ type: cc.Sprite, displayName: \"Background sprite\" })\n    backgroundSprite: cc.Sprite = DummySprite;\n    @property({ type: cc.Node, displayName: \"Click node\" })\n    clickNode: cc.Node = DummyNode;\n    @property({ type: cc.Node, displayName: \"RedDot node\" })\n    redDotNode: cc.Node = DummyNode;\n    @property({ type: cc.RichText, displayName: \"Background richText\" })\n    describeRichText: cc.RichText = DummyRichText;\n\n    private _activityId: number;\n    private _callFunc: () => void;\n\n    async setData(activityId: number, canClick: boolean, describe: string, callback: () => void) {\n        this._activityId = activityId;\n        this._callFunc = callback;\n        this.backgroundSprite.spriteFrame = await ResUtils.loadRes(`textures/notice/activitiesItem/${activityId}`, cc.SpriteFrame);\n        this.clickNode.active = canClick;\n        this.describeRichText.string = describe;\n        this.refreshRedDot();\n    }\n\n    refreshRedDot() {\n        let isReaded = ActivitiesItemModelManager.getActivitiesReaded(this._activityId);\n        this.redDotNode.active = !isReaded;\n    }\n\n    onItemButtonClick() {\n        if (this._callFunc) {\n            this._callFunc();\n        }\n    }\n}"]}