946b717e-7b20-4611-bbec-59ead60879df.js 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. "use strict";
  2. cc._RF.push(module, '946b7F+eyBGEbvsWerWCHnf', 'RewardRedBagPanel');
  3. // common-plugin/Scripts/RewardRedBagPanel.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 RewardRedBagPanel = /** @class */ (function (_super) {
  28. __extends(RewardRedBagPanel, _super);
  29. function RewardRedBagPanel() {
  30. var _this = _super !== null && _super.apply(this, arguments) || this;
  31. _this._panel = null;
  32. return _this;
  33. }
  34. // _location: SubLocation = SubLocation.isMoreGame;
  35. RewardRedBagPanel.prototype.onLoad = function () {
  36. if (Utils_1.utils.otherConfig && Utils_1.utils.otherConfig.group) {
  37. this.node.group = Utils_1.utils.otherConfig.group;
  38. }
  39. this._panel = this.node.getChildByName("Panel");
  40. var ratio = 1;
  41. if (cc.winSize.height < cc.winSize.width) {
  42. // 横屏游戏
  43. ratio = cc.winSize.width / 1920 * 0.5;
  44. }
  45. else {
  46. ratio = cc.winSize.width / 1080;
  47. }
  48. this._panel.scale = ratio;
  49. this.init();
  50. };
  51. RewardRedBagPanel.prototype.openRedBag = function () {
  52. Utils_1.utils.SendEvent("恭喜获得红包弹窗-点击领取红包!");
  53. Utils_1.utils.showOpenRedBagPanel({ showType: 2 });
  54. this.hide();
  55. };
  56. RewardRedBagPanel.prototype.init = function () {
  57. Utils_1.utils.SendEvent("恭喜获得红包弹窗-展示成功!");
  58. };
  59. RewardRedBagPanel.prototype.hide = function () {
  60. this.node.active = false;
  61. };
  62. RewardRedBagPanel.prototype.onCloseBtnHandler = function (event, data) {
  63. this.hide();
  64. };
  65. RewardRedBagPanel = __decorate([
  66. ccclass
  67. ], RewardRedBagPanel);
  68. return RewardRedBagPanel;
  69. }(cc.Component));
  70. exports.default = RewardRedBagPanel;
  71. cc._RF.pop();