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CAAC,GAAG,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC;oBACvC,qBAAS,CAAC,aAAa,CAAC,2CAAoB,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;gBAC7E,CAAC;aACJ,CAAC,CAAC;YACH,WAAW;YACX,0DAA0D;YAC1D,IAAI;QACR,CAAC;QAED,WAAW;YACP,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBACrB,IAAI,CAAC,YAAY,EAAE,CAAC;aACvB;QACL,CAAC;QAED,sBAAsB;YAClB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBACrB,IAAI,CAAC,YAAY,EAAE,CAAC;aACvB;QACL,CAAC;QAED,MAAM;YACF,KAAK,CAAC,MAAM,EAAE,CAAC;YACf,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBACrB,IAAI,CAAC,YAAY,EAAE,CAAC;aACvB;QACL,CAAC;QAED,MAAM;YACF,IAAI,CAAC,YAAY,EAAE,CAAC;QACxB,CAAC;QAED,MAAM;QAEN,CAAC;KACJ,CAAA;IAjEY,uBAAuB;QADnC,wCAAe,CAAC,2CAAsB,CAAC;OAC3B,uBAAuB,CAiEnC;IAAD,8BAAC;KAAA;AAjEY,0DAAuB","file":"","sourceRoot":"/","sourcesContent":["import { Presenter, Subpresenter } from \"../../../common/classbase/PresenterBase\";\nimport { DatingEventViewType, DatingEventView } from \"../view/type/DatingEventView\";\nimport { RegPresenter, RegSubpresenter } from \"../PresenterCCViewFactory\";\nimport { DatingEventSubviewType, DatingEventItemProps, DatingEventSubview } from \"../view/type/DatingEventSubview\";\nimport { GameModelManager } from \"../../model/GameModelManager\";\nimport { DatingEventSceneModel, DatingEventStatus } from \"../../model/DatingEventSceneModel\";\nimport { UIManager } from \"../../../common/gameplay/managers/UIManager\";\nimport { DatingScenePresenter } from \"./DatingScenePresenter\";\n\n@RegPresenter(DatingEventViewType)\nexport default class DatingEventViewPresenter extends Presenter<undefined, DatingEventView> {\n static uuid = \"DatingEventViewPresenter\";\n\n onOpen() {\n super.onOpen(undefined);\n this.checkRedDot();\n }\n\n onEnterForeground() {\n super.onEnterForeground();\n this.checkRedDot();\n }\n\n onShow() {\n super.onShow();\n this.checkRedDot();\n }\n\n private checkRedDot() {\n let mainRedDot = false;\n for (let model of GameModelManager.getMainDatingEventScenesModel()) {\n if (model.status === DatingEventStatus.New || model.status === DatingEventStatus.InProgress) {\n mainRedDot = true;\n }\n }\n this.view.setProps({ mainEventRedDot: mainRedDot, extraEventRedDot: false });\n }\n}\n\n@RegSubpresenter(DatingEventSubviewType)\nexport class DatingEventSubpresenter extends Subpresenter<DatingEventSubview> {\n // private _items: DatingEventItemProps[];\n private _lineStyle: 0 | 1 = 0;\n private _modelMap: { [key: string]: DatingEventSceneModel } = {};\n\n private sceneModelToViewModel(item: DatingEventSceneModel): DatingEventItemProps {\n this._modelMap[item.id] = item;\n return {\n key: item.id + \"\",\n title: item.config.name,\n date: item.config.date,\n time: item.config.time,\n status: item.status,\n coverImage: \"textures/dating_event/cover/\" + item.config.background,\n lineStyle: this._lineStyle\n }\n }\n\n refreshItems() {\n // if (!this._items) {\n if (this.view.name.indexOf(\"MainEvent\") < 0) this._lineStyle = 1;\n let items: DatingEventItemProps[] = [];\n if (this.view.name.indexOf(\"MainEvent\") === 0) {\n items = GameModelManager.getMainDatingEventScenesModel().map(v => this.sceneModelToViewModel(v));\n if (items.length) {\n items[items.length - 1].lineStyle = \"none\";\n }\n }\n this.view.setProps({\n items, onItemClick: (key: string) => {\n console.log(\"start dating event\", key);\n UIManager.pushPresenter(DatingScenePresenter, this._modelMap[key], true);\n }\n });\n // } else {\n // this.view.updateProps({ items: [...this._items] });\n // }\n }\n\n onOwnerShow() {\n if (!this.view.isHidden) {\n this.refreshItems();\n }\n }\n\n onOwnerEnterForeground() {\n if (!this.view.isHidden) {\n this.refreshItems();\n }\n }\n\n onOpen() {\n super.onOpen();\n if (!this.view.isHidden) {\n this.refreshItems();\n }\n }\n\n onShow() {\n this.refreshItems();\n }\n\n onHide() {\n\n }\n}"]}