init
This commit is contained in:
@@ -0,0 +1,196 @@
|
||||
function i(e, o) {
|
||||
if (!(e instanceof o)) {
|
||||
throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
}
|
||||
function n(e, o) {
|
||||
for (var t = 0; t < o.length; t++) {
|
||||
var i = o[t];
|
||||
i.enumerable = i.enumerable || false;
|
||||
i.configurable = true;
|
||||
"value" in i && (i.writable = true);
|
||||
Object.defineProperty(e, i.key, i);
|
||||
}
|
||||
}
|
||||
function a(e, o, t) {
|
||||
o && n(e.prototype, o);
|
||||
t && n(e, t);
|
||||
return e;
|
||||
}
|
||||
var c = function () {
|
||||
function e() {
|
||||
i(this, e);
|
||||
this.SystemInformation = null;
|
||||
this.BannerInstance = null;
|
||||
this.VideoInstance = null;
|
||||
this.VideoSuccessCallBack = null;
|
||||
this.VideoFailureCallBack = null;
|
||||
this.ChapingShowNum = 0;
|
||||
this.InterstitialInstance = null;
|
||||
this.InterstitialTimer = null;
|
||||
this.ChapingShow = false;
|
||||
}
|
||||
a(e, [{
|
||||
key: "doInitialize",
|
||||
value: function () {
|
||||
console.log("初始化uc");
|
||||
self = this;
|
||||
self.SystemInformation = uc.getSystemInfoSync();
|
||||
this.ChapingShow = false;
|
||||
new Date().getTime() >= 1647311813866 && (this.ChapingShow = true);
|
||||
}
|
||||
}, {
|
||||
key: "executeShowBanner",
|
||||
value: function (e) {
|
||||
console.log("ucbanner");
|
||||
if (this.BannerInstance) {
|
||||
this.BannerInstance.destroy();
|
||||
this.BannerInstance = null;
|
||||
}
|
||||
var o = uc.getSystemInfoSync();
|
||||
if ("string" == typeof o) {
|
||||
try {
|
||||
o = JSON.parse(o);
|
||||
console.log("res111111::" + o);
|
||||
} catch (e) {
|
||||
console.log("res::" + o);
|
||||
}
|
||||
}
|
||||
var t = (o.screenWidth > o.screenHeight ? o.screenHeight : o.screenWidth) / 2;
|
||||
var i = 194 * t / 345;
|
||||
this.BannerInstance = uc.createBannerAd({
|
||||
style: {
|
||||
width: t,
|
||||
height: i,
|
||||
gravity: 7
|
||||
}
|
||||
});
|
||||
this.BannerInstance.onError(function (e) {
|
||||
console.log("bannerAd 广告加载出错", e);
|
||||
});
|
||||
this.BannerInstance.onLoad(function () {
|
||||
console.log("bannerAd 广告加载成功");
|
||||
});
|
||||
this.BannerInstance.show();
|
||||
this.executeShowInterstitial();
|
||||
}
|
||||
}, {
|
||||
key: "executeHideBanner",
|
||||
value: function () {}
|
||||
}, {
|
||||
key: "Suijivideo",
|
||||
value: function (e) {}
|
||||
}, {
|
||||
key: "executeShowInterstitial",
|
||||
value: function () {
|
||||
if (this.ChapingShow) {
|
||||
this.InterstitialInstance = uc.createInterstitialAd();
|
||||
this.InterstitialInstance.show().then(function () {
|
||||
return console.log("展示成功");
|
||||
}).catch(function (e) {
|
||||
return console.log(e);
|
||||
});
|
||||
this.InterstitialInstance.onLoad(function () {
|
||||
console.log("插屏-广告加载成功");
|
||||
});
|
||||
this.InterstitialInstance.onError(function (e) {
|
||||
console.log("插屏-广告加载失败", e);
|
||||
});
|
||||
this.InterstitialInstance.onClose(function (e) {
|
||||
console.log("插屏-关闭");
|
||||
});
|
||||
} else {
|
||||
console.log("不达到条件不能谈");
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "executeJieSuanChaPing",
|
||||
value: function () {
|
||||
this.InterstitialInstance = uc.createInterstitialAd();
|
||||
this.InterstitialInstance.show().then(function () {
|
||||
return console.log("展示成功");
|
||||
}).catch(function (e) {
|
||||
return console.log(e);
|
||||
});
|
||||
this.InterstitialInstance.onLoad(function () {
|
||||
console.log("插屏-广告加载成功");
|
||||
});
|
||||
this.InterstitialInstance.onError(function (e) {
|
||||
console.log("插屏-广告加载失败", e);
|
||||
});
|
||||
this.InterstitialInstance.onClose(function (e) {
|
||||
console.log("插屏-关闭");
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "executeShowAwardVideo",
|
||||
value: function (e, o) {
|
||||
var t = this;
|
||||
this.VideoSuccessCallBack = e;
|
||||
this.VideoFailureCallBack = o;
|
||||
this.VideoInstance = uc.createRewardVideoAd();
|
||||
this.VideoInstance.show().then().catch(function (e) {
|
||||
return console.log(e);
|
||||
});
|
||||
this.VideoInstance.onLoad(function () {
|
||||
console.log("激励视频-广告加载成功");
|
||||
});
|
||||
this.VideoInstance.onError(function (e) {
|
||||
console.log("激励视频-广告加载失败", e);
|
||||
});
|
||||
this.VideoInstance.onClose(function (e) {
|
||||
if (e && e.isEnded) {
|
||||
t.videoDisplaySuccessCallBack();
|
||||
console.log("正常播放结束,可以下发游戏奖励 res: ", e);
|
||||
} else {
|
||||
console.log("播放中途退出,不下发游戏奖励 res :", e);
|
||||
t.videoDisplayFailureCallBack();
|
||||
}
|
||||
if (t.VideoInstance) {
|
||||
t.VideoInstance.offClose();
|
||||
t.VideoInstance.offLoad();
|
||||
t.VideoInstance.offError();
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "videoDisplaySuccessCallBack",
|
||||
value: function () {
|
||||
if (null != this.VideoSuccessCallBack) {
|
||||
this.VideoSuccessCallBack();
|
||||
this.VideoSuccessCallBack = null;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "videoDisplayFailureCallBack",
|
||||
value: function () {
|
||||
if (null != this.VideoFailureCallBack) {
|
||||
this.VideoFailureCallBack();
|
||||
this.VideoFailureCallBack = null;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "executeRecorder",
|
||||
value: function () {}
|
||||
}, {
|
||||
key: "stopRecorder",
|
||||
value: function () {}
|
||||
}, {
|
||||
key: "executeShareRecorder",
|
||||
value: function (e, o) {}
|
||||
}, {
|
||||
key: "executeShowPushBox",
|
||||
value: function () {}
|
||||
}, {
|
||||
key: "isInstalledShortcut",
|
||||
value: function () {}
|
||||
}, {
|
||||
key: "sendDesktopShortcut",
|
||||
value: function () {}
|
||||
}, {
|
||||
key: "executeBlockAdShow",
|
||||
value: function () {}
|
||||
}]);
|
||||
return e;
|
||||
}();
|
||||
module.exports = new c();
|
||||
Reference in New Issue
Block a user