62ee506e0f57064b502a58971d90f4f5591e8ce5.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. System.register(["__unresolved_0", "cc", "__unresolved_1"], function (_export, _context) {
  2. "use strict";
  3. var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Constants, PlatformBrowser, _crd, ccclass, property;
  4. function _reportPossibleCrUseOfConstants(extras) {
  5. _reporterNs.report("Constants", "../data/Constants", _context.meta, extras);
  6. }
  7. return {
  8. setters: [function (_unresolved_) {
  9. _reporterNs = _unresolved_;
  10. }, function (_cc) {
  11. _cclegacy = _cc.cclegacy;
  12. __checkObsolete__ = _cc.__checkObsolete__;
  13. __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
  14. _decorator = _cc._decorator;
  15. }, function (_unresolved_2) {
  16. Constants = _unresolved_2.Constants;
  17. }],
  18. execute: function () {
  19. _crd = true;
  20. _cclegacy._RF.push({}, "eb6c844IflGH4yGRmIDs+NM", "PlatformBrowser", undefined);
  21. __checkObsolete__(['_decorator']);
  22. ({
  23. ccclass,
  24. property
  25. } = _decorator);
  26. PlatformBrowser = class PlatformBrowser {
  27. constructor() {
  28. this.adInstance = null;
  29. this.gtag = null;
  30. this.openAd = true;
  31. }
  32. initialize() {
  33. this.adInstance = window['adInstance'];
  34. try {
  35. var _window$__woso, _window$__woso$TopCal;
  36. (_window$__woso = window["__woso"]) == null || (_window$__woso$TopCal = _window$__woso["TopCallback"]) == null || _window$__woso$TopCal.call(_window$__woso);
  37. } catch (error) {}
  38. console.log('web ads sdk初始化');
  39. }
  40. /**显示插屏广告*/
  41. showInterstitialAd(cb) {
  42. if ((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
  43. error: Error()
  44. }), Constants) : Constants).isDebug) {
  45. console.log('模拟显示插屏广告回调');
  46. cb == null || cb();
  47. return;
  48. }
  49. try {
  50. window['showAd']('interstitial').then(() => {
  51. console.log("rewarded11111");
  52. }).catch(() => {// GtagMgr.inst.doGameDot(GtagType.ad_error);
  53. });
  54. } catch (error) {// tgxUITips.show('The ad failed to load')
  55. }
  56. }
  57. /** 显示激励广告*/
  58. showRewardVideo(cb) {
  59. if ((_crd && Constants === void 0 ? (_reportPossibleCrUseOfConstants({
  60. error: Error()
  61. }), Constants) : Constants).isDebug) {
  62. console.log('模拟激励广告回调');
  63. cb == null || cb(1);
  64. return;
  65. }
  66. try {
  67. window["showAd"]('rewarded').then(() => {
  68. if (cb) cb(1);
  69. }).catch(() => {//上报信息
  70. // GtagMgr.inst.doGameDot(GtagType.ad_error);
  71. // cb && cb();
  72. });
  73. return;
  74. } catch (error) {} //tgxUITips.show('The ads failed to load');
  75. }
  76. /** 显示激励广告*/
  77. hideBannerAd() {}
  78. showBannerAd() {}
  79. vibrateShort() {}
  80. };
  81. _export("default", new PlatformBrowser());
  82. _cclegacy._RF.pop();
  83. _crd = false;
  84. }
  85. };
  86. });
  87. //# sourceMappingURL=62ee506e0f57064b502a58971d90f4f5591e8ce5.js.map