ba4b63a4-50f5-46b3-aad5-6d3ce9b47a5a.js 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. "use strict";
  2. cc._RF.push(module, 'ba4b6OkUPVGs6rVbTzptHpa', 'WithdrawalNode');
  3. // common-plugin/Scripts/WithdrawalNode.ts
  4. "use strict";
  5. var __extends = (this && this.__extends) || (function () {
  6. var extendStatics = function (d, b) {
  7. extendStatics = Object.setPrototypeOf ||
  8. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  9. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  10. return extendStatics(d, b);
  11. };
  12. return function (d, b) {
  13. extendStatics(d, b);
  14. function __() { this.constructor = d; }
  15. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16. };
  17. })();
  18. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  19. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  20. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  21. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  22. return c > 3 && r && Object.defineProperty(target, key, r), r;
  23. };
  24. Object.defineProperty(exports, "__esModule", { value: true });
  25. var Utils_1 = require("./Utils");
  26. var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
  27. var WithdrawalNode = /** @class */ (function (_super) {
  28. __extends(WithdrawalNode, _super);
  29. function WithdrawalNode() {
  30. var _this = _super !== null && _super.apply(this, arguments) || this;
  31. _this.balanceLbl = null;
  32. return _this;
  33. }
  34. WithdrawalNode.prototype.onLoad = function () {
  35. this.balanceLbl = this.node.getComponentInChildren(cc.Label);
  36. };
  37. WithdrawalNode.prototype.init = function (data) {
  38. if (Utils_1.utils.yzRedBagInfo.balance > 0) {
  39. this.balanceLbl.string = "\u00A5" + Utils_1.utils.yzRedBagInfo.balance;
  40. }
  41. else {
  42. this.balanceLbl.string = "\u00A50.00";
  43. }
  44. };
  45. WithdrawalNode.prototype.showWithdrawalPanel = function () {
  46. Utils_1.utils.SendEvent("红包提现框-点击提现按钮!");
  47. Utils_1.utils.showWithdrawalPanel();
  48. };
  49. WithdrawalNode.prototype.onEnable = function () {
  50. var _this = this;
  51. Utils_1.utils.SendEvent("红包提现框-展示成功!");
  52. this.init();
  53. cc.game.on("YZ_RED_BAG_BALANCE_CHANGE", function () {
  54. _this.init();
  55. }, this);
  56. };
  57. WithdrawalNode.prototype.onDisable = function () {
  58. this.unscheduleAllCallbacks();
  59. this.node.targetOff(this);
  60. cc.game.targetOff(this);
  61. };
  62. WithdrawalNode = __decorate([
  63. ccclass
  64. ], WithdrawalNode);
  65. return WithdrawalNode;
  66. }(cc.Component));
  67. exports.default = WithdrawalNode;
  68. cc._RF.pop();