Commit db8a8b11 db8a8b116f41f873caaecb0d935da1accb2f4262 by 金学艇

1.修改部分详情页

1 parent ec8ef34c
......@@ -66,27 +66,27 @@ cc.Class({
this._nodeEpisodeListWrapper = cc.find("EpisodeArea/EpisodeListWrapper", this.node);
this._nodeEpisodeList = cc.find("EpisodeList", this._nodeEpisodeListWrapper);
this.initPrefab();
// this.initPrefab();
this.checkPfbReadyAndInitPage();
this.checkDataReadyAndInitFocus();
},
initPrefab: function () {
for (let i = 0; i < 4; i++) {
let nodeEpisodeCell = cc.instantiate(this.PFB_EPISODE);
nodeEpisodeCell.x = nodeEpisodeCell.width / 2 + (i) * (nodeEpisodeCell.width + 20);
this._nodeEpisodeList.addChild(nodeEpisodeCell, 10, "EpisodeListCell" + i);
let fiEpisodeBlock = nodeEpisodeCell.addComponent(FocusInfo);
fiEpisodeBlock.init('{"click": [{"action": "ChangeScene","parameters": {"sceneName":"sceneProgramPlayerFullScreen"}}]}'
, true, null, null, 1.0);
this._aFocusTargets[0]['episode_list_cell_' + i] = nodeEpisodeCell;
// let borderX = nodeEpisodeCell.x - nodeEpisodeCell.width / 2; //搞边框
// let borderY = nodeEpisodeCell.y - nodeEpisodeCell.height / 2;
// this._graphicsLine.roundRect(borderX, borderY, 278, 175, 20);//圆角矩形路径
// this._graphicsLine.stroke(); //绘制路径
}
},
// initPrefab: function () {
// for (let i = 0; i < 4; i++) {
// let nodeEpisodeCell = cc.instantiate(this.PFB_EPISODE);
// nodeEpisodeCell.x = nodeEpisodeCell.width / 2 + (i) * (nodeEpisodeCell.width + 20);
// this._nodeEpisodeList.addChild(nodeEpisodeCell, 10, "EpisodeListCell" + i);
// let fiEpisodeBlock = nodeEpisodeCell.addComponent(FocusInfo);
// fiEpisodeBlock.init('{"click": [{"action": "ChangeScene","parameters": {"sceneName":"sceneProgramPlayerFullScreen"}}]}'
// , true, null, null, 1.0);
// this._aFocusTargets[0]['episode_list_cell_' + i] = nodeEpisodeCell;
// // let borderX = nodeEpisodeCell.x - nodeEpisodeCell.width / 2; //搞边框
// // let borderY = nodeEpisodeCell.y - nodeEpisodeCell.height / 2;
// // this._graphicsLine.roundRect(borderX, borderY, 278, 175, 20);//圆角矩形路径
// // this._graphicsLine.stroke(); //绘制路径
// }
// },
getGatherDetailList: function () {
Network.ajax("GET", Common.TOPDRAW_API_SERVER + "videoDetail/movie_detail_list_by_media.json", null, null,
......@@ -96,25 +96,13 @@ cc.Class({
this._oEpisode = oJSONResult;
if (oJSONResult.businessCode == 'success') {
for (let i = 0; i < 4; i++) {
let nodeEpisodeListCell = this._nodeEpisodeList.getChildByName("EpisodeListCell" + i);
if (i >= oJSONResult.resultSet.length) {//数据较少时隐藏其他多余预制体
nodeEpisodeListCell.active = false; //
continue;
}
nodeEpisodeListCell.active = true; //恢复预制可见及可点击
let nodeEpisodeListCell = cc.instantiate(this.PFB_EPISODE);
nodeEpisodeCell.x = nodeEpisodeCell.width / 2 + (i) * (nodeEpisodeCell.width + 20);
cc.find("EpisodeNum/Text", nodeEpisodeListCell).getComponent(cc.Label).string = oJSONResult.resultSet[i].name;
// cc.find("TopArea/Name/NormalName/MidName", nodeGatherDetailListCell).getComponent(cc.Label).string = oJSONResult.resultSet[i].name;
// cc.find("TopArea/Name/ActiveName/NameContainer/NameText/NameText1", nodeGatherDetailListCell).getComponent(cc.Label).string = oJSONResult.resultSet[i].name;
// cc.find("TopArea/Name/ActiveName/NameContainer/NameText/NameText2", nodeGatherDetailListCell).getComponent(cc.Label).string = oJSONResult.resultSet[i].name;
// cc.find("TopArea/Name/ActiveName/NameContainer/NameText/NameText1", nodeGatherDetailListCell).getComponent(cc.Label)._updateRenderData(true);
// cc.find("TopArea/Name/ActiveName/NameContainer/NameText/NameText2", nodeGatherDetailListCell).getComponent(cc.Label)._updateRenderData(true);
let fiBlock = nodeEpisodeListCell.getComponent(FocusInfo);
fiBlock.setTVLink(
'{"click":[{"action":"ChangeScene","parameters":{"sceneName":"sceneProgramPlayerFullScreen",\
"appId":"' + this._strAppId + '","id":"' + this._iMediaId + '","episodeNum":"' + oJSONResult.resultSet[i].index + '",\
"mediaCode":"'+ oJSONResult.resultSet[i].code + '","name":"' + oJSONResult.resultSet[i].name + '"}}]}'
);
let fiEpisodeBlock = nodeEpisodeCell.addComponent(FocusInfo);
fiEpisodeBlock.init('', true, null, null, 1.0);
this._aFocusTargets[0]['episode_list_cell_' + i] = nodeEpisodeCell;
}
if (!this._bIsNaviDataInit) {
......
......@@ -43,8 +43,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 278,
"height": 49
"width": 104,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -119,8 +119,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 278,
"height": 175
"width": 104,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -235,8 +235,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 278,
"height": 49
"width": 104,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -311,8 +311,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 278,
"height": 49
"width": 104,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -430,7 +430,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 278,
"width": 104,
"height": 49
},
"_anchorPoint": {
......