Commit bc0cd5df bc0cd5dfefb71e24d3ba4535d352a874b228cc99 by jinwawa

complete sceneHistory

1 parent c3eb0620
......@@ -2887,8 +2887,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 784,
"height": 448
"width": 1164,
"height": 523
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2897,8 +2897,8 @@
},
"_position": {
"__type__": "cc.Vec3",
"x": 110,
"y": 0,
"x": 0,
"y": -42.512,
"z": 0
},
"_scale": {
......@@ -2929,10 +2929,16 @@
"__id__": 66
},
"_enabled": true,
"_materials": [],
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_spriteFrame": {
"__uuid__": "1c7a33d8-7cec-4bbc-8e8c-90b17a6de4f9"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
......
......@@ -80,10 +80,13 @@
"__id__": 13
},
{
"__id__": 15
"__id__": 16
},
{
"__id__": 17
"__id__": 19
},
{
"__id__": 22
},
{
"__id__": 25
......@@ -339,7 +342,7 @@
"__id__": 2
},
"_children": [],
"_active": true,
"_active": false,
"_level": 2,
"_components": [
{
......@@ -360,8 +363,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 142,
"height": 54
"width": 176,
"height": 64
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -402,10 +405,16 @@
"__id__": 7
},
"_enabled": true,
"_materials": [],
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_spriteFrame": {
"__uuid__": "cafbb817-8e14-4f94-8071-733ee3859e0a"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
......@@ -431,9 +440,9 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": 40,
"_left": 23,
"_right": 0,
"_top": 30,
"_top": 25,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
......@@ -486,7 +495,7 @@
},
"_position": {
"__type__": "cc.Vec3",
"x": -452,
"x": -529,
"y": 303,
"z": 0
},
......@@ -553,7 +562,7 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": 100,
"_left": 23,
"_right": 0,
"_top": 25,
"_bottom": 0,
......@@ -571,7 +580,7 @@
},
{
"__type__": "cc.Node",
"_name": "EditorSprite",
"_name": "EditorIcon",
"_objFlags": 0,
"_parent": {
"__id__": 2
......@@ -582,6 +591,9 @@
"_components": [
{
"__id__": 14
},
{
"__id__": 15
}
],
"_prefab": null,
......@@ -596,7 +608,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 137,
"height": 63
"height": 65
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -605,8 +617,8 @@
},
"_position": {
"__type__": "cc.Vec3",
"x": 360,
"y": 303,
"x": 321.5,
"y": 302.5,
"z": 0
},
"_scale": {
......@@ -627,7 +639,7 @@
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": "6ciKFyaElLH5TQ4kXAqGrd"
"_id": "b9ARw+zj1O9JGEuuqtOg9V"
},
{
"__type__": "cc.Sprite",
......@@ -659,11 +671,38 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "97Q0EH1BRJGKPa98nn2+Yc"
"_id": "53VxUsvEdMPYncByNtp4jD"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 33,
"_left": 881.197,
"_right": 250,
"_top": 25,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "e7B0Xu1CdJL6KsX+RsupzF"
},
{
"__type__": "cc.Node",
"_name": "IndexSprite",
"_name": "ClearIcon",
"_objFlags": 0,
"_parent": {
"__id__": 2
......@@ -673,11 +712,14 @@
"_level": 2,
"_components": [
{
"__id__": 16
"__id__": 17
},
{
"__id__": 18
}
],
"_prefab": null,
"_opacity": 255,
"_opacity": 0,
"_color": {
"__type__": "cc.Color",
"r": 255,
......@@ -688,7 +730,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 137,
"height": 64
"height": 65
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -697,8 +739,8 @@
},
"_position": {
"__type__": "cc.Vec3",
"x": 530,
"y": 303,
"x": 491.5,
"y": 302.5,
"z": 0
},
"_scale": {
......@@ -719,14 +761,14 @@
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": "0bB+Kflr1HKKY9/XCYmf3D"
"_id": "dftNHd+XFBwqjjJevsHHA1"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
"__id__": 16
},
"_enabled": true,
"_materials": [
......@@ -737,7 +779,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "b8d38b8c-3423-44ac-bc70-4f95ea2a4cb8"
"__uuid__": "828266d7-375c-4ab0-b654-db585576594e"
},
"_type": 0,
"_sizeMode": 0,
......@@ -751,227 +793,51 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "ea0H41MT9Ap67ZyyS10TEq"
},
{
"__type__": "cc.Node",
"_name": "TypeListArea",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 18
},
{
"__id__": 21
},
{
"__id__": 23
}
],
"_active": false,
"_level": 0,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 300,
"height": 450
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_position": {
"__type__": "cc.Vec3",
"x": -450,
"y": -25,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": "8dduWtCA9Ah4sfMc1qKG8Z"
},
{
"__type__": "cc.Node",
"_name": "TypeListWrapper",
"_objFlags": 0,
"_parent": {
"__id__": 17
},
"_children": [
{
"__id__": 19
}
],
"_active": true,
"_level": 0,
"_components": [
{
"__id__": 20
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 300,
"height": 450
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 1
},
"_position": {
"__type__": "cc.Vec3",
"x": 0,
"y": 225,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": "6auvTXe79Jeo/f/xdUQoZr"
},
{
"__type__": "cc.Node",
"_name": "TypeList",
"_objFlags": 0,
"_parent": {
"__id__": 18
},
"_children": [],
"_active": true,
"_level": 0,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 1
},
"_position": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": "17/+pxhHRPQqa1j9vdHdLz"
"_id": "59An2/xqhBDYRlEnvv3RX4"
},
{
"__type__": "cc.Mask",
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
"__id__": 16
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_spriteFrame": null,
"_type": 0,
"_segments": 64,
"_N$alphaThreshold": 1,
"_N$inverted": false,
"_id": "7fNB2fWOlFMpqSvXNTlfer"
"alignMode": 1,
"_target": null,
"_alignFlags": 33,
"_left": 1064.605,
"_right": 80,
"_top": 25,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "34gyymNA1OiariEHjILP55"
},
{
"__type__": "cc.Node",
"_name": "Up",
"_name": "BackEditorIcon",
"_objFlags": 0,
"_parent": {
"__id__": 17
"__id__": 2
},
"_children": [],
"_active": true,
"_level": 1,
"_level": 2,
"_components": [
{
"__id__": 22
"__id__": 20
},
{
"__id__": 21
}
],
"_prefab": null,
......@@ -985,8 +851,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 46,
"height": 22
"width": 137,
"height": 65
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -995,8 +861,8 @@
},
"_position": {
"__type__": "cc.Vec3",
"x": 0,
"y": 261,
"x": 321.5,
"y": 302.5,
"z": 0
},
"_scale": {
......@@ -1017,22 +883,28 @@
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": "85eNeKVr1OLb951tLUb0pj"
"_id": "3dn7XQc1dMs4Fh+RpBkHFt"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 21
"__id__": 19
},
"_enabled": true,
"_materials": [],
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_spriteFrame": {
"__uuid__": "171d3929-fbaa-475e-a350-bc4cb2cf698e"
},
"_type": 0,
"_sizeMode": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
......@@ -1043,25 +915,55 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "7ezxR7BQ5LnIb7twgLUgrP"
"_id": "5fDvKzzeJKOIAPeUHGXbZp"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 19
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 33,
"_left": 1072.5,
"_right": 250,
"_top": 25,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 137,
"_originalHeight": 0,
"_id": "94G/EEtixIeY3TbTZDdgy8"
},
{
"__type__": "cc.Node",
"_name": "Down",
"_name": "IndexIcon",
"_objFlags": 0,
"_parent": {
"__id__": 17
"__id__": 2
},
"_children": [],
"_active": true,
"_level": 1,
"_level": 2,
"_components": [
{
"__id__": 23
},
{
"__id__": 24
}
],
"_prefab": null,
"_opacity": 0,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
......@@ -1071,8 +973,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 46,
"height": 28
"width": 137,
"height": 65
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1081,8 +983,8 @@
},
"_position": {
"__type__": "cc.Vec3",
"x": 0,
"y": -265,
"x": 491.5,
"y": 302.5,
"z": 0
},
"_scale": {
......@@ -1103,22 +1005,28 @@
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": "27uByxQM9ALJpKDHMGUgLn"
"_id": "25HTzk30xOk5pSXwA4KVaf"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 23
"__id__": 22
},
"_enabled": true,
"_materials": [],
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_spriteFrame": {
"__uuid__": "b8d38b8c-3423-44ac-bc70-4f95ea2a4cb8"
},
"_type": 0,
"_sizeMode": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
......@@ -1129,7 +1037,34 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "1fly3W4qFK+oW3AmyGrosZ"
"_id": "17Wwb6m8JD2ZW8LR1MPQ3C"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 33,
"_left": 0,
"_right": 80,
"_top": 25,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "00/XRqpEdJhpCijZQ5kFay"
},
{
"__type__": "cc.Node",
......@@ -1936,7 +1871,7 @@
},
"_position": {
"__type__": "cc.Vec3",
"x": 30,
"x": 29.999999999999996,
"y": -2.3399999999999963,
"z": 0
},
......@@ -2017,7 +1952,7 @@
"_is3DNode": false,
"groupIndex": 0,
"showInEditor": false,
"_id": "492e5MYFVJCa7zVnna9LNZ"
"_id": "66nIzQ7pZAPJG4emKC21kQ"
},
{
"__type__": "cc.Label",
......@@ -2047,7 +1982,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "a889jNIhNELK6S73eyqyzh"
"_id": "39Zb8CXbtArJGk6XGyx6an"
},
{
"__type__": "cc.PrivateNode",
......@@ -2106,7 +2041,7 @@
"_is3DNode": false,
"groupIndex": 0,
"showInEditor": false,
"_id": "44tdWup1pJCZ9DEJbHSBn4"
"_id": "60IAushhxERqx+7eoKTbwX"
},
{
"__type__": "cc.Label",
......@@ -2136,7 +2071,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "9edkJf6uRLJonLoSuoqvK5"
"_id": "3348o4E+9L3JK7GZ6/9qzD"
},
{
"__type__": "cc.PrivateNode",
......@@ -2195,7 +2130,7 @@
"_is3DNode": false,
"groupIndex": 0,
"showInEditor": false,
"_id": "afYFpDSEFJAIUEiK4MAC3Z"
"_id": "f0ghP9ofNOBZ1i3lcJV4Lp"
},
{
"__type__": "cc.Label",
......@@ -2225,7 +2160,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "c6t5tGLcdJBq4G+sp58xbJ"
"_id": "3fZII17DpAcJGkyA1Bdnw5"
},
{
"__type__": "cc.PrivateNode",
......@@ -2284,7 +2219,7 @@
"_is3DNode": false,
"groupIndex": 0,
"showInEditor": false,
"_id": "22NhEcgt9C/IKehlGFl3PF"
"_id": "e1RXHf09ZPuanSS31+qpDf"
},
{
"__type__": "cc.Label",
......@@ -2314,7 +2249,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "afOldmZFxEfLUMmA5Yb2Xb"
"_id": "9b3Oj6HGlJqJ+h35GjPPi6"
},
{
"__type__": "cc.RichText",
......@@ -2347,7 +2282,7 @@
"alignMode": 0,
"_target": null,
"_alignFlags": 9,
"_left": 26,
"_left": 25.999999999999996,
"_right": 0,
"_top": 20,
"_bottom": 0,
......@@ -2468,7 +2403,7 @@
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 510,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
......@@ -2479,7 +2414,7 @@
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "19jqxsTD5NL7CSeBplaD1S"
"_id": "50J8GnwD5On4qUjkKfBrfG"
},
{
"__type__": "cc.Widget",
......@@ -2577,8 +2512,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 784,
"height": 448
"width": 1164,
"height": 523
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2587,8 +2522,8 @@
},
"_position": {
"__type__": "cc.Vec3",
"x": 110,
"y": 0,
"x": 0,
"y": -37,
"z": 0
},
"_scale": {
......@@ -2619,10 +2554,16 @@
"__id__": 58
},
"_enabled": true,
"_materials": [],
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_spriteFrame": {
"__uuid__": "1c7a33d8-7cec-4bbc-8e8c-90b17a6de4f9"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
......@@ -2673,8 +2614,8 @@
},
"_position": {
"__type__": "cc.Vec3",
"x": 569,
"y": -322,
"x": 572,
"y": -331,
"z": 0
},
"_scale": {
......@@ -2695,7 +2636,7 @@
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": "85SUP+vgVOOrYxm9l3a+wQ"
"_id": "6asxTrygJEmq7PXj0IvpAO"
},
{
"__type__": "cc.Label",
......@@ -2725,7 +2666,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "d0CZ1Ao75PXa0OrFk6SYmo"
"_id": "4ePf13G0pNu5jt9RRFjN2a"
},
{
"__type__": "cc.Canvas",
......@@ -2768,37 +2709,31 @@
"_oFocusScaleFactorInfo": null,
"holdClick": false,
"_bShowExitBox": false,
"spriteScrollBarBlock": {
"__id__": 51
"spriteCollect": {
"__id__": 11
},
"spriteScrollBarUp": {
"__id__": 35
"spriteEditor": {
"__id__": 14
},
"spriteScrollBarDown": {
"__id__": 38
"spriteClear": {
"__id__": 17
},
"spriteBackEditor": {
"__id__": 20
},
"spriteIndex": {
"__id__": 23
},
"_bPfbTypeCellInit": false,
"_aTypeAppId": [],
"_aTypeUrl": [],
"_aNavList": [],
"_nodeTypeHeight": 0,
"TYPE_LIST_CELL_SIZE": 4,
"_strAppId": "",
"_strDirURL": "",
"_oDestURL": null,
"_strIndexURL": "",
"_strIconSrc": "",
"_iCollectionId": 0,
"_aEpisodeIndex": [],
"_strPageIds": "",
"_bIsContentWStatus": true,
"_bIsCategoryListDataInit": false,
"_strIds": "",
"_iDefaultCollectionId": 0,
"_bEditorStatus": false,
"_oType": null,
"_aCategoryMediaId": [],
"_aCategoryAlreadyMediaId": [],
"_bBackStatus": false,
"PFB_TYPE": null,
"_id": "a15wRNM8dNz7y8/tCUBSuF"
"_aNavList": [],
"_strAppId": "",
"_id": "45WbjOhxdJ/qGICJukUhoz"
}
]
\ No newline at end of file
......
......@@ -73,10 +73,6 @@ cc.Class({
this.spriteBackEditor.spriteFrame.setRect(cc.rect(0, 0, 137, 65));
this.spriteIndex.spriteFrame.setRect(cc.rect(0, 0, 137, 65));
// //左分类框框
// this._nodeTypeListWrapper = cc.find("TypeListArea/TypeListWrapper", this.node);
// this._nodeTypeList = cc.find("TypeList", this._nodeTypeListWrapper);
// this._nodeTypeList.addComponent(TVScrollParameter);
//右分类框框
this._nodeCategoryList = cc.find("CategoryList", this.node);
let lvCategoryList = this._nodeCategoryList.addComponent(ListView);
......@@ -90,93 +86,9 @@ cc.Class({
}
);
// //滚动条按钮
// let nodeScrollBtn = cc.find("CategoryList/ScrollBarContainer/ScrollBarShadow/ScrollBarBlock", this.node);
// var fiScrollBtn = nodeScrollBtn.addComponent(FocusInfo);
// this._aFocusTargets[0]['scroll_bar_block'] = nodeScrollBtn;
// fiScrollBtn.init(null, true);
this.getPageBg(this, 'background');
},
// getTypeList: function () {
// let oTypeRequestParameters = {
// "view": "json",
// "start": 0,
// "limit": 100,
// "name": "indexCollectionNew",
// "sortField": "left",
// "sortDirection": "desc",
// "token": Common.TEST_API_TOKEN,
// };
// Network.ajax('GET', Common.TOPDRAW_API_SERVER + "Promotion/ListItemByName", null, oTypeRequestParameters,
// function (strResponse) {
// try {
// var oJSONResult = JSON.parse(strResponse);
// if (oJSONResult.businessCode == 'success') {
// this._oType = [];
// if (oJSONResult.resultSet.length > 0) {
// for (var i = 0; i < oJSONResult.resultSet.length; i++) {
// this._oType.push(oJSONResult.resultSet[i]);
// //恢复上下文带过来的位置
// // if (this._oSceneContext.requestedTypeId && this._oSceneContext.requestedTypeId == oJSONResult.resultSet[i].id) {
// // this._iCurrentTypeIndex = i;
// // }
// let oTvlink = JSON.parse(oJSONResult.resultSet[i].tvlink);
// let oListCell = {};
// let jaClick = oTvlink.click;
// let oParameters = null
// for (let i = 0; i < jaClick.length; i++) {
// oParameters = jaClick[i].parameters;
// }
// oListCell.appId = oParameters.appId;
// this._aNavList.push(oListCell);
// this._aTypeAppId.push(oParameters.appId); //拿到appId并保存到_aTypeAppId
// let nodeTypeListCell = cc.instantiate(this.PFB_TYPE);
// nodeTypeListCell.y = -nodeTypeListCell.height / 2 - i * (nodeTypeListCell.height + 25) - 10;
// this._nodeTypeList.addChild(nodeTypeListCell, 10, "TypeListCell" + i);
// //准备焦点坐标
// let fiTypeBlock = nodeTypeListCell.addComponent(FocusInfo);
// fiTypeBlock.init(
// '',
// true, null, null, 1.15
// );
// this._aFocusTargets[0]['type_list_cell_' + i] = nodeTypeListCell;
// if (oJSONResult.resultSet[i].image[0]) {
// let width = oJSONResult.resultSet[i].image[0].width;
// let height = oJSONResult.resultSet[i].image[0].height / 2;
// nodeTypeListCell.width = width;
// nodeTypeListCell.height = height;
// this._nodeTypeHeight = height;
// Network.loadImageInNativeRuntime(
// Common.TOPDRAW_IMAGE_SERVER + oJSONResult.resultSet[i].image[0].fileUrl,
// function (texture) {
// cc.find('Bg', nodeTypeListCell).getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, width, height));
// }, null, this
// );
// }
// }
// this._oSceneContext.requestedTypeId = this._aTypeAppId[this._oSceneContext._iCurrentTypeIndex];
// this.getDefaultCollection();
// } else {
// this._oSceneContext.focusPath = "app";
// }
// cc.log("Success GET TYPE LIST...");
// } else {
// cc.log("Error GET TYPE LIST..." + oJSONResult.description);
// }
// } catch (error) {
// cc.log("Exception GET TYPE LIST..." + error);
// }
// },
// function (strResponse) {
// cc.log("Communication Error : Get Type List Information..." + strResponse + "\r\n");
// }, this, "uuid"
// );
// },
/**
* 用当前typeid拿到id
*/
......@@ -249,7 +161,7 @@ cc.Class({
this._bIsCategoryListDataInit = true;
this._oSceneContext.categoryRecordIndexOfFirstCell = lvCategoryList.getRecordIndexOfFirstCellInPage();
this.checkDataReadyAndInitFocus();
this.changeEditorStatus();
// this.changeEditorStatus();
});
},
null,
......@@ -259,23 +171,6 @@ cc.Class({
var self = this;
this._iShowCellRows = 2;
this._iCellCountEachRow = 3;
// lvCategoryList.setDataPositionRender(function (iPosition, iCount) {
// //这里是ListView的this 执行时作用域
// let nodeDataPosition = self.node.getChildByName('DataPosition');
// if (iCount == 0) {
// nodeDataPosition.getComponent(cc.Label).string = "1 / 1";
// nodeDataPosition.x = Common.SCREEN_WIDTH / 2 - 70 - nodeDataPosition.width / 2;
// return;
// }
// if (null == iCount) {
// iCount = parseInt(nodeDataPosition.getComponent(cc.Label).string.split('/')[1]);
// cc.log(iCount);
// }
// nodeDataPosition.getComponent(cc.Label).string = Math.ceil(Math.min((iPosition + self._iShowCellRows * self._iCellCountEachRow - 1), iCount) / self._iShowCellRows / self._iCellCountEachRow) + " / " + Math.ceil(iCount / self._iShowCellRows / self._iCellCountEachRow);
// nodeDataPosition.x = Common.SCREEN_WIDTH / 2 - 70 - nodeDataPosition.width / 2;
// // this._compSceneCanvas.checkCountAndDisplayTopBtns(iCount);
// });
},
/**
......@@ -289,9 +184,11 @@ cc.Class({
if (this._bEditorStatus) {
fiFocusTarget = cc.find('BackEditorIcon', this.node).getComponent(FocusInfo);
cc.find('EditorIcon', this.node).getComponent(FocusInfo).setEnable(false);
cc.find('IndexIcon', this.node).getComponent(FocusInfo).setEnable(false);
cc.find('ClearIcon', this.node).getComponent(FocusInfo).setEnable(true);
cc.find('BackEditorIcon', this.node).getComponent(FocusInfo).setEnable(true);
cc.find('EditorIcon', this.node).opacity = 0;
cc.find('IndexIcon', this.node).opacity = 0;
cc.find('BackEditorIcon', this.node).opacity = 255;
cc.find('ClearIcon', this.node).opacity = 255;
// for (let i = 0; i < aNodeChildren.length; i++) {
......@@ -300,9 +197,11 @@ cc.Class({
} else {
fiFocusTarget = cc.find('EditorIcon', this.node).getComponent(FocusInfo);
cc.find('EditorIcon', this.node).getComponent(FocusInfo).setEnable(true);
cc.find('IndexIcon', this.node).getComponent(FocusInfo).setEnable(true);
cc.find('ClearIcon', this.node).getComponent(FocusInfo).setEnable(false);
cc.find('BackEditorIcon', this.node).getComponent(FocusInfo).setEnable(false);
cc.find('EditorIcon', this.node).opacity = 255;
cc.find('IndexIcon', this.node).opacity = 255;
cc.find('BackEditorIcon', this.node).opacity = 0;
cc.find('ClearIcon', this.node).opacity = 0;
// for (let i = 0; i < aNodeChildren.length; i++) {
......@@ -320,7 +219,7 @@ cc.Class({
'view': "json",
"collectionId": this._iDefaultCollectionId,
'mediaIds': id,
"appId": this._aTypeAppId[this._oSceneContext._iCurrentTypeIndex],
// "appId": this._aTypeAppId[this._oSceneContext._iCurrentTypeIndex],
"token": Common.TEST_API_TOKEN,
}
Network.ajax('GET', Common.TOPDRAW_API_SERVER + "User/RemoveMediaFromCollection", null, oRemoveProgramPara,
......@@ -353,15 +252,17 @@ cc.Class({
var oRemoveAllProgramPara = {
'view': "json",
"collectionId": this._iDefaultCollectionId,
"appId": this._aTypeAppId[this._oSceneContext._iCurrentTypeIndex],
"token": Common.TEST_API_TOKEN,
// "appId": this._aTypeAppId[this._oSceneContext._iCurrentTypeIndex],
"token": Common.TEST_API_TOKEN_EDU,
}
Network.ajax('GET', Common.TOPDRAW_API_SERVER + "User/RemoveAllMediaFromCollection", null, oRemoveAllProgramPara,
Network.ajax('GET', Common.TOPDRAW_API_SERVER_EDU + "User/RemoveAllMediaFromCollection", null, oRemoveAllProgramPara,
function (strResponse) {
try {
var oJSONResult = JSON.parse(strResponse);
if (oJSONResult.businessCode == 'success') {
cc.log("删除所有成功");
let nodeContainer = cc.find('CategoryList/DataContainerMask/DataContainer', this.node);
nodeContainer.destroyAllChildren();
this.getCategoryList();
cc.log("Success GET RemoveAllProgram...");
} else {
......@@ -383,6 +284,7 @@ cc.Class({
this.initFocus();
// }, 0);
this._bIsFocusInit = true;
this.changeEditorStatus();
}
},
......@@ -425,7 +327,7 @@ cc.Class({
var fiIndex = this.spriteIndex.addComponent(FocusInfo);
this._aFocusTargets[0]['to_home_index'] = this.spriteIndex;
fiIndex.init(null, false);
fiIndex.init('{"click": [{"action": "ChangeScene","parameters": {"sceneName":"sceneRecommend"}}]}', true);
// var nodeInitFocus = cc.find(this._oSceneContext.focusPath, this.node);
var nodeInitFocus = cc.find("HistoryIcon", this.node); //从其他界面回退回来错乱,强制使用死路径
......@@ -440,24 +342,6 @@ cc.Class({
nodeInitFocus.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 64, 176, 64));
});
}
// if (0 == nodeInitFocus.name.indexOf('TypeListCell')) {
// let iIndex = parseInt(nodeInitFocus.name.replace("TypeListCell", ''));
// if (this._oType[iIndex]) {
// Network.loadImageInNativeRuntime(
// Common.TOPDRAW_IMAGE_SERVER + this._oType[iIndex].image[0].fileUrl,
// function (texture) {
// let width = self._oType[iIndex].image[0].width;
// let height = self._oType[iIndex].image[0].height;
// nodeInitFocus.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, height / 2, width, height / 2));
// }, null, this
// );
// }
// }
// //处理焦点位于下方问题
// if (this._oSceneContext.typeListY) {
// this._nodeTypeList.y = this._oSceneContext.typeListY;
// }
},
onKeyDown: function (event) {
......@@ -479,10 +363,9 @@ cc.Class({
// return;
// }
// }
if (0 == this._fiCurrentFocus.node.getName().indexOf('DiaryListCell')) {
var index = parseInt(this._fiCurrentFocus.node.getName().replace('DiaryListCell', ''));
// cc.log("当前时多少条目:"+index);
let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView);
if (0 == this._fiCurrentFocus.node.getName().indexOf('OtherListCell')) {
var index = parseInt(this._fiCurrentFocus.node.getName().replace('OtherListCell', ''));
// let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView);
if (lvCategoryList.scrollARowUp(index)) {
return;
}
......@@ -510,10 +393,9 @@ cc.Class({
// }
// return;
// }
if (0 == this._fiCurrentFocus.node.getName().indexOf('DiaryListCell')) {
var index = parseInt(this._fiCurrentFocus.node.getName().replace('DiaryListCell', ''));
// cc.log("CategoryList索引数:"+index);
let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView);
if (0 == this._fiCurrentFocus.node.getName().indexOf('OtherListCell')) {
var index = parseInt(this._fiCurrentFocus.node.getName().replace('OtherListCell', ''));
// let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView);
if (lvCategoryList.scrollARowDown(null, index)) {
// cc.log("line feed!");
return;
......@@ -538,7 +420,8 @@ cc.Class({
if (event.keyCode == cc.macro.KEY.enter || event.keyCode == Common.ANDROID_KEY.enter) {
if (0 == fiCurrentFocus.node.name.indexOf('EditorIcon') || 0 == fiCurrentFocus.node.name.indexOf('BackEditorIcon')) {
this._bEditorStatus = !this._bEditorStatus;
this.getCategoryList();
// this.getCategoryList();
this.changeEditorStatus();
} else if (0 == fiCurrentFocus.node.name.indexOf('DiaryListCell')) { //进入详情或删除该条目
if (this._bEditorStatus) { //删除
this.requestRemoveProgram();
......@@ -552,7 +435,7 @@ cc.Class({
}
} else if (this._bEditorStatus && 0 == fiCurrentFocus.node.name.indexOf('ClearIcon')) { //清空
this.requestRemoveAllProgram();
} else if (0 == fiCurrentFocus.node.name.indexOf('HistoryIcon')) { //观看历史
} else { //观看历史
this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK);
}
}
......@@ -565,47 +448,6 @@ cc.Class({
this._oSceneContext.categoryRecordIndexOfFirstCell = lvCategoryList.getRecordIndexOfFirstCellInPage();
},
checkFocusTarget: function (fiFocusTarget, oScrollParameter) {
// if (0 == this._fiCurrentFocus.node.name.indexOf("TypeListCell") && 0 != fiFocusTarget.node.name.indexOf("TypeListCell")) {
// if (!this._bIsCategoryListDataInit) { //滑动过快时_bIsCategoryListDataInit可能还未初始完成
// return [null, oScrollParameter];
// }
// }
// if (fiFocusTarget && 0 == fiFocusTarget.node.name.indexOf("TypeListCell")) {
// if (0 != this._fiCurrentFocus.node.name.indexOf("TypeListCell")) {//如果不是TypeList之间跳转,则哪里来回哪里去
// fiFocusTarget = cc.find("TypeListCell" + this._oSceneContext._iCurrentTypeIndex, this._nodeTypeList).getComponent(FocusInfo);
// } else {
// let iIndex = parseInt(fiFocusTarget.node.name.replace(/TypeListCell/, ''));
// let iDirRate = null;
// if (-fiFocusTarget.node.y + fiFocusTarget.node.height / 2 - this._nodeTypeList.y >= this._nodeTypeListWrapper.height) {
// oScrollParameter = this._nodeTypeList.getComponent(TVScrollParameter);
// oScrollParameter.setHasRelation(true);
// oScrollParameter.setStep(-(-fiFocusTarget.node.y + fiFocusTarget.node.height / 2 + 1 - this._nodeTypeList.y) + this._nodeTypeListWrapper.height);
// oScrollParameter.setTargetPosition(this._nodeTypeList.y - oScrollParameter.getStep());
// this._oSceneContext.typeListY = this._nodeTypeList.y - oScrollParameter.getStep();
// iDirRate = 1;
// }
// if (-fiFocusTarget.node.y - this._nodeTypeList.y < 0) {
// oScrollParameter = this._nodeTypeList.getComponent(TVScrollParameter);
// oScrollParameter.setHasRelation(true);
// oScrollParameter.setStep(-fiFocusTarget.node.y - fiFocusTarget.node.height / 2 - this._nodeTypeList.y);
// oScrollParameter.setTargetPosition(this._nodeTypeList.y + oScrollParameter.getStep());
// this._oSceneContext.typeListY = this._nodeTypeList.y + oScrollParameter.getStep();
// iDirRate = -1;
// }
// if (iDirRate) {
// if (this._nodeTypeList.y + iDirRate * (this._nodeTypeHeight + 5) >= (this._aTypeAppId.length - this.TYPE_LIST_CELL_SIZE) * (this._nodeTypeHeight + 5) - 5) {//减5没有多大的意思,因为.y是有误差的
// cc.find("TypeListArea/Down", this.node).opacity = 0;
// } else {
// cc.find("TypeListArea/Down", this.node).opacity = 255;
// }
// if (this._nodeTypeList.y + iDirRate * (this._nodeTypeHeight + 1) <= 5) {
// cc.find('TypeListArea/Up', this.node).opacity = 0;
// } else {
// cc.find('TypeListArea/Up', this.node).opacity = 255;
// }
// }
// }
// }
return [fiFocusTarget, oScrollParameter];
},
......@@ -613,36 +455,6 @@ cc.Class({
onBeforeFocusChange: function (event) {
let fiFrom = event.detail.from;
let fiTo = event.detail.to;
// if (0 == fiFrom.node.getName().indexOf('DiaryListCell')) {
// cc.loader.loadRes('texture/ui/delete', cc.Texture2D, function (err, texture) {
// cc.find('GrayMask/DeleteButton', fiFrom.node).getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, 122, 122));
// });
// // cc.find('GrayMask/DeleteButton', fiFrom.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 122, 122));
// fiFrom.node.getComponent(ListCell).setUIWithoutFocus();
// }
// if (0 == fiFrom.node.getName().indexOf('TypeListCell')) {
// var self = this;
// let iIndex = fiFrom.node.name.replace("TypeListCell", '');
// if (0 == fiTo.node.getName().indexOf('TypeListCell')) {
// if (this._oType[iIndex]) {
// let width = self._oType[iIndex].image[0].width;
// let height = self._oType[iIndex].image[0].height / 2;
// Network.loadImageInNativeRuntime(
// Common.TOPDRAW_IMAGE_SERVER + self._oType[iIndex].image[0].fileUrl,
// function (texture) {
// fiFrom.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, width, height));
// }, null, this
// );
// }
// }
// }
// if (0 == fiFrom.node.getName().indexOf('HistoryIcon') || 0 == fiFrom.node.getName().indexOf('EditorIcon')
// || 0 == fiFrom.node.getName().indexOf('ClearIcon') || 0 == fiFrom.node.getName().indexOf('BackEditorIcon')) { //
// fiFrom.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, fiFrom.node.width, fiFrom.node.height));
// }
if (0 == fiFrom.node.getName().indexOf('HistoryIcon')) {
cc.loader.loadRes('button/history_button', cc.Texture2D, function (err, texture) {
......@@ -673,37 +485,6 @@ cc.Class({
onAfterFocusChange: function (event) {
let fiTo = event.detail.to;
// if (0 == fiTo.node.getName().indexOf('DiaryListCell')) {
// cc.loader.loadRes('texture/ui/delete', cc.Texture2D, function (err, texture) {
// cc.find('GrayMask/DeleteButton', fiTo.node).getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 122, 122, 122));
// });
// // cc.find('GrayMask/DeleteButton', fiTo.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 122, 122, 122));
// fiTo.node.getComponent(ListCell).setUIWithFocus();
// }
// if (0 == fiTo.node.getName().indexOf('TypeListCell')) {
// var self = this;
// let iIndex = fiTo.node.name.replace("TypeListCell", '');
// if (this._oType[iIndex]) {
// let width = self._oType[iIndex].image[0].width;
// let height = self._oType[iIndex].image[0].height / 2;
// Network.loadImageInNativeRuntime(
// Common.TOPDRAW_IMAGE_SERVER + self._oType[iIndex].image[0].fileUrl,
// function (texture) {
// fiTo.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, height, width, height));
// }, null, this
// );
// }
// this._oSceneContext._iCurrentTypeIndex = iIndex;
// this.scheduleOnce(this.getDefaultCollection, 1);
// this._bIsCategoryListDataInit = false; //初始化它
// }
// if (0 == fiTo.node.getName().indexOf('HistoryIcon') || 0 == fiTo.node.getName().indexOf('EditorIcon')
// || 0 == fiTo.node.getName().indexOf('ClearIcon') || 0 == fiTo.node.getName().indexOf('BackEditorIcon')) { //
// fiTo.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height));
// }
if (0 == fiTo.node.getName().indexOf('HistoryIcon')) {
cc.loader.loadRes('button/history_button', cc.Texture2D, function (err, texture) {
......
//观看历史
//日记(我的收藏)
//这里跳转地址是由返回数据指定,暂未实现
//这里获取CategoryList数据的接口有问题
//正常接口不管limit字段多少返回的count都是总数据量,这里只返回了limit的数量,导致CategoryList刷新出错!!!
var Common = require('Common');
var Network = require('Network');
var TVFocus = require('TVFocus');
......@@ -10,63 +8,33 @@ var TVCanvas = require('TVCanvas');
var TVScrollParameter = require('TVScrollParameter');
var ListView = require('ListView');
var ListCell = require('ListCell');
var Utils = require('Utils');
var BusinessParameter = require('BusinessParameter');
cc.Class({
extends: TVCanvas,
properties: {
spriteScrollBarBlock: cc.Sprite,
spriteScrollBarUp: cc.Sprite,
spriteScrollBarDown: cc.Sprite,
spriteCollect: cc.Sprite,
spriteEditor: cc.Sprite,
spriteClear: cc.Sprite,
spriteBackEditor: cc.Sprite,
spriteIndex: cc.Sprite,
_bPfbTypeCellInit: false,
_aTypeAppId: [],
_aTypeUrl: [],
_aNavList: [],
_nodeTypeHeight: 0,
TYPE_LIST_CELL_SIZE: 4,
_strAppId: '', //为了跳播放
_strDirURL: '',
_oDestURL: null,
_strIndexURL: '',
_strIconSrc: '',
_iCollectionId: 0,//默认收藏夹的id
_aEpisodeIndex: [],//剧集index集合
_strPageIds: '', //页面内mediaId
_bIsContentWStatus: true,//海报图状态,true为横图,false为竖图
_bIsCategoryListDataInit: false,
// _iCurrentTypeIndex: 0,
_strIds: '',
_oType: null,
_aCategoryMediaId: [],
_aCategoryAlreadyMediaId: [],
_bBackStatus: false,
// PFB_TYPE: {
// default: null,
// type: cc.Prefab,
// },
_iDefaultCollectionId: 0,
_bEditorStatus: false,
_oType: null,
_aNavList: [], //存储跳转需要的参数,appId,url...
_strAppId: '',
},
onLoad: function () {
this._super();
this._iShowCellRows = 3;
this._iAlphaCellRows = 0;
this._iHiddenCellRows = 3;
this._iCellCountEachRow = 2;
this._iBeginPositionX = -200;
this._iBeginPositionY = 210;
this._fCellMarginTop = 20;
this._fCellMarginRight = 15;
this._fCellMarginBottom = 10;
this._fCellMarginLeft = 0;
//-----------上下文及参数相关处理------------
let oSceneParameter = this._cApplication.getTopSceneParameter();
if (oSceneParameter) {
......@@ -76,13 +44,12 @@ cc.Class({
if (this._cApplication.getBackStatus()) {
this._oSceneContext = this._cApplication.popSceneContext();
this._cApplication.setBackStatus(false);
this._bBackStatus = true;
} else {
this._oSceneContext = {};
this._oSceneContext.requestedTypeId = null;
this._oSceneContext._iCurrentTypeIndex = 0;
this._oSceneContext.categoryRecordIndexOfFirstCell = 0;
this._oSceneContext.focusPath = "CollectionIcon";
this._oSceneContext.focusPath = "TypeListArea/TypeListWrapper/TypeList/TypeListCell0";
this._oSceneContext.typeListY = 0;
// this._oSceneContext.elderTypeId = oSceneParameter.elderTypeId || 37; //从上级拿过来的二级父Id
}
......@@ -90,165 +57,18 @@ cc.Class({
this._strAppId = this._strAppId || "tda7e47f868313d9f5"; //测试
//---------上下文及参数相关处理结束-----------
//左分类框框
this._nodeTypeListWrapper = cc.find("TypeListArea/TypeListWrapper", this.node);
this._nodeTypeList = cc.find("TypeList", this._nodeTypeListWrapper);
this._nodeTypeList.addComponent(TVScrollParameter);
// //右分类框框
this._nodeCategoryList = cc.find("CategoryList", this.node);
// cc.find("HistoryIcon", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 54, 142, 54));
cc.find("CollectionIcon", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 176, 64));
cc.find("EditorSprite", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 137, 64));
cc.find("IndexSprite", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 137, 64));
//滚动条按钮
let nodeScrollBtn = cc.find("CategoryList/ScrollBarContainer/ScrollBarShadow/ScrollBarBlock", this.node);
var fiScrollBtn = nodeScrollBtn.addComponent(FocusInfo);
this._aFocusTargets[0]['scroll_bar_block'] = nodeScrollBtn;
fiScrollBtn.init(null, true);
// this.spriteHistory.spriteFrame.setRect(cc.rect(0, 0, 176, 64));
this.spriteCollect.spriteFrame.setRect(cc.rect(0, 0, 176, 64));
this.spriteEditor.spriteFrame.setRect(cc.rect(0, 0, 137, 65));
this.spriteClear.spriteFrame.setRect(cc.rect(0, 0, 137, 65));
this.spriteBackEditor.spriteFrame.setRect(cc.rect(0, 0, 137, 65));
this.spriteIndex.spriteFrame.setRect(cc.rect(0, 0, 137, 65));
this.getPageBg(this, 'background');
// this.addHomeIcon(this);
// this.getTypeList(); //暂时不要Type
this.getListBookmark(); //直接请求
this.checkDataReadyAndInitFocus(); //初始化焦点放到这里
this.getDefaultCollection(); //删除所有条目用的
},
// getTypeList: function () {
// let oTypeRequestParameters = {
// "view": "json",
// "start": 0,
// "limit": 100,
// "name": "indexHistoryNew",
// "sortField": "left",
// "sortDirection": "desc",
// "token": Common.TEST_API_TOKEN,
// };
// Network.ajax('GET', Common.TOPDRAW_API_SERVER + "Promotion/ListItemByName", null, oTypeRequestParameters,
// function (strResponse) {
// try {
// var oJSONResult = JSON.parse(strResponse);
// if (oJSONResult.businessCode == 'success') {
// if (oJSONResult.resultSet.length > 0) {
// this._oType = [];
// this._aNavList = [];
// cc.loader.setAutoReleaseRecursively(this.PFB_TYPE, true); //设置允许自动释放
// for (var i = 0; i < oJSONResult.resultSet.length; i++) {
// let oTvlink = JSON.parse(oJSONResult.resultSet[i].tvlink);
// let oListCell = {};
// let jaClick = oTvlink.click;
// let oParameters = null
// for (let i = 0; i < jaClick.length; i++) {
// oParameters = jaClick[i].parameters;
// }
// oListCell.appId = oParameters.appId;
// this._aNavList.push(oListCell);
// this._aTypeAppId.push(oParameters.appId); //拿到appId并保存到_aTypeAppId
// this._oType.push(oJSONResult.resultSet[i]);
// //恢复上下文带过来的位置
// // if (this._oSceneContext.requestedTypeId && this._oSceneContext.requestedTypeId == oJSONResult.resultSet[i].id) {
// // this._iCurrentTypeIndex = i;
// // }
// let nodeTypeListCell = cc.instantiate(this.PFB_TYPE);
// nodeTypeListCell.y = -nodeTypeListCell.height / 2 - i * (nodeTypeListCell.height + 27) - 10;
// this._nodeTypeList.addChild(nodeTypeListCell, 10, "TypeListCell" + i);
// //准备焦点坐标
// let fiTypeBlock = nodeTypeListCell.addComponent(FocusInfo);
// fiTypeBlock.init(
// '',
// true, null, null, 1.15
// );
// this._aFocusTargets[0]['type_list_cell_' + i] = nodeTypeListCell;
// if (oJSONResult.resultSet[i].image[0]) {
// let width = oJSONResult.resultSet[i].image[0].width;
// let height = oJSONResult.resultSet[i].image[0].height / 2;
// nodeTypeListCell.width = width;
// nodeTypeListCell.height = height;
// this._nodeTypeHeight = height;
// if (this._oSceneContext._iCurrentTypeIndex == i) {
// Network.loadImageInNativeRuntime(
// Common.TOPDRAW_IMAGE_SERVER + oJSONResult.resultSet[i].image[0].fileUrl,
// function (texture) {
// cc.find('Bg', nodeTypeListCell).getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, height, width, height));
// }, null, this
// );
// } else {
// Network.loadImageInNativeRuntime(
// Common.TOPDRAW_IMAGE_SERVER + oJSONResult.resultSet[i].image[0].fileUrl,
// function (texture) {
// cc.find('Bg', nodeTypeListCell).getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, width, height));
// }, null, this
// );
// }
// }
// }
// this._oSceneContext.requestedTypeId = this._aTypeAppId[this._oSceneContext._iCurrentTypeIndex];
// this.getCollectionId();
// this._bInitTypeListSuccess = true;
// this.checkDataReadyAndInitFocus(); //初始化焦点放到这里
// } else {
// this._oSceneContext.focusPath = "app";
// }
// cc.log("Success GET TYPE LIST...");
// } else {
// cc.log("Error GET TYPE LIST..." + oJSONResult.description);
// }
// } catch (error) {
// cc.log("Exception GET TYPE LIST..." + error);
// }
// },
// function (strResponse) {
// cc.log("Communication Error : Get Type List Information..." + strResponse + "\r\n");
// }, this, "uuid"
// );
// },
// //获取当前的appId等相关的信息
// getCollectionId: function () {
// this._strAppId = this._aNavList[this._oSceneContext._iCurrentTypeIndex].appId;
// this._strDirURL = this._aNavList[this._oSceneContext._iCurrentTypeIndex].dirURL;
// this._oDestURL = this._aNavList[this._oSceneContext._iCurrentTypeIndex].destURL;
// this._strIndexURL = this._aNavList[this._oSceneContext._iCurrentTypeIndex].indexURL;
// var oGetDefaultCollectionPara = {
// 'view': "json",
// 'appId': this._strAppId,
// "token": Common.TEST_API_TOKEN,
// };
// Network.ajax('GET', Common.TOPDRAW_API_SERVER + "User/GetDefaultCollection", null, oGetDefaultCollectionPara,
// function (strResponse) {
// try {
// var oJSONResult = JSON.parse(strResponse);
// // var strBlank = '{"businessCode":"success","count":0,"currentTime":1542195457309,"description":"","resultSet":[]}';
// if (oJSONResult.businessCode == 'success') {
// this._iCollectionId = oJSONResult.resultSet[0].id; //获取默认收藏id
// // if (this._strAppId == BusinessParameter.CARTOON_APPID) { //动漫
// // this._bIsContentWStatus = false; //竖图
// // // this._nodeCategoryList.getComponents(ListView)[1].renderInitData(strBlank); //另一个置空
// // // this.lvCategoryList = this._nodeCategoryList.getComponents(ListView)[0];
// // } else { //横图
// // this._bIsCategoryListDataInit = true;
// // // this._nodeCategoryList.getComponents(ListView)[0].renderInitData(strBlank);
// // // this.lvCategoryList = this._nodeCategoryList.getComponents(ListView)[1];
// // }
// this.getListBookmark();
// cc.log("Success GET GetDefaultCollection...");
// } else {
// cc.log("Error GET GetDefaultCollection..." + oJSONResult.description);
// }
// } catch (error) {
// cc.log("Exception GET GetDefaultCollection..." + error);
// }
// },
// function (strResponse) {
// cc.log("Communication Error : Get GetDefaultCollection Information..." + strResponse + "\r\n");
// }, this, "uuid"
// );
// },
/**
* 拿到列表需要的ids
......@@ -300,30 +120,48 @@ cc.Class({
);
},
/**
* 用当前typeid拿到id
*/
getDefaultCollection: function () {
// this._strAppId = this._aNavList[this._oSceneContext._iCurrentTypeIndex].appId;
let oDefaultCollectionParameters = {
"view": "json",
// "appId": this._aTypeAppId[this._oSceneContext._iCurrentTypeIndex],
"token": Common.TEST_API_TOKEN_EDU,
};
Network.ajax('GET', Common.TOPDRAW_API_SERVER_EDU + "User/GetDefaultCollection", null, oDefaultCollectionParameters,
function (strResponse) {
try {
var oJSONResult = JSON.parse(strResponse);
if (oJSONResult.businessCode == 'success') {
if (oJSONResult.resultSet.length > 0) {
this._iDefaultCollectionId = oJSONResult.resultSet[0].id;
// this.getCategoryList();
} else {
this._oSceneContext.focusPath = "app";
}
cc.log("Success GET DefaultCollection...");
} else {
cc.log("Error GET DefaultCollection..." + oJSONResult.description);
}
} catch (error) {
cc.log("Exception GET DefaultCollection..." + error);
}
},
function (strResponse) {
cc.log("Communication Error : Get DefaultCollection Information..." + strResponse + "\r\n");
}, this, "uuid"
);
},
getCategoryList: function () {
//把之前的东西删掉
let nodeCategoryList = this.node.getChildByName('CategoryList');
// nodeCategoryList.getChildByName('DataContainerMask').getChildByName('DataContainer').removeAllChildren();
nodeCategoryList.getChildByName('DataContainerMask').getChildByName('DataContainer').destroyAllChildren();
// let strAppId = this._aTypeAppId[this._oSceneContext._iCurrentTypeIndex];
// switch (strAppId) {
// case BusinessParameter.CARTOON_APPID:
// this._oSceneContext.focusPath = this._oSceneContext.focusPath || "SongList/DataContainerMask/DataContainer/ListCell0/SongTitleContainer";
// this._strSongListCellComponentName = "HistoryCartoonListCell";
// this._iBeginPositionX = -250;
// this._iBeginPositionY = 200;
// this._iShowCellRows = 2;
// this._iAlphaCellRows = 0;
// this._iHiddenCellRows = 2;
// this._iCellCountEachRow = 3;
// this._fCellMarginTop = 0;
// this._fCellMarginRight = 53;
// this._fCellMarginBottom = 15;
// this._fCellMarginLeft = 0;
// break;
// default:
// // this._oSceneContext.focusPath = this._oSceneContext.focusPath || "SongList/DataContainerMask/DataContainer/ListCell0/ImageBlock";
this._strSongListCellComponentName = "HistoryOtherListCell";
this._iBeginPositionX = -450;
this._iBeginPositionY = 250;
......@@ -393,197 +231,128 @@ cc.Class({
);
}
);
// var self = this;
// lvCategoryList.setDataDecorator(
// function (oData, onDecorate, oScope) {
// let oCollectionRequestParameters = {
// "view": "json",
// "mediaIds": "",
// "needCollection": 1,
// "start": 0,
// "limit": 0,
// "appId": self._strAppId,
// "token": Common.TEST_API_TOKEN,
// };
// let aData = oData.refData;
// //造一个跳转tvlink
// for (let i = 0; i < aData.length; i++) {
// //造一个跳转界面
// let tvlink = '';
// if (aData[i].type == 4) {
// tvlink = '{"click": [{"action": "ChangeScene","parameters": {"sceneName":"sceneProgramPlayerFullScreen",\
// "appId":"' + self._strAppId + '","id":"' + aData[i].id + '","episodeNum":"' + aData[i].episode_number + '"}}]}';
// } else {
// tvlink = '{"click": [{"action": "ChangeScene","parameters": {"sceneName":"sceneProgramPlayerFullScreen",\
// "appId":"' + self._strAppId + '","id":"' + aData[i].id + '"}}]}';
// }
// aData[i].tvlink = tvlink;
// }
// for (let i = 0; i < aData.length; i++) {
// oCollectionRequestParameters.mediaIds += (aData[i].id + ',');
// }
// oCollectionRequestParameters.limit = aData.length;
// oCollectionRequestParameters.mediaIds = oCollectionRequestParameters.mediaIds.substring(0, oCollectionRequestParameters.mediaIds.length - 1);
// // if (this._strAppId != BusinessParameter.CARTOON_APPID) { //刨去动漫,动漫没有收藏选项
// // Network.ajax('GET', Common.TOPDRAW_API_SERVER + "User/ListMediaAdditional", null, oCollectionRequestParameters,
// // function (strResponse) {
// // try {
// // var oJSONResult = JSON.parse(strResponse);
// // if (oJSONResult.businessCode == 'success') {
// // self._aCategoryAlreadyMediaId = [];
// // for (var i = 0; i < oJSONResult.resultSet[0].collections.length; i++) {
// // var mediaId = oJSONResult.resultSet[0].collections[i].media_id;
// // for (let i = 0; i < aData.length; i++) {
// // // cc.log("tvlink--------------------->" + aData[i].tvlink);
// // if (aData[i].id == mediaId) { //检测是否收藏
// // aData[i].isCollect = true; //将已收藏的插进去
// // }
// // }
// // }
// // if (onDecorate) {
// // if (null != oScope) {
// // onDecorate.call(oScope, aData);
// // } else {
// // onDecorate(aData);
// // }
// // }
// // cc.log("Success GET MediaAdditinal...");
// // } else {
// // cc.log("Error GET MediaAdditinal..." + oJSONResult.description);
// // }
// // } catch (error) {
// // cc.log("Exception GET MediaAdditinal..." + error);
// // }
// // },
// // function (strResponse) {
// // cc.log("Communication Error : Get MediaAdditinal Information..." + strResponse + "\r\n");
// // }, self, "uuid"
// // );
// // }
// }
// );
},
// lvCategoryList.setDataPositionRender(function (iPosition, iCount) {
// //这里是ListView的this 执行时作用域
// let nodeDataPosition = self.node.getChildByName('DataPosition');
// if (iCount == 0) {
// nodeDataPosition.getComponent(cc.Label).string = "1 / 1";
// nodeDataPosition.x = Common.SCREEN_WIDTH / 2 - 70 - nodeDataPosition.width / 2;
// return;
// }
// if (null == iCount) {
// iCount = parseInt(nodeDataPosition.getComponent(cc.Label).string.split('/')[1]);
// cc.log(iCount);
/**
* 改变管理的状态
*/
changeEditorStatus: function () {
var fiFocusTarget = null;
if (!this._bIsFocusInit) return; //还未初始化焦点
var nodeContainer = cc.find('CategoryList/DataContainerMask/DataContainer', this.node);
var aNodeChildren = nodeContainer.children;
if (this._bEditorStatus) {
fiFocusTarget = cc.find('BackEditorIcon', this.node).getComponent(FocusInfo);
cc.find('EditorIcon', this.node).getComponent(FocusInfo).setEnable(false);
cc.find('IndexIcon', this.node).getComponent(FocusInfo).setEnable(false);
cc.find('ClearIcon', this.node).getComponent(FocusInfo).setEnable(true);
cc.find('BackEditorIcon', this.node).getComponent(FocusInfo).setEnable(true);
cc.find('EditorIcon', this.node).opacity = 0;
cc.find('IndexIcon', this.node).opacity = 0;
cc.find('BackEditorIcon', this.node).opacity = 255;
cc.find('ClearIcon', this.node).opacity = 255;
// for (let i = 0; i < aNodeChildren.length; i++) {
// cc.find('GrayMask', aNodeChildren[i]).opacity = 255;
// }
// nodeDataPosition.getComponent(cc.Label).string = Math.ceil(Math.min((iPosition + self._iShowCellRows * self._iCellCountEachRow - 1), iCount) / self._iShowCellRows / self._iCellCountEachRow) + " / " + Math.ceil(iCount / self._iShowCellRows / self._iCellCountEachRow);
// nodeDataPosition.x = Common.SCREEN_WIDTH / 2 - 70 - nodeDataPosition.width / 2;
// // this._compSceneCanvas.checkCountAndDisplayTopBtns(iCount);
// });
} else {
fiFocusTarget = cc.find('EditorIcon', this.node).getComponent(FocusInfo);
cc.find('EditorIcon', this.node).getComponent(FocusInfo).setEnable(true);
cc.find('IndexIcon', this.node).getComponent(FocusInfo).setEnable(true);
cc.find('ClearIcon', this.node).getComponent(FocusInfo).setEnable(false);
cc.find('BackEditorIcon', this.node).getComponent(FocusInfo).setEnable(false);
cc.find('EditorIcon', this.node).opacity = 255;
cc.find('IndexIcon', this.node).opacity = 255;
cc.find('BackEditorIcon', this.node).opacity = 0;
cc.find('ClearIcon', this.node).opacity = 0;
// for (let i = 0; i < aNodeChildren.length; i++) {
// cc.find('GrayMask', aNodeChildren[i]).opacity = 0;
// }
}
// this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_RIGHT, null, null);//TODO:焦点跳转一次,不然按钮状态无法改变
},
/**
* 添加收藏
*/
AddMedia2Collection: function () {
let nodeId = this._fiCurrentFocus.node.parent.getComponent(ListCell).id;
if (!nodeId || !this._iCollectionId) {
return;
}
let oCollectionRequestParameters = {
"view": "json",
"mediaId": nodeId,
"collectionId": this._iCollectionId,
"appId": this._strAppId,
//删除ListView条目
requestRemoveProgram: function () {
let id = this._fiCurrentFocus.node.getChildByName('Id').getComponent(cc.Label).string;
var oRemoveProgramPara = {
'view': "json",
"collectionId": this._iDefaultCollectionId,
'mediaIds': id,
// "appId": this._aTypeAppId[this._oSceneContext._iCurrentTypeIndex],
"token": Common.TEST_API_TOKEN,
};
Network.ajax('GET', Common.TOPDRAW_API_SERVER + "User/AddMedia2Collection", null, oCollectionRequestParameters,
}
Network.ajax('GET', Common.TOPDRAW_API_SERVER + "User/RemoveMediaFromCollection", null, oRemoveProgramPara,
function (strResponse) {
try {
var oJSONResult = JSON.parse(strResponse);
if (oJSONResult.businessCode == 'success') {
cc.log("添加成功");
// this.getCategoryList(); //不能更新网络,焦点会错乱
this._aCategoryAlreadyMediaId.push(nodeId);
let nodeCollectionPic = cc.find("CollectionBg/CollectionPic", this._fiCurrentFocus.node.parent);
cc.loader.loadRes("texture/ui/collect_heart", cc.Texture2D, function (err, texture) {
var spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 28, 30, 28));
nodeCollectionPic.getComponent(cc.Sprite).spriteFrame = spriteFrame;
});
cc.log("删除成功");
this.getCategoryList();
let fiFocusTarget = cc.find("BackEditorIcon", this.node).getComponent(FocusInfo); //处理焦点跳转
setTimeout(function () {
this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_UP, null, null);
}.bind(this), 300);
cc.log("Success GET RemoveProgram...");
} else {
cc.log("Error GET AddMedia..." + oJSONResult.description);
cc.log("Error GET RemoveProgram..." + oJSONResult.description);
}
} catch (error) {
cc.log("Exception GET AddMedia..." + error);
cc.log("Exception GET RemoveProgram..." + error);
}
},
function (strResponse) {
cc.log("Communication Error : Get AddMedia Information..." + strResponse + "\r\n");
cc.log("Communication Error : Get RemoveProgram Information..." + strResponse + "\r\n");
}, this, "uuid"
);
},
/**
* 移除收藏
*/
removeMedia2Collection: function () {
let nodeId = this._fiCurrentFocus.node.parent.getChildByName('Id').getComponent(cc.Label).string;
if (!nodeId || !this._iCollectionId) {
return;
//清空所有条目
requestRemoveAllProgram: function () {
var oRemoveAllProgramPara = {
'view': "json",
"collectionId": this._iDefaultCollectionId,
// "appId": this._aTypeAppId[this._oSceneContext._iCurrentTypeIndex],
"token": Common.TEST_API_TOKEN_EDU,
}
let oCollectionRequestParameters = {
"view": "json",
"mediaId": nodeId,
"collectionId": this._iCollectionId,
"appId": this._strAppId,
"token": Common.TEST_API_TOKEN,
};
Network.ajax('GET', Common.TOPDRAW_API_SERVER + "User/RemoveMediaFromCollection", null, oCollectionRequestParameters,
Network.ajax('GET', Common.TOPDRAW_API_SERVER_EDU + "User/RemoveAllMediaFromCollection", null, oRemoveAllProgramPara,
function (strResponse) {
try {
var oJSONResult = JSON.parse(strResponse);
if (oJSONResult.businessCode == 'success') {
cc.log("移除成功");
// this.getCategoryList(); //不能更新网络,焦点会错乱
Utils.remove(this._aCategoryAlreadyMediaId, nodeId);
let nodeCollectionPic = cc.find("CollectionBg/CollectionPic", this._fiCurrentFocus.node.parent);
cc.loader.loadRes("texture/ui/collect_heart", cc.Texture2D, function (err, texture) {
var spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, 30, 28));
nodeCollectionPic.getComponent(cc.Sprite).spriteFrame = spriteFrame;
});
cc.log("删除所有成功");
let nodeContainer = cc.find('CategoryList/DataContainerMask/DataContainer', this.node);
nodeContainer.destroyAllChildren();
this.getCategoryList();
cc.log("Success GET RemoveAllProgram...");
} else {
cc.log("Error GET removeMedia..." + oJSONResult.description);
cc.log("Error GET RemoveAllProgram..." + oJSONResult.description);
}
} catch (error) {
cc.log("Exception GET removeMedia..." + error);
cc.log("Exception GET RemoveAllProgram..." + error);
}
},
function (strResponse) {
cc.log("Communication Error : Get removeMedia Information..." + strResponse + "\r\n");
cc.log("Communication Error : Get RemoveAllProgram Information..." + strResponse + "\r\n");
}, this, "uuid"
);
},
checkDataReadyAndInitFocus: function () {
if (!this._bIsFocusInit) {
if (this._bIsCategoryListDataInit && !this._bIsFocusInit) {
// this.scheduleOnce(() => { //指定0让回调函数在下一帧立即执行
this.initFocus();
// }, 0);
this._bIsFocusInit = true;
this.changeEditorStatus();
}
},
initFocus: function () {
var self = this;
// //----------------Creator2.1.0-rc2版本有毒--------------------------
// //动态加载这几张引起黑屏的罪魁祸首
//----------------Creator2.1.0-rc2版本有毒--------------------------
//动态加载这几张引起黑屏的罪魁祸首
// cc.loader.loadRes("Texture/scroll/pageIncon", cc.SpriteFrame, function (err, spriteFrame) {
// self.spriteScrollBarBlock.spriteFrame = spriteFrame;
// });
......@@ -593,95 +362,61 @@ cc.Class({
// cc.loader.loadRes("Texture/scroll/down_arrow", cc.SpriteFrame, function (err, spriteFrame) {
// self.spriteScrollBarDown.spriteFrame = spriteFrame;
// });
// //-----------------------------------------------------------------
var nodeEditor = cc.find("EditorSprite", this.node); //管理
// cc.find("HistoryIcon", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 54, 142, 54));
var fiEditor = nodeEditor.addComponent(FocusInfo);
this._aFocusTargets[0]['to_editor_index'] = nodeEditor;
fiEditor.init(
null, true
);
var nodeIndex = cc.find("IndexSprite", this.node); //首页
// cc.find("HistoryIcon", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 54, 142, 54));
var fiIndex = nodeIndex.addComponent(FocusInfo);
this._aFocusTargets[0]['to_first_index'] = nodeIndex;
fiIndex.init(
null, true
);
var nodeCollection = cc.find("CollectionIcon", this.node); //我的收藏
// cc.find("CollectionIcon", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 142, 54));
var fiCollection = nodeCollection.addComponent(FocusInfo);
this._aFocusTargets[0]['to_collection_index'] = nodeCollection;
fiCollection.init(
'{"click": [{"action": "ChangeScene","parameters": {"sceneName":"sceneDiary","appId":"' + this._strAppId + '"}}]}', true
);
var nodeInitFocus = cc.find(this._oSceneContext.focusPath, this.node);
//-----------------------------------------------------------------
var fiCollection = this.spriteCollect.addComponent(FocusInfo);
this._aFocusTargets[0]['to_collection_index'] = this.spriteCollect;
fiCollection.init('{"click": [{"action": "ChangeScene","parameters": {"sceneName":"sceneDiary","appId":"' + this._strAppId + '"}}]}', true);
// self.spriteEditor.spriteFrame.setRect(cc.rect(0, 0, 142, 54));
var fiEditor = this.spriteEditor.addComponent(FocusInfo);
this._aFocusTargets[0]['to_editor_index'] = this.spriteEditor;
fiEditor.init(null, true);
// self.spriteClear.spriteFrame.setRect(cc.rect(0, 0, 142, 54));
var fiClearEditor = this.spriteClear.addComponent(FocusInfo);
this._aFocusTargets[0]['to_clear_index'] = this.spriteClear;
fiClearEditor.init(null, false);
// self.spriteBackEditor.spriteFrame.setRect(cc.rect(0, 0, 142, 54));
var fiBackEditor = this.spriteBackEditor.addComponent(FocusInfo);
this._aFocusTargets[0]['to_exit_editor_index'] = this.spriteBackEditor;
fiBackEditor.init(null, false);
var fiIndex = this.spriteIndex.addComponent(FocusInfo);
this._aFocusTargets[0]['to_home_index'] = this.spriteIndex;
fiIndex.init('{"click": [{"action": "ChangeScene","parameters": {"sceneName":"sceneRecommend"}}]}', true);
// var nodeInitFocus = cc.find(this._oSceneContext.focusPath, this.node);
var nodeInitFocus = cc.find("CollectionIcon", this.node); //从其他界面回退回来错乱,强制使用死路径
var nodeFocus = new cc.Node('nodeFocus');
this.node.addChild(nodeFocus, 10);
this._cFocus = this.node.getChildByName('nodeFocus').addComponent(TVFocus);
this._cFocus.init('focusContainer', this,
nodeInitFocus.getComponent(FocusInfo),
Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, 0, 0, 1.0);
if (0 == nodeInitFocus.getName().indexOf('CollectionIcon')) { //
nodeInitFocus.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 64, 176, 64));
}
// if (0 == nodeInitFocus.name.indexOf('TypeListCell')) {
// let iIndex = parseInt(nodeInitFocus.name.replace("TypeListCell", ''));
// if (this._oType[iIndex]) {
// Network.loadImageInNativeRuntime(
// Common.TOPDRAW_IMAGE_SERVER + this._oType[iIndex].image[0].fileUrl,
// function (texture) {
// let width = self._oType[iIndex].image[0].width;
// let height = self._oType[iIndex].image[0].height;
// nodeInitFocus.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, height / 2, width, height / 2));
// }, null, this
// );
// }
// }
if (this._bBackStatus && 0 == nodeInitFocus.getName().indexOf('OtherListCell')) { //显示收藏框框
nodeInitFocus.getChildByName("CollectionBg").opacity = 255;
nodeInitFocus.getComponent(ListCell).setUIWithFocus();
}
// if (this._bBackStatus && 0 == nodeInitFocus.getName().indexOf('CartoonListCell')) { //显示收藏框框
// nodeInitFocus.getComponent(ListCell).setUIWithFocus();
// }
//处理焦点位于下方问题
if (this._oSceneContext.typeListY) {
this._nodeTypeList.y = this._oSceneContext.typeListY;
if (0 == nodeInitFocus.name.indexOf('CollectionIcon')) {
cc.loader.loadRes('button/collection_button', cc.Texture2D, function (err, texture) {
nodeInitFocus.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 64, 176, 64));
});
}
},
onKeyDown: function (event) {
this._super(event);
// cc.log("当前列表:" + this._fiCurrentFocus.node.getName());
var fiFocusTarget = null;
var fiCurrentFocus = this._fiCurrentFocus;
var oScrollParameter = null;
let aCheckResult;
//TODO:给ListView传值,使其可以让滑块跟随滚动
let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView);
// if (lvCategoryList) {
// lvCategoryList.setCurrentFocus(this._fiCurrentFocus);
// }
// this.lvCategoryList.setCurrentFocus(this._fiCurrentFocus);
// this._oSceneContext.categoryRecordIndexOfFirstCell=lvCategoryList.getRecordIndexOfFirstCellInPageAdvance();
if (lvCategoryList) {
lvCategoryList.setCurrentFocus(this._fiCurrentFocus);
}
// this._oSceneContext.categoryRecordIndexOfFirstCell = lvCategoryList.getRecordIndexOfFirstCellInPageAdvance();
if (event.keyCode == cc.macro.KEY.up || event.keyCode == Common.ANDROID_KEY.up) {
// if (this._bIsCategoryItemMoving || this._bIsSongListMoving) {
// return;
// }
// if (0 == this._fiCurrentFocus.node.getName().indexOf('ScrollBarBlock')) { //如果滚动条
// let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView);
// if (lvCategoryList.scrollAPageUp()) {
// }
// return;
// }
// }
if (0 == this._fiCurrentFocus.node.getName().indexOf('OtherListCell')) {
var index = parseInt(this._fiCurrentFocus.node.getName().replace('OtherListCell', ''));
// let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView);
......@@ -689,13 +424,6 @@ cc.Class({
return;
}
}
// if (0 == this._fiCurrentFocus.node.getName().indexOf('CartoonListCell')) {
// var index = parseInt(this._fiCurrentFocus.node.getName().replace('CartoonListCell', ''));
// let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView);
// if (lvCategoryList.scrollARowUp(index)) {
// return;
// }
// }
fiFocusTarget = this._cFocus.findTarget(fiCurrentFocus, this._aFocusTargets, 0, Common.MOVE_DIRECTION_UP);
if (!fiFocusTarget) { return; }
aCheckResult = this.checkFocusTarget(fiFocusTarget, oScrollParameter);
......@@ -706,12 +434,6 @@ cc.Class({
if (event.keyCode == cc.macro.KEY.right || event.keyCode == Common.ANDROID_KEY.right) {
fiFocusTarget = this._cFocus.findTarget(this._fiCurrentFocus, this._aFocusTargets, 0, Common.MOVE_DIRECTION_RIGHT);
if (!fiFocusTarget) { return; }
// if (0 == this._fiCurrentFocus.node.name.indexOf("OtherListCell")) {
// let index = this._fiCurrentFocus.node.name.replace("OtherListCell", '');
// // cc.find("DataContainerMask/DataContainer/EnglishListCell" + index + "/CollectionBg", this._nodeCategoryList).opacity=255;
// fiFocusTarget = cc.find("DataContainerMask/DataContainer/OtherListCell" + index + "/CollectionBg", this._nodeCategoryList).getComponent(FocusInfo);
// }
aCheckResult = this.checkFocusTarget(fiFocusTarget, oScrollParameter);
fiFocusTarget = aCheckResult[0];
oScrollParameter = aCheckResult[1];
......@@ -719,24 +441,12 @@ cc.Class({
}
if (event.keyCode == cc.macro.KEY.down || event.keyCode == Common.ANDROID_KEY.down) {
// if (!this._iScrollGroupStatus) {
if (this._bIsCategoryItemMoving || this._bIsSongListMoving) {
return;
}
// if (0 == this._fiCurrentFocus.node.getName().indexOf('ScrollBarBlock')) { //如果是滚动条
// let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView);
// if (lvCategoryList.scrollAPageDown()) {
// }
// return;
// }
// if (0 == this._fiCurrentFocus.node.getName().indexOf('CartoonListCell')) {
// var index = parseInt(this._fiCurrentFocus.node.getName().replace('CartoonListCell', ''));
// let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView);
// if (lvCategoryList.scrollARowDown(null, index)) {
// // cc.log("line feed!");
// return;
// }
// }
if (0 == this._fiCurrentFocus.node.getName().indexOf('OtherListCell')) {
var index = parseInt(this._fiCurrentFocus.node.getName().replace('OtherListCell', ''));
// let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView);
......@@ -762,201 +472,99 @@ cc.Class({
this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_LEFT, null, oScrollParameter);
}
if (event.keyCode == cc.macro.KEY.enter || event.keyCode == Common.ANDROID_KEY.enter) {
if (0 == this._fiCurrentFocus.node.name.indexOf("CollectionBg")) { //收藏OR取消收藏
let nodeId = this._fiCurrentFocus.node.parent.getComponent(ListCell).id;
//数组转成字符串才能判断是否包含某串值(存在返回位置,不存在则返回-1)
-1 != this._aCategoryAlreadyMediaId.toString().indexOf(nodeId) ? this.removeMedia2Collection() : this.AddMedia2Collection();
return;
if (0 == fiCurrentFocus.node.name.indexOf('EditorIcon') || 0 == fiCurrentFocus.node.name.indexOf('BackEditorIcon')) {
this._bEditorStatus = !this._bEditorStatus;
// this.getCategoryList();
this.changeEditorStatus();
} else if (0 == fiCurrentFocus.node.name.indexOf('DiaryListCell')) { //进入详情或删除该条目
if (this._bEditorStatus) { //删除
this.requestRemoveProgram();
} else { //进入详情(这里要先设置焦点)注意:有些不需要进入详情是直接播放的
let id = fiCurrentFocus.node.getChildByName('Id').getComponent(cc.Label).string;
let fiBlock = fiCurrentFocus.node.getComponent(FocusInfo);
fiBlock.init(
'{"click": [{"action": "ChangeScene","parameters": {"sceneName":"sceneCartoonDetail","appId":"' + this._strAppId + '","id":"' + id + '"}}]}'
);
this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK);
}
} else if (this._bEditorStatus && 0 == fiCurrentFocus.node.name.indexOf('ClearIcon')) { //清空
this.requestRemoveAllProgram();
} else { //观看历史
this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK);
}
if (event.keyCode == cc.macro.KEY.space) {
// this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK);
}
if (event.keyCode == cc.macro.KEY.space) { }
if (event.keyCode == cc.macro.KEY.backspace || event.keyCode == Common.ANDROID_KEY.back) {
this.backAScene();
}
//记录CategoryList滚动位置
this._oSceneContext.categoryRecordIndexOfFirstCell = lvCategoryList.getRecordIndexOfFirstCellInPage();
},
checkFocusTarget: function (fiFocusTarget, oScrollParameter) {
// if (0 == this._fiCurrentFocus.node.name.indexOf("TypeListCell") && 0 != fiFocusTarget.node.name.indexOf("TypeListCell")) {
// if (!this._bIsCategoryListDataInit) {
// return [null, oScrollParameter];
// }
// }
// if (fiFocusTarget && 0 == fiFocusTarget.node.name.indexOf("TypeListCell")) {
// if (0 != this._fiCurrentFocus.node.name.indexOf("TypeListCell")) {//如果不是TypeList之间跳转,则哪里来回哪里去
// fiFocusTarget = cc.find("TypeListCell" + this._oSceneContext._iCurrentTypeIndex, this._nodeTypeList).getComponent(FocusInfo);
// } else {
// let iIndex = parseInt(fiFocusTarget.node.name.replace(/TypeListCell/, ''));
// let iDirRate = null;
// if (-fiFocusTarget.node.y + fiFocusTarget.node.height / 2 - this._nodeTypeList.y >= this._nodeTypeListWrapper.height) {
// oScrollParameter = this._nodeTypeList.getComponent(TVScrollParameter);
// oScrollParameter.setHasRelation(true);
// oScrollParameter.setStep(-(-fiFocusTarget.node.y + fiFocusTarget.node.height / 2 + 1 - this._nodeTypeList.y) + this._nodeTypeListWrapper.height);
// oScrollParameter.setTargetPosition(this._nodeTypeList.y - oScrollParameter.getStep());
// this._oSceneContext.typeListY = this._nodeTypeList.y - oScrollParameter.getStep();
// iDirRate = 1;
// }
// if (-fiFocusTarget.node.y - this._nodeTypeList.y < 0) {
// oScrollParameter = this._nodeTypeList.getComponent(TVScrollParameter);
// oScrollParameter.setHasRelation(true);
// oScrollParameter.setStep(-fiFocusTarget.node.y - fiFocusTarget.node.height / 2 - this._nodeTypeList.y);
// oScrollParameter.setTargetPosition(this._nodeTypeList.y + oScrollParameter.getStep());
// this._oSceneContext.typeListY = this._nodeTypeList.y + oScrollParameter.getStep();
// iDirRate = -1;
// }
// if (iDirRate) {
// if (this._nodeTypeList.y + iDirRate * (this._nodeTypeHeight + 5) >= (this._aTypeAppId.length - this.TYPE_LIST_CELL_SIZE) * (this._nodeTypeHeight + 5) - 5) {//减5没有多大的意思,因为.y是有误差的
// cc.find("TypeListArea/Down", this.node).opacity = 0;
// } else {
// cc.find("TypeListArea/Down", this.node).opacity = 255;
// }
// if (this._nodeTypeList.y + iDirRate * (this._nodeTypeHeight + 1) <= 5) {
// cc.find('TypeListArea/Up', this.node).opacity = 0;
// } else {
// cc.find('TypeListArea/Up', this.node).opacity = 255;
// }
// }
// }
// }
return [fiFocusTarget, oScrollParameter];
},
onBeforeFocusChange: function (event) {
this._super(event);
let fiFrom = event.detail.from;
let fiTo = event.detail.to;
// if (0 == fiFrom.node.getName().indexOf('CartoonListCell')) {
// fiFrom.node.getComponent(ListCell).setUIWithoutFocus();
// }
// if (0 == fiFrom.node.getName().indexOf('TypeListCell') && 0 == fiTo.node.getName().indexOf('TypeListCell')) {
// // fiFrom.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, fiFrom.node.width, fiFrom.node.height));
// var self = this;
// let iIndex = fiFrom.node.name.replace("TypeListCell", '');
// if (0 == fiTo.node.getName().indexOf('TypeListCell')) {
// if (this._oType[iIndex]) {
// let width = self._oType[iIndex].image[0].width;
// let height = self._oType[iIndex].image[0].height / 2;
// // Network.loadImageInNativeRuntime(
// // Common.TOPDRAW_IMAGE_SERVER + self._oType[iIndex].image[0].fileUrl,
// // function (texture) {
// // fiFrom.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, width, height));
// // }, null, this
// // );
// cc.loader.load(Common.TOPDRAW_IMAGE_SERVER + self._oType[iIndex].image[0].fileUrl, function (err, texture) {
// fiFrom.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, width, height));
// });
// }
// }
// }
if (0 == fiFrom.node.getName().indexOf('CollectionIcon')) {
// fiFrom.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 142, 54));
cc.loader.loadRes('button/collection_button', cc.Texture2D, function (err, texture) {
fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, 176, 64));
});
}
if (0 == fiFrom.node.getName().indexOf('EditorSprite')) { //我的收藏按钮
// fiTo.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 54, 142, 54));
if (0 == fiFrom.node.getName().indexOf('EditorIcon')) {
cc.loader.loadRes('button/editor_button', cc.Texture2D, function (err, texture) {
fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, 137, 64));
fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, 137, 65));
});
}
if (0 == fiFrom.node.getName().indexOf('IndexSprite')) { //我的收藏按钮
// fiTo.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 54, 142, 54));
if (0 == fiFrom.node.getName().indexOf('ClearIcon')) {
cc.loader.loadRes('button/clear_button', cc.Texture2D, function (err, texture) {
fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, 137, 65));
});
}
if (0 == fiFrom.node.getName().indexOf('BackEditorIcon')) {
cc.loader.loadRes('button/exitEditor_button', cc.Texture2D, function (err, texture) {
fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, 137, 65));
});
}
if (0 == fiFrom.node.getName().indexOf('IndexIcon')) {
cc.loader.loadRes('button/index_button', cc.Texture2D, function (err, texture) {
fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, 137, 64));
fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, 137, 65));
});
}
// if (0 == fiFrom.node.getName().indexOf('OtherListCell')) {
// fiFrom.node.getChildByName("CollectionBg").opacity = 0;
// fiFrom.node.getComponent(ListCell).setUIWithoutFocus();
// }
// if (0 == fiFrom.node.getName().indexOf('CollectionBg')) { //TODO:解决收藏框框跳转某些不隐藏情况
// fiFrom.node.opacity = 0;
// // fiFrom.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 53, 171));
// cc.loader.loadRes('texture/ui/collect_bg', cc.Texture2D, function (err, texture) {
// fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, 53, 171));
// });
// }
},
onAfterFocusChange: function (event) {
this._super(event);
let fiTo = event.detail.to;
let fiFrom = event.detail.from;
// if (0 == fiTo.node.getName().indexOf('CartoonListCell')) {
// fiTo.node.getComponent(ListCell).setUIWithFocus();
// }
// if (0 == fiTo.node.getName().indexOf('TypeListCell')) {
// let iIndex = fiTo.node.name.replace("TypeListCell", '');
// this._oSceneContext._iCurrentTypeIndex = iIndex;
// // fiTo.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height));
// var self = this;
// if (this._oType[this._oSceneContext._iCurrentTypeIndex]) {
// let width = self._oType[iIndex].image[0].width;
// let height = self._oType[iIndex].image[0].height / 2;
// // Network.loadImageInNativeRuntime(
// // Common.TOPDRAW_IMAGE_SERVER + self._oType[iIndex].image[0].fileUrl,
// // function (texture) {
// // fiTo.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, height, width, height));
// // }, null, this
// // );
// cc.loader.load(Common.TOPDRAW_IMAGE_SERVER + self._oType[iIndex].image[0].fileUrl, function (err, texture) {
// fiTo.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, height, width, height));
// });
// }
// if (0 == fiFrom.node.getName().indexOf('TypeListCell')) { //正常状态返回回去不需要刷新
// this.scheduleOnce(this.getCollectionId, 0.3);
// this._bIsCategoryListDataInit = false; //初始它
// }
// }
if (0 == fiTo.node.getName().indexOf('CollectionIcon')) { //我的收藏按钮
// fiTo.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 54, 142, 54));
if (0 == fiTo.node.getName().indexOf('CollectionIcon')) {
cc.loader.loadRes('button/collection_button', cc.Texture2D, function (err, texture) {
fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 64, 176, 64));
});
}
if (0 == fiTo.node.getName().indexOf('EditorSprite')) { //我的收藏按钮
// fiTo.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 54, 142, 54));
if (0 == fiTo.node.getName().indexOf('EditorIcon')) {
cc.loader.loadRes('button/editor_button', cc.Texture2D, function (err, texture) {
fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 64, 137, 64));
fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 65, 137, 65));
});
}
if (0 == fiTo.node.getName().indexOf('IndexSprite')) { //我的收藏按钮
// fiTo.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 54, 142, 54));
if (0 == fiTo.node.getName().indexOf('ClearIcon')) {
cc.loader.loadRes('button/clear_button', cc.Texture2D, function (err, texture) {
fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 65, 137, 65));
});
}
if (0 == fiTo.node.getName().indexOf('BackEditorIcon')) {
cc.loader.loadRes('button/exitEditor_button', cc.Texture2D, function (err, texture) {
fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 65, 137, 65));
});
}
if (0 == fiTo.node.getName().indexOf('IndexIcon')) {
cc.loader.loadRes('button/index_button', cc.Texture2D, function (err, texture) {
fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 64, 137, 64));
fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 65, 137, 65));
});
}
// if (0 == fiTo.node.getName().indexOf('OtherListCell')) { //显示收藏框框
// fiTo.node.getChildByName("CollectionBg").opacity = 255;
// fiTo.node.getComponent(ListCell).setUIWithFocus();
// }
// if (0 == fiTo.node.getName().indexOf('CollectionBg')) {
// fiTo.node.opacity = 255;
// cc.loader.loadRes("texture/ui/collect_bg", cc.Texture2D, function (err, texture) {
// var spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 171, 53, 171));
// fiTo.node.getComponent(cc.Sprite).spriteFrame = spriteFrame;
// });
// }
},
doCurrentFocusTVLinkAction: function (strAction) {
......@@ -977,17 +585,7 @@ cc.Class({
}
},
onListScrollStart: function () {
this._bIsSongListMoving = true;
cc.log("scroll start");
},
onListScrollEnd: function () {
this._bIsSongListMoving = false;
cc.log("scroll completed");
},
onDestroy: function () {
cc.director.emit('stop_render'); //分发事件
},
});
......
//观看历史
//这里跳转地址是由返回数据指定,暂未实现
//这里获取CategoryList数据的接口有问题
//正常接口不管limit字段多少返回的count都是总数据量,这里只返回了limit的数量,导致CategoryList刷新出错!!!
var Common = require('Common');
var Network = require('Network');
var TVFocus = require('TVFocus');
var FocusInfo = require('FocusInfo');
var TVCanvas = require('TVCanvas');
var TVScrollParameter = require('TVScrollParameter');
var ListView = require('ListView');
var ListCell = require('ListCell');
var Utils = require('Utils');
var BusinessParameter = require('BusinessParameter');
cc.Class({
extends: TVCanvas,
properties: {
spriteScrollBarBlock: cc.Sprite,
spriteScrollBarUp: cc.Sprite,
spriteScrollBarDown: cc.Sprite,
_bPfbTypeCellInit: false,
_aTypeAppId: [],
_aTypeUrl: [],
_aNavList: [],
_nodeTypeHeight: 0,
TYPE_LIST_CELL_SIZE: 4,
_strAppId: '', //为了跳播放
_strDirURL: '',
_oDestURL: null,
_strIndexURL: '',
_strIconSrc: '',
_iCollectionId: 0,//默认收藏夹的id
_aEpisodeIndex: [],//剧集index集合
_strPageIds: '', //页面内mediaId
_bIsContentWStatus: true,//海报图状态,true为横图,false为竖图
_bIsCategoryListDataInit: false,
// _iCurrentTypeIndex: 0,
_strIds: '',
_oType: null,
_aCategoryMediaId: [],
_aCategoryAlreadyMediaId: [],
_bBackStatus: false,
// PFB_TYPE: {
// default: null,
// type: cc.Prefab,
// },
},
onLoad: function () {
this._super();
this._iShowCellRows = 3;
this._iAlphaCellRows = 0;
this._iHiddenCellRows = 3;
this._iCellCountEachRow = 2;
this._iBeginPositionX = -200;
this._iBeginPositionY = 210;
this._fCellMarginTop = 20;
this._fCellMarginRight = 15;
this._fCellMarginBottom = 10;
this._fCellMarginLeft = 0;
//-----------上下文及参数相关处理------------
let oSceneParameter = this._cApplication.getTopSceneParameter();
if (oSceneParameter) {
this._strAppId = oSceneParameter.appId;//应用id
}
//恢复上下文
if (this._cApplication.getBackStatus()) {
this._oSceneContext = this._cApplication.popSceneContext();
this._cApplication.setBackStatus(false);
this._bBackStatus = true;
} else {
this._oSceneContext = {};
this._oSceneContext.requestedTypeId = null;
this._oSceneContext._iCurrentTypeIndex = 0;
this._oSceneContext.categoryRecordIndexOfFirstCell = 0;
this._oSceneContext.focusPath = "CollectionIcon";
this._oSceneContext.typeListY = 0;
// this._oSceneContext.elderTypeId = oSceneParameter.elderTypeId || 37; //从上级拿过来的二级父Id
}
this._strAppId = this._strAppId || "tda7e47f868313d9f5"; //测试
//---------上下文及参数相关处理结束-----------
// //右分类框框
this._nodeCategoryList = cc.find("CategoryList", this.node);
// cc.find("HistoryIcon", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 54, 142, 54));
cc.find("CollectionIcon", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 176, 64));
cc.find("EditorSprite", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 137, 64));
cc.find("IndexSprite", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 137, 64));
this.getPageBg(this, 'background');
// this.addHomeIcon(this);
// this.getTypeList(); //暂时不要Type
this.getListBookmark(); //直接请求
this.checkDataReadyAndInitFocus(); //初始化焦点放到这里
},
/**
* 拿到列表需要的ids
*/
getListBookmark: function () {
let oTypeRequestParameters = {
"view": "json",
// "appId": this._aTypeAppId[this._oSceneContext._iCurrentTypeIndex],
"sortByCollection": 1,
"start": 0,
"limit": 9,
"sortField": "update_time",
"sortDirection": "desc",
"token": Common.TEST_API_TOKEN_EDU,
};
Network.ajax('GET', Common.TOPDRAW_API_SERVER_EDU + "User/ListBookmark", null, oTypeRequestParameters,
function (strResponse) {
try {
var oJSONResult = JSON.parse(strResponse);
if (oJSONResult.businessCode == 'success') {
this._strIds = ""; //初始化
if (oJSONResult.resultSet.length > 0) {
cc.find('BlankIcon', this.node).opacity = 0;
for (let i = 0; i < oJSONResult.resultSet.length; i++) {
if (oJSONResult.resultSet[i].media_id) {
this._strIds = this._strIds + "," + oJSONResult.resultSet[i].media_id;
}
}
// this.getCategoryList();
}
this.getCategoryList();
// else {
// cc.find('BlankIcon', this.node).opacity = 255;
// let lvCategoryList = this._nodeCategoryList.getComponent(ListView);
// lvCategoryList.renderInitData(strResponse); //将ListView数据置空
// this._oSceneContext.focusPath = "app";
// }
cc.log("Success GET ListBookmark...");
} else {
cc.log("Error GET ListBookmark..." + oJSONResult.description);
}
} catch (error) {
cc.log("Exception GET ListBookmark..." + error);
}
},
function (strResponse) {
cc.log("Communication Error : Get ListBookmark Information..." + strResponse + "\r\n");
}, this, "uuid"
);
},
getCategoryList: function () {
//把之前的东西删掉
let nodeCategoryList = this.node.getChildByName('CategoryList');
// nodeCategoryList.getChildByName('DataContainerMask').getChildByName('DataContainer').removeAllChildren();
nodeCategoryList.getChildByName('DataContainerMask').getChildByName('DataContainer').destroyAllChildren();
this._strSongListCellComponentName = "HistoryOtherListCell";
this._iBeginPositionX = -450;
this._iBeginPositionY = 250;
this._iShowCellRows = 2;
this._iAlphaCellRows = 1;
this._iHiddenCellRows = 2;
this._iCellCountEachRow = 4;
this._fCellMarginTop = 0;
this._fCellMarginRight = 20;
this._fCellMarginBottom = 60;
this._fCellMarginLeft = 0;
// break;
// }
//重新开始
let lvCategoryList = nodeCategoryList.getComponent(ListView);
if (!lvCategoryList) {
lvCategoryList = nodeCategoryList.addComponent(ListView);
}
var ids = this._strIds.substring(1, this._strIds.length);
lvCategoryList.init(this, this._iShowCellRows, this._iAlphaCellRows, this._iHiddenCellRows, this._iCellCountEachRow, this._strSongListCellComponentName,
this._iBeginPositionX, this._iBeginPositionY,//起始位置
this._fCellMarginTop, this._fCellMarginRight, this._fCellMarginBottom, this._fCellMarginLeft,
1, 1, //0-横向 1-纵向
function () {
//请求列表
let oMediaParas = {};
oMediaParas.ids = ids;
// oMediaParas.appId = strAppId;
oMediaParas.sortField = "update_time";
oMediaParas.sortDirection = "desc";
let iStart1 = 0;
if (null != this._oSceneContext.categoryRecordIndexOfFirstCell) {
iStart1 = this._oSceneContext.categoryRecordIndexOfFirstCell;
}
//函数默认取一页数据,但是第一次显示需要加上Alpha的部分
lvCategoryList.setDataSource(
"GET",
Common.TOPDRAW_API_SERVER_EDU + "Media/List",
oMediaParas,
iStart1, (lvCategoryList.getShowCellRows() + lvCategoryList.getAlphaCellRows()) * lvCategoryList.getCellCountEachRow(),
null, null
);
lvCategoryList.loadData(
function (strResponse) {
lvCategoryList.renderInitData(strResponse, function () {
var oJSONResult = JSON.parse(strResponse);
if (oJSONResult.resultSet.length <= 0) { //没有数据就显示占位图
cc.find('BlankIcon', this.node).opacity = 255
} else {
cc.find('BlankIcon', this.node).opacity = 0
}
// this.lvCategoryList.renderInitData(strResponse);
this._bIsCategoryListDataInit = true;
this._oSceneContext.categoryRecordIndexOfFirstCell = lvCategoryList.getRecordIndexOfFirstCellInPage();
this.checkDataReadyAndInitFocus();
// for (var key in this._aFocusTargets[0]) {
// cc.log(key + "=====current focus========" + this._aFocusTargets[0][key].name + "==cc.isValid==" + cc.isValid(this._aFocusTargets[0][key]));
// }
});
},
null,
this
);
}
);
},
/**
* 添加收藏
*/
AddMedia2Collection: function () {
let nodeId = this._fiCurrentFocus.node.parent.getComponent(ListCell).id;
if (!nodeId || !this._iCollectionId) {
return;
}
let oCollectionRequestParameters = {
"view": "json",
"mediaId": nodeId,
"collectionId": this._iCollectionId,
"appId": this._strAppId,
"token": Common.TEST_API_TOKEN,
};
Network.ajax('GET', Common.TOPDRAW_API_SERVER + "User/AddMedia2Collection", null, oCollectionRequestParameters,
function (strResponse) {
try {
var oJSONResult = JSON.parse(strResponse);
if (oJSONResult.businessCode == 'success') {
cc.log("添加成功");
// this.getCategoryList(); //不能更新网络,焦点会错乱
this._aCategoryAlreadyMediaId.push(nodeId);
let nodeCollectionPic = cc.find("CollectionBg/CollectionPic", this._fiCurrentFocus.node.parent);
cc.loader.loadRes("texture/ui/collect_heart", cc.Texture2D, function (err, texture) {
var spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 28, 30, 28));
nodeCollectionPic.getComponent(cc.Sprite).spriteFrame = spriteFrame;
});
} else {
cc.log("Error GET AddMedia..." + oJSONResult.description);
}
} catch (error) {
cc.log("Exception GET AddMedia..." + error);
}
},
function (strResponse) {
cc.log("Communication Error : Get AddMedia Information..." + strResponse + "\r\n");
}, this, "uuid"
);
},
/**
* 移除收藏
*/
removeMedia2Collection: function () {
let nodeId = this._fiCurrentFocus.node.parent.getChildByName('Id').getComponent(cc.Label).string;
if (!nodeId || !this._iCollectionId) {
return;
}
let oCollectionRequestParameters = {
"view": "json",
"mediaId": nodeId,
"collectionId": this._iCollectionId,
"appId": this._strAppId,
"token": Common.TEST_API_TOKEN,
};
Network.ajax('GET', Common.TOPDRAW_API_SERVER + "User/RemoveMediaFromCollection", null, oCollectionRequestParameters,
function (strResponse) {
try {
var oJSONResult = JSON.parse(strResponse);
if (oJSONResult.businessCode == 'success') {
cc.log("移除成功");
// this.getCategoryList(); //不能更新网络,焦点会错乱
Utils.remove(this._aCategoryAlreadyMediaId, nodeId);
let nodeCollectionPic = cc.find("CollectionBg/CollectionPic", this._fiCurrentFocus.node.parent);
cc.loader.loadRes("texture/ui/collect_heart", cc.Texture2D, function (err, texture) {
var spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, 30, 28));
nodeCollectionPic.getComponent(cc.Sprite).spriteFrame = spriteFrame;
});
} else {
cc.log("Error GET removeMedia..." + oJSONResult.description);
}
} catch (error) {
cc.log("Exception GET removeMedia..." + error);
}
},
function (strResponse) {
cc.log("Communication Error : Get removeMedia Information..." + strResponse + "\r\n");
}, this, "uuid"
);
},
checkDataReadyAndInitFocus: function () {
if (!this._bIsFocusInit) {
this.initFocus();
this._bIsFocusInit = true;
}
},
initFocus: function () {
var self = this;
// //----------------Creator2.1.0-rc2版本有毒--------------------------
// //动态加载这几张引起黑屏的罪魁祸首
// cc.loader.loadRes("Texture/scroll/pageIncon", cc.SpriteFrame, function (err, spriteFrame) {
// self.spriteScrollBarBlock.spriteFrame = spriteFrame;
// });
// cc.loader.loadRes("Texture/scroll/up_arrow", cc.SpriteFrame, function (err, spriteFrame) {
// self.spriteScrollBarUp.spriteFrame = spriteFrame;
// });
// cc.loader.loadRes("Texture/scroll/down_arrow", cc.SpriteFrame, function (err, spriteFrame) {
// self.spriteScrollBarDown.spriteFrame = spriteFrame;
// });
// //-----------------------------------------------------------------
var nodeEditor = cc.find("EditorSprite", this.node); //管理
// cc.find("HistoryIcon", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 54, 142, 54));
var fiEditor = nodeEditor.addComponent(FocusInfo);
this._aFocusTargets[0]['to_editor_index'] = nodeEditor;
fiEditor.init(
null, true
);
var nodeIndex = cc.find("IndexSprite", this.node); //首页
// cc.find("HistoryIcon", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 54, 142, 54));
var fiIndex = nodeIndex.addComponent(FocusInfo);
this._aFocusTargets[0]['to_first_index'] = nodeIndex;
fiIndex.init(
null, true
);
var nodeCollection = cc.find("CollectionIcon", this.node); //我的收藏
// cc.find("CollectionIcon", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 142, 54));
var fiCollection = nodeCollection.addComponent(FocusInfo);
this._aFocusTargets[0]['to_collection_index'] = nodeCollection;
fiCollection.init(
'{"click": [{"action": "ChangeScene","parameters": {"sceneName":"sceneDiary","appId":"' + this._strAppId + '"}}]}', true
);
var nodeInitFocus = cc.find(this._oSceneContext.focusPath, this.node);
var nodeFocus = new cc.Node('nodeFocus');
this.node.addChild(nodeFocus, 10);
this._cFocus = this.node.getChildByName('nodeFocus').addComponent(TVFocus);
this._cFocus.init('focusContainer', this,
nodeInitFocus.getComponent(FocusInfo),
Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, 0, 0, 1.0);
if (0 == nodeInitFocus.getName().indexOf('CollectionIcon')) { //
nodeInitFocus.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 64, 176, 64));
}
if (this._bBackStatus && 0 == nodeInitFocus.getName().indexOf('OtherListCell')) { //显示收藏框框
nodeInitFocus.getChildByName("CollectionBg").opacity = 255;
nodeInitFocus.getComponent(ListCell).setUIWithFocus();
}
//处理焦点位于下方问题
if (this._oSceneContext.typeListY) {
this._nodeTypeList.y = this._oSceneContext.typeListY;
}
},
onKeyDown: function (event) {
this._super(event);
// cc.log("当前列表:" + this._fiCurrentFocus.node.getName());
var fiFocusTarget = null;
var fiCurrentFocus = this._fiCurrentFocus;
var oScrollParameter = null;
let aCheckResult;
//TODO:给ListView传值,使其可以让滑块跟随滚动
let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView);
if (event.keyCode == cc.macro.KEY.up || event.keyCode == Common.ANDROID_KEY.up) {
if (0 == this._fiCurrentFocus.node.getName().indexOf('OtherListCell')) {
var index = parseInt(this._fiCurrentFocus.node.getName().replace('OtherListCell', ''));
// let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView);
if (lvCategoryList.scrollARowUp(index)) {
return;
}
}
fiFocusTarget = this._cFocus.findTarget(fiCurrentFocus, this._aFocusTargets, 0, Common.MOVE_DIRECTION_UP);
if (!fiFocusTarget) { return; }
aCheckResult = this.checkFocusTarget(fiFocusTarget, oScrollParameter);
fiFocusTarget = aCheckResult[0];
oScrollParameter = aCheckResult[1];
this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_UP, null, oScrollParameter);
}
if (event.keyCode == cc.macro.KEY.right || event.keyCode == Common.ANDROID_KEY.right) {
fiFocusTarget = this._cFocus.findTarget(this._fiCurrentFocus, this._aFocusTargets, 0, Common.MOVE_DIRECTION_RIGHT);
if (!fiFocusTarget) { return; }
aCheckResult = this.checkFocusTarget(fiFocusTarget, oScrollParameter);
fiFocusTarget = aCheckResult[0];
oScrollParameter = aCheckResult[1];
this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_RIGHT, null, oScrollParameter);
}
if (event.keyCode == cc.macro.KEY.down || event.keyCode == Common.ANDROID_KEY.down) {
// if (!this._iScrollGroupStatus) {
if (this._bIsCategoryItemMoving || this._bIsSongListMoving) {
return;
}
if (0 == this._fiCurrentFocus.node.getName().indexOf('OtherListCell')) {
var index = parseInt(this._fiCurrentFocus.node.getName().replace('OtherListCell', ''));
// let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView);
if (lvCategoryList.scrollARowDown(null, index)) {
// cc.log("line feed!");
return;
}
}
fiFocusTarget = this._cFocus.findTarget(this._fiCurrentFocus, this._aFocusTargets, 0, Common.MOVE_DIRECTION_DOWN);
if (!fiFocusTarget) { return; }
aCheckResult = this.checkFocusTarget(fiFocusTarget, oScrollParameter);
fiFocusTarget = aCheckResult[0];
oScrollParameter = aCheckResult[1];
this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_DOWN, null, oScrollParameter);
// }
}
if (event.keyCode == cc.macro.KEY.left || event.keyCode == Common.ANDROID_KEY.left) {
fiFocusTarget = this._cFocus.findTarget(this._fiCurrentFocus, this._aFocusTargets, 0, Common.MOVE_DIRECTION_LEFT);
if (!fiFocusTarget) { return; }
aCheckResult = this.checkFocusTarget(fiFocusTarget, oScrollParameter);
fiFocusTarget = aCheckResult[0];
oScrollParameter = aCheckResult[1];
this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_LEFT, null, oScrollParameter);
}
if (event.keyCode == cc.macro.KEY.enter || event.keyCode == Common.ANDROID_KEY.enter) {
if (0 == this._fiCurrentFocus.node.name.indexOf("CollectionBg")) { //收藏OR取消收藏
let nodeId = this._fiCurrentFocus.node.parent.getComponent(ListCell).id;
//数组转成字符串才能判断是否包含某串值(存在返回位置,不存在则返回-1)
-1 != this._aCategoryAlreadyMediaId.toString().indexOf(nodeId) ? this.removeMedia2Collection() : this.AddMedia2Collection();
return;
}
this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK);
}
if (event.keyCode == cc.macro.KEY.space) {
// this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK);
}
if (event.keyCode == cc.macro.KEY.backspace || event.keyCode == Common.ANDROID_KEY.back) {
this.backAScene();
}
//记录CategoryList滚动位置
this._oSceneContext.categoryRecordIndexOfFirstCell = lvCategoryList.getRecordIndexOfFirstCellInPage();
},
checkFocusTarget: function (fiFocusTarget, oScrollParameter) {
return [fiFocusTarget, oScrollParameter];
},
onBeforeFocusChange: function (event) {
this._super(event);
let fiFrom = event.detail.from;
let fiTo = event.detail.to;
if (0 == fiFrom.node.getName().indexOf('CollectionIcon')) {
// fiFrom.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 142, 54));
cc.loader.loadRes('button/collection_button', cc.Texture2D, function (err, texture) {
fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, 176, 64));
});
}
if (0 == fiFrom.node.getName().indexOf('EditorSprite')) { //我的收藏按钮
// fiTo.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 54, 142, 54));
cc.loader.loadRes('button/editor_button', cc.Texture2D, function (err, texture) {
fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, 137, 64));
});
}
if (0 == fiFrom.node.getName().indexOf('IndexSprite')) { //我的收藏按钮
// fiTo.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 54, 142, 54));
cc.loader.loadRes('button/index_button', cc.Texture2D, function (err, texture) {
fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, 137, 64));
});
}
},
onAfterFocusChange: function (event) {
this._super(event);
let fiTo = event.detail.to;
let fiFrom = event.detail.from;
if (0 == fiTo.node.getName().indexOf('CollectionIcon')) { //我的收藏按钮
// fiTo.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 54, 142, 54));
cc.loader.loadRes('button/collection_button', cc.Texture2D, function (err, texture) {
fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 64, 176, 64));
});
}
if (0 == fiTo.node.getName().indexOf('EditorSprite')) { //我的收藏按钮
// fiTo.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 54, 142, 54));
cc.loader.loadRes('button/editor_button', cc.Texture2D, function (err, texture) {
fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 64, 137, 64));
});
}
if (0 == fiTo.node.getName().indexOf('IndexSprite')) { //我的收藏按钮
// fiTo.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 54, 142, 54));
cc.loader.loadRes('button/index_button', cc.Texture2D, function (err, texture) {
fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 64, 137, 64));
});
}
},
doCurrentFocusTVLinkAction: function (strAction) {
let strTVLink = this._fiCurrentFocus.getTVLink();
var joTVLink = null;
try {
joTVLink = JSON.parse(strTVLink);
let jaOperationList = joTVLink.click;
for (let i = 0; i < jaOperationList.length; i++) {
switch (jaOperationList[i].action) {
default:
this.doTVLinkAction(jaOperationList[i]);
break;
}
}
} catch (error) {
cc.log("runTVLinkAction Exception..." + error);
}
},
onListScrollStart: function () {
this._bIsSongListMoving = true;
cc.log("scroll start");
},
onListScrollEnd: function () {
this._bIsSongListMoving = false;
cc.log("scroll completed");
},
onDestroy: function () {
cc.director.emit('stop_render'); //分发事件
},
});
{
"ver": "1.0.5",
"uuid": "2d3cc4e7-dfc9-48e9-bfdf-2912b6a42eed",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
......@@ -683,7 +683,8 @@ cc.Class({
this._aFocusTargets[0]['btn_collect'] = cc.find('IntroductionArea/BtnPicCollect', this.node);
let fiHomeBtn = cc.find('HomeBtn', this.node).addComponent(FocusInfo); //
fiHomeBtn.init('', true, null, null, 1.0);
// fiHomeBtn.init('', true, null, null, 1.0);
fiHomeBtn.init('{"click": [{"action": "ChangeScene","parameters": {"sceneName":"sceneRecommend"}}]}', true);
this._aFocusTargets[0]['btn_home'] = cc.find('HomeBtn', this.node);
var nodeInitFocus = cc.find('PlayBg/VideoView', this.node);
......@@ -795,10 +796,11 @@ cc.Class({
} else if (this._bScore && 0 == this._fiCurrentFocus.node.name.indexOf('Score')) { //已经是加入课堂了
// this.submitScore();
return;
}else if(0 == this._fiCurrentFocus.node.name.indexOf('HomeBtn')){
cc.log("返回首页");
return;
}
// else if(0 == this._fiCurrentFocus.node.name.indexOf('HomeBtn')){
// cc.log("返回首页");
// return;
// }
this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK);
break;
case cc.macro.KEY.backspace:
......
......@@ -281,7 +281,8 @@ cc.Class({
);
if (currentNode.getComponent(FocusInfo)) {
let fiBlock = currentNode.getComponent(FocusInfo); //弄tvlink
fiBlock.setTVLink(currentRemote.tvlink);
// fiBlock.setTVLink(currentRemote.tvlink);
fiBlock.setTVLink('{"click":[{"action":"ChangeScene","parameters":{"sceneName":"sceneCategory"}}]}');
}
} else if (currentNode.name == "hasChildFrame" && currentNode.childrenCount > 0) { //渲染自动布局的节点
for (let k = 0; k < currentNode.childrenCount; k++) {
......@@ -295,7 +296,8 @@ cc.Class({
);
if (sonCurrentNode.getComponent(FocusInfo)) {
let fiBlock = sonCurrentNode.getComponent(FocusInfo); //弄tvlink
fiBlock.setTVLink(currentRemote.tvlink);
// fiBlock.setTVLink(currentRemote.tvlink);
fiBlock.setTVLink('{"click":[{"action":"ChangeScene","parameters":{"sceneName":"sceneCategory"}}]}');
}
}
}
......
......@@ -76,12 +76,12 @@ cc.Class({
"name": "Addition",//模块名称
"resultSet": [
{
"name": "我的",
"name": "收藏",
"left": 822,
"top": 19,
"width": 137,
"height": 65,
"tvlink": '{"click": [{"action": "changeUI","parameters": {"uiName": "collection"}}]}',
"tvlink": '{"click":[{"action":"ChangeScene","parameters":{"sceneName":"sceneDiary"}}]}',
"type" : "promotion_item",
"imageURL": "image/addition/my.png"
},
......@@ -91,7 +91,7 @@ cc.Class({
"top": 19,
"width": 137,
"height": 65,
"tvlink": '{"click": [{"action": "changeUI","parameters": {"uiName": "history"}}]}',
"tvlink": '{"click":[{"action":"ChangeScene","parameters":{"sceneName":"sceneHistory"}}]}',
"type" : "promotion_item",
"imageURL": "image/addition/history.png"
},
......@@ -101,7 +101,7 @@ cc.Class({
"top": 19,
"width": 137,
"height": 65,
"tvlink": '{"click": [{"action": "changeUI","parameters": {"uiName": "search"}}]}',
"tvlink": '{"click":[{"action":"ChangeScene","parameters":{"sceneName":"sceneSearch"}}]}',
"type" : "promotion_item",
"imageURL": "image/addition/search.png"
}
......
......@@ -55,7 +55,9 @@ cc.Class({
);
}
this.node.getComponent(FocusInfo).setTVLink(oData.tvlink);
// this.node.getComponent(FocusInfo).setTVLink(oData.tvlink);
this.node.getComponent(FocusInfo)
.setTVLink('{"click": [{"action": "ChangeScene","parameters": {"sceneName":"sceneProgram","id":"' + oData.id + '"}}]}');
},
enableFocusInfo: function () {
......
......@@ -59,7 +59,8 @@ cc.Class({
);
}
this.node.getComponent(FocusInfo).setTVLink(oData.tvlink);
// this.node.getComponent(FocusInfo).setTVLink(oData.tvlink);
this.node.getComponent(FocusInfo).setTVLink('{"click": [{"action": "ChangeScene","parameters": {"sceneName":"sceneProgram","id":"' + oData.id + '"}}]}');
},
enableFocusInfo: function () {
......
{
"ver": "2.3.1",
"uuid": "45eb9209-7e5f-4879-928c-d322d78d8c0d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"collection404": {
"ver": "1.0.4",
"uuid": "1c7a33d8-7cec-4bbc-8e8c-90b17a6de4f9",
"rawTextureUuid": "45eb9209-7e5f-4879-928c-d322d78d8c0d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -57.5,
"trimX": 58,
"trimY": 156,
"width": 1164,
"height": 523,
"rawWidth": 1280,
"rawHeight": 720,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"android-instant": {
"REMOTE_SERVER_ROOT": "",
"host": "",
"pathPattern": "",
"recordPath": "",
"scheme": "https",
"skipRecord": false
},
"appBundle": false,
"baidugame": {
"REMOTE_SERVER_ROOT": "",
"appid": "testappid",
"orientation": "portrait",
"subContext": ""
},
"encryptJs": true,
"excludeScenes": [],
"fb-instant-games": {},
"includeSDKBox": false,
"inlineSpriteFrames": true,
"inlineSpriteFrames_native": true,
"md5Cache": false,
"mergeStartScene": false,
"optimizeHotUpdate": false,
"orientation": {
"landscapeLeft": true,
"landscapeRight": true,
......@@ -7,7 +30,21 @@
"upsideDown": false
},
"packageName": "org.cocos2d.helloworld",
"qqplay": {
"REMOTE_SERVER_ROOT": "",
"orientation": "portrait",
"zip": false
},
"startScene": "2d2f792f-a40c-49bb-a189-ed176a246e49",
"title": "hello_world",
"webOrientation": "auto"
"title": "fuse_apk",
"webOrientation": "auto",
"wechatgame": {
"REMOTE_SERVER_ROOT": "",
"appid": "wx6ac3f5090a6b99c5",
"orientation": "portrait",
"separate_engine": false,
"subContext": ""
},
"xxteaKey": "0b7cbd8b-f258-42",
"zipCompressJs": true
}
\ No newline at end of file
......
{
"assets-sort-type": "name",
"collision-matrix": [
[
true
]
],
"excluded-modules": [],
"group-list": [
"default"
],
"start-scene": "current",
"design-resolution-width": 960,
"design-resolution-height": 640,
"fit-width": false,
"fit-height": true,
"use-project-simulator-setting": false,
"simulator-orientation": false,
"use-customize-simulator": false,
"simulator-resolution": {
"width": 960,
"height": 640
},
"last-module-event-record-time": 0,
"assets-sort-type": "name",
"design-resolution-width": 960,
"excluded-modules": [],
"facebook": {
"enable": false,
"appID": "",
"live": {
"audience": {
"enable": false
},
"audience": {
"enable": false,
"live": {
"enable": false
}
}
},
"fit-height": true,
"fit-width": false,
"group-list": [
"default"
],
"last-module-event-record-time": 1567662056700,
"simulator-orientation": false,
"simulator-resolution": {
"height": 640,
"width": 960
},
"start-scene": "current",
"use-customize-simulator": false,
"use-project-simulator-setting": false
}
\ No newline at end of file
......
......@@ -16,45 +16,30 @@
"iOS",
"HTML5"
],
"package_download_url": "http://download.cocos.com/CocosServices/plugins/service-analytics/1.2.0_2.1.0.zip",
"package_version_desc": "1、优化SDK,修复H5-SDK 与多个小游戏平台适配问题,删除和优化init事件无用接口<br>2、 如有相关问题咨询或者需求, 可以联系我们技术支持邮箱 <a href=' '>support-cocos@cocos.com</a>",
"package_download_url": "https://download.cocos.com/CocosServices/plugins/service-analytics/1.2.0_2.1.0.zip",
"package_version_desc": "<b>更新日期:</b>2019/6/10<br>\n<br><b>更新说明:</b><br>\n1、优化SDK,修复H5-SDK 与多个小游戏平台适配问题,删除和优化init事件无用接口<br>\n2、如有相关问题咨询或者需求, 可以联系我们技术支持邮箱 <a href=' '>support-cocos@cocos.com</a>",
"service_component_name": "service-analytics",
"package_versions": [
"1.0.0_1.0.5",
"1.1.2_2.0.0",
"1.1.3_2.0.1",
"1.1.4_2.0.1",
"1.1.5_2.0.1",
"1.1.6_2.0.1_2.0.2",
"1.2.1_2.1.0",
"1.2.0_2.1.0",
"1.1.7_2.0.3",
"1.1.8_2.0.4",
"1.1.9_2.1.0",
"1.2.0_2.1.0"
],
"build_platform": [
"web-mobile",
"web-desktop",
"wechatgame",
"android",
"ios",
"fb-instant-games",
"android-instant",
"baidugame",
"quickgame",
"qgame",
"qqplay",
"huawei"
"1.1.6_2.0.1_2.0.2",
"1.1.5_2.0.1",
"1.1.4_2.0.1",
"1.1.3_2.0.1",
"1.1.2_2.0.0",
"1.0.0_1.0.5"
],
"build_platform": [],
"require_verify": 0,
"service_price": "",
"packpage_version_desc": "",
"service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见<a href='http://auth.cocos.com/CocosServiceAgreement.html'>《Cocos用户服务协议》</a>和<a href='http://auth.cocos.com/PrivacyPolicy.html'>《Cocos隐私政策》</a>"
},
{
"service_id": "241",
"service_name": "Matchvs",
"service_icon": "https://account.cocos.com/client/14406719a07eb3d714d36e5edc6e06fa.png",
"service_desc": "通过SDK接入快速实现联网功能、帧同步、国内外多节点、服务器独立部署、gameServer自定义游戏服务端逻辑。\n技术支持群QQ群:822523258",
"service_desc": "通过SDK接入快速实现联网功能、帧同步、国内外多节点、服务器独立部署、gameServer自定义游戏服务端逻辑。",
"service_title": "专业成熟的移动游戏联网与服务端解决方案",
"service_guide_url": "http://doc.matchvs.com/QuickStart/QuickStart-CocosCreator",
"service_sample_url": "http://www.matchvs.com/serviceCourse",
......@@ -66,41 +51,26 @@
"iOS",
"HTML5"
],
"package_download_url": "http://download.cocos.com/CocosServices/plugins/service-matchvs/1.0.9_3.7.9.9.zip",
"package_version_desc": "更新日期:2019-07-18<br>更新内容:<br>1、修复多节点登录返回值错误<br>2、修复FaceBook平台受限安全策略的问题",
"package_download_url": "https://download.cocos.com/CocosServices/plugins/service-matchvs/1.0.9_3.7.9.9.zip",
"package_version_desc": "<p><strong>更新日期:</strong> 2019/07/18\n<strong>更新内容:</strong>\n1、修复多节点登录返回值错误\n2、修复FaceBook平台受限安全策略的问题</p>",
"service_component_name": "service-matchvs",
"package_versions": [
"1.0.3_3.7.6.4",
"1.0.5_3.7.7.3",
"1.0.6_3.7.9.2",
"1.0.9_3.7.9.9",
"1.0.7_3.7.9.6",
"1.0.9_3.7.9.9"
],
"build_platform": [
"web-mobile",
"web-desktop",
"fb-instant-games",
"wechatgame",
"wechatgame-subcontext",
"qqplay",
"android",
"android-instant",
"ios",
"mac",
"quickgame",
"qgame",
"huawei"
"1.0.6_3.7.9.2",
"1.0.5_3.7.7.3",
"1.0.3_3.7.6.4"
],
"build_platform": [],
"require_verify": 0,
"service_price": "该服务按使用量计费,<a href='https://www.matchvs.com/price'><font color='#dddddd'>计费规则</font></a>,所产生的费用将由第三方从您的 <a href='https://account.cocos.com/#/finance/finance_list'><font color='#dddddd'>Cocos 账户余额</font></a> 中扣除。",
"packpage_version_desc": "",
"service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见<a href='http://auth.cocos.com/CocosServiceAgreement.html'>《Cocos用户服务协议》</a>和<a href='http://auth.cocos.com/PrivacyPolicy.html'>《Cocos隐私政策》</a>"
},
{
"service_id": "242",
"service_name": "Agora Voice",
"service_icon": "https://account.cocos.com/uploads/client_icon/2019-07-16/273952d155b4cdb72d2b1bc61de91ade.png",
"service_desc": "稳定、低耗、76ms超低延时、全球200+数据中心覆盖;变声器、超高音质、听声辩位等丰富玩法极速接入;全平台支持:Android、iOS、Web。\n技术支持群QQ群:799099183\n",
"service_desc": "稳定、低耗、76ms超低延时、全球200+数据中心覆盖;变声器、超高音质、听声辩位等丰富玩法极速接入;全平台支持:Android、iOS、Web。",
"service_title": "游戏内置实时语音",
"service_guide_url": "https://docs.agora.io/cn/Interactive Gaming/game_c?platform=Cocos Creator",
"service_sample_url": "https://github.com/AgoraIO/Voice-Call-for-Mobile-Gaming/tree/master/Basic-Voice-Call-for-Gaming/Hello-CocosCreator-Voice-Agora",
......@@ -112,22 +82,16 @@
"iOS",
"HTML5"
],
"package_download_url": "http://download.cocos.com/CocosServices/plugins/service-agora/1.0.2_2.2.3.20_2.5.2.zip",
"package_version_desc": "解决Bug:onAudioVolumeIndication 回调收不到.",
"package_download_url": "https://download.cocos.com/CocosServices/plugins/service-agora/1.0.2_2.2.3.20_2.5.2.zip",
"package_version_desc": "<b>更新日期:<b>2019/06/27<br>\n<br><b>更新内容:</b><br>\n1、修复部分BUG<br>\n2、代码优化",
"service_component_name": "service-agora",
"package_versions": [
"1.0.1_2.2.3.20_2.5.2",
"1.0.2_2.2.3.20_2.5.2"
],
"build_platform": [
"web-mobile",
"web-desktop",
"android",
"ios"
"1.0.2_2.2.3.20_2.5.2",
"1.0.1_2.2.3.20_2.5.2"
],
"build_platform": [],
"require_verify": 1,
"service_price": "该服务按使用量计费,<a href='https://docs.agora.io/cn/Agora Platform/billing_faq?platform=All Platforms'><font color='#dddddd'>计费规则</font></a>,所产生的费用将由第三方从您的 <a href='https://account.cocos.com/#/finance/finance_list'><font color='#dddddd'>Cocos 账户余额</font></a> 中扣除。",
"packpage_version_desc": "",
"service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见<a href='http://auth.cocos.com/CocosServiceAgreement.html'>《Cocos用户服务协议》</a>和<a href='http://auth.cocos.com/PrivacyPolicy.html'>《Cocos隐私政策》</a>"
}
],
......