1.修改部分详情页
Showing
3 changed files
with
31 additions
and
43 deletions
... | @@ -66,27 +66,27 @@ cc.Class({ | ... | @@ -66,27 +66,27 @@ cc.Class({ |
66 | this._nodeEpisodeListWrapper = cc.find("EpisodeArea/EpisodeListWrapper", this.node); | 66 | this._nodeEpisodeListWrapper = cc.find("EpisodeArea/EpisodeListWrapper", this.node); |
67 | this._nodeEpisodeList = cc.find("EpisodeList", this._nodeEpisodeListWrapper); | 67 | this._nodeEpisodeList = cc.find("EpisodeList", this._nodeEpisodeListWrapper); |
68 | 68 | ||
69 | this.initPrefab(); | 69 | // this.initPrefab(); |
70 | this.checkPfbReadyAndInitPage(); | 70 | this.checkPfbReadyAndInitPage(); |
71 | this.checkDataReadyAndInitFocus(); | 71 | this.checkDataReadyAndInitFocus(); |
72 | }, | 72 | }, |
73 | 73 | ||
74 | initPrefab: function () { | 74 | // initPrefab: function () { |
75 | for (let i = 0; i < 4; i++) { | 75 | // for (let i = 0; i < 4; i++) { |
76 | let nodeEpisodeCell = cc.instantiate(this.PFB_EPISODE); | 76 | // let nodeEpisodeCell = cc.instantiate(this.PFB_EPISODE); |
77 | nodeEpisodeCell.x = nodeEpisodeCell.width / 2 + (i) * (nodeEpisodeCell.width + 20); | 77 | // nodeEpisodeCell.x = nodeEpisodeCell.width / 2 + (i) * (nodeEpisodeCell.width + 20); |
78 | this._nodeEpisodeList.addChild(nodeEpisodeCell, 10, "EpisodeListCell" + i); | 78 | // this._nodeEpisodeList.addChild(nodeEpisodeCell, 10, "EpisodeListCell" + i); |
79 | let fiEpisodeBlock = nodeEpisodeCell.addComponent(FocusInfo); | 79 | // let fiEpisodeBlock = nodeEpisodeCell.addComponent(FocusInfo); |
80 | fiEpisodeBlock.init('{"click": [{"action": "ChangeScene","parameters": {"sceneName":"sceneProgramPlayerFullScreen"}}]}' | 80 | // fiEpisodeBlock.init('{"click": [{"action": "ChangeScene","parameters": {"sceneName":"sceneProgramPlayerFullScreen"}}]}' |
81 | , true, null, null, 1.0); | 81 | // , true, null, null, 1.0); |
82 | this._aFocusTargets[0]['episode_list_cell_' + i] = nodeEpisodeCell; | 82 | // this._aFocusTargets[0]['episode_list_cell_' + i] = nodeEpisodeCell; |
83 | 83 | ||
84 | // let borderX = nodeEpisodeCell.x - nodeEpisodeCell.width / 2; //搞边框 | 84 | // // let borderX = nodeEpisodeCell.x - nodeEpisodeCell.width / 2; //搞边框 |
85 | // let borderY = nodeEpisodeCell.y - nodeEpisodeCell.height / 2; | 85 | // // let borderY = nodeEpisodeCell.y - nodeEpisodeCell.height / 2; |
86 | // this._graphicsLine.roundRect(borderX, borderY, 278, 175, 20);//圆角矩形路径 | 86 | // // this._graphicsLine.roundRect(borderX, borderY, 278, 175, 20);//圆角矩形路径 |
87 | // this._graphicsLine.stroke(); //绘制路径 | 87 | // // this._graphicsLine.stroke(); //绘制路径 |
88 | } | 88 | // } |
89 | }, | 89 | // }, |
90 | 90 | ||
91 | getGatherDetailList: function () { | 91 | getGatherDetailList: function () { |
92 | Network.ajax("GET", Common.TOPDRAW_API_SERVER + "videoDetail/movie_detail_list_by_media.json", null, null, | 92 | Network.ajax("GET", Common.TOPDRAW_API_SERVER + "videoDetail/movie_detail_list_by_media.json", null, null, |
... | @@ -96,25 +96,13 @@ cc.Class({ | ... | @@ -96,25 +96,13 @@ cc.Class({ |
96 | this._oEpisode = oJSONResult; | 96 | this._oEpisode = oJSONResult; |
97 | if (oJSONResult.businessCode == 'success') { | 97 | if (oJSONResult.businessCode == 'success') { |
98 | for (let i = 0; i < 4; i++) { | 98 | for (let i = 0; i < 4; i++) { |
99 | let nodeEpisodeListCell = this._nodeEpisodeList.getChildByName("EpisodeListCell" + i); | 99 | let nodeEpisodeListCell = cc.instantiate(this.PFB_EPISODE); |
100 | if (i >= oJSONResult.resultSet.length) {//数据较少时隐藏其他多余预制体 | 100 | nodeEpisodeCell.x = nodeEpisodeCell.width / 2 + (i) * (nodeEpisodeCell.width + 20); |
101 | nodeEpisodeListCell.active = false; // | ||
102 | continue; | ||
103 | } | ||
104 | nodeEpisodeListCell.active = true; //恢复预制可见及可点击 | ||
105 | cc.find("EpisodeNum/Text", nodeEpisodeListCell).getComponent(cc.Label).string = oJSONResult.resultSet[i].name; | 101 | cc.find("EpisodeNum/Text", nodeEpisodeListCell).getComponent(cc.Label).string = oJSONResult.resultSet[i].name; |
106 | 102 | ||
107 | // cc.find("TopArea/Name/NormalName/MidName", nodeGatherDetailListCell).getComponent(cc.Label).string = oJSONResult.resultSet[i].name; | 103 | let fiEpisodeBlock = nodeEpisodeCell.addComponent(FocusInfo); |
108 | // cc.find("TopArea/Name/ActiveName/NameContainer/NameText/NameText1", nodeGatherDetailListCell).getComponent(cc.Label).string = oJSONResult.resultSet[i].name; | 104 | fiEpisodeBlock.init('', true, null, null, 1.0); |
109 | // cc.find("TopArea/Name/ActiveName/NameContainer/NameText/NameText2", nodeGatherDetailListCell).getComponent(cc.Label).string = oJSONResult.resultSet[i].name; | 105 | this._aFocusTargets[0]['episode_list_cell_' + i] = nodeEpisodeCell; |
110 | // cc.find("TopArea/Name/ActiveName/NameContainer/NameText/NameText1", nodeGatherDetailListCell).getComponent(cc.Label)._updateRenderData(true); | ||
111 | // cc.find("TopArea/Name/ActiveName/NameContainer/NameText/NameText2", nodeGatherDetailListCell).getComponent(cc.Label)._updateRenderData(true); | ||
112 | let fiBlock = nodeEpisodeListCell.getComponent(FocusInfo); | ||
113 | fiBlock.setTVLink( | ||
114 | '{"click":[{"action":"ChangeScene","parameters":{"sceneName":"sceneProgramPlayerFullScreen",\ | ||
115 | "appId":"' + this._strAppId + '","id":"' + this._iMediaId + '","episodeNum":"' + oJSONResult.resultSet[i].index + '",\ | ||
116 | "mediaCode":"'+ oJSONResult.resultSet[i].code + '","name":"' + oJSONResult.resultSet[i].name + '"}}]}' | ||
117 | ); | ||
118 | } | 106 | } |
119 | 107 | ||
120 | if (!this._bIsNaviDataInit) { | 108 | if (!this._bIsNaviDataInit) { | ... | ... |
... | @@ -43,8 +43,8 @@ | ... | @@ -43,8 +43,8 @@ |
43 | }, | 43 | }, |
44 | "_contentSize": { | 44 | "_contentSize": { |
45 | "__type__": "cc.Size", | 45 | "__type__": "cc.Size", |
46 | "width": 278, | 46 | "width": 104, |
47 | "height": 49 | 47 | "height": 60 |
48 | }, | 48 | }, |
49 | "_anchorPoint": { | 49 | "_anchorPoint": { |
50 | "__type__": "cc.Vec2", | 50 | "__type__": "cc.Vec2", |
... | @@ -119,8 +119,8 @@ | ... | @@ -119,8 +119,8 @@ |
119 | }, | 119 | }, |
120 | "_contentSize": { | 120 | "_contentSize": { |
121 | "__type__": "cc.Size", | 121 | "__type__": "cc.Size", |
122 | "width": 278, | 122 | "width": 104, |
123 | "height": 175 | 123 | "height": 60 |
124 | }, | 124 | }, |
125 | "_anchorPoint": { | 125 | "_anchorPoint": { |
126 | "__type__": "cc.Vec2", | 126 | "__type__": "cc.Vec2", |
... | @@ -235,8 +235,8 @@ | ... | @@ -235,8 +235,8 @@ |
235 | }, | 235 | }, |
236 | "_contentSize": { | 236 | "_contentSize": { |
237 | "__type__": "cc.Size", | 237 | "__type__": "cc.Size", |
238 | "width": 278, | 238 | "width": 104, |
239 | "height": 49 | 239 | "height": 60 |
240 | }, | 240 | }, |
241 | "_anchorPoint": { | 241 | "_anchorPoint": { |
242 | "__type__": "cc.Vec2", | 242 | "__type__": "cc.Vec2", |
... | @@ -311,8 +311,8 @@ | ... | @@ -311,8 +311,8 @@ |
311 | }, | 311 | }, |
312 | "_contentSize": { | 312 | "_contentSize": { |
313 | "__type__": "cc.Size", | 313 | "__type__": "cc.Size", |
314 | "width": 278, | 314 | "width": 104, |
315 | "height": 49 | 315 | "height": 60 |
316 | }, | 316 | }, |
317 | "_anchorPoint": { | 317 | "_anchorPoint": { |
318 | "__type__": "cc.Vec2", | 318 | "__type__": "cc.Vec2", |
... | @@ -430,7 +430,7 @@ | ... | @@ -430,7 +430,7 @@ |
430 | }, | 430 | }, |
431 | "_contentSize": { | 431 | "_contentSize": { |
432 | "__type__": "cc.Size", | 432 | "__type__": "cc.Size", |
433 | "width": 278, | 433 | "width": 104, |
434 | "height": 49 | 434 | "height": 49 |
435 | }, | 435 | }, |
436 | "_anchorPoint": { | 436 | "_anchorPoint": { | ... | ... |
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment