const { ccclass, property } = cc._decorator;

/**
 * 服务协议，隐私协议
 * @author 邹勇
 */
@ccclass
export default class Rule extends cc.Component {
    @property({ type: cc.ScrollView, displayName: "滚动条" })
    scrollView: cc.ScrollView = null;
    @property({ type: cc.Label, displayName: "内容" })
    lbl_content: cc.Label = null;
    @property({ type: cc.Button, displayName: "关闭" })
    btn_close: cc.Button = null;

    onLoad() {

    }

    /**
     * 
     * @param type 0服务协议  1隐私协议
     */
    public setContent(type: string = "0") {
        this.lbl_content.string = type == "0" ? "服务协议" : "隐私协议";
        this.scrollView.scrollToTop();
    }

    private close() {
        this.node.active = false;
    }
}