xieyipanle.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Learn cc.Class:
  2. // - [Chinese] http://www.cocos.com/docs/creator/scripting/class.html
  3. // - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/class/index.html
  4. // Learn Attribute:
  5. // - [Chinese] http://www.cocos.com/docs/creator/scripting/reference/attributes.html
  6. // - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/reference/attributes/index.html
  7. // Learn life-cycle callbacks:
  8. // - [Chinese] http://www.cocos.com/docs/creator/scripting/life-cycle-callbacks.html
  9. // - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/life-cycle-callbacks/index.html
  10. cc.Class({
  11. extends: cc.Component,
  12. properties: {
  13. titleLabel: cc.Label,
  14. yinsiNode: cc.Node,
  15. xieyiNode: cc.Node,
  16. scrollJS1: cc.ScrollView,
  17. scrollJS2: cc.ScrollView,
  18. },
  19. // LIFE-CYCLE CALLBACKS:
  20. // onLoad () {},
  21. show (type) {
  22. this.node.active = true;
  23. this.yinsiNode.active = type == 1;
  24. this.xieyiNode.active = type == 2;
  25. let stri = "Política de Privacidade";
  26. if(type == 2) {
  27. stri = "Terms and conditions of use and services";
  28. this.scrollJS2.scrollToTop(0.1);
  29. }else{
  30. this.scrollJS1.scrollToTop(0.1);
  31. }
  32. this.titleLabel.string = stri;
  33. },
  34. onEventHideXieYi() {
  35. this.node.active = false;
  36. },
  37. // update (dt) {},
  38. });