Share1.js 717 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. score: cc.Label,
  5. },
  6. init (game) {
  7. this.game = game;
  8. this.shareFlag = 0;
  9. },
  10. show () {
  11. this.node.active = true;
  12. this.getComponent(cc.Animation).play();
  13. this.score.string = this.game.inGameUI.score;
  14. },
  15. hide () {
  16. this.node.active = false;
  17. this.node.y = 700;
  18. },
  19. doShare () {
  20. this.shareFlag = 1;
  21. this.game.doShare();
  22. wx.onShow(res => {
  23. if(this.shareFlag == 1) {
  24. this.hide();
  25. this.game.gameContinue();
  26. this.shareFlag = 0;
  27. }
  28. })
  29. },
  30. start () {
  31. },
  32. });