Rule.ts 828 B

1234567891011121314151617181920212223242526272829303132
  1. const { ccclass, property } = cc._decorator;
  2. /**
  3. * 服务协议,隐私协议
  4. * @author 邹勇
  5. */
  6. @ccclass
  7. export default class Rule extends cc.Component {
  8. @property({ type: cc.ScrollView, displayName: "滚动条" })
  9. scrollView: cc.ScrollView = null;
  10. @property({ type: cc.Label, displayName: "内容" })
  11. lbl_content: cc.Label = null;
  12. @property({ type: cc.Button, displayName: "关闭" })
  13. btn_close: cc.Button = null;
  14. onLoad() {
  15. }
  16. /**
  17. *
  18. * @param type 0服务协议 1隐私协议
  19. */
  20. public setContent(type: string = "0") {
  21. this.lbl_content.string = type == "0" ? gData.loginData.ruleStr : gData.loginData.privacyStr;
  22. this.scrollView.scrollToTop();
  23. }
  24. private close() {
  25. this.node.active = false;
  26. }
  27. }