将排行榜换成从apk获取

This commit is contained in:
zhl 2020-08-07 20:44:32 +08:00
parent c0c3122c9f
commit 312c61d3fa
10 changed files with 351 additions and 221 deletions

View File

@ -851,7 +851,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 230.08,
"width": 308.16,
"height": 92.72
},
"_anchorPoint": {
@ -899,8 +899,8 @@
}
],
"_useOriginalSize": false,
"_string": "Current score:",
"_N$string": "Current score:",
"_string": "label.current_score",
"_N$string": "label.current_score",
"_fontSize": 36,
"_lineHeight": 72,
"_enableWrapText": true,
@ -1885,10 +1885,16 @@
"__id__": 54
},
"_enabled": true,
"_materials": [],
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_spriteFrame": {
"__uuid__": "13c2d59c-6122-4dee-a0ce-50695e563838"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
@ -2456,7 +2462,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 23.13,
"width": 60,
"height": 49.88
},
"_anchorPoint": {
@ -2516,7 +2522,7 @@
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$overflow": 2,
"_N$cacheMode": 0,
"_id": ""
},
@ -2590,6 +2596,7 @@
"__id__": 46
},
"tipTag": false,
"default_avatar": "texture/comppreload/default_avatar",
"_id": ""
},
{
@ -3099,10 +3106,16 @@
"__id__": 89
},
"_enabled": true,
"_materials": [],
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_spriteFrame": {
"__uuid__": "13c2d59c-6122-4dee-a0ce-50695e563838"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
@ -3670,7 +3683,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 23.13,
"width": 60,
"height": 49.88
},
"_anchorPoint": {
@ -3730,7 +3743,7 @@
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$overflow": 2,
"_N$cacheMode": 0,
"_id": ""
},
@ -3804,6 +3817,7 @@
"__id__": 81
},
"tipTag": false,
"default_avatar": "texture/comppreload/default_avatar",
"_id": ""
},
{
@ -4313,10 +4327,16 @@
"__id__": 124
},
"_enabled": true,
"_materials": [],
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_spriteFrame": {
"__uuid__": "13c2d59c-6122-4dee-a0ce-50695e563838"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
@ -4884,7 +4904,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 23.13,
"width": 60,
"height": 49.88
},
"_anchorPoint": {
@ -4944,7 +4964,7 @@
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$overflow": 2,
"_N$cacheMode": 0,
"_id": ""
},
@ -5018,6 +5038,7 @@
"__id__": 116
},
"tipTag": false,
"default_avatar": "texture/comppreload/default_avatar",
"_id": ""
},
{
@ -5635,7 +5656,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "91be20ae-2782-48fa-abdb-1169eaf8813d"
"__uuid__": "cf3c4f04-2110-46f0-adbb-d7fe3f8b6743"
},
"_type": 1,
"_sizeMode": 0,

View File

@ -8,7 +8,8 @@
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
@ -78,18 +79,19 @@
"y": 1,
"z": 1
},
"_rotationX": 0,
"_rotationY": 0,
"_skewX": 0,
"_skewY": 0,
"groupIndex": 0,
"_id": "",
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": ""
},
{
"__type__": "cc.Node",
@ -139,18 +141,19 @@
"y": 1,
"z": 1
},
"_rotationX": 0,
"_rotationY": 0,
"_skewX": 0,
"_skewY": 0,
"groupIndex": 0,
"_id": "",
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
@ -160,6 +163,11 @@
"__id__": 2
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
@ -176,7 +184,6 @@
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_state": 0,
"_atlas": null,
"_id": ""
},
@ -239,18 +246,19 @@
"y": 1,
"z": 1
},
"_rotationX": 0,
"_rotationY": 0,
"_skewX": 0,
"_skewY": 0,
"groupIndex": 0,
"_id": "",
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
@ -260,6 +268,11 @@
"__id__": 5
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
@ -276,7 +289,6 @@
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_state": 0,
"_atlas": null,
"_id": ""
},
@ -343,18 +355,19 @@
"y": 1,
"z": 1
},
"_rotationX": 0,
"_rotationY": 0,
"_skewX": 0,
"_skewY": 0,
"groupIndex": 0,
"_id": "",
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": ""
},
{
"__type__": "cc.Node",
@ -408,18 +421,19 @@
"y": 1,
"z": 1
},
"_rotationX": 0,
"_rotationY": 0,
"_skewX": 0,
"_skewY": 0,
"groupIndex": 0,
"_id": "",
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": ""
},
{
"__type__": "cc.Node",
@ -469,18 +483,19 @@
"y": 1,
"z": 1
},
"_rotationX": 0,
"_rotationY": 0,
"_skewX": 0,
"_skewY": 0,
"groupIndex": 0,
"_id": "",
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
@ -490,9 +505,16 @@
"__id__": 10
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_spriteFrame": {
"__uuid__": "13c2d59c-6122-4dee-a0ce-50695e563838"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
@ -504,7 +526,6 @@
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_state": 0,
"_atlas": null,
"_id": ""
},
@ -527,6 +548,11 @@
"__id__": 9
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_spriteFrame": null,
"_type": 1,
"_segments": 64,
@ -553,6 +579,11 @@
"__id__": 8
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
@ -569,7 +600,6 @@
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_state": 0,
"_atlas": null,
"_id": ""
},
@ -632,18 +662,19 @@
"y": 1,
"z": 1
},
"_rotationX": 0,
"_rotationY": 0,
"_skewX": 0,
"_skewY": 0,
"groupIndex": 0,
"_id": "",
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": ""
},
{
"__type__": "cc.Label",
@ -653,6 +684,11 @@
"__id__": 17
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_useOriginalSize": false,
"_string": "名字七个字玩家",
"_N$string": "名字七个字玩家",
@ -733,18 +769,19 @@
"y": 1,
"z": 1
},
"_rotationX": 0,
"_rotationY": 0,
"_skewX": 0,
"_skewY": 0,
"groupIndex": 0,
"_id": "",
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": ""
},
{
"__type__": "cc.Node",
@ -778,7 +815,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 102.11,
"height": 38
"height": 49.88
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -797,18 +834,19 @@
"y": 1,
"z": 1
},
"_rotationX": 0,
"_rotationY": 0,
"_skewX": 0,
"_skewY": 0,
"groupIndex": 0,
"_id": "",
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": ""
},
{
"__type__": "cc.Label",
@ -818,6 +856,11 @@
"__id__": 21
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_useOriginalSize": false,
"_string": "121722",
"_N$string": "121722",
@ -872,6 +915,11 @@
"__id__": 20
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
@ -888,7 +936,6 @@
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_state": 0,
"_atlas": null,
"_id": ""
},
@ -951,18 +998,19 @@
"y": 1,
"z": 1
},
"_rotationX": 0,
"_rotationY": 0,
"_skewX": 0,
"_skewY": 0,
"groupIndex": 0,
"_id": "",
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
@ -972,6 +1020,7 @@
"__id__": 27
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
@ -988,7 +1037,6 @@
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_state": 0,
"_atlas": null,
"_id": ""
},
@ -1034,8 +1082,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 23.13,
"height": 38
"width": 60,
"height": 49.88
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -1054,18 +1102,19 @@
"y": 1,
"z": 1
},
"_rotationX": 0,
"_rotationY": 0,
"_skewX": 0,
"_skewY": 0,
"groupIndex": 0,
"_id": "",
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": ""
},
{
"__type__": "cc.Label",
@ -1075,6 +1124,11 @@
"__id__": 30
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_useOriginalSize": false,
"_string": "4",
"_N$string": "4",
@ -1088,7 +1142,7 @@
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$overflow": 2,
"_N$cacheMode": 0,
"_id": ""
},
@ -1162,6 +1216,7 @@
"__id__": 2
},
"tipTag": false,
"default_avatar": "texture/comppreload/default_avatar",
"_id": ""
},
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B

View File

@ -835,7 +835,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "0a21092a-8e23-4517-a053-e335ab01a7e7"
"__uuid__": "1b6192e2-19d9-467a-979e-16c62b389291"
},
"_type": 0,
"_sizeMode": 0,
@ -1707,7 +1707,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 68.47,
"width": 164.1,
"height": 54.4
},
"_anchorPoint": {
@ -1755,8 +1755,8 @@
}
],
"_useOriginalSize": false,
"_string": "test",
"_N$string": "test",
"_string": "label.test",
"_N$string": "label.test",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
@ -3712,7 +3712,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 105,
"width": 69,
"height": 36
},
"_anchorPoint": {
@ -3762,7 +3762,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "141236f0-d7de-4de0-9f84-c5e42000b3e0"
"__uuid__": "502c714d-c3e9-4080-b81d-1bf4e254e6ba"
},
"_type": 0,
"_sizeMode": 2,
@ -4128,7 +4128,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 74,
"width": 68,
"height": 36
},
"_anchorPoint": {
@ -4178,7 +4178,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "ddf78896-eb4d-44b4-b91a-1bb25cf4032b"
"__uuid__": "83a5d7c2-b0ef-422c-9cd6-aa8589bb4b14"
},
"_type": 0,
"_sizeMode": 2,
@ -4631,7 +4631,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 134,
"width": 138,
"height": 36
},
"_anchorPoint": {
@ -4681,7 +4681,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "0e311a49-0fae-4344-b880-6f603aa5df3b"
"__uuid__": "e79e7317-1f09-4364-9489-385d7842c969"
},
"_type": 0,
"_sizeMode": 2,
@ -5792,7 +5792,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 113,
"width": 74,
"height": 36
},
"_anchorPoint": {
@ -5842,7 +5842,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d03f6777-188e-4a29-962c-276b471e554a"
"__uuid__": "d8437b13-a052-429b-b25d-a10cdfe27a65"
},
"_type": 0,
"_sizeMode": 2,
@ -6205,7 +6205,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 113,
"width": 104,
"height": 36
},
"_anchorPoint": {
@ -6255,7 +6255,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "f307440c-f491-4892-93b3-0ac76bc4c6fb"
"__uuid__": "36308c71-201e-408c-8e09-b85326139da5"
},
"_type": 0,
"_sizeMode": 2,
@ -6831,7 +6831,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "c90f0114-ec3a-4f24-8533-8817b60160fd"
"__uuid__": "7829e4ed-8942-4d04-8893-f26c41208532"
},
"_type": 1,
"_sizeMode": 0,
@ -8446,7 +8446,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "9177b4f3-4ae8-4af3-8ed9-cb992213a57a"
"__uuid__": "3be4381f-ca76-4daa-b37c-205b87f23084"
},
"_type": 1,
"_sizeMode": 0,
@ -8726,7 +8726,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 80,
"width": 151.22,
"height": 50.4
},
"_anchorPoint": {
@ -8774,8 +8774,8 @@
}
],
"_useOriginalSize": false,
"_string": "Global",
"_N$string": "Global",
"_string": "label.global_rank",
"_N$string": "label.global_rank",
"_fontSize": 20,
"_lineHeight": 40,
"_enableWrapText": true,
@ -10356,7 +10356,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 80,
"width": 145.64,
"height": 50.4
},
"_anchorPoint": {
@ -10404,8 +10404,8 @@
}
],
"_useOriginalSize": false,
"_string": "Best record",
"_N$string": "Best record",
"_string": "label.best_score",
"_N$string": "label.best_score",
"_fontSize": 20,
"_lineHeight": 40,
"_enableWrapText": true,
@ -10721,7 +10721,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 80,
"width": 144.53,
"height": 50.4
},
"_anchorPoint": {
@ -10769,8 +10769,8 @@
}
],
"_useOriginalSize": false,
"_string": "Weekly ranking",
"_N$string": "Weekly ranking",
"_string": "label.week_rank",
"_N$string": "label.week_rank",
"_fontSize": 20,
"_lineHeight": 40,
"_enableWrapText": true,
@ -11346,10 +11346,16 @@
"__id__": 302
},
"_enabled": true,
"_materials": [],
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_spriteFrame": {
"__uuid__": "13c2d59c-6122-4dee-a0ce-50695e563838"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
@ -11917,7 +11923,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 23.13,
"width": 60,
"height": 49.88
},
"_anchorPoint": {
@ -11977,7 +11983,7 @@
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$overflow": 2,
"_N$cacheMode": 0,
"_id": "64aVmqucxBG4jPvQXPs+Pl"
},
@ -12051,6 +12057,7 @@
"__id__": 294
},
"tipTag": false,
"default_avatar": "texture/comppreload/default_avatar",
"_id": "486Gqzx5ZMj5xhSA+DFWGk"
},
{

View File

@ -27,7 +27,7 @@ cc.Class({
// onLoad () {},
start() {
this.nd_res.active = false;
// this.nd_res.active = false;
},
setUP() {
},

View File

@ -7,6 +7,7 @@ module.exports = {
this.channelid = channelid;
this.isoffical = isoffical;
this.nickname = '';
this.defaultAvatar = 'texture/comppreload/default_avatar.png';
this.url = url.replace('webapp/index.php', 'api/games');
console.log("[jcrankctrl]init:"+gameid + "|" + channelid + "|" + isoffical);
},
@ -22,7 +23,7 @@ module.exports = {
if(avatar){
this.avatar_url = avatar;
}else{
this.avatar_url = 'https://resource.kingsome.cn/share/1004/normal/5d42b6fb8e19260c1a16eefa.png'
this.avatar_url = 'texture/comppreload/default_avatar.png'
}
},
setUserInfo(info){
@ -43,12 +44,23 @@ module.exports = {
* - param3 当前用户的段位
* */
reqRankList(successcb, failcb){
let self = this;
if (cc.sys.isNative && cc.sys.os === cc.sys.OS_ANDROID && cc.jc.useLocal) {
let data = jsb.reflection.callStaticMethod('com/jc/jcfw/JcSDK', 'lbTop20', '(Ljava/lang/String;)Ljava/lang/String;', this.owner.accountID);
try {
let obj = httpclient.JSON_parse(data);
self.recordList = obj.records;
successcb && successcb(self.recordList, obj.userRank, obj.userScore, obj.userTitle);
} catch (err) {
failcb && failcb(0, -1, "ranklist is not obj");
}
return;
}
if(!this.url){
failcb && failcb(0, -1234, 'not inited!');
return;
}
const url = `${this.url}/rank`
let self = this;
let data = {gameId: this.gameid, channelId: this.channelid, accountId: this.owner.accountID};
httpclient.httpPost(url, this.jsonToKeyVal(data), (restext) => {
// httpclient.httpPost(url, this.jsonToKeyVal(data), (restext) => {
@ -88,31 +100,10 @@ module.exports = {
* @title {string} 段位
* */
updateRank(score, successcb, failcb, title) {
if(!this.url){
failcb && failcb(0, -1234, 'not inited!');
return;
}
this.nickname = this.nickname || cc.jc.nickName;
if(!this.nickname && !this.avatar_url) {
failcb && failcb(0, -1234, 'not login!');
return;
}
const url = `${this.url}/rank/update`
let data = {gameId: this.gameid,
channelId: this.channelid,
accountId: this.owner.accountID,
score: score,
nickname: this.nickname,
avatar: this.avatar_url,
needType: 1,
};
httpclient.httpPost(url, this.jsonToKeyVal(data), (restext) => {
// httpclient.httpPost(url, this.jsonToKeyVal(data), (restext) => {
let obj
if (cc.sys.isNative && cc.sys.os === cc.sys.OS_ANDROID && cc.jc.useLocal) {
let data = jsb.reflection.callStaticMethod('com/jc/jcfw/JcSDK', 'updateRank', '(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;', this.owner.accountID, this.nickname, score);
try {
obj = httpclient.JSON_parse(restext);
} catch (err) {}
if(obj && obj.errcode === 0){
let obj = JSON.parse(data);
let datas = [];
if (obj.preRecord) {
obj.preRecord.rank += 1;
@ -129,15 +120,64 @@ module.exports = {
datas.push(obj.nextRecord);
}
successcb && successcb(datas);
}else{
console.log('[reqRankList]failed!'+ obj ? obj.errcode : '' +":"+ obj ? obj.errmsg : '');
failcb && failcb(0, obj ? obj.errcode : -1235, obj ? obj.errmsg : '');
}
}, (errcode, errmsg) => {
console.log('[updateRank]failed!'+errcode+":"+errmsg);
failcb && failcb(errcode, 0, errmsg);
});
} catch (err) {
console.log('parse json error');
failcb && failcb(errcode, 0, errmsg);
}
} else {
if(!this.url){
failcb && failcb(0, -1234, 'not inited!');
return;
}
this.nickname = this.nickname || cc.jc.nickName;
if(!this.nickname && !this.avatar_url) {
failcb && failcb(0, -1234, 'not login!');
return;
}
const url = `${this.url}/rank/update`
let data = {gameId: this.gameid,
channelId: this.channelid,
accountId: this.owner.accountID,
score: score,
nickname: this.nickname,
avatar: this.avatar_url,
needType: 1,
};
httpclient.httpPost(url, this.jsonToKeyVal(data), (restext) => {
// httpclient.httpPost(url, this.jsonToKeyVal(data), (restext) => {
let obj
try {
obj = httpclient.JSON_parse(restext);
} catch (err) {}
if(obj && obj.errcode === 0){
let datas = [];
if (obj.preRecord) {
obj.preRecord.rank += 1;
datas.push(obj.preRecord);
}
datas.push({
score: obj.userScore,
rank: obj.userRank + 1,
avatar: this.avatar_url,
nickname: this.nickname,
})
if (obj.nextRecord) {
obj.nextRecord.rank += 1;
datas.push(obj.nextRecord);
}
successcb && successcb(datas);
}else{
console.log('[reqRankList]failed!'+ obj ? obj.errcode : '' +":"+ obj ? obj.errmsg : '');
failcb && failcb(0, obj ? obj.errcode : -1235, obj ? obj.errmsg : '');
}
}, (errcode, errmsg) => {
console.log('[updateRank]failed!'+errcode+":"+errmsg);
failcb && failcb(errcode, 0, errmsg);
});
}
},
/*
* 挑战列表

View File

@ -235,8 +235,8 @@ cc.Class({
this.updateItemBtnState();
this.panel.level = this.level;
this.panel.startGame();
this.battleRankNd = this.battleRank.getComponent('battleRank');
this.battleRankNd.init(this, this.score, this.level);
// this.battleRankNd = this.battleRank.getComponent('battleRank');
// this.battleRankNd.init(this, this.score, this.level);
this.comboProgressComp = this.comboProgress.getComponent('comboProgress');
this.comboProgressComp.init(this);
if (!Global.getHelpStatus(6) && !this.slideHelp) {
@ -440,7 +440,7 @@ cc.Class({
addScore(score) {
this.score += score;
(this.battleRankNd) && (this.battleRankNd.updateSelf(this.score));
// (this.battleRankNd) && (this.battleRankNd.updateSelf(this.score));
Global.saveData.score = this.score;
Global.save();
this.updateLevelInfo();
@ -633,7 +633,7 @@ cc.Class({
if (cc.sys.platform === cc.sys.WECHAT_GAME || cc.jc.channelID === cc.jc.channel.TEST || cc.jc.channelID === cc.jc.channel.ANDROID) {
if (cc.jc.channelID === cc.jc.channel.TT || cc.jc.channelID === cc.jc.channel.TEST || cc.jc.channelID === cc.jc.channel.ANDROID) {
cc.jc.rank.updateRank(self.score, function (datas) {
console.log('[jcrank] update score success', datas);
console.log('[jcrank] update score success', JSON.stringify(datas));
comp.showRank(datas);
}, function () {
console.log('[jcrank] update score error');

View File

@ -33,6 +33,7 @@ cc.Class({
type: cc.Node
},
tipTag: false,
default_avatar: 'texture/comppreload/default_avatar.png',
},
// LIFE-CYCLE CALLBACKS:
@ -60,12 +61,14 @@ cc.Class({
(this.sp_more) && (this.sp_more.active = true);
this.lb_rank.node.active = true;
}
let avatar = data.url || data.avatar || self.default_avatar;
console.log('show avatar: ', avatar);
if ((cc.jc.channelID === cc.jc.channel.TT || cc.jc.channelID === cc.jc.channel.TEST
|| cc.jc.channelID === cc.jc.channel.QQ_MINI
|| cc.jc.channelID === cc.jc.channel.ANDROID
|| cc.jc.channelID === cc.jc.channel.WECHAT) && (data.url || data.avatar)) {
try {
fileUtil.loadImage(data.url || data.avatar, self.sp_head);
fileUtil.loadImage(avatar, self.sp_head);
} catch (e) {
console.log(e);
}

View File

@ -48,7 +48,6 @@ cc.Class({
this.nd_Score.removeAllChildren();
var self = this;
cc.jc.rank.reqRankList(function (records, userRank, userScore) {
console.log(records, userRank);
for(let i = 0; i< records.length; i++ ) {
var rd = records[i];
rd.rank = i + 1;

View File

@ -890,8 +890,8 @@
"relativePath": "prefab/oneAwardItem.prefab"
},
"9657563b-14ba-4c1f-bc72-e015b75a2cc8": {
"asset": 1594617426864,
"meta": 1594617496075,
"asset": 1596803605173,
"meta": 1596803605183,
"relativePath": "prefab/pbRank.prefab"
},
"c9de3a10-051d-46a7-9c08-91377f20daea": {
@ -1725,7 +1725,7 @@
"relativePath": "scriptes/adjustsize.js"
},
"5cd8ec2c-bd77-4d11-a3b8-1150a5083111": {
"asset": 1594617427450,
"asset": 1596771250393,
"meta": 1561987023015,
"relativePath": "scriptes/cc"
},
@ -1985,7 +1985,7 @@
"relativePath": "scriptes/prefab/trader/traderBtn.js"
},
"119a2cdd-a51a-464c-9347-7281ee0eafd9": {
"asset": 1565769779212,
"asset": 1596771250335,
"meta": 1565338098060,
"relativePath": "scriptes/st_module"
},
@ -2254,11 +2254,6 @@
"meta": 1594617513215,
"relativePath": "scriptes/st_module/script/wxcustomer/customerUtil_m.js"
},
"4602f58d-e215-4285-99a1-547c1784df39": {
"asset": 1566474595356,
"meta": 1594617513232,
"relativePath": "scriptes/UIRankBattle.js"
},
"24100bcf-ca6f-4f59-9a32-95a3d6ae1a70": {
"asset": 1563193575066,
"meta": 1594617513294,
@ -5255,8 +5250,8 @@
"relativePath": "texture/main/comp2/bg_npc2.png"
},
"3d1aa8f0-f6a6-4d58-8b67-0eab06a87508": {
"asset": 1594617426854,
"meta": 1594617496047,
"asset": 1596803557768,
"meta": 1596803557779,
"relativePath": "prefab/nodeOver.prefab"
},
"e3d32bd3-3e24-4417-aa8b-53edcad6d036": {
@ -5315,8 +5310,8 @@
"relativePath": "scriptes/cc/service/jcadsharectrl.js"
},
"6810d8b2-8a37-47af-94b4-21d4f29e21f0": {
"asset": 1570867506545,
"meta": 1594617511611,
"asset": 1596771515937,
"meta": 1596786266035,
"relativePath": "scriptes/st_module/script/goods/goodspanel_m.js"
},
"808df4c5-6c30-4f12-bc84-1ae0c2f34375": {
@ -5990,7 +5985,7 @@
"relativePath": "scriptes/cc/utils/strutils.js"
},
"f5404b65-4d23-4ee5-aa3d-5f84400f12f4": {
"asset": 1594617427590,
"asset": 1596771250302,
"meta": 1572340460707,
"relativePath": "scriptes/matchvs"
},
@ -6095,8 +6090,8 @@
"relativePath": "texture/main/comp2/txt_start.png"
},
"57fa73c8-be97-40c0-b762-59b88e3d768a": {
"asset": 1594617427438,
"meta": 1594617499545,
"asset": 1596803589108,
"meta": 1596803589124,
"relativePath": "scene/Main.fire"
},
"99ad4704-165a-4f80-85bd-0a2207a2dea0": {
@ -7780,8 +7775,8 @@
"relativePath": "texture/main/comp2/circle_big_bar.png"
},
"5e38c347-c929-46e7-8f50-e28ef3dae730": {
"asset": 1573728398034,
"meta": 1594617505705,
"asset": 1596771931784,
"meta": 1596786265934,
"relativePath": "scriptes/gameCookie.js"
},
"885a4d37-eda5-46d8-b1b7-66d3c2442370": {
@ -8424,11 +8419,6 @@
"meta": 1594617510248,
"relativePath": "scriptes/prefab/nodeStageResult.js"
},
"45fd1b70-72d9-49b0-87e9-212460f78e21": {
"asset": 1594211916630,
"meta": 1594617511147,
"relativePath": "scriptes/prefab/UIRank.js"
},
"43490d3e-d482-4613-9815-5963bc013934": {
"asset": 1594261174270,
"meta": 1594617499745,
@ -8439,11 +8429,6 @@
"meta": 1594617510178,
"relativePath": "scriptes/prefab/nodeOver.js"
},
"5306e714-1e54-442f-93f5-1e457561ab6c": {
"asset": 1594267792213,
"meta": 1594617509004,
"relativePath": "scriptes/pbRank.js"
},
"8cc65593-ab3a-4f84-b657-efedf8d8bcfb": {
"asset": 1594276776504,
"meta": 1594617496183,
@ -8544,11 +8529,6 @@
"meta": 1594279925724,
"relativePath": "texture/tw"
},
"56cc7cf9-c72f-42aa-927c-f967b251fb36": {
"asset": 1594282312855,
"meta": 1594617503984,
"relativePath": "scriptes/cc/service/jcrank.js"
},
"b5f212cb-0103-4834-85e6-f4537648b804": {
"asset": 1594187398688,
"meta": 1594617513489,
@ -9585,8 +9565,8 @@
"relativePath": "texture/tw/btn_offline_triple.png"
},
"f034b4cc-6485-4290-8a26-4265781bacac": {
"asset": 1594371571661,
"meta": 1594617496260,
"asset": 1596771756164,
"meta": 1596786265019,
"relativePath": "resources/i18n/zh.js"
},
"30708166-d2e5-4f25-9c3d-623af6a99161": {
@ -9610,13 +9590,13 @@
"relativePath": "resources/GameConfig_en.json"
},
"c975c23e-ce95-489c-a224-9dc8999ea05b": {
"asset": 1594375651308,
"meta": 1594617496238,
"asset": 1596771839948,
"meta": 1596786264823,
"relativePath": "resources/i18n/en.js"
},
"04923a8c-68bb-4f01-a1fd-2b7d1ec4f12c": {
"asset": 1594375664955,
"meta": 1594617496258,
"asset": 1596771777841,
"meta": 1596786264852,
"relativePath": "resources/i18n/tw.js"
},
"9563c868-6d9b-4ba6-b532-434ea007eff4": {
@ -9744,11 +9724,6 @@
"meta": 1595473457608,
"relativePath": "scriptes/cc/service/jclogin.js"
},
"1ed0d4ab-dac6-4920-9283-bc219b3f3326": {
"asset": 1596090882696,
"meta": 1596090894568,
"relativePath": "scriptes/layer/gameScene.js"
},
"9768430a-8f3a-4d3c-94f2-017ca540a1a9": {
"asset": 1596623554792,
"meta": 1596623562699,
@ -9765,13 +9740,43 @@
"relativePath": "scriptes/cc/service/jccloud.js"
},
"21355da7-b032-4ad7-b8c8-24ded34ef720": {
"asset": 1596719239369,
"meta": 1596719245153,
"asset": 1596771377123,
"meta": 1596786265118,
"relativePath": "scriptes/cc/platform/plat_android.js"
},
"c8a21efa-9a26-459c-8758-c09dd1ed8371": {
"asset": 1596719411506,
"meta": 1596719415599,
"relativePath": "scriptes/cc/jcfw.js"
},
"f17477fd-c29f-464d-9fbd-cdb2a9b41a86": {
"asset": 1596786664962,
"meta": 1596786877304,
"relativePath": "resources/texture/comppreload/default_avatar.png"
},
"45fd1b70-72d9-49b0-87e9-212460f78e21": {
"asset": 1596787069959,
"meta": 1596787077938,
"relativePath": "scriptes/prefab/UIRank.js"
},
"1ed0d4ab-dac6-4920-9283-bc219b3f3326": {
"asset": 1596800081139,
"meta": 1596800086823,
"relativePath": "scriptes/layer/gameScene.js"
},
"5306e714-1e54-442f-93f5-1e457561ab6c": {
"asset": 1596802094409,
"meta": 1596802096213,
"relativePath": "scriptes/pbRank.js"
},
"4602f58d-e215-4285-99a1-547c1784df39": {
"asset": 1596803353307,
"meta": 1596803356006,
"relativePath": "scriptes/UIRankBattle.js"
},
"56cc7cf9-c72f-42aa-927c-f967b251fb36": {
"asset": 1596803488852,
"meta": 1596803491887,
"relativePath": "scriptes/cc/service/jcrank.js"
}
}