NormalCashProNode.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /** 常规提现进度提醒
  2. * @author lzg
  3. * @date 20210306
  4. */
  5. import CashOutData from "../datas/CashOutData";
  6. import GameM, { AUDIO_TYPE } from "../manager/GameM";
  7. import UiM, { PANEL_NAME } from "../manager/UiM";
  8. import Main from "../Main";
  9. const { ccclass, property } = cc._decorator;
  10. @ccclass
  11. export default class NormalCashProNode extends cc.Component {
  12. @property(cc.Node)
  13. par: cc.Node = null;
  14. @property(cc.Label)
  15. labGapLv: cc.Label = null;
  16. @property(cc.Sprite)
  17. spMonster: cc.Sprite = null;
  18. @property(cc.Label)
  19. labLv: cc.Label = null;
  20. @property(cc.Label)
  21. labLv1: cc.Label = null;
  22. @property(cc.Label)
  23. labMoney: cc.Label = null;
  24. @property(cc.Node)
  25. qipao: cc.Node = null;
  26. @property(cc.Node)
  27. btnGoon: cc.Node = null;
  28. @property(cc.Node)
  29. btnClose: cc.Node = null;
  30. start() {
  31. let cashCfg = CashOutData.Instance.cashCft
  32. let len = cashCfg.length
  33. let curCashCfg = null
  34. for (var i = 0; i < len; i++) {
  35. if (GameM.commonData.maxCarLevel < cashCfg[i].type_value) {
  36. curCashCfg = cashCfg[i]
  37. break
  38. }
  39. }
  40. let gapLv = curCashCfg.type_value - GameM.commonData.maxCarLevel
  41. this.labGapLv.string = `${gapLv}`
  42. cc.loader.loadRes('carPic/side/side_' + GameM.commonData.maxCarLevel, cc.SpriteFrame, (err, assets) => {
  43. if (err) {
  44. cc.error(err);
  45. return;
  46. }
  47. this.spMonster.spriteFrame = assets;
  48. })
  49. this.labLv.string = GameM.commonData.maxCarLevel.toString()
  50. this.labLv1.string = curCashCfg.type_value.toString()
  51. let money = curCashCfg.moneyshow.split('~')[1].replace('元', '')
  52. this.labMoney.string = money
  53. // this.qipao.scale = 0
  54. // this.btnGoon.scale = 0
  55. // cc.tween(this.qipao)
  56. // .delay(0.5)
  57. // .to(0.3, { scale: 1 })
  58. // .start()
  59. // this.btnClose.active = false
  60. // cc.tween(this.btnGoon)
  61. // .delay(1.5)
  62. // .call(() => {
  63. // this.btnClose.active = true
  64. // })
  65. // .to(0.3, { scale: 1 })
  66. // .start()
  67. }
  68. clickClose() {
  69. GameM.audioM.playEffect(AUDIO_TYPE.button)
  70. this.hideEff()
  71. }
  72. hideEff() {
  73. let main = UiM.Instance.hallNode.getComponent(Main)
  74. let pos1 = main.tixianProBtn.node.position
  75. let addY = 0
  76. if (cc.winSize.height > 1500) {
  77. addY = 90
  78. }
  79. let pos = cc.v2(pos1.x, pos1.y + addY)
  80. cc.tween(this.par).to(0.4, { scale: 0, position: pos }).call(() => {
  81. UiM.Instance.offPanel(PANEL_NAME.NormalCashProNode)
  82. }).start();
  83. }
  84. }