更新SDK 符合质量看板 校验
This commit is contained in:
parent
276dd1274d
commit
0b038d4d3b
|
|
@ -272,7 +272,7 @@ export default class GameManager extends cc.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("abTests:", cc.fx.GameConfig.GM_INFO.abTests);
|
// console.log("abTests:", cc.fx.GameConfig.GM_INFO.abTests);
|
||||||
}
|
}
|
||||||
|
|
||||||
readUserData(retryCount = 0) {
|
readUserData(retryCount = 0) {
|
||||||
|
|
@ -848,6 +848,7 @@ export default class GameManager extends cc.Component {
|
||||||
MiniGameSdk.API.yinli_Login();
|
MiniGameSdk.API.yinli_Login();
|
||||||
this.setWX();
|
this.setWX();
|
||||||
if (this.register_time != 0) MiniGameSdk.API.shushu_userSet(this.register_time);
|
if (this.register_time != 0) MiniGameSdk.API.shushu_userSet(this.register_time);
|
||||||
|
MiniGameSdk.API.shushu_userSetLast(cc.fx.GameTool.formatDate(new Date()));
|
||||||
this.startGame();
|
this.startGame();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3762,12 +3762,13 @@ export default class JiaZai extends cc.Component {
|
||||||
}, true)
|
}, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// console.log("rankingData_________", rankData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log("rankingData_________", rankData);
|
|
||||||
});
|
});
|
||||||
}, isShow);
|
}, isShow);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -554,6 +554,7 @@ export default class MapConroler extends cc.Component {
|
||||||
if ((cc.fx.GameConfig.GM_INFO.level + 1) == 1) {
|
if ((cc.fx.GameConfig.GM_INFO.level + 1) == 1) {
|
||||||
this.guideNode.getComponent(Animation).stop();
|
this.guideNode.getComponent(Animation).stop();
|
||||||
this.guideNode.active = false;
|
this.guideNode.active = false;
|
||||||
|
MiniGameSdk.API.tencent_TutorialEnd(1);
|
||||||
}
|
}
|
||||||
if (cc.fx.GameConfig.GM_INFO.winStreak >= 10) {
|
if (cc.fx.GameConfig.GM_INFO.winStreak >= 10) {
|
||||||
this.is_frenzy = true;
|
this.is_frenzy = true;
|
||||||
|
|
@ -573,6 +574,7 @@ export default class MapConroler extends cc.Component {
|
||||||
cc.fx.StorageMessage.setStorage("winState", cc.fx.GameConfig.GM_INFO.winState);
|
cc.fx.StorageMessage.setStorage("winState", cc.fx.GameConfig.GM_INFO.winState);
|
||||||
}
|
}
|
||||||
cc.fx.GameTool.shushu_Track("enter_stage", data);
|
cc.fx.GameTool.shushu_Track("enter_stage", data);
|
||||||
|
MiniGameSdk.API.tencent_LevelEnter(cc.fx.GameConfig.GM_INFO.level + 1);
|
||||||
this.stopTimeCutDown();
|
this.stopTimeCutDown();
|
||||||
this.startTimeCutDown();
|
this.startTimeCutDown();
|
||||||
}
|
}
|
||||||
|
|
@ -731,6 +733,7 @@ export default class MapConroler extends cc.Component {
|
||||||
this.guideNode.active = true;
|
this.guideNode.active = true;
|
||||||
this.guideNode.zIndex = 1000;
|
this.guideNode.zIndex = 1000;
|
||||||
this.guideNode.getComponent(Animation).play();
|
this.guideNode.getComponent(Animation).play();
|
||||||
|
MiniGameSdk.API.tencent_TutorialStart(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cc.fx.GameConfig.GM_INFO.hammerFirst == true) {
|
if (cc.fx.GameConfig.GM_INFO.hammerFirst == true) {
|
||||||
|
|
@ -3185,6 +3188,7 @@ export default class MapConroler extends cc.Component {
|
||||||
console.log("获胜了成功了!!!!!!")
|
console.log("获胜了成功了!!!!!!")
|
||||||
this.gameWin = true;
|
this.gameWin = true;
|
||||||
this.gameStart = false;
|
this.gameStart = false;
|
||||||
|
MiniGameSdk.API.tencent_LevelPass(cc.fx.GameConfig.GM_INFO.level + 1);
|
||||||
// alert("游戏成功");
|
// alert("游戏成功");
|
||||||
Utils.getCityRank((res) => {
|
Utils.getCityRank((res) => {
|
||||||
if (res.code === 1) {
|
if (res.code === 1) {
|
||||||
|
|
@ -4029,6 +4033,7 @@ export default class MapConroler extends cc.Component {
|
||||||
|
|
||||||
|
|
||||||
this.node.parent.parent.getChildByName("Lose").active = false;
|
this.node.parent.parent.getChildByName("Lose").active = false;
|
||||||
|
MiniGameSdk.API.tencent_LevelEnter(cc.fx.GameConfig.GM_INFO.level + 1);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.reviewState = false;
|
this.reviewState = false;
|
||||||
this.blockNum = this.blocks.length;
|
this.blockNum = this.blocks.length;
|
||||||
|
|
@ -4096,6 +4101,7 @@ export default class MapConroler extends cc.Component {
|
||||||
this.blockNum = this.blocks.length;
|
this.blockNum = this.blocks.length;
|
||||||
if (this.blockNum == 0) this.nextLevel(1);
|
if (this.blockNum == 0) this.nextLevel(1);
|
||||||
this.node.parent.parent.getChildByName("Lose").active = false;
|
this.node.parent.parent.getChildByName("Lose").active = false;
|
||||||
|
MiniGameSdk.API.tencent_LevelEnter(cc.fx.GameConfig.GM_INFO.level + 1);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.reviewState = false;
|
this.reviewState = false;
|
||||||
}, 200);
|
}, 200);
|
||||||
|
|
@ -4240,6 +4246,7 @@ export default class MapConroler extends cc.Component {
|
||||||
|
|
||||||
//返回主界面
|
//返回主界面
|
||||||
returnHome(event, customEventData) {
|
returnHome(event, customEventData) {
|
||||||
|
MiniGameSdk.API.tencent_LevelExit(cc.fx.GameConfig.GM_INFO.level + 1);
|
||||||
cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
|
cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
|
||||||
if (MapConroler._instance = null) {
|
if (MapConroler._instance = null) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -4333,6 +4340,7 @@ export default class MapConroler extends cc.Component {
|
||||||
|
|
||||||
this.stopTimeCutDown();
|
this.stopTimeCutDown();
|
||||||
//失败
|
//失败
|
||||||
|
MiniGameSdk.API.tencent_LevelLose(cc.fx.GameConfig.GM_INFO.level + 1);
|
||||||
if (cc.fx.GameConfig.GM_INFO.otherLevel > 0) {
|
if (cc.fx.GameConfig.GM_INFO.otherLevel > 0) {
|
||||||
let eventData = {
|
let eventData = {
|
||||||
identity: "helper", //发起者为helped 帮助者为helper
|
identity: "helper", //发起者为helped 帮助者为helper
|
||||||
|
|
|
||||||
|
|
@ -974,6 +974,13 @@ export namespace MiniGameSdk {
|
||||||
private static _ta: any = null;
|
private static _ta: any = null;
|
||||||
private static _ge: any = null;
|
private static _ge: any = null;
|
||||||
static _tencent: any;
|
static _tencent: any;
|
||||||
|
private static _tencentLevelActive: boolean = false;
|
||||||
|
private static _tencentLevelId: number = 0;
|
||||||
|
private static _tencentLevelEnterTime: number = 0;
|
||||||
|
private static _tencentLevelAdCount: number = 0;
|
||||||
|
private static _tencentPendingLevelAdCount: number = 0;
|
||||||
|
private static _tencentTutorialStarted: boolean = false;
|
||||||
|
private static _tencentTutorialEnded: boolean = false;
|
||||||
/**
|
/**
|
||||||
* 分享app给朋友,微信小游戏分享是没有onSuccess回调的。
|
* 分享app给朋友,微信小游戏分享是没有onSuccess回调的。
|
||||||
* @param title 标题
|
* @param title 标题
|
||||||
|
|
@ -1555,7 +1562,7 @@ export namespace MiniGameSdk {
|
||||||
}
|
}
|
||||||
|
|
||||||
static tencent_SetOpenId(openId: string) {
|
static tencent_SetOpenId(openId: string) {
|
||||||
if (API._tencent) API._tencent.setOpenId(cc.fx.GameConfig.GM_INFO.openid);
|
if (API._tencent) API._tencent.setOpenId(openId);
|
||||||
}
|
}
|
||||||
|
|
||||||
static tencent_OnRegister() {
|
static tencent_OnRegister() {
|
||||||
|
|
@ -1566,6 +1573,93 @@ export namespace MiniGameSdk {
|
||||||
if (API._tencent) API._tencent.onAddToWishlist();
|
if (API._tencent) API._tencent.onAddToWishlist();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** DataNexus IAP 质量看板使用的通用事件上报入口。 */
|
||||||
|
static tencent_Track(actionType: string, actionParam: any = {}) {
|
||||||
|
if (!API._tencent) return null;
|
||||||
|
return API._tencent.track(actionType, actionParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
static tencent_TutorialStart(tutorialId: number = 1) {
|
||||||
|
if (API._tencentTutorialStarted || API._tencentTutorialEnded) return;
|
||||||
|
API._tencentTutorialStarted = true;
|
||||||
|
API.tencent_Track("TUTORIAL_START", {
|
||||||
|
id: tutorialId,
|
||||||
|
first: true,
|
||||||
|
});
|
||||||
|
console.log("______________________开始新手指引上報");
|
||||||
|
}
|
||||||
|
|
||||||
|
static tencent_TutorialEnd(tutorialId: number = 1) {
|
||||||
|
if (!API._tencentTutorialStarted || API._tencentTutorialEnded) return;
|
||||||
|
API._tencentTutorialEnded = true;
|
||||||
|
API.tencent_Track("TUTORIAL_END", {
|
||||||
|
id: tutorialId,
|
||||||
|
last: true,
|
||||||
|
});
|
||||||
|
console.log("______________________完成新手指引上報");
|
||||||
|
// 同时上报开发指引中的标准“完成新手指引”转化事件。
|
||||||
|
if (API._tencent) API._tencent.onTutorialFinish();
|
||||||
|
}
|
||||||
|
|
||||||
|
static tencent_LevelEnter(levelId: number) {
|
||||||
|
const normalizedLevelId = Math.max(1, Math.floor(Number(levelId) || 1));
|
||||||
|
API._tencentLevelId = normalizedLevelId;
|
||||||
|
API._tencentLevelEnterTime = Date.now();
|
||||||
|
API._tencentLevelAdCount = API._tencentPendingLevelAdCount;
|
||||||
|
API._tencentPendingLevelAdCount = 0;
|
||||||
|
API._tencentLevelActive = true;
|
||||||
|
API.tencent_Track("LEVEL_ENTER", {
|
||||||
|
level_id: normalizedLevelId,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private static tencent_LevelFinish(actionType: string, levelId?: number) {
|
||||||
|
if (!API._tencentLevelActive) return;
|
||||||
|
|
||||||
|
const normalizedLevelId = Math.max(
|
||||||
|
1,
|
||||||
|
Math.floor(Number(levelId || API._tencentLevelId) || 1)
|
||||||
|
);
|
||||||
|
const duration = API._tencentLevelEnterTime > 0
|
||||||
|
? Math.max(0, Math.floor((Date.now() - API._tencentLevelEnterTime) / 1000))
|
||||||
|
: 0;
|
||||||
|
|
||||||
|
API.tencent_Track(actionType, {
|
||||||
|
level_id: normalizedLevelId,
|
||||||
|
ad_cnt: API._tencentLevelAdCount,
|
||||||
|
duration: duration,
|
||||||
|
});
|
||||||
|
|
||||||
|
API._tencentLevelActive = false;
|
||||||
|
API._tencentLevelId = 0;
|
||||||
|
API._tencentLevelEnterTime = 0;
|
||||||
|
API._tencentLevelAdCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static tencent_LevelPass(levelId?: number) {
|
||||||
|
API.tencent_LevelFinish("LEVEL_PASS", levelId);
|
||||||
|
}
|
||||||
|
|
||||||
|
static tencent_LevelLose(levelId?: number) {
|
||||||
|
API.tencent_LevelFinish("LEVEL_LOSE", levelId);
|
||||||
|
}
|
||||||
|
|
||||||
|
static tencent_LevelExit(levelId?: number) {
|
||||||
|
API.tencent_LevelFinish("LEVEL_EXIT", levelId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 记录关卡内完整观看的营销单元次数,供 LEVEL_PASS 等结束事件携带 ad_cnt。 */
|
||||||
|
static tencent_MarketingUnitComplete(count: number = 1, currentPage: string = "") {
|
||||||
|
if (currentPage !== "GameScene") return;
|
||||||
|
const normalizedCount = Math.max(1, Math.floor(Number(count) || 1));
|
||||||
|
if (API._tencentLevelActive) {
|
||||||
|
API._tencentLevelAdCount += normalizedCount;
|
||||||
|
} else {
|
||||||
|
// 失败后观看的复活广告属于复活后的下一次关卡循环。
|
||||||
|
API._tencentPendingLevelAdCount += normalizedCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//#region 数数平台
|
//#region 数数平台
|
||||||
/*
|
/*
|
||||||
* 数数平台初始化以及登录
|
* 数数平台初始化以及登录
|
||||||
|
|
@ -1648,6 +1742,14 @@ export namespace MiniGameSdk {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static shushu_userSetLast(time) {
|
||||||
|
//@ts-ignore
|
||||||
|
if ((typeof wx !== 'undefined' && wx !== null) || (typeof tt !== 'undefined' && tt !== null)) {
|
||||||
|
console.log("_______________设置用户最后登录属性", time);
|
||||||
|
API._ta.userSet({ last_login_time: time });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static updateCoinAndLevel() {
|
static updateCoinAndLevel() {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
if ((typeof wx !== 'undefined' && wx !== null) || (typeof tt !== 'undefined' && tt !== null)) {
|
if ((typeof wx !== 'undefined' && wx !== null) || (typeof tt !== 'undefined' && tt !== null)) {
|
||||||
|
|
@ -1849,6 +1951,7 @@ export namespace MiniGameSdk {
|
||||||
if (version == "开发版" || version == "体验版") {
|
if (version == "开发版" || version == "体验版") {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (API._tencent) API._tencent.onPurchase(payAmount);
|
||||||
API._ge.payEvent(payAmount, "CNY", orderId, payReason, "微信");
|
API._ge.payEvent(payAmount, "CNY", orderId, payReason, "微信");
|
||||||
}
|
}
|
||||||
console.log("版本:", version);
|
console.log("版本:", version);
|
||||||
|
|
@ -2297,4 +2400,4 @@ export namespace MiniGameSdk {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -309,7 +309,7 @@ export class GameConfig {
|
||||||
vibrateOpen: true, //震动
|
vibrateOpen: true, //震动
|
||||||
coinnum: 0, //每局的金币数
|
coinnum: 0, //每局的金币数
|
||||||
paid_user: false, //是否是付费用户
|
paid_user: false, //是否是付费用户
|
||||||
version: "1.9.97", //版本号
|
version: "1.9.98", //版本号
|
||||||
shushu_DistinctId: "", //数数访客ID
|
shushu_DistinctId: "", //数数访客ID
|
||||||
shushu_AccountId: "", //数数账号ID
|
shushu_AccountId: "", //数数账号ID
|
||||||
uid: "", //用户和后端唯一id
|
uid: "", //用户和后端唯一id
|
||||||
|
|
|
||||||
|
|
@ -1912,6 +1912,7 @@ var GameTool = {
|
||||||
data.is_complete_play = true;
|
data.is_complete_play = true;
|
||||||
MiniGameSdk.API.showToast('用户看完广告,可以奖励');
|
MiniGameSdk.API.showToast('用户看完广告,可以奖励');
|
||||||
cc.fx.GameTool.shushu_Track("ad_close", data);
|
cc.fx.GameTool.shushu_Track("ad_close", data);
|
||||||
|
MiniGameSdk.API.tencent_MarketingUnitComplete(count, videoData.current_page);
|
||||||
callback(true, "ad");
|
callback(true, "ad");
|
||||||
// cc.fx.GameTool.preloadRewardedVideoAd(true);
|
// cc.fx.GameTool.preloadRewardedVideoAd(true);
|
||||||
break;
|
break;
|
||||||
|
|
@ -2538,4 +2539,4 @@ var GameTool = {
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
export { GameTool };
|
export { GameTool };
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"last-module-event-record-time": 1783394460369,
|
"last-module-event-record-time": 1784108777617,
|
||||||
"group-list": [
|
"group-list": [
|
||||||
"default",
|
"default",
|
||||||
"Map"
|
"Map"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user