/**
 * 村长镇长信息面板
 */
cc.Class({
    extends: cc.Component,

    properties: {
        title: {
            default: null,
            type: cc.Label,
            serializable: true,
        },
        content: {
            default: null,
            type: cc.Label,
            serializable: true,
        },
        callback: {
            default: null,
            visible: false
        },
        confirmLabel: {
            default: null,
            type: cc.Label,
            serializable: true,
        },

      
    },

    /**
     * 设置面板信息
     */
    setVillageAndMayorInfo(context) {
        let { title, content, confirmText, callback } = context;
        this.node.active = true;
        this.callback = callback;
        this.title.string = title;
        this.content.string = content;
        this.confirmLabel.string = confirmText;
    },

    onConfirm(e) {
        if (this.callback)
            this.callback(e);
    },

    onCancel(e) {
        this.node.active = false;
    }
});
