This commit is contained in:
TJH 2025-12-08 16:38:10 +08:00
parent b8c88c106c
commit 40c46f7c04
13 changed files with 3175 additions and 4367 deletions

View File

@ -143,7 +143,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1080,
"height": 1919.9999999999998
"height": 1920
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -494,7 +494,7 @@
"__expectedType__": "sp.SkeletonData"
},
"defaultSkin": "default",
"defaultAnimation": "",
"defaultAnimation": "<None>",
"_premultipliedAlpha": false,
"_timeScale": 1,
"_preCacheMode": 0,
@ -758,17 +758,17 @@
"b": 255,
"a": 255
},
"_string": "123,456,789",
"_string": "65.2",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 146,
"_actualFontSize": 49,
"_fontSize": 200,
"_fontFamily": "Arial",
"_lineHeight": 200,
"_overflow": 2,
"_enableWrapText": true,
"_font": {
"__uuid__": "42af2cb2-a2c9-4bcc-a5bb-925456bbbec2",
"__uuid__": "277ce92c-75d5-4d3f-9b31-5ba7c7e8a8fa",
"__expectedType__": "cc.BitmapFont"
},
"_isSystemFontUsed": false,
@ -835,7 +835,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1080,
"height": 1919.9999999999998
"height": 1920
},
"_anchorPoint": {
"__type__": "cc.Vec2",

View File

@ -31,11 +31,11 @@
"_active": true,
"_components": [
{
"__id__": 48
"__id__": 46
}
],
"_prefab": {
"__id__": 50
"__id__": 48
},
"_lpos": {
"__type__": "cc.Vec3",
@ -385,8 +385,6 @@
"__id__": 0
},
"fileId": "4aIwt+05lLMpKnoJdiNdh8",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
@ -415,7 +413,7 @@
}
],
"_prefab": {
"__id__": 47
"__id__": 45
},
"_lpos": {
"__type__": "cc.Vec3",
@ -470,8 +468,8 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -0.00001873087603598833,
"y": 142.83750915527344,
"x": 0,
"y": 415.992,
"z": 0
},
"_lrot": {
@ -521,7 +519,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"y": -39.962,
"z": 0
},
"_lrot": {
@ -561,7 +559,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 407.5,
"width": 451.56,
"height": 300
},
"_anchorPoint": {
@ -597,17 +595,17 @@
"b": 255,
"a": 255
},
"_string": "12",
"_string": "+5",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 300,
"_fontSize": 300,
"_actualFontSize": 50,
"_fontSize": 50,
"_fontFamily": "Arial",
"_lineHeight": 300,
"_overflow": 0,
"_enableWrapText": true,
"_font": {
"__uuid__": "4d9a2958-fba8-4af2-8a6c-537300ece858",
"__uuid__": "277ce92c-75d5-4d3f-9b31-5ba7c7e8a8fa",
"__expectedType__": "cc.BitmapFont"
},
"_isSystemFontUsed": false,
@ -696,8 +694,6 @@
"__id__": 0
},
"fileId": "25FWpwjTFPlbbiZ9Mtz796",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
@ -724,8 +720,8 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 3.899945020675659,
"y": 419.25,
"x": 3.9,
"y": 48.04,
"z": 0
},
"_lrot": {
@ -747,7 +743,7 @@
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0.000005008956130975262
"z": 0.000005008955871170517
},
"_id": ""
},
@ -818,8 +814,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 774,
"height": 156
"width": 732,
"height": 166
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -855,7 +851,7 @@
"a": 255
},
"_spriteFrame": {
"__uuid__": "4c9beb5e-b6a9-4e1a-b94a-6f7604f821ed@3df26",
"__uuid__": "5f6d8da4-b85d-4187-95a8-7972983ec02b@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
@ -870,10 +866,7 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": {
"__uuid__": "4c9beb5e-b6a9-4e1a-b94a-6f7604f821ed",
"__expectedType__": "cc.SpriteAtlas"
},
"_atlas": null,
"_id": ""
},
{
@ -892,7 +885,7 @@
"__prefab": {
"__id__": 36
},
"spriteName": "FREESPINSWON",
"spriteName": "13",
"_id": ""
},
{
@ -1013,14 +1006,7 @@
"_timeScale": 1,
"_preCacheMode": 0,
"_cacheMode": 0,
"_sockets": [
{
"__id__": 45
},
{
"__id__": 46
}
],
"_sockets": [],
"_useTint": false,
"_debugMesh": false,
"_debugBones": false,
@ -1033,20 +1019,6 @@
"__type__": "cc.CompPrefabInfo",
"fileId": "bdGtjTa1VO0oE6pBlWnKjZ"
},
{
"__type__": "sp.Skeleton.SpineSocket",
"path": "root/All/txt/NUM",
"target": {
"__id__": 19
}
},
{
"__type__": "sp.Skeleton.SpineSocket",
"path": "root/All/txt/FREESPINSWON",
"target": {
"__id__": 29
}
},
{
"__type__": "cc.PrefabInfo",
"root": {
@ -1070,7 +1042,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 49
"__id__": 47
},
"_contentSize": {
"__type__": "cc.Size",

View File

@ -31,11 +31,11 @@
"_active": true,
"_components": [
{
"__id__": 82
"__id__": 86
}
],
"_prefab": {
"__id__": 84
"__id__": 88
},
"_lpos": {
"__type__": "cc.Vec3",
@ -392,7 +392,7 @@
{
"__type__": "cc.Node",
"_name": "spine",
"_objFlags": 0,
"_objFlags": 512,
"__editorExtras__": {},
"_parent": {
"__id__": 1
@ -405,14 +405,14 @@
"_active": true,
"_components": [
{
"__id__": 73
"__id__": 81
},
{
"__id__": 75
"__id__": 83
}
],
"_prefab": {
"__id__": 81
"__id__": 85
},
"_lpos": {
"__type__": "cc.Vec3",
@ -446,7 +446,7 @@
{
"__type__": "cc.Node",
"_name": "Node",
"_objFlags": 0,
"_objFlags": 512,
"__editorExtras__": {},
"_parent": {
"__id__": 18
@ -468,14 +468,14 @@
"_active": true,
"_components": [
{
"__id__": 68
"__id__": 76
},
{
"__id__": 70
"__id__": 78
}
],
"_prefab": {
"__id__": 72
"__id__": 80
},
"_lpos": {
"__type__": "cc.Vec3",
@ -509,7 +509,7 @@
{
"__type__": "cc.Node",
"_name": "NumNode",
"_objFlags": 0,
"_objFlags": 512,
"__editorExtras__": {},
"_parent": {
"__id__": 19
@ -533,8 +533,8 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -0.000024128687073243782,
"y": 138,
"x": 0,
"y": 111.126,
"z": 0
},
"_lrot": {
@ -563,7 +563,7 @@
{
"__type__": "cc.Node",
"_name": "Label",
"_objFlags": 0,
"_objFlags": 512,
"__editorExtras__": {},
"_parent": {
"__id__": 20
@ -624,7 +624,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 407.5,
"width": 273.75,
"height": 300
},
"_anchorPoint": {
@ -662,15 +662,15 @@
},
"_string": "12",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 300,
"_fontSize": 300,
"_verticalAlign": 0,
"_actualFontSize": 30,
"_fontSize": 30,
"_fontFamily": "Arial",
"_lineHeight": 300,
"_overflow": 0,
"_enableWrapText": true,
"_font": {
"__uuid__": "4d9a2958-fba8-4af2-8a6c-537300ece858",
"__uuid__": "1a8bc16c-8474-4998-8d27-b431dcf0952d",
"__expectedType__": "cc.BitmapFont"
},
"_isSystemFontUsed": false,
@ -785,7 +785,7 @@
{
"__type__": "cc.Node",
"_name": "TitleNode",
"_objFlags": 0,
"_objFlags": 512,
"__editorExtras__": {},
"_parent": {
"__id__": 19
@ -836,7 +836,7 @@
{
"__type__": "cc.Node",
"_name": "SpriteFREESPINWON",
"_objFlags": 0,
"_objFlags": 512,
"__editorExtras__": {},
"_parent": {
"__id__": 32
@ -900,8 +900,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 774,
"height": 156
"width": 947,
"height": 227
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -937,7 +937,7 @@
"a": 255
},
"_spriteFrame": {
"__uuid__": "4c9beb5e-b6a9-4e1a-b94a-6f7604f821ed@3df26",
"__uuid__": "e4389818-6bc5-4100-9ede-ca2eb0fe88c0@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
@ -952,10 +952,7 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": {
"__uuid__": "4c9beb5e-b6a9-4e1a-b94a-6f7604f821ed",
"__expectedType__": "cc.SpriteAtlas"
},
"_atlas": null,
"_id": ""
},
{
@ -974,7 +971,7 @@
"__prefab": {
"__id__": 39
},
"spriteName": "FREESPINSWON",
"spriteName": "12",
"_id": ""
},
{
@ -1038,7 +1035,7 @@
{
"__type__": "cc.Node",
"_name": "ContentNode",
"_objFlags": 0,
"_objFlags": 512,
"__editorExtras__": {},
"_parent": {
"__id__": 19
@ -1059,8 +1056,8 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0.00003609336636145599,
"y": -206.42999267578125,
"x": 0,
"y": -231.203,
"z": 0
},
"_lrot": {
@ -1089,7 +1086,7 @@
{
"__type__": "cc.Node",
"_name": "SpriteCONTENT",
"_objFlags": 0,
"_objFlags": 512,
"__editorExtras__": {},
"_parent": {
"__id__": 44
@ -1153,8 +1150,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 544,
"height": 127
"width": 804,
"height": 218
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -1190,7 +1187,7 @@
"a": 255
},
"_spriteFrame": {
"__uuid__": "4c9beb5e-b6a9-4e1a-b94a-6f7604f821ed@4922f",
"__uuid__": "a13f11b6-790f-419c-94a4-cba0dd047b69@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
@ -1205,10 +1202,7 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": {
"__uuid__": "4c9beb5e-b6a9-4e1a-b94a-6f7604f821ed",
"__expectedType__": "cc.SpriteAtlas"
},
"_atlas": null,
"_id": ""
},
{
@ -1227,7 +1221,7 @@
"__prefab": {
"__id__": 51
},
"spriteName": "CONTENT",
"spriteName": "14",
"_id": ""
},
{
@ -1291,7 +1285,7 @@
{
"__type__": "cc.Node",
"_name": "BtnNode",
"_objFlags": 0,
"_objFlags": 512,
"__editorExtras__": {},
"_parent": {
"__id__": 19
@ -1304,16 +1298,16 @@
"_active": true,
"_components": [
{
"__id__": 65
"__id__": 73
}
],
"_prefab": {
"__id__": 67
"__id__": 75
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0.00008036076178541407,
"y": -459.6099853515625,
"x": 0,
"y": -576.19,
"z": 0
},
"_lrot": {
@ -1342,26 +1336,30 @@
{
"__type__": "cc.Node",
"_name": "BtnStart",
"_objFlags": 0,
"_objFlags": 512,
"__editorExtras__": {},
"_parent": {
"__id__": 56
},
"_children": [],
"_children": [
{
"__id__": 58
}
],
"_active": true,
"_components": [
{
"__id__": 58
"__id__": 66
},
{
"__id__": 60
"__id__": 68
},
{
"__id__": 62
"__id__": 70
}
],
"_prefab": {
"__id__": 64
"__id__": 72
},
"_lpos": {
"__type__": "cc.Vec3",
@ -1392,6 +1390,164 @@
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Sprite",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 57
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 59
},
{
"__id__": 61
},
{
"__id__": 63
}
],
"_prefab": {
"__id__": 65
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 22.737,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 58
},
"_enabled": true,
"__prefab": {
"__id__": 60
},
"_contentSize": {
"__type__": "cc.Size",
"width": 240,
"height": 110
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "b8o29mkd5EgJCN1rri+nxM"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 58
},
"_enabled": true,
"__prefab": {
"__id__": 62
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "52008ccd-b69b-423e-9b68-21bfa3000f40@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "9eSokLKPlOdpnLKog3SJwj"
},
{
"__type__": "e6c8d4szahIuLbtf6yx+hH6",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 58
},
"_enabled": true,
"__prefab": {
"__id__": 64
},
"spriteName": "11",
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "fansOEXNpIE53uvKrmMes9"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "30YGRg7+BHTYY1kzlCWzvA",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
@ -1402,12 +1558,12 @@
},
"_enabled": true,
"__prefab": {
"__id__": 59
"__id__": 67
},
"_contentSize": {
"__type__": "cc.Size",
"width": 418,
"height": 203
"width": 594,
"height": 249
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -1430,7 +1586,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 61
"__id__": 69
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@ -1443,7 +1599,7 @@
"a": 255
},
"_spriteFrame": {
"__uuid__": "b434f2c7-e90b-413f-be9d-4fdb27d33ce2@f9941",
"__uuid__": "78d94e2a-e3d4-47b9-bf33-02e1a6a56704@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
@ -1475,7 +1631,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 63
"__id__": 71
},
"clickEvents": [],
"_interactable": true,
@ -1544,7 +1700,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 66
"__id__": 74
},
"_contentSize": {
"__type__": "cc.Size",
@ -1585,7 +1741,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 69
"__id__": 77
},
"_contentSize": {
"__type__": "cc.Size",
@ -1613,7 +1769,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 71
"__id__": 79
},
"_opacity": 255,
"_id": ""
@ -1645,7 +1801,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 74
"__id__": 82
},
"_contentSize": {
"__type__": "cc.Size",
@ -1673,7 +1829,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 76
"__id__": 84
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@ -1695,20 +1851,7 @@
"_timeScale": 1,
"_preCacheMode": 0,
"_cacheMode": 0,
"_sockets": [
{
"__id__": 77
},
{
"__id__": 78
},
{
"__id__": 79
},
{
"__id__": 80
}
],
"_sockets": [],
"_useTint": false,
"_debugMesh": false,
"_debugBones": false,
@ -1721,34 +1864,6 @@
"__type__": "cc.CompPrefabInfo",
"fileId": "bdGtjTa1VO0oE6pBlWnKjZ"
},
{
"__type__": "sp.Skeleton.SpineSocket",
"path": "root/All/object/txt/NUM",
"target": {
"__id__": 20
}
},
{
"__type__": "sp.Skeleton.SpineSocket",
"path": "root/All/object/txt/FREESPINSWON",
"target": {
"__id__": 32
}
},
{
"__type__": "sp.Skeleton.SpineSocket",
"path": "root/All/object/txt/MULTIPLIERS",
"target": {
"__id__": 44
}
},
{
"__type__": "sp.Skeleton.SpineSocket",
"path": "root/All/object/txt/BTN",
"target": {
"__id__": 56
}
},
{
"__type__": "cc.PrefabInfo",
"root": {
@ -1772,7 +1887,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 83
"__id__": 87
},
"_contentSize": {
"__type__": "cc.Size",

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +0,0 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "ea6407fa-1ee9-4559-8bba-2dec8acb8976",
"files": [],
"subMetas": {},
"userData": {}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +0,0 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "437a9b29-9280-4d46-8379-70f1b2aa0f3a",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "webView"
}
}

View File

@ -45,8 +45,6 @@ const { ccclass, property } = _decorator;
@ccclass("SlotBar")
export class SlotBar extends Component {
@property({ type: Prefab })
private webViewPre: Prefab = null;
@property({ type: Prefab })
private autoSpinPanel: Prefab = null;

View File

@ -789,7 +789,7 @@ export class SlotScene extends Component {
return
}
this.TotalWin.show(this.spinData.AllScore, () => {
this.TotalWin.show(this.spinData.AllScore, this.spinInfo.Data.Free.MaxCount, () => {
this.slotBar.setBalance(this.spinData.Balance);
this.slotGame.showWinScore(
true,

View File

@ -10,6 +10,7 @@ export class TotalWin extends Component {
totalWinUiPre: Prefab = null;
totalWinUINode: Node = null;
freeSpinTimes: Label = null;
totalWinNodeOpacity: UIOpacity | null = null;
totalWinSpine: sp.Skeleton | null = null;
totalWinSprite: Sprite | null = null;
@ -21,7 +22,7 @@ export class TotalWin extends Component {
closeCallBack: (() => void) | null = null;
show(winScore: number, closeCallBack: (() => void) | null = null) {
show(winScore: number, totalFreeTimes: number, closeCallBack: (() => void) | null = null) {
this.totalWinUINode = NodePoolManager.instance.getNodeFromPoolStatic('totalWinUI', this.totalWinUiPre);
this.totalWinSpine = this.totalWinUINode.getChildByName('spine').getComponent(sp.Skeleton);
@ -29,6 +30,8 @@ export class TotalWin extends Component {
this.totalWinNodeOpacity = titleNode.getComponent(UIOpacity);
this.totalWinNodeOpacity.opacity = 255;
this.totalWinSprite = titleNode.getChildByName('TOTALWIN').getComponent(Sprite);
this.freeSpinTimes = titleNode.getChildByPath('freeSpin/spinTime').getComponent(Label);
this.freeSpinTimes.string = totalFreeTimes.toString()
let numNode = this.totalWinSpine.node.getChildByName('NumNode');
this.NumNodeOpacityCom = numNode.getComponent(UIOpacity);

View File

@ -1,143 +0,0 @@
import { _decorator, Component, director, Label, log, Node, tween, UITransform, v3, Vec3, view, WebView } from 'cc';
import { getHistoryUrl, getOddsUrl, getSupportUrl } from '../../../Loading/scripts/comm';
import { NodePoolManager } from '../../../Loading/scripts/manager/NodePoolManager';
import { I18nManager } from '../../../Loading/scripts/manager/I18nManager';
import { AudioManager } from '../../../Loading/scripts/manager/AudioManager';
const { ccclass, property } = _decorator;
@ccclass('webView')
export class webView extends Component {
@property(WebView)
webV: WebView = null;
@property(Node)
mainNode: Node = null;
@property(Label)
title: Label = null;
@property(Node)
loadingView: Node = null;
param: string = null;
private readonly DURATION = 0.2;
private OFFSET_Y = -800; // 根据实际UI调整偏移量
private initPos: Vec3 = v3(0, 0, 0);
protected onLoad(): void {
}
protected start(): void {
this.webV.node.on(WebView.EventType.LOADED, this.webViewLoaded, this);
this.webV.node.on(WebView.EventType.ERROR, this.webViewError, this);
this.webV.node.on(WebView.EventType.LOADING, this.webViewLoading, this);
const waitForIframe = () => {
const iframe = document.querySelector('iframe');
if (iframe) {
iframe.setAttribute('scrolling', 'no');
iframe.setAttribute('sandbox', 'allow-same-origin allow-scripts allow-forms allow-top-navigation-by-user-activation allow-popups');
} else {
setTimeout(waitForIframe, 100);
}
};
waitForIframe();
}
private webViewLoading() {
this.loadingView.active = true;
}
private webViewLoaded() {
this.scheduleOnce(() => {
this.loadingView.active = false;
this.webV.node.active = true;
}, 0.8);
}
private webViewError() {
console.error('WebView load failed');
this.loadingView.active = false;
// 可以显示错误提示
this.onBtnClose();
}
protected onDestroy(): void {
}
// 'http://192.168.0.30:5173/#/rp_fortuneRabbit/support?l=en';
async open(param: string, curBet) {
try {
this.loadingView.active = true;
// 计算初始位置 - 屏幕中心
this.param = param;
this.webV.node.active = false;
this.OFFSET_Y = -view.getVisibleSize().height;
let url = '';
let title = '';
if (param == 'rule') {
url = getSupportUrl();
title = I18nManager.instance.t('AID_MAIN_OPERATE_RULES');
} else if (param == 'paytable') {
url = getOddsUrl();
title = I18nManager.instance.t('AID_MAIN_OPERATE_PAYTABLE');
} else if (param == 'history') {
url = getHistoryUrl();
title = I18nManager.instance.t('AID_MAIN_OPERATE_HISTORY');
}
this.title.string = title;
// url = `http://192.168.0.6:5173/#/history?gid=rp_10002&type=odds&l=th&c=IDR&bet=${curBet}&t=eyJQIjoxMDAwMDEsIkUiOjE3NDE0NDEyMjEsIlMiOjEwMDAsIkQiOiJycF8xMDAwMSJ9.4VEuBbGan0ljnBgLN7AtqLNqcwQa02BdQL3rHinPS3w`
// let data = {
// curBet: curBet,
// }
// this.webV.evaluateJS(`receiveDataFromGame(${JSON.stringify(data)})`);
this.node.setPosition(v3(0, this.OFFSET_Y, 0));
// 播放进入动画到目标位置
tween(this.mainNode)
.to(this.DURATION, {
position: this.initPos
})
.call(() => {
// 先隐藏WebView等加载完再显示
this.webV.url = url;
})
.start();
} catch (error) {
console.error('WebView open failed:', error);
this.onBtnClose();
}
}
private isClosing: boolean = false; // 添加状态标记
onBtnClose() {
// 如果正在关闭中,直接返回
if (this.isClosing) return;
this.isClosing = true; // 设置关闭状态
AudioManager.instance.playSFX('Common_Button_Click');
// 播放退出动画 - 移动到屏幕下方
tween(this.node)
.to(this.DURATION, {
position: v3(
this.initPos.x,
this.initPos.y + this.OFFSET_Y,
0
)
})
.call(() => {
// 动画结束后回收节点
// 清理事件监听
this.webV.node.off(WebView.EventType.LOADED, this.webViewLoaded, this);
this.webV.node.off(WebView.EventType.ERROR, this.webViewError, this);
this.webV.node.off(WebView.EventType.LOADING, this.webViewLoading, this);
NodePoolManager.instance.clearNodePoolByName(this.param);
this.node.destroy();
})
.start();
}
}

View File

@ -1,9 +0,0 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "80db1669-799d-4c82-b111-dbc402e3f9dc",
"files": [],
"subMetas": {},
"userData": {}
}