32806f93-1c51-4f40-a76d-43b580a2723d.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. "use strict";
  2. cc._RF.push(module, '32806+THFFPQKdtQ7WAonI9', 'YZ_RecommendGamesBanner');
  3. // common-plugin/Scripts/YZ_RecommendGamesBanner.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 PlatUtils_1 = require("./PlatUtils");
  27. var YZ_Constant_1 = require("./YZ_Constant");
  28. var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
  29. var YZ_RecommendGamesBanner = /** @class */ (function (_super) {
  30. __extends(YZ_RecommendGamesBanner, _super);
  31. function YZ_RecommendGamesBanner() {
  32. var _this = _super !== null && _super.apply(this, arguments) || this;
  33. _this._listView = null;
  34. _this._isInit = false;
  35. _this.closeBtn = null;
  36. return _this;
  37. }
  38. YZ_RecommendGamesBanner.prototype.onLoad = function () {
  39. if (Utils_1.utils.otherConfig && Utils_1.utils.otherConfig.group) {
  40. this.node.group = Utils_1.utils.otherConfig.group;
  41. }
  42. this._listView = this.getComponentInChildren("YZ_ListView");
  43. this._listView.node.active = false;
  44. this.closeBtn = cc.find("bg/close", this.node);
  45. };
  46. YZ_RecommendGamesBanner.prototype.onEnable = function () {
  47. var _this = this;
  48. Utils_1.utils.registerServerInitEvent(function () {
  49. _this._initWidget();
  50. _this.closeBtn.on(cc.Node.EventType.TOUCH_START, function (event) {
  51. _this.node.destroy();
  52. });
  53. }, this);
  54. };
  55. YZ_RecommendGamesBanner.prototype.onDisable = function () {
  56. Utils_1.utils.unregisterServerInitEvent(this);
  57. this.closeBtn.targetOff(this);
  58. };
  59. YZ_RecommendGamesBanner.prototype._initWidget = function () {
  60. if (this._isInit)
  61. return;
  62. if (Utils_1.utils.isShowRecommondGamesBanner()) {
  63. var data = Utils_1.utils.getRecommondGameList();
  64. if (data) {
  65. if (data.length > 0) {
  66. if (data.length >= 6) {
  67. this._isInit = true;
  68. this._listView.init(data);
  69. this._listView.node.active = true;
  70. Utils_1.utils.postRecommentShowData(YZ_Constant_1.SubLocation.isYzBanner);
  71. if (PlatUtils_1.default.IsOPPO) {
  72. Utils_1.utils.oppoTool.countYzBannerShowCount();
  73. Utils_1.utils.adManager.hideKyxBanner();
  74. }
  75. }
  76. else {
  77. cc.warn("交叉推广数据长度小于6");
  78. }
  79. }
  80. else {
  81. cc.warn("交叉推广数据长度为0");
  82. }
  83. }
  84. else {
  85. cc.warn("交叉推广数据为null!");
  86. }
  87. }
  88. else {
  89. this.node.destroy();
  90. }
  91. };
  92. YZ_RecommendGamesBanner = __decorate([
  93. ccclass
  94. ], YZ_RecommendGamesBanner);
  95. return YZ_RecommendGamesBanner;
  96. }(cc.Component));
  97. exports.default = YZ_RecommendGamesBanner;
  98. cc._RF.pop();