NoticeViewPresenter.ts 1.01 KB
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();
    }

}