NoticeViewPresenter.ts
1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { RegPresenter } from "../PresenterCCViewFactory";
import { NoticeViewType, NoticeView, NoticeViewProps } from "../view/type/NoticeView";
import { Presenter } from "../../../common/classbase/PresenterBase";
export interface NoticeViewParam {
title: string;
content: string;
}
@RegPresenter(NoticeViewType)
export default class NoticeViewPresenter extends Presenter<NoticeViewParam, NoticeView>
{
static uuid = "NoticeViewPresenter"
private _viewProps: NoticeViewProps;
constructor() {
super();
this._viewProps = {
titletxt: "",//标题
contenttxt: "",//内容
onCloseClick: this.onCloseHandleClick
};
}
onOpen(param: NoticeViewParam) {
super.onOpen(param);
this._viewProps.titletxt = param.title;
this._viewProps.contenttxt = param.content;
this.view.setProps(this._viewProps);
}
onCloseHandleClick = () => {
this.view.close();
}
}