Commit 2bf98ed9 2bf98ed9b8b4f665b4a894c5c86496a3c959535c by 金学艇

1.修改详情页

1 parent 224549ff
......@@ -189,7 +189,7 @@
"array": [
0,
0,
271.0659484863281,
250.28134155273438,
0,
0,
0,
......@@ -802,7 +802,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 250,
"height": 550
"height": 565
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......
......@@ -27,7 +27,7 @@ cc.Class({
this._oInit = {};
this._lastFocus = null;
this._oSceneContext._iCurrentLeftIndex = 0;
this._oSceneContext.focusPath = "TypeListArea/TypeListWrapper/TypeList/topNavi" + this._oSceneContext._iCurrentLeftIndex;
// this._oSceneContext.focusPath = "TypeListArea/TypeListWrapper/TypeList/topNavi" + this._oSceneContext._iCurrentLeftIndex;
this._bIsDataListMoving = false;
this._bInitCategoryListSuccess = false;
......@@ -42,6 +42,14 @@ 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;
}
this._nodeTypeListWrapper = cc.find("TypeListArea/TypeListWrapper", this.node);
this._nodeTypeList = cc.find("TypeList", this._nodeTypeListWrapper);
this._nodeTypeList.addComponent(TVScrollParameter);
......@@ -99,7 +107,7 @@ cc.Class({
function (texture, iRequestId) {
node.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, oProgram.image[0].width, oProgram.image[0].height));
if (i == self._oSceneContext._iCurrentLeftIndex) {
node.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, oProgram.image[0].height, oProgram.image[0].width, oProgram.image[0].height));
node.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, oProgram.image[0].height * 2, oProgram.image[0].width, oProgram.image[0].height));
}
}, function () { }, this
);
......@@ -142,7 +150,7 @@ cc.Class({
getSimulateRequest: function () {
var self = this;
var aJsonList = ["catetory_jtdr_list.json", "catetory_all_list.json", "catetory_nlbz_list.json", "catetory_3dyx_list.json", "catetory_xyx_list.json", "catetory_tyjj_list.json"];
var aJsonList = ["catetory_jtdr_list.json", "catetory_all_list.json", "catetory_nlbz_list.json", "catetory_3dyx_list.json", "catetory_xyx_list.json", "catetory_dfdj_list.json"];
if (this._oInit[this._oSceneContext._iCurrentLeftIndex]) { //已经加载过数据直接取
self.requestMediaList(1);
} else {
......@@ -174,7 +182,7 @@ cc.Class({
// let strAppId = this._oInit.aNavList[this._oSceneContext.iNaviIndex].appId;
// switch (strAppId) {
// case BusinessParameter.CARTOON_APPID:
// this._oSceneContext.focusPath = this._oSceneContext.focusPath || "SongList/DataContainerMask/DataContainer/ListCell0/SongTitleContainer";
this._oSceneContext.focusPath = this._oSceneContext.focusPath || "CategoryList/DataContainerMask/DataContainer/CategoryListCell0";
this._strSongListCellComponentName = "pfbCategoryListCell";
this._iBeginPositionX = -350;
this._iBeginPositionY = 196;
......@@ -317,6 +325,12 @@ cc.Class({
this._cFocus.hide();
}
if (0 == nodeInitFocus.getName().indexOf('CategoryListCell')) {
nodeInitFocus.getChildByName("Normal").active = false;
nodeInitFocus.getChildByName("Name").active = true;
nodeInitFocus.getComponent(ListCell).setUIWithFocus();
}
//处理焦点位于下方问题
if (this._oSceneContext.typeListY) {
this._nodeTypeList.y = this._oSceneContext.typeListY;
......@@ -377,7 +391,7 @@ cc.Class({
onKeyUp: function (event) {
// cc.log(this._lastFocus.node.name + " down->抬起。。。" + this._fiCurrentFocus.node.name);
cc.log("抬起:" + event.keyCode);
if (0 == this._lastFocus.node.getName().indexOf('topNavi')
if (this._lastFocus != null && 0 == this._lastFocus.node.getName().indexOf('topNavi')
&& 0 == this._fiCurrentFocus.node.getName().indexOf('topNavi')
&& event.keyCode != (Common.ANDROID_KEY.left || cc.macro.KEY.left)) {
this.scheduleOnce(function () {
......
......@@ -73,6 +73,7 @@ cc.Class({
cc.find("ButtonOpen", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 264, 100));
// cc.find("ButtonVip", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 572, 72));
cc.find("FullView", this.node).zIndex = 100;
cc.find("FullDesc", this.node).zIndex = 100;
this._nodeTypeListWrapper = cc.find("TypeListArea/TypeListWrapper", this.node);
this._nodeTypeList = cc.find("TypeList", this._nodeTypeListWrapper);
......@@ -279,10 +280,14 @@ cc.Class({
cc.find("Desc/LabelVersion", this.node).getComponent(cc.Label).string = oJSONResult.resultSet[0].versions;
cc.find("Desc/LabelSize", this.node).getComponent(cc.Label).string = oJSONResult.resultSet[0].size;
cc.find("Desc/LabelTime", this.node).getComponent(cc.Label).string = oJSONResult.resultSet[0].updateTime;
//==========放到大屏显示问题
cc.find("FullDesc/Title", this.node).getComponent(cc.Label).string = oJSONResult.resultSet[0].name;
cc.find("FullDesc/Desc", this.node).getComponent(cc.Label).string = oJSONResult.resultSet[0].description;
//==========end
//这里给描述做拦截,防止字数多超出栏目
var description = oJSONResult.resultSet[0].description;
if (description.length > 110) {
description = description.substring(0, 110) + "...";
if (description.length > 80) {
description = description.substring(0, 80) + "...";
}
cc.find("Desc/LabelDesc", this.node).getComponent(cc.Label).string = description;
//搞标签
......@@ -341,9 +346,17 @@ cc.Class({
initFocus: function () {
this._aFocusTargets[1] = [];
// let fiPic = cc.find('Pic', this.node).addComponent(FocusInfo); //
// fiPic.init('', true, null, null, 1.0);
// this._aFocusTargets[0]['pic'] = cc.find('Pic', this.node);
let fiPic = cc.find('Pic', this.node).addComponent(FocusInfo); //
if (this._oSceneContext._downloadUrl && this._oSceneContext._downloadUrl != "undefined") {
fiPic.init("{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameLoading\",\"packageName\":\"" + this._oSceneContext._packageName + "\",\"className\":\"" + this._oSceneContext._className + "\",\"downloadUrl\":\"" + Common.TOPDRAW_API_SERVER + this._oSceneContext._downloadUrl + "\"}}]}", true, null, null, 1.0);
} else {
fiPic.init("{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameLoading\",\"packageName\":\"" + this._oSceneContext._packageName + "\",\"className\":\"" + this._oSceneContext._className + "\",\"downloadUrl\":\"" + this._oSceneContext._downloadUrl + "\"}}]}", true, null, null, 1.0);
}
this._aFocusTargets[0]['pic'] = cc.find('Pic', this.node);
let fiDesc = cc.find('Desc/LabelDesc', this.node).addComponent(FocusInfo); //
fiDesc.init('', true, null, null, 1.0);
this._aFocusTargets[0]['desc'] = cc.find('Desc/LabelDesc', this.node);
let fiOpen = cc.find('ButtonOpen', this.node).addComponent(FocusInfo); //
if (this._oSceneContext._downloadUrl && this._oSceneContext._downloadUrl != "undefined") {
......@@ -416,6 +429,7 @@ cc.Class({
var fiFocusTarget = null;
var fiCurrentFocus = this._fiCurrentFocus;
cc.find("FullView", this.node).active = false;
cc.find("FullDesc", this.node).active = false;
switch (event.keyCode) {
case cc.macro.KEY.up:
case Common.ANDROID_KEY.up:
......@@ -445,9 +459,11 @@ cc.Class({
cc.loader.loadRes(icon, cc.Texture2D, function (err, texture) {
self._fiCurrentFocus.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 56, self._fiCurrentFocus.node.width, 56));
});
} else if (0 == this._fiCurrentFocus.node.name.indexOf('Pic')) {
} else if (0 == this._fiCurrentFocus.node.name.indexOf('TypeListCell')) {
cc.find("FullView", this.node).active = true;
} else if (0 == this._fiCurrentFocus.node.name.indexOf('ButtonOpen')) {
} else if (0 == this._fiCurrentFocus.node.name.indexOf('LabelDesc')) {
cc.find("FullDesc", this.node).active = true;
} else if (0 == this._fiCurrentFocus.node.name.indexOf('ButtonOpen') || 0 == this._fiCurrentFocus.node.name.indexOf('Pic')) {
// this.commonSimpleTip("是否拿到数据: " + this._bInitExistApk);
if (!this._bInitExistApk) { //还未拿到判断数据
return;
......@@ -530,7 +546,7 @@ cc.Class({
},
onAfterFocusChange: function (event) {
var self = this;
let fiTo = event.detail.to;
let fiFrom = event.detail.from;
......@@ -555,6 +571,17 @@ cc.Class({
fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 72, 572, 72));
});
}
if (0 == fiTo.node.getName().indexOf('TypeListCell')) {
let iIndex = fiTo.node.name.replace("TypeListCell", '');
if (this._oInit.aListImage[iIndex]) {
Network.loadImageInNativeRuntime(Common.TOPDRAW_IMAGE_SERVER + this._oInit.aListImage[iIndex].fileUrl, null,
function (texture) {
cc.find("FullView", self.node).getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
}, function () { }, this
);
}
}
},
});
......
......@@ -75,7 +75,7 @@ cc.Class({
this._bInitCategoryListSuccess = false;
this._bInitRecommendDataSuccess = false;
this._scrollview = this.node.getComponent(cc.ScrollView);
this._oSceneContext.focusPath = "scrollContent/TopNavi/topNavi1";
this._oSceneContext.focusPath = "scrollContent/RecommendLayout/ViewPager/Carousel0";
this._oSceneContext._iPageIndex = 1;
this._oSceneContext._iCurrentLeftIndex = 1;
this._oSceneContext._iViewPagerIndex = 0;
......@@ -116,7 +116,7 @@ cc.Class({
//轮播图相关
initViewPager: function () {
var self=this;
var self = this;
this._pageView = cc.find('scrollContent/ViewPagerArea', this.node).getComponent(cc.PageView);
Network.ajax("GET", Common.TOPDRAW_API_SERVER + "main/main_viewpager.json", null, null,
function (strResponse) {
......@@ -281,10 +281,10 @@ cc.Class({
function (texture, iRequestId) {
if (strCellName == "topNavi") {
nodeNav.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, aTopNaviJson[i].width, aTopNaviJson[i].height));
if (i == 1 && 1 == this._oSceneContext._iCurrentLeftIndex && this._oSceneContext.focusPath != "scrollContent/TopNavi/topNavi1") {//恢复光标记忆不需要选中状态,将i先改为1,其他导航暂时不做光标记忆,有点复杂,后续考虑做。。。
nodeNav.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, aTopNaviJson[i].height * 2, aTopNaviJson[i].width, aTopNaviJson[i].height));
} else if (i == this._oSceneContext._iCurrentLeftIndex) {
if (i == this._oSceneContext._iCurrentLeftIndex && 1 != this._oSceneContext._iCurrentLeftIndex) {//恢复光标记忆不需要选中状态,将i先改为1,其他导航暂时不做光标记忆,有点复杂,后续考虑做。。。
nodeNav.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, aTopNaviJson[i].height, aTopNaviJson[i].width, aTopNaviJson[i].height));
} else if (i == this._oSceneContext._iCurrentLeftIndex) {
nodeNav.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, aTopNaviJson[i].height * 2, aTopNaviJson[i].width, aTopNaviJson[i].height));
}
} else {
nodeNav.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, aTopNaviJson[i].width, aTopNaviJson[i].height));
......@@ -1018,11 +1018,11 @@ cc.Class({
this._oSceneContext._iPageIndex--;
let height = this._aBgHeight[this._oSceneContext._iPageIndex - 1] || 0; //520,750,1177,1463,1737,2119,2239
this.onScrollViewScrollStart();
this._scrollview.scrollToOffset(cc.v2(0, height), 0.5);
this._scrollview.scrollToOffset(cc.v2(0, height), 0.4);
// cc.log("滚动到:" + height);
this.scheduleOnce(function () {
this.keyDownDirection(Common.MOVE_DIRECTION_UP);
}, 0.4);
}, 0.3);
// setTimeout(function () {
// this.keyDownDirection(Common.MOVE_DIRECTION_UP);
// }.bind(this), 300);
......@@ -1082,12 +1082,12 @@ cc.Class({
//----------------------------------------------------------------------
let height = this._aBgHeight[this._oSceneContext._iPageIndex] || 0; //520,750,1177,1463,1737,2119,2239
this.onScrollViewScrollStart();
this._scrollview.scrollToOffset(cc.v2(0, height), 0.5);
this._scrollview.scrollToOffset(cc.v2(0, height), 0.4);
// cc.log("滚动到:"+height);
this._oSceneContext._iPageIndex++;
this.scheduleOnce(function () {
this.keyDownDirection(Common.MOVE_DIRECTION_DOWN);
}, 0.4);
}, 0.3);
// setTimeout(function () {
// this.keyDownDirection(Common.MOVE_DIRECTION_DOWN);
// }.bind(this), 300);
......
......@@ -14,11 +14,11 @@
"size": 74263,
"enable": true,
"name": "b2b1bb5f-a956-4930-9273-eb72920a9faa.png",
"fileUrl": "upload/image/category//icon_top1.png",
"fileUrl": "upload/image/category/icon_top1.png",
"id": 7509,
"type": 2,
"width": 236,
"height": 100
"width": 202,
"height": 94
}
]
},
......@@ -31,11 +31,11 @@
"size": 74263,
"enable": true,
"name": "b2b1bb5f-a956-4930-9273-eb72920a9faa.png",
"fileUrl": "upload/image/category//icon_top2.png",
"fileUrl": "upload/image/category/icon_top2.png",
"id": 7509,
"type": 2,
"width": 236,
"height": 100
"width": 202,
"height": 94
}
]
},
......@@ -48,11 +48,11 @@
"size": 74263,
"enable": true,
"name": "b2b1bb5f-a956-4930-9273-eb72920a9faa.png",
"fileUrl": "upload/image/category//icon_top3.png",
"fileUrl": "upload/image/category/icon_top3.png",
"id": 7509,
"type": 2,
"width": 236,
"height": 100
"width": 202,
"height": 94
}
]
},
......@@ -65,11 +65,11 @@
"size": 74263,
"enable": true,
"name": "b2b1bb5f-a956-4930-9273-eb72920a9faa.png",
"fileUrl": "upload/image/category//icon_top4.png",
"fileUrl": "upload/image/category/icon_top4.png",
"id": 7509,
"type": 2,
"width": 236,
"height": 100
"width": 202,
"height": 94
}
]
},
......@@ -82,11 +82,28 @@
"size": 74263,
"enable": true,
"name": "b2b1bb5f-a956-4930-9273-eb72920a9faa.png",
"fileUrl": "upload/image/category//icon_top5.png",
"fileUrl": "upload/image/category/icon_top5.png",
"id": 7509,
"type": 2,
"width": 236,
"height": 100
"width": 202,
"height": 94
}
]
},
{
"name": "巅峰对决",
"image": [
{
"extension": ".png",
"code": "image_e9fea105-0412-4600-a0f1-f606a003c63f",
"size": 74263,
"enable": true,
"name": "b2b1bb5f-a956-4930-9273-eb72920a9faa.png",
"fileUrl": "upload/image/category/icon_top6.png",
"id": 7509,
"type": 2,
"width": 202,
"height": 94
}
]
}
......
......@@ -125,37 +125,37 @@
{
"name": "Subject1",
"imageURL": "upload/image/main/block4_1.png",
"tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\"}}]}",
"tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\",\"currentIndex\":\"0\"}}]}",
"code": "promotionItem_e432ac2d-c1f3-4daehr4w5g4w5yh4w5yh"
},
{
"name": "Subject2",
"imageURL": "upload/image/main/block4_2.png",
"tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\"}}]}",
"tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\",\"currentIndex\":\"1\"}}]}",
"code": "promotionItem_f90b7ff3-1f36-401erhb54wyh4th"
},
{
"name": "Subject3",
"imageURL": "upload/image/main/block4_3.png",
"tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\"}}]}",
"tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\",\"currentIndex\":\"2\"}}]}",
"code": "promotionItem_e29b33e4-8954-4eerthy6rthg54er"
},
{
"name": "Subject4",
"imageURL": "upload/image/main/block4_4.png",
"tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\"}}]}",
"tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\",\"currentIndex\":\"3\"}}]}",
"code": "promotionItem_e29b33e4-8954-vwregv54thw6"
},
{
"name": "Subject5",
"imageURL": "upload/image/main/block4_5.png",
"tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\"}}]}",
"tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\",\"currentIndex\":\"4\"}}]}",
"code": "promotionItem_e29b33e4-8954-bq4wrjhwbt4t"
},
{
"name": "Subject6",
"imageURL": "upload/image/main/block4_6.png",
"tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\"}}]}",
"tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\",\"currentIndex\":\"5\"}}]}",
"code": "promotionItem_57aea4b3-7716-4we5j56trhgser2"
}
]
......