ExchangeCodeViewImpl.ts 1.03 KB
import { ExchangeCodeViewType, ExchangeCodeViewProps, ExchangeCodeView } from "../type/ExChangeCodeView";
import { CCPureView } from "../../../../common/classbase/CCViewBase";
import { RegView } from "../../PresenterCCViewFactory";
import { DummyLabel, DymmyEditBox } from "../../../../common/CCDummyObjects";

const { ccclass, property } = cc._decorator;

@ccclass
@RegView(ExchangeCodeViewType, "prefab/ui/ExchangeCodeView")
export class ExchangeCodeViewImpl extends CCPureView<ExchangeCodeViewProps> implements ExchangeCodeView {
    @property(cc.Label)
    titlelbl: cc.Label = DummyLabel;

    @property(cc.EditBox)
    editbox: cc.EditBox = DymmyEditBox;

    onLoad() {
        this.bindProp("titletxt", this.titlelbl, "string");
        this.bindProp("contenttxt", this.editbox, "string");
    }

    onCancleClickCallback() {
        this._props.onActionClick(false);
        this.close();
    }

    onOkClickCallback() {
        this._props.onActionClick(true, this.editbox.string);
        this.close();
    }
}