Compare commits

..

No commits in common. "6c880489869ed2e5555044c31557c9512ab2f651" and "a0de1686b86de9e9805cb3776ca28b6a88e1fa0c" have entirely different histories.

5 changed files with 23 additions and 56 deletions

View File

@ -586,7 +586,7 @@
"__id__": 18
}
],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 21
@ -3041,7 +3041,7 @@
"__id__": 7
},
"_children": [],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 64
@ -3137,7 +3137,7 @@
"__id__": 7
},
"_children": [],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 66

View File

@ -65,13 +65,7 @@ private heathScheduleCallback: Function = null;
// console.log("加载关卡配置2");
// window.initMgr();
GameManager._instance.Block_Color = this.Block_Color;
let version = cc.fx.GameTool.getWechatGameVersion();
if(version == "开发版" || version == "体验版"){
this.node.getChildByName("Load").getChildByName("New EditBox").active = true;
}
else if(version == "正式版"){
this.node.getChildByName("Load").getChildByName("New EditBox").active = false
}
// 预加载 shop 预制体
if (!JiaZai.cachedShopPrefab) {
cc.assetManager.loadBundle('shop', (err: Error, bundle: cc.AssetManager.Bundle) => {
@ -94,12 +88,7 @@ private heathScheduleCallback: Function = null;
console.log("————————准备注册事件", cc.fx.GameConfig.GM_INFO.openid);
if (cc.fx.GameConfig.GM_INFO.openid != "") {
console.log("————————发送注册事件");
const time = cc.fx.GameTool.formatDate(new Date());
let data = {
register_time: time, // 注册时间
}
cc.fx.GameTool.shushu_Track("register",data);
MiniGameSdk.API.shushu_SetSuperProperties(time);
cc.fx.GameTool.shushu_Track("register");
}
cc.fx.AudioManager._instance.playEffect("zhuan1", null);
this.node.getChildByName("zhuanchang").active = true;
@ -286,8 +275,6 @@ stopHeathTimeCutDown() {
}
if (this.node.getChildByName("Load").getChildByName("startBtn").getComponent("btnControl")._touch) {
this.node.getChildByName("Load").getChildByName("startBtn").getComponent("btnControl").setTouch(false);
let version = cc.fx.GameTool.getWechatGameVersion();
if(version == "开发版" || version == "体验版"){
if(this.custom.string != ""){
cc.fx.GameConfig.GM_INFO.level = parseInt(this.custom.string) - 1;
// cc.fx.StorageMessage.setStorage("level",cc.fx.GameConfig.GM_INFO.level.toString());
@ -300,13 +287,6 @@ stopHeathTimeCutDown() {
cc.fx.GameConfig.LEVEL_INFO_init(true, 1000);
}
}
else if(version == "正式版"){
cc.fx.AudioManager._instance.playEffect("zhuan1", null);
this.node.getChildByName("zhuanchang").active = true;
this.node.getChildByName("zhuanchang").getComponent(sp.Skeleton).setAnimation(1, "up", false);
cc.fx.GameConfig.LEVEL_INFO_init(true, 1000);
}
}

View File

@ -1137,7 +1137,7 @@ export namespace MiniGameSdk {
API._ta.login(cc.fx.GameConfig.GM_INFO.openid);
const result = "success";
API.shushu_Track("login", result);
API.shushu_SetSuperProperties(null);
API.shushu_SetSuperProperties();
}
}
@ -1152,26 +1152,16 @@ export namespace MiniGameSdk {
*
*/
static shushu_SetSuperProperties(register_time) {
static shushu_SetSuperProperties() {
if (typeof wx !== 'undefined' && wx !== null && API._ta) {
const versionData = "1.3";
// API._ta.userSetOnce({ register_time:time});
var superProperties = {};
superProperties = {
var superProperties = {
current_level: (cc.fx.GameConfig.GM_INFO.level + 1), //当前关卡等级 number
current_health: cc.fx.GameConfig.GM_INFO.hp, //当前体力值
tmp_coin: cc.fx.GameConfig.GM_INFO.coin,//当前金币
version: versionData
};
if(register_time != null){
superProperties = {
current_level: (cc.fx.GameConfig.GM_INFO.level + 1), //当前关卡等级 number
current_health: cc.fx.GameConfig.GM_INFO.hp, //当前体力值
tmp_coin: cc.fx.GameConfig.GM_INFO.coin,//当前金币
version: versionData,
register_time:register_time
};
}
API._ta.setSuperProperties(superProperties);//设置公共事件属性
}
}

View File

@ -353,7 +353,7 @@ var GameTool = {
result:"success"
}
cc.fx.GameTool.shushu_Track("finish_stage",data);
MiniGameSdk.API.shushu_SetSuperProperties(null);
MiniGameSdk.API.shushu_SetSuperProperties();
}
cc.fx.GameTool.setUserLevel((data)=>{
@ -382,7 +382,7 @@ var GameTool = {
coin: cc.fx.GameConfig.GM_INFO.coin,
timestamp: timestamp,
}
MiniGameSdk.API.shushu_SetSuperProperties(null);
MiniGameSdk.API.shushu_SetSuperProperties();
cc.fx.StorageMessage.setStorage("coin", coinInfo);
// console.log("存储金币数据:",cc.fx.GameConfig.GM_INFO.coin,coinInfo);
cc.fx.GameTool.setUserCoin((data) => {
@ -494,7 +494,7 @@ var GameTool = {
"health":cc.fx.GameConfig.GM_INFO.hp,
"timestamp":data.result.timestamp
}
MiniGameSdk.API.shushu_SetSuperProperties(null);
MiniGameSdk.API.shushu_SetSuperProperties();
cc.fx.StorageMessage.setStorage("health",healthInfo);
}
else if(data.result.code == 404 && data.result.message == "未找到体力数据"){
@ -588,7 +588,7 @@ var GameTool = {
}
}
cc.fx.StorageMessage.setStorage("health",healthInfo);
MiniGameSdk.API.shushu_SetSuperProperties(null);
MiniGameSdk.API.shushu_SetSuperProperties();
//@ts-ignore
if (typeof wx!== 'undefined' && wx!== null) {
//@ts-ignore
@ -887,9 +887,6 @@ var GameTool = {
let eventData = {}
switch(name){
case "register":
eventData = {
register_time: data.register_time,
}
break;
case "enter_stage":
eventData = {

View File

@ -1275,7 +1275,7 @@
"ctor": "Float64Array",
"array": [
15,
160,
150,
0,
0,
0,
@ -1971,7 +1971,7 @@
"ctor": "Float64Array",
"array": [
20,
160,
150,
0,
0,
0,
@ -2667,7 +2667,7 @@
"ctor": "Float64Array",
"array": [
15,
160,
150,
0,
0,
0,
@ -3363,7 +3363,7 @@
"ctor": "Float64Array",
"array": [
18,
165,
150,
0,
0,
0,
@ -4059,7 +4059,7 @@
"ctor": "Float64Array",
"array": [
14,
165,
150,
0,
0,
0,
@ -4755,7 +4755,7 @@
"ctor": "Float64Array",
"array": [
21,
165,
150,
0,
0,
0,