GuideAuthUI.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Learn TypeScript:
  2. // - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
  3. // Learn Attribute:
  4. // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
  5. // Learn life-cycle callbacks:
  6. // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
  7. const { ccclass, property } = cc._decorator;
  8. @ccclass
  9. export default class GuideAuthUI extends cc.Component {
  10. @property(cc.Node)
  11. node_rectBg: cc.Node = null;
  12. @property(cc.Node)
  13. node_bottom: cc.Node = null;
  14. @property(cc.Node)
  15. node_authBtn: cc.Node = null;
  16. // LIFE-CYCLE CALLBACKS:
  17. // onLoad () {}
  18. start() {
  19. this.node_rectBg.setContentSize(cc.winSize.width, cc.winSize.height);
  20. this.initEvent();
  21. }
  22. onEnable() {
  23. this.node_bottom.y = -cc.winSize.height * 0.5 - this.node_bottom.height * 0.5 - 10;
  24. let endY = -cc.winSize.height * 0.5 + this.node_bottom.height * 0.5
  25. // cc.tween(this.node_bottom).to(0.2, { y: endY, ease: cc.easeBackOut }).start();
  26. }
  27. // update (dt) {}
  28. initEvent() {
  29. this.node_rectBg.on(cc.Node.EventType.TOUCH_END, this.onClickAuthBtn, this);
  30. this.node_authBtn.on(cc.Node.EventType.TOUCH_END, this.onClickAuthBtn, this);
  31. }
  32. onClickBg() {
  33. // this.node.active = true;
  34. mk.ui.closePanel("GuideAuthUI")
  35. }
  36. onClickAuthBtn() {
  37. // this.node.active = false;
  38. mk.ui.closePanel("GuideAuthUI")
  39. // JsbMgr.WxAuth();
  40. }
  41. }