Commit 31fc8e35 31fc8e35e144fb6e411b78bb7125df9955ce5089 by 金学艇

1.修改了视频详情页

1 parent 12218b03
......@@ -57,7 +57,7 @@
"_is3DNode": true,
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": false,
"autoReleaseAssets": true,
"_id": "704d4ab7-0300-44ac-9b6e-ba3076e019c9"
},
{
......@@ -96,28 +96,28 @@
"__id__": 35
},
{
"__id__": 40
"__id__": 41
},
{
"__id__": 54
"__id__": 55
},
{
"__id__": 62
"__id__": 63
},
{
"__id__": 68
"__id__": 69
},
{
"__id__": 57
"__id__": 58
}
],
"_active": true,
"_components": [
{
"__id__": 77
"__id__": 78
},
{
"__id__": 78
"__id__": 79
}
],
"_prefab": null,
......@@ -207,7 +207,7 @@
"array": [
0,
0,
265.0037841796875,
247.68325805664062,
0,
0,
0,
......@@ -1542,7 +1542,7 @@
"_active": true,
"_components": [
{
"__id__": 39
"__id__": 40
}
],
"_prefab": null,
......@@ -1620,7 +1620,7 @@
"_active": true,
"_components": [
{
"__id__": 38
"__id__": 39
}
],
"_prefab": null,
......@@ -1634,7 +1634,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1236,
"width": 1216,
"height": 180
},
"_anchorPoint": {
......@@ -1658,7 +1658,7 @@
"__type__": "TypedArray",
"ctor": "Float32Array",
"array": [
-628,
-608,
0,
0,
0,
......@@ -1692,7 +1692,11 @@
},
"_children": [],
"_active": true,
"_components": [],
"_components": [
{
"__id__": 38
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -1704,7 +1708,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1176,
"width": 1216,
"height": 0
},
"_anchorPoint": {
......@@ -1728,7 +1732,7 @@
"__type__": "TypedArray",
"ctor": "Float32Array",
"array": [
20,
0,
0,
0,
0,
......@@ -1754,6 +1758,39 @@
"_id": "f5Z3KDl6xH3L5s0OCNIyOO"
},
{
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 37
},
"_enabled": true,
"_layoutSize": {
"__type__": "cc.Size",
"width": 1216,
"height": 0
},
"_resize": 1,
"_N$layoutType": 1,
"_N$padding": 0,
"_N$cellSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_N$startAxis": 0,
"_N$paddingLeft": 0,
"_N$paddingRight": 0,
"_N$paddingTop": 0,
"_N$paddingBottom": 0,
"_N$spacingX": 0,
"_N$spacingY": 0,
"_N$verticalDirection": 1,
"_N$horizontalDirection": 0,
"_N$affectedByScale": false,
"_id": "58UJyIFoBCB7aBzEf896AG"
},
{
"__type__": "cc.Mask",
"_name": "",
"_objFlags": 0,
......@@ -1811,22 +1848,22 @@
},
"_children": [
{
"__id__": 41
"__id__": 42
},
{
"__id__": 44
"__id__": 45
},
{
"__id__": 47
"__id__": 48
},
{
"__id__": 50
"__id__": 51
}
],
"_active": false,
"_components": [
{
"__id__": 53
"__id__": 54
}
],
"_prefab": null,
......@@ -1882,16 +1919,16 @@
"_name": "New Sprite(Splash)",
"_objFlags": 0,
"_parent": {
"__id__": 40
"__id__": 41
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 42
"__id__": 43
},
{
"__id__": 43
"__id__": 44
}
],
"_prefab": null,
......@@ -1947,7 +1984,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 41
"__id__": 42
},
"_enabled": true,
"_materials": [
......@@ -1979,7 +2016,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 41
"__id__": 42
},
"_enabled": true,
"alignMode": 1,
......@@ -2006,16 +2043,16 @@
"_name": "Title",
"_objFlags": 0,
"_parent": {
"__id__": 40
"__id__": 41
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 45
"__id__": 46
},
{
"__id__": 46
"__id__": 47
}
],
"_prefab": null,
......@@ -2071,7 +2108,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 44
"__id__": 45
},
"_enabled": true,
"_materials": [
......@@ -2101,7 +2138,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 44
"__id__": 45
},
"_enabled": true,
"alignMode": 1,
......@@ -2128,16 +2165,16 @@
"_name": "Desc",
"_objFlags": 0,
"_parent": {
"__id__": 40
"__id__": 41
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 48
"__id__": 49
},
{
"__id__": 49
"__id__": 50
}
],
"_prefab": null,
......@@ -2193,7 +2230,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 47
"__id__": 48
},
"_enabled": true,
"_materials": [
......@@ -2223,7 +2260,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 47
"__id__": 48
},
"_enabled": true,
"alignMode": 1,
......@@ -2250,16 +2287,16 @@
"_name": "New Sprite(Splash)",
"_objFlags": 0,
"_parent": {
"__id__": 40
"__id__": 41
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 51
"__id__": 52
},
{
"__id__": 52
"__id__": 53
}
],
"_prefab": null,
......@@ -2315,7 +2352,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 50
"__id__": 51
},
"_enabled": true,
"_materials": [
......@@ -2347,7 +2384,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 50
"__id__": 51
},
"_enabled": true,
"alignMode": 1,
......@@ -2374,7 +2411,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 40
"__id__": 41
},
"_enabled": true,
"_materials": [
......@@ -2412,10 +2449,10 @@
"_active": true,
"_components": [
{
"__id__": 55
"__id__": 56
},
{
"__id__": 61
"__id__": 62
}
],
"_prefab": null,
......@@ -2471,14 +2508,14 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 54
"__id__": 55
},
"_enabled": true,
"videoPlayer1": null,
"currentTime": null,
"totalTime": null,
"loadingIcon": {
"__id__": 56
"__id__": 57
},
"now": 0,
"duration": 0,
......@@ -2492,16 +2529,16 @@
"_name": "LoadingIcon",
"_objFlags": 0,
"_parent": {
"__id__": 57
"__id__": 58
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 59
"__id__": 60
},
{
"__id__": 60
"__id__": 61
}
],
"_prefab": null,
......@@ -2561,13 +2598,13 @@
},
"_children": [
{
"__id__": 56
"__id__": 57
}
],
"_active": true,
"_components": [
{
"__id__": 58
"__id__": 59
}
],
"_prefab": null,
......@@ -2623,7 +2660,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 57
"__id__": 58
},
"_enabled": true,
"alignMode": 1,
......@@ -2650,7 +2687,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 56
"__id__": 57
},
"_enabled": true,
"_materials": [
......@@ -2682,7 +2719,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 56
"__id__": 57
},
"_enabled": true,
"_defaultClip": {
......@@ -2701,7 +2738,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 54
"__id__": 55
},
"_enabled": true,
"alignMode": 1,
......@@ -2734,16 +2771,16 @@
},
"_children": [
{
"__id__": 63
"__id__": 64
},
{
"__id__": 65
"__id__": 66
}
],
"_active": true,
"_components": [
{
"__id__": 67
"__id__": 68
}
],
"_prefab": null,
......@@ -2811,13 +2848,13 @@
"_name": "GraphicsLine",
"_objFlags": 0,
"_parent": {
"__id__": 62
"__id__": 63
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 64
"__id__": 65
}
],
"_prefab": null,
......@@ -2885,7 +2922,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 63
"__id__": 64
},
"_enabled": true,
"_materials": [
......@@ -2918,11 +2955,11 @@
"_name": "EpisodeListWrapper",
"_objFlags": 0,
"_parent": {
"__id__": 62
"__id__": 63
},
"_children": [
{
"__id__": 66
"__id__": 67
}
],
"_active": true,
......@@ -2938,7 +2975,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1230,
"width": 1216,
"height": 80
},
"_anchorPoint": {
......@@ -2962,7 +2999,7 @@
"__type__": "TypedArray",
"ctor": "Float32Array",
"array": [
-14,
0,
0,
0,
0,
......@@ -2992,7 +3029,7 @@
"_name": "EpisodeList",
"_objFlags": 0,
"_parent": {
"__id__": 65
"__id__": 66
},
"_children": [],
"_active": true,
......@@ -3032,7 +3069,7 @@
"__type__": "TypedArray",
"ctor": "Float32Array",
"array": [
14,
0,
0,
0,
0,
......@@ -3062,7 +3099,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 62
"__id__": 63
},
"_enabled": true,
"alignMode": 1,
......@@ -3093,19 +3130,19 @@
},
"_children": [
{
"__id__": 69
"__id__": 70
},
{
"__id__": 72
"__id__": 73
},
{
"__id__": 74
"__id__": 75
}
],
"_active": true,
"_components": [
{
"__id__": 76
"__id__": 77
}
],
"_prefab": null,
......@@ -3173,17 +3210,17 @@
"_name": "NaviListWrapper",
"_objFlags": 0,
"_parent": {
"__id__": 68
"__id__": 69
},
"_children": [
{
"__id__": 70
"__id__": 71
}
],
"_active": true,
"_components": [
{
"__id__": 71
"__id__": 72
}
],
"_prefab": null,
......@@ -3251,7 +3288,7 @@
"_name": "NaviList",
"_objFlags": 0,
"_parent": {
"__id__": 69
"__id__": 70
},
"_children": [],
"_active": true,
......@@ -3321,7 +3358,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 69
"__id__": 70
},
"_enabled": true,
"_materials": [
......@@ -3341,13 +3378,13 @@
"_name": "LeftIcon",
"_objFlags": 0,
"_parent": {
"__id__": 68
"__id__": 69
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 73
"__id__": 74
}
],
"_prefab": null,
......@@ -3415,7 +3452,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 72
"__id__": 73
},
"_enabled": true,
"_materials": [],
......@@ -3441,13 +3478,13 @@
"_name": "RightIcon",
"_objFlags": 0,
"_parent": {
"__id__": 68
"__id__": 69
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 75
"__id__": 76
}
],
"_prefab": null,
......@@ -3515,7 +3552,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 74
"__id__": 75
},
"_enabled": true,
"_materials": [],
......@@ -3541,7 +3578,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 68
"__id__": 69
},
"_enabled": true,
"alignMode": 1,
......
......@@ -31,7 +31,15 @@ cc.Class({
this._bIsDataListMoving = false;
this._bInitCategoryListSuccess = false;
if (this._cApplication.getBackStatus()) {
let aSceneParameter = this._cApplication.getSceneParameter();
cc.log("gameDetail->aSceneParameter..." + JSON.stringify(aSceneParameter));
if (aSceneParameter.length) {
this._oSceneContext._iCurrentLeftIndex = aSceneParameter[aSceneParameter.length - 1].currentIndex || 0;
} else if (aSceneParameter) {
this._oSceneContext._iCurrentLeftIndex = aSceneParameter.currentIndex || 0;
}
if (this._cApplication.getBackStatus()) { //返回值放到下方,否则恢复的数据是首页带回来的数值
//恢复上下文 包括
//光标位置 focusPath
let oSceneContext = this._cApplication.popSceneContext();
......@@ -41,14 +49,7 @@ cc.Class({
}
this._cApplication.setBackStatus(false);
}
let aSceneParameter = this._cApplication.getSceneParameter();
cc.log("gameDetail->aSceneParameter..." + JSON.stringify(aSceneParameter));
if (aSceneParameter.length) {
this._oSceneContext._iCurrentLeftIndex = aSceneParameter[aSceneParameter.length - 1].currentIndex || 0;
} else if (aSceneParameter) {
this._oSceneContext._iCurrentLeftIndex = aSceneParameter.currentIndex || 0;
}
cc.log("back status: " + this._oSceneContext._iCurrentLeftIndex);
this._nodeTypeListWrapper = cc.find("TypeListArea/TypeListWrapper", this.node);
this._nodeTypeList = cc.find("TypeList", this._nodeTypeListWrapper);
......
......@@ -101,9 +101,9 @@ cc.Class({
if (i >= oJSONResult.resultSet.length) {//数据较少时
continue;
}
let nodeEpisodeCell = cc.instantiate(this.PFB_EPISODE);
nodeEpisodeCell.x = nodeEpisodeCell.width / 2 + (i) * (nodeEpisodeCell.width + 20);
cc.find("EpisodeNum/Text", nodeEpisodeCell).getComponent(cc.Label).string = oJSONResult.resultSet[i].name;
let nodeEpisodeCell = cc.find("EpisodeListCell" + i, this._nodeEpisodeList);
if (nodeEpisodeCell == null) {
nodeEpisodeCell = cc.instantiate(this.PFB_EPISODE);
this._nodeEpisodeList.addChild(nodeEpisodeCell, 10, "EpisodeListCell" + i);
let fiEpisodeBlock = nodeEpisodeCell.addComponent(FocusInfo);
......@@ -111,6 +111,10 @@ cc.Class({
this._aFocusTargets[0]['episode_list_cell_' + i] = nodeEpisodeCell;
}
nodeEpisodeCell.x = nodeEpisodeCell.width / 2 + (i) * (nodeEpisodeCell.width + 12);
cc.find("EpisodeNum/Text", nodeEpisodeCell).getComponent(cc.Label).string = oJSONResult.resultSet[i].name;
}
if (!this._bIsNaviDataInit) {
this.initNaviList(); //初始化Navi
}
......@@ -124,6 +128,7 @@ cc.Class({
}, this, "uuid");
},
//1-20、21-40、41-60
initNaviList: function () {
//剧集分类
let sum = this._oEpisode.count / 20;
......@@ -135,21 +140,21 @@ cc.Class({
continue;
}
nodeNaviListCell = cc.instantiate(this.PFB_NAVI);
nodeNaviListCell.x = nodeNaviListCell.width / 2 + (i - 1) * (nodeNaviListCell.width + 23);
nodeNaviListCell.x = nodeNaviListCell.width / 2 + (i - 1) * (nodeNaviListCell.width + 12);
i == Math.ceil(sum) ? nodeNaviListCell.getChildByName('Text').getComponent(cc.Label).string = (20 * i - 19) + "-" + this._oEpisode.count
: nodeNaviListCell.getChildByName('Text').getComponent(cc.Label).string = (20 * i - 19) + "-" + 20 * i;//TODO:最后显示应该是41-52而不是41-60
this._nodeNaviList.addChild(nodeNaviListCell, 10, "NaviListCell" + i);
cc.loader.loadRes('VideoDetail/navi_bg', cc.Texture2D, function (err, texture) {
let spriteFrame = new cc.SpriteFrame();
if (i == 1) {
cc.find('Text', nodeNaviListCell).color = new cc.Color(112, 69, 61);
spriteFrame.setTexture(texture, cc.rect(0, 42, 110, 42));
} else {
spriteFrame.setTexture(texture, cc.rect(0, 0, 110, 42));
}
nodeNaviListCell.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame = spriteFrame;
spriteFrame._calculateUV();
});
// cc.loader.loadRes('VideoDetail/navi_bg', cc.Texture2D, function (err, texture) {
// let spriteFrame = new cc.SpriteFrame();
// if (i == 1) {
// cc.find('Text', nodeNaviListCell).color = new cc.Color(112, 69, 61);
// spriteFrame.setTexture(texture, cc.rect(0, 42, 110, 42));
// } else {
// spriteFrame.setTexture(texture, cc.rect(0, 0, 110, 42));
// }
// nodeNaviListCell.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame = spriteFrame;
// spriteFrame._calculateUV();
// });
//准备焦点坐标
let fiNaviBlock = nodeNaviListCell.addComponent(FocusInfo);
fiNaviBlock.init('', true, null, null, 1.0);
......@@ -308,7 +313,7 @@ cc.Class({
}
if (fiFocusTarget && 0 == fiFocusTarget.node.name.indexOf("EpisodeListCell")) {
if (fiFocusTarget.node.x - fiFocusTarget.node.width / 2 + this._nodeEpisodeList.x >= this._nodeEpisodeListWrapper.width) {
if (fiFocusTarget.node.x + fiFocusTarget.node.width / 2 + this._nodeEpisodeList.x >= this._nodeEpisodeListWrapper.width) {
oScrollParameter = this._nodeEpisodeList.getComponent(TVScrollParameter);
oScrollParameter.setHasRelation(true);
oScrollParameter.setStep((fiFocusTarget.node.x + fiFocusTarget.node.width / 2 + this._nodeEpisodeList.x) - this._nodeEpisodeListWrapper.width + 20);
......@@ -318,7 +323,7 @@ cc.Class({
if (fiFocusTarget.node.x + this._nodeEpisodeList.x < 0) {
oScrollParameter = this._nodeEpisodeList.getComponent(TVScrollParameter);
oScrollParameter.setHasRelation(true);
oScrollParameter.setStep(-fiFocusTarget.node.x + fiFocusTarget.node.width / 2 - this._nodeEpisodeList.x + 16);
oScrollParameter.setStep(-fiFocusTarget.node.x + fiFocusTarget.node.width / 2 - this._nodeEpisodeList.x);
oScrollParameter.setTargetPosition(this._nodeEpisodeList.x + oScrollParameter.getStep())
// this._oSceneContext._nodeNaviListX = this._nodeEpisodeList.x + oScrollParameter.getStep();
}
......@@ -417,10 +422,19 @@ cc.Class({
if (0 == fiFrom.node.getName().indexOf('NaviListCell') && 0 == fiTo.node.getName().indexOf('NaviListCell')) { //剧集分类1-20.21-40...
cc.find('Text', fiFrom.node).color = new cc.Color(255, 255, 255);
// fiFrom.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, fiFrom.node.getChildByName('Bg').width, fiFrom.node.getChildByName('Bg').height));
cc.loader.loadRes('VideoDetail/navi_bg', cc.Texture2D, function (err, texture) {
fiFrom.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, fiFrom.node.getChildByName('Bg').width, fiFrom.node.getChildByName('Bg').height));
});
}
// cc.loader.loadRes('VideoDetail/navi_bg', cc.Texture2D, function (err, texture) {
// fiFrom.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, fiFrom.node.getChildByName('Bg').width, fiFrom.node.getChildByName('Bg').height));
// });
}
// if (0 == fiFrom.node.getName().indexOf('EpisodeListCell')) { //剧集分类1-20.21-40...
// fiFrom.node.width = 104;
// // cc.find('Text', fiTo.node).color = new cc.Color(255, 204, 1);
// // fiTo.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, fiTo.node.getChildByName('Bg').height, fiTo.node.getChildByName('Bg').width, fiTo.node.getChildByName('Bg').height));
// // cc.loader.loadRes('VideoDetail/navi_bg', cc.Texture2D, function (err, texture) {
// // fiTo.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, fiTo.node.getChildByName('Bg').height, fiTo.node.getChildByName('Bg').width, fiTo.node.getChildByName('Bg').height));
// // });
// }
},
......@@ -456,16 +470,25 @@ cc.Class({
this._oSceneContext.currentPage = 1; //页面恢复
cc.find('Text', fiTo.node).color = new cc.Color(112, 69, 61);
cc.find('Text', fiTo.node).color = new cc.Color(255, 204, 1);
// fiTo.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, fiTo.node.getChildByName('Bg').height, fiTo.node.getChildByName('Bg').width, fiTo.node.getChildByName('Bg').height));
cc.loader.loadRes('VideoDetail/navi_bg', cc.Texture2D, function (err, texture) {
fiTo.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, fiTo.node.getChildByName('Bg').height, fiTo.node.getChildByName('Bg').width, fiTo.node.getChildByName('Bg').height));
});
// cc.loader.loadRes('VideoDetail/navi_bg', cc.Texture2D, function (err, texture) {
// fiTo.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, fiTo.node.getChildByName('Bg').height, fiTo.node.getChildByName('Bg').width, fiTo.node.getChildByName('Bg').height));
// });
let index = fiTo.node.name.replace('NaviListCell', '');
this._iCurrentNaviNumLoc = index;
this._oSceneContext.requestedStart = index * 20 - 20;
this.getGatherDetailList();
}
// if (0 == fiTo.node.getName().indexOf('EpisodeListCell')) { //剧集分类1-20.21-40...
// fiTo.node.width = 378;
// // cc.find('Text', fiTo.node).color = new cc.Color(255, 204, 1);
// // fiTo.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, fiTo.node.getChildByName('Bg').height, fiTo.node.getChildByName('Bg').width, fiTo.node.getChildByName('Bg').height));
// // cc.loader.loadRes('VideoDetail/navi_bg', cc.Texture2D, function (err, texture) {
// // fiTo.node.getChildByName('Bg').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, fiTo.node.getChildByName('Bg').height, fiTo.node.getChildByName('Bg').width, fiTo.node.getChildByName('Bg').height));
// // });
// }
},
doCurrentFocusTVLinkAction: function (strAction) {
......