This commit is contained in:
YZ\249929363 2025-07-08 18:13:18 +08:00
parent 7cf729f994
commit 80fa040344
5 changed files with 1452 additions and 1201 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1250,39 +1250,41 @@ export namespace MiniGameSdk {
//#region 引力平台-
static yinli_Init(){
const configYinli = {
accessToken: "aGws0nluotbm6Jjiv9WMuzOAbXLydxwe", // 项目通行证,在:网站后台-->设置-->应用列表中找到Access Token列 复制(首次使用可能需要先新增应用)
clientId: cc.fx.GameConfig.GM_INFO.openid, // 用户唯一标识如产品为小游戏则必须填用户openid注意不是小游戏的APPID
name: "ge", // 全局变量名称
debugMode: "none", // 是否开启测试模式,开启测试模式后,可以在 网站后台--设置--元数据--事件流中查看实时数据上报结果。测试时使用上线之后一定要关掉改成none或者删除
sendTimeout: 3000, // 网络请求超时时间,单位毫秒,默认值 3000 ms
maxRetries: 3, // 网络请求失败时的重试次数1 表示不重试。默认值是 3
enablePersistence: true, // 是否使用本地缓存,主实例默认为 true子实例默认为 false
asyncPersistence: false, // 是否使用异步存储,默认为 false
};
API._ge = new GravityAnalyticsAPI(configYinli);
API._ge .setupAndStart();
if (typeof wx !== 'undefined' && wx !== null) {
const configYinli = {
accessToken: "aGws0nluotbm6Jjiv9WMuzOAbXLydxwe", // 项目通行证,在:网站后台-->设置-->应用列表中找到Access Token列 复制(首次使用可能需要先新增应用)
clientId: cc.fx.GameConfig.GM_INFO.openid, // 用户唯一标识如产品为小游戏则必须填用户openid注意不是小游戏的APPID
name: "ge", // 全局变量名称
debugMode: "none", // 是否开启测试模式,开启测试模式后,可以在 网站后台--设置--元数据--事件流中查看实时数据上报结果。测试时使用上线之后一定要关掉改成none或者删除
sendTimeout: 3000, // 网络请求超时时间,单位毫秒,默认值 3000 ms
maxRetries: 3, // 网络请求失败时的重试次数1 表示不重试。默认值是 3
enablePersistence: true, // 是否使用本地缓存,主实例默认为 true子实例默认为 false
asyncPersistence: false, // 是否使用异步存储,默认为 false
};
API._ge = new GravityAnalyticsAPI(configYinli);
API._ge .setupAndStart();
API._ge .initialize({
name: cc.fx.GameConfig.GM_INFO.openid,
version: cc.fx.GameConfig.GM_INFO.version,
openid: cc.fx.GameConfig.GM_INFO.openid,
enable_sync_attribution: false,
})
.then((res) => {
console.log("引力引擎初始化成功", res)
})
.catch((err) => {
console.log("引力引擎初始化失败 " + err);
});
API._ge .initialize({
name: cc.fx.GameConfig.GM_INFO.openid,
version: cc.fx.GameConfig.GM_INFO.version,
openid: cc.fx.GameConfig.GM_INFO.openid,
enable_sync_attribution: false,
})
.then((res) => {
console.log("引力引擎初始化成功", res)
})
.catch((err) => {
console.log("引力引擎初始化失败 " + err);
});
if(cc.fx.GameConfig.GM_INFO.shushu_AccountId == "") cc.fx.GameConfig.GM_INFO.shushu_AccountId =
cc.fx.GameConfig.GM_INFO.openid;
if(cc.fx.GameConfig.GM_INFO.shushu_AccountId == "") cc.fx.GameConfig.GM_INFO.shushu_AccountId =
cc.fx.GameConfig.GM_INFO.openid;
const CURRENT_USER_TA_ACCOUNT_ID = cc.fx.GameConfig.GM_INFO.shushu_AccountId; // 用户唯一标识如产品为小游戏则必须填用户openid注意不是小游戏的APPID
const CURRENT_USER_TA_DISTINCT_ID = cc.fx.GameConfig.GM_INFO.shushu_DistinctId; // 用户唯一标识如产品为小游戏则必须填用户openid注意不是小游戏的APPID
API._ge.bindTAThirdPlatform(CURRENT_USER_TA_ACCOUNT_ID, CURRENT_USER_TA_DISTINCT_ID);
const CURRENT_USER_TA_ACCOUNT_ID = cc.fx.GameConfig.GM_INFO.shushu_AccountId; // 用户唯一标识如产品为小游戏则必须填用户openid注意不是小游戏的APPID
const CURRENT_USER_TA_DISTINCT_ID = cc.fx.GameConfig.GM_INFO.shushu_DistinctId; // 用户唯一标识如产品为小游戏则必须填用户openid注意不是小游戏的APPID
API._ge.bindTAThirdPlatform(CURRENT_USER_TA_ACCOUNT_ID, CURRENT_USER_TA_DISTINCT_ID);
}
}
}

View File

@ -373,8 +373,8 @@ var GameTool = {
}
cc.fx.GameConfig.GM_INFO.coin += coin;
if(coin > 0){
let data = "获得" + (coin) + "金币";
MiniGameSdk.API.showToast(data);
// let data = "获得" + (coin) + "金币";
// MiniGameSdk.API.showToast(data);
}
else{
let data = "消耗" + (-coin) + "金币";
@ -637,8 +637,16 @@ var GameTool = {
buyProp(propid,callback: Function) {
//@ts-ignore
if (typeof wx!== 'undefined' && wx!== null) {
cc.fx.GameTool.changeCoin(-1500);
cc.fx.GameTool.setUserProp(propid,3,(data)=>{
let num = 3;
if(propid == 2002){
cc.fx.GameTool.changeCoin(-1000);
num = 1;
}
else{
cc.fx.GameTool.changeCoin(-1500);
}
cc.fx.GameTool.setUserProp(propid,num,(data)=>{
})
const data = {
id: (propid + ""),

View File

@ -33,14 +33,14 @@
"_active": true,
"_components": [
{
"__id__": 320
"__id__": 324
},
{
"__id__": 321
"__id__": 325
}
],
"_prefab": {
"__id__": 322
"__id__": 326
},
"_opacity": 255,
"_color": {
@ -428,7 +428,7 @@
"ctor": "Float64Array",
"array": [
0,
-141.52999999999997,
-290,
0,
0,
0,
@ -9836,7 +9836,7 @@
"_alignFlags": 1,
"_left": 0,
"_right": 0,
"_top": 351.53,
"_top": 500,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
@ -9876,23 +9876,26 @@
"__id__": 272
},
{
"__id__": 278
"__id__": 276
},
{
"__id__": 299
"__id__": 282
},
{
"__id__": 312
"__id__": 303
},
{
"__id__": 316
}
],
"_active": true,
"_components": [
{
"__id__": 318
"__id__": 322
}
],
"_prefab": {
"__id__": 319
"__id__": 323
},
"_opacity": 255,
"_color": {
@ -9984,7 +9987,7 @@
"ctor": "Float64Array",
"array": [
0,
126.72199999999998,
31.149999999999977,
0,
0,
0,
@ -10055,7 +10058,7 @@
"_alignFlags": 1,
"_left": 0,
"_right": 0,
"_top": -4.110000000000014,
"_top": 91.46199999999993,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
@ -10080,6 +10083,145 @@
"fileId": "91FPh7kZtC+51mI5KXRts7",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "shop_1",
"_objFlags": 0,
"_parent": {
"__id__": 267
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 273
},
{
"__id__": 274
}
],
"_prefab": {
"__id__": 275
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1080,
"height": 436
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
461.72500000000025,
0,
0,
0,
0,
1,
1,
-1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 272
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "11bc6aa1-f82e-42c0-8581-7cc70ba6cde0"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 272
},
"_enabled": true,
"alignMode": 1,
"_target": {
"__id__": 1
},
"_alignFlags": 1,
"_left": 0,
"_right": 0,
"_top": -339.11300000000017,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1080,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "c2W8O2LhdN2Yt3Y+q1zlF1",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "tx",
@ -10089,17 +10231,17 @@
},
"_children": [
{
"__id__": 273
"__id__": 277
}
],
"_active": true,
"_components": [
{
"__id__": 276
"__id__": 280
}
],
"_prefab": {
"__id__": 277
"__id__": 281
},
"_opacity": 255,
"_color": {
@ -10124,7 +10266,7 @@
"ctor": "Float64Array",
"array": [
-412.791,
111.536,
15.964,
0,
0,
0,
@ -10153,17 +10295,17 @@
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 272
"__id__": 276
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 274
"__id__": 278
}
],
"_prefab": {
"__id__": 275
"__id__": 279
},
"_opacity": 255,
"_color": {
@ -10217,7 +10359,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 273
"__id__": 277
},
"_enabled": true,
"_materials": [
@ -10260,7 +10402,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 272
"__id__": 276
},
"_enabled": true,
"_materials": [
@ -10309,32 +10451,32 @@
},
"_children": [
{
"__id__": 279
"__id__": 283
},
{
"__id__": 282
"__id__": 286
},
{
"__id__": 285
"__id__": 289
},
{
"__id__": 288
"__id__": 292
},
{
"__id__": 291
"__id__": 295
},
{
"__id__": 293
"__id__": 297
}
],
"_active": true,
"_components": [
{
"__id__": 296
"__id__": 300
}
],
"_prefab": {
"__id__": 298
"__id__": 302
},
"_opacity": 255,
"_color": {
@ -10359,7 +10501,7 @@
"ctor": "Float64Array",
"array": [
-81.953,
166.638,
71.066,
0,
0,
0,
@ -10388,17 +10530,17 @@
"_name": "New Sprite",
"_objFlags": 0,
"_parent": {
"__id__": 278
"__id__": 282
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 280
"__id__": 284
}
],
"_prefab": {
"__id__": 281
"__id__": 285
},
"_opacity": 255,
"_color": {
@ -10452,7 +10594,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 279
"__id__": 283
},
"_enabled": true,
"_materials": [
@ -10497,17 +10639,17 @@
"_name": "New Sprite",
"_objFlags": 0,
"_parent": {
"__id__": 278
"__id__": 282
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 283
"__id__": 287
}
],
"_prefab": {
"__id__": 284
"__id__": 288
},
"_opacity": 255,
"_color": {
@ -10561,7 +10703,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 282
"__id__": 286
},
"_enabled": true,
"_materials": [
@ -10606,17 +10748,17 @@
"_name": "New Sprite",
"_objFlags": 0,
"_parent": {
"__id__": 278
"__id__": 282
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 286
"__id__": 290
}
],
"_prefab": {
"__id__": 287
"__id__": 291
},
"_opacity": 255,
"_color": {
@ -10670,7 +10812,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 285
"__id__": 289
},
"_enabled": true,
"_materials": [
@ -10715,17 +10857,17 @@
"_name": "man",
"_objFlags": 0,
"_parent": {
"__id__": 278
"__id__": 282
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 289
"__id__": 293
}
],
"_prefab": {
"__id__": 290
"__id__": 294
},
"_opacity": 255,
"_color": {
@ -10779,7 +10921,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 288
"__id__": 292
},
"_enabled": true,
"_materials": [
@ -10824,13 +10966,13 @@
"_name": "health",
"_objFlags": 0,
"_parent": {
"__id__": 278
"__id__": 282
},
"_children": [],
"_active": false,
"_components": [],
"_prefab": {
"__id__": 292
"__id__": 296
},
"_opacity": 255,
"_color": {
@ -10895,17 +11037,17 @@
"_name": "time",
"_objFlags": 0,
"_parent": {
"__id__": 278
"__id__": 282
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 294
"__id__": 298
}
],
"_prefab": {
"__id__": 295
"__id__": 299
},
"_opacity": 255,
"_color": {
@ -10959,7 +11101,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 293
"__id__": 297
},
"_enabled": true,
"_materials": [
@ -11003,7 +11145,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 278
"__id__": 282
},
"_enabled": false,
"_normalMaterial": null,
@ -11012,7 +11154,7 @@
"zoomScale": 1.1,
"clickEvents": [
{
"__id__": 297
"__id__": 301
}
],
"_N$interactable": true,
@ -11098,22 +11240,22 @@
},
"_children": [
{
"__id__": 300
"__id__": 304
},
{
"__id__": 303
"__id__": 307
},
{
"__id__": 306
"__id__": 310
},
{
"__id__": 309
"__id__": 313
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 311
"__id__": 315
},
"_opacity": 255,
"_color": {
@ -11137,8 +11279,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
335.588,
166.638,
304.668,
71.066,
0,
0,
0,
@ -11167,17 +11309,17 @@
"_name": "New Sprite",
"_objFlags": 0,
"_parent": {
"__id__": 299
"__id__": 303
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 301
"__id__": 305
}
],
"_prefab": {
"__id__": 302
"__id__": 306
},
"_opacity": 255,
"_color": {
@ -11231,7 +11373,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 300
"__id__": 304
},
"_enabled": true,
"_materials": [
@ -11276,17 +11418,17 @@
"_name": "New Sprite",
"_objFlags": 0,
"_parent": {
"__id__": 299
"__id__": 303
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 304
"__id__": 308
}
],
"_prefab": {
"__id__": 305
"__id__": 309
},
"_opacity": 255,
"_color": {
@ -11340,7 +11482,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 303
"__id__": 307
},
"_enabled": true,
"_materials": [
@ -11385,17 +11527,17 @@
"_name": "New Sprite",
"_objFlags": 0,
"_parent": {
"__id__": 299
"__id__": 303
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 307
"__id__": 311
}
],
"_prefab": {
"__id__": 308
"__id__": 312
},
"_opacity": 255,
"_color": {
@ -11449,7 +11591,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 306
"__id__": 310
},
"_enabled": true,
"_materials": [
@ -11494,13 +11636,13 @@
"_name": "Coin",
"_objFlags": 0,
"_parent": {
"__id__": 299
"__id__": 303
},
"_children": [],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 310
"__id__": 314
},
"_opacity": 255,
"_color": {
@ -11582,17 +11724,17 @@
"_active": true,
"_components": [
{
"__id__": 313
"__id__": 317
},
{
"__id__": 314
"__id__": 318
},
{
"__id__": 315
"__id__": 319
}
],
"_prefab": {
"__id__": 317
"__id__": 321
},
"_opacity": 255,
"_color": {
@ -11617,7 +11759,7 @@
"ctor": "Float64Array",
"array": [
447.208,
-6.111999999999966,
-108.50999999999999,
0,
0,
0,
@ -11646,7 +11788,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 312
"__id__": 316
},
"_enabled": true,
"_materials": [
@ -11680,7 +11822,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 312
"__id__": 316
},
"_enabled": true,
"alignMode": 1,
@ -11690,7 +11832,7 @@
"_alignFlags": 1,
"_left": 0,
"_right": 24.363999999999976,
"_top": 295.724,
"_top": 398.12199999999996,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
@ -11709,7 +11851,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 312
"__id__": 316
},
"_enabled": true,
"_normalMaterial": null,
@ -11718,7 +11860,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 316
"__id__": 320
}
],
"_N$interactable": true,
@ -11774,7 +11916,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 312
"__id__": 316
},
"_id": ""
},
@ -11854,10 +11996,10 @@
"__id__": 18
},
"coin": {
"__id__": 309
"__id__": 313
},
"Stamina": {
"__id__": 278
"__id__": 282
},
"_id": ""
},

View File

@ -235,8 +235,8 @@ protected update(dt: number): void {
// Utils.GoKEFu();
if(systemType == "ios"){
// MiniGameSdk.API.showToast("IOS系统暂不支持支付");
Utils.GoKEFu();
MiniGameSdk.API.showToast("IOS系统暂不支持支付");
// Utils.GoKEFu();
}
else{
const data = {