bdc2890a-6e2c-46fe-9de3-4ffea85639bb.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. "use strict";
  2. cc._RF.push(module, 'bdc28kKbixG/p3jT/6oVjm7', 'InsufficientPanel');
  3. // Script/view/insufficientPanel/InsufficientPanel.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 (Object.prototype.hasOwnProperty.call(b, 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 BaseView_1 = require("../../../lightMVC/core/base/BaseView");
  26. var App_1 = require("../../Manager/App");
  27. var SDK_1 = require("../../sdk/SDK");
  28. var SoundManager_1 = require("../../Manager/SoundManager");
  29. var ATRewardedVideoJSSDK_1 = require("../../AnyThinkAds/ATRewardedVideoJSSDK");
  30. var ATAndroidJS2_1 = require("../../ATAndroidJS2");
  31. var GlobalManager_1 = require("../../GlobalManager");
  32. var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
  33. var InsufficientPanel = /** @class */ (function (_super) {
  34. __extends(InsufficientPanel, _super);
  35. function InsufficientPanel() {
  36. return _super !== null && _super.apply(this, arguments) || this;
  37. }
  38. InsufficientPanel.prototype.onLoad = function () {
  39. console.log('zh:InsufficientPanel.ts onload');
  40. SDK_1.default.Instance.initAdForPage();
  41. };
  42. InsufficientPanel.prototype.drawView = function () {
  43. var _this = this;
  44. // 返回
  45. var closeBtn = this.ui.getNode("close");
  46. closeBtn.on(cc.Node.EventType.TOUCH_END, function () {
  47. _this.closeView();
  48. }, this);
  49. //体力不足看AD
  50. var confirmBtn = this.ui.getNode("confirm");
  51. confirmBtn.on(cc.Node.EventType.TOUCH_END, function () {
  52. SoundManager_1.SoundManager.getInstance().VideoStartStop();
  53. if (cc.sys.os == cc.sys.OS_ANDROID) {
  54. if (ATRewardedVideoJSSDK_1.default.hasAdReady(ATAndroidJS2_1.default.getPlacementId())) {
  55. cc.sys.localStorage.setItem('yxAdMark', 'callBack_for_tiLiAd'); //看广告用于 xx 标记
  56. GlobalManager_1.default.instance.registerMethod('callBack_for_tiLiAd', _this.callBack_for_tiLiAd.bind(_this));
  57. ATRewardedVideoJSSDK_1.default.showAd(ATAndroidJS2_1.default.getPlacementId());
  58. }
  59. else {
  60. console.log('zh:AD 没有OK');
  61. SDK_1.default.Instance.initAdForPage();
  62. _this.callBack_for_tiLiAd();
  63. }
  64. }
  65. else {
  66. _this.callBack_for_tiLiAd();
  67. }
  68. // SDK.Instance.showRewardVideo(() => {
  69. // App.DataManager.UpdateTili(App.DataManager.VideoAddTili);
  70. // SoundManager.getInstance().VideoEndOpen();
  71. // this.closeView();
  72. // }, () => {
  73. // SoundManager.getInstance().VideoEndOpen();
  74. // }, () => {
  75. // SoundManager.getInstance().VideoEndOpen();
  76. // });
  77. }, this);
  78. };
  79. InsufficientPanel.prototype.callBack_for_tiLiAd = function () {
  80. console.log('zh:callBack_for_tiLiAd 被触发');
  81. App_1.App.DataManager.UpdateTili(App_1.App.DataManager.VideoAddTili);
  82. SoundManager_1.SoundManager.getInstance().VideoEndOpen();
  83. this.closeView();
  84. // SDK.Instance.showRewardVideo(() => {
  85. // }, () => {
  86. // SoundManager.getInstance().VideoEndOpen();
  87. // }, () => {
  88. // SoundManager.getInstance().VideoEndOpen();
  89. // });
  90. };
  91. InsufficientPanel.path = function () {
  92. return "/prefabs/InsufficientPanel";
  93. };
  94. InsufficientPanel = __decorate([
  95. ccclass
  96. ], InsufficientPanel);
  97. return InsufficientPanel;
  98. }(BaseView_1.BaseView));
  99. exports.default = InsufficientPanel;
  100. cc._RF.pop();