Files
tothvillar e896e2ead4 init
2026-07-09 15:04:14 +08:00

65 lines
2.2 KiB
JavaScript

cc.Class({
extends: cc.Component,
properties: {
qiandaoPrefab: cc.Prefab
},
onLoad: function () {
cc.global.MianScript = this;
this.game = "game1";
},
start: function () {
if (cc.sys.platform == cc.sys.VIVO_GAME) {
undefined != window.vivoUtil && vivoUtil.showMoreGame();
} else {
cc.PlatformTools.executeShowBanner();
}
window.uc || cc.PlatformTools.executeShowInterstitial();
cc.PlatformTools.executeBlockAdShow();
cc.global.signInfo.allow && cc.global.isOneShowHome && this.OnQianDaoUi();
cc.global.isOneShowHome;
cc.global.isOneShowHome || (cc.global.isOneShowHome = true);
cc.global.Source.onPlayBjM("bj1");
},
onDestroy: function () {
window.vivoUtil && vivoUtil.closeBoxPortalAd();
cc.PlatformTools.executeHideBanner();
},
oonBtnClickEvent: function (e) {
var o = this;
cc.global.Source.onPlayBtnEffect("buttonClick");
switch (e.target.name) {
case "Startbtn":
cc.global.zhiyinNode.showZhuanchang(function () {
cc.global.LoadPreFtabData("".concat(o.game, "/prefab/gameui/").concat(o.game, "_xuanguan"), function () {}.bind(o));
});
break;
case "Startbtn2":
this.game = "game1";
console.log("this.game" + this.game);
cc.global.zhiyinNode.showZhuanchang(function () {
cc.global.LoadPreFtabData("".concat(o.game, "/prefab/gameui/").concat(o.game, "_xuanguan"), function () {}.bind(o));
});
break;
case "qdbtn":
this.OnQianDaoUi();
break;
case "shangdian_ske":
cc.global.LoadPreFtabData("".concat(this.game, "/shop/shopUI"), function () {}.bind(this));
}
},
showTuiSong: function (e) {
var o = arguments.length > 1 && undefined !== arguments[1] ? arguments[1] : null;
cc.loader.loadRes("prefab/ui/pushCoins_UI", function (t, i) {
if (!t && i instanceof cc.Prefab) {
var n = cc.instantiate(i);
n.parent = cc.director.getScene();
n.position = cc.v2(0, 0);
n.zIndex = 9999;
n.getComponent("pushWindow").show(e, o);
}
}.bind(this));
},
OnQianDaoUi: function () {
cc.instantiate(this.qiandaoPrefab).parent = cc.director.getScene();
}
});