003c244b-ccbb-48c9-afed-cb434d616083.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. "use strict";
  2. cc._RF.push(module, '003c2RLzLtIya/ty0NNYWCD', 'UIADPanel');
  3. // scripts/UI/UIADPanel.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("../../common-plugin/Scripts/Utils");
  26. var CocosZ_1 = require("../Framework/CocosZ");
  27. var Msg_1 = require("../Framework/Msg");
  28. // @ts-ignore
  29. var i18n = require('LanguageData');
  30. var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
  31. var NewClass = /** @class */ (function (_super) {
  32. __extends(NewClass, _super);
  33. function NewClass() {
  34. var _this = _super !== null && _super.apply(this, arguments) || this;
  35. _this.btnAD = null;
  36. _this.btnSkip = null;
  37. _this.isDiamond = false;
  38. return _this;
  39. }
  40. NewClass.prototype.start = function () {
  41. if (CocosZ_1.cocosz.isADON) {
  42. this.node.scale = 0;
  43. cc.tween(this.node).to(0.3, { scale: 1 }, { easing: "backOut" }).start();
  44. Utils_1.utils.SendEvent("页面-" + (this.isDiamond ? "钻石" : "金币"));
  45. }
  46. else {
  47. this.node.destroy();
  48. }
  49. };
  50. NewClass.prototype.setDiamond = function () {
  51. this.isDiamond = true;
  52. this.node.getChildByName("bg").active = false;
  53. this.node.getChildByName("bg1").active = true;
  54. };
  55. NewClass.prototype.watchAD = function () {
  56. var _this = this;
  57. Utils_1.utils.SendEvent("\u89C6\u9891-" + (this.isDiamond ? "钻石购买" : "金币购买") + "-\u64AD\u653E");
  58. CocosZ_1.cocosz.watchAD(function () {
  59. Utils_1.utils.SendEvent("\u89C6\u9891-" + (_this.isDiamond ? "钻石购买" : "金币购买") + "-\u6210\u529F");
  60. if (_this.isDiamond) {
  61. var num = CocosZ_1.cocosz.isDeBug ? 10000 : 200;
  62. CocosZ_1.cocosz.dataMgr.DiamondCount += num;
  63. Msg_1.default.Show(i18n.t("msg.gxhdzs") + num); //恭喜获得钻石
  64. }
  65. else {
  66. var num = CocosZ_1.cocosz.isDeBug ? 10000 : 500;
  67. CocosZ_1.cocosz.dataMgr.CoinCount += num;
  68. Msg_1.default.Show(i18n.t("msg.gxhdjb") + num); //恭喜获得金币
  69. }
  70. _this.node.destroy();
  71. }, function () {
  72. Utils_1.utils.SendEvent("\u89C6\u9891-" + (_this.isDiamond ? "钻石购买" : "金币购买") + "-\u5931\u8D25");
  73. });
  74. };
  75. NewClass.prototype.exit = function () {
  76. CocosZ_1.cocosz.audioMgr.playBtnEffect();
  77. this.node.destroy();
  78. };
  79. __decorate([
  80. property(cc.Node)
  81. ], NewClass.prototype, "btnAD", void 0);
  82. __decorate([
  83. property(cc.Node)
  84. ], NewClass.prototype, "btnSkip", void 0);
  85. NewClass = __decorate([
  86. ccclass
  87. ], NewClass);
  88. return NewClass;
  89. }(cc.Component));
  90. exports.default = NewClass;
  91. cc._RF.pop();