Commit 2467b3d1 2467b3d18e0ba898922f1c18b3f70156b45ea8c0 by 金学艇

1.修改分类页

1 parent abfd79d2
......@@ -17,7 +17,7 @@
"__id__": 2
}
],
"_active": true,
"_active": false,
"_components": [],
"_prefab": null,
"_opacity": 255,
......@@ -189,7 +189,7 @@
"array": [
0,
0,
265.0037841796875,
271.0659484863281,
0,
0,
0,
......@@ -643,7 +643,7 @@
"__type__": "TypedArray",
"ctor": "Float32Array",
"array": [
-485,
-505,
-43,
0,
0,
......@@ -951,7 +951,7 @@
"alignMode": 2,
"_target": null,
"_alignFlags": 9,
"_left": 30,
"_left": 10,
"_right": 0,
"_top": 128,
"_bottom": 0,
......@@ -999,7 +999,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 900,
"width": 1000,
"height": 650
},
"_anchorPoint": {
......@@ -1023,7 +1023,7 @@
"__type__": "TypedArray",
"ctor": "Float32Array",
"array": [
148.5,
90,
-35,
0,
0,
......@@ -1077,7 +1077,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 900,
"width": 1020,
"height": 650
},
"_anchorPoint": {
......@@ -1147,7 +1147,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 900,
"width": 1000,
"height": 650
},
"_anchorPoint": {
......@@ -2114,7 +2114,7 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 12,
"_left": 338.5,
"_left": 230,
"_right": 0,
"_top": 119,
"_bottom": 0,
......
......@@ -57,7 +57,7 @@
"_is3DNode": true,
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": true,
"autoReleaseAssets": false,
"_id": "77eede39-2337-45ac-ba31-eb6e433ff217"
},
{
......@@ -207,7 +207,7 @@
"array": [
0,
0,
265.0037841796875,
271.0659484863281,
0,
0,
0,
......@@ -602,7 +602,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 216,
"width": 0,
"height": 63
},
"_anchorPoint": {
......@@ -614,7 +614,7 @@
"__type__": "TypedArray",
"ctor": "Float32Array",
"array": [
120,
12,
272.5,
0,
0,
......@@ -1345,7 +1345,7 @@
"__type__": "TypedArray",
"ctor": "Float32Array",
"array": [
-78,
30,
-36.400001525878906,
0,
0,
......@@ -1469,7 +1469,7 @@
"__type__": "TypedArray",
"ctor": "Float32Array",
"array": [
54,
162,
-36.400001525878906,
0,
0,
......@@ -1593,7 +1593,7 @@
"__type__": "TypedArray",
"ctor": "Float32Array",
"array": [
243,
351,
-36.400001525878906,
0,
0,
......@@ -1691,8 +1691,8 @@
}
],
"_useOriginalSize": false,
"_string": "疯狂赛车手手",
"_N$string": "疯狂赛车手手",
"_string": "",
"_N$string": "",
"_fontSize": 36,
"_lineHeight": 50,
"_enableWrapText": true,
......@@ -2137,7 +2137,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 564,
"height": 60
"height": 120
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2149,7 +2149,7 @@
"ctor": "Float32Array",
"array": [
294,
191,
161,
0,
0,
0,
......@@ -2260,8 +2260,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 200,
"height": 52
"width": 264,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2272,8 +2272,8 @@
"__type__": "TypedArray",
"ctor": "Float32Array",
"array": [
112,
13,
144,
10,
0,
0,
0,
......@@ -2313,7 +2313,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "2c3552e2-5961-4541-ab46-068aeabbf034"
"__uuid__": "74d68834-c4a7-44a8-b9e0-2fa2693ba5e4"
},
"_type": 0,
"_sizeMode": 0,
......@@ -2342,7 +2342,7 @@
"_alignFlags": 9,
"_left": 652,
"_right": 0,
"_top": 321,
"_top": 300,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
......@@ -2458,7 +2458,7 @@
"__id__": 2
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 56
......@@ -2530,9 +2530,7 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "431c5199-fa09-462c-8892-21eb3d0e0b89"
},
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
......@@ -2576,7 +2574,7 @@
},
{
"__type__": "cc.Node",
"_name": "New Label",
"_name": "NewLabel",
"_objFlags": 0,
"_parent": {
"__id__": 2
......
......@@ -906,7 +906,7 @@
"__id__": 35
}
],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 40
......@@ -2054,7 +2054,7 @@
"__id__": 8
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 46
......
......@@ -175,12 +175,12 @@ cc.Class({
// case BusinessParameter.CARTOON_APPID:
// this._oSceneContext.focusPath = this._oSceneContext.focusPath || "SongList/DataContainerMask/DataContainer/ListCell0/SongTitleContainer";
this._strSongListCellComponentName = "pfbCategoryListCell";
this._iBeginPositionX = -289.5;
this._iBeginPositionX = -350;
this._iBeginPositionY = 196;
this._iShowCellRows = 3;
this._iAlphaCellRows = 0;
this._iHiddenCellRows = 3;
this._iCellCountEachRow = 3;
this._iCellCountEachRow = 4;
this._fCellMarginTop = 0;
this._fCellMarginRight = 24;
this._fCellMarginBottom = 16;
......
......@@ -70,8 +70,8 @@ cc.Class({
this._nodeTypeList.addComponent(TVScrollParameter);
// cc.find("Desc/Collect", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 172, 56));
cc.find("ButtonOpen", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 278, 72));
cc.find("ButtonVip", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 572, 72));
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;
this._nodeTypeListWrapper = cc.find("TypeListArea/TypeListWrapper", this.node);
......@@ -281,8 +281,8 @@ cc.Class({
cc.find("Desc/LabelTime", this.node).getComponent(cc.Label).string = oJSONResult.resultSet[0].updateTime;
//这里给描述做拦截,防止字数多超出栏目
var description = oJSONResult.resultSet[0].description;
if (description.length > 55) {
description = description.substring(0, 55) + "...";
if (description.length > 110) {
description = description.substring(0, 110) + "...";
}
cc.find("Desc/LabelDesc", this.node).getComponent(cc.Label).string = description;
//搞标签
......@@ -369,7 +369,7 @@ cc.Class({
if (0 == nodeInitFocus.name.indexOf('Button')) {
this._cFocus.hide();
cc.loader.loadRes("GameDetail/icon_button_open", cc.Texture2D, function (err, texture) {
nodeInitFocus.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 72, 278, 72));
nodeInitFocus.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 100, 264, 100));
});
}
......@@ -510,7 +510,7 @@ cc.Class({
if (0 == fiFrom.node.getName().indexOf('ButtonOpen')) {
cc.loader.loadRes("GameDetail/icon_button_open", cc.Texture2D, function (err, texture) {
fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, 278, 72));
fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, 264, 100));
});
}
......@@ -545,7 +545,7 @@ cc.Class({
if (0 == fiTo.node.getName().indexOf('ButtonOpen')) {
// fiTo.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height));
cc.loader.loadRes("GameDetail/icon_button_open", cc.Texture2D, function (err, texture) {
fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 72, 278, 72));
fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 100, 264, 100));
});
}
......
......@@ -37,6 +37,9 @@ cc.Class({
cc.log("gameLoading包名:" + this._oSceneContext._downloadUrl);
if (!cc.sys.isNative) {
return;
}
if (this._oSceneContext._downloadUrl && this._oSceneContext._downloadUrl != "undefined") { //如果有下载地址就启动奥比游戏
jsb.reflection.callStaticMethod("com/topdraw/melody/TopdrawSDKWrapper", "startOBiGame", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._downloadUrl, this._oSceneContext._packageName, this._oSceneContext._className, "updateProgress");
} else {
......@@ -51,7 +54,6 @@ cc.Class({
let nodeBar = cc.find("ProgressBar/bar", this.node);
nodeBar.width = strProgress / 100 * progressBarWidth;
// this._downloadUrl && this._downloadUrl != "undefined" &&
if (strProgress == "100") {
this._bIsFocusInit = true;
this.backAScene();
......
......@@ -208,9 +208,20 @@ cc.Class({
self.getTopNaviRequest("topNavi");
self.getTopNaviRequest("topCell");
self.getRecommendModelRequest();
self.getRightRecommendRequest(); //
//在这里选择是初始化首页瀑布流还是初始化其他导航的列表数据
if (this._oSceneContext._iCurrentLeftIndex == 1) {
cc.log("初始化瀑布流");
self.getRightRecommendRequestData();
cc.find("scrollContent/ViewPagerArea", this.node).active = true;
cc.find("scrollContent/BlockShadow", this.node).active = true;
} else {
this.getSimulateRequest();
cc.find("scrollContent/ViewPagerArea", this.node).active = false;
cc.find("scrollContent/BlockShadow", this.node).active = false;
}
} catch (error) {
cc.log("Business Exception:Get getMainLayoutJsonRequest..." + error);
}
......@@ -361,255 +372,274 @@ cc.Class({
}
},
getRightRecommendRequestData: function () {
if (this._oInit.main_recommend) {
this.getRightRecommendRequest();
return;
}
Network.ajax("GET", Common.TOPDRAW_API_SERVER + "main/main_recommend.json", null, null,
function (strResponse) {
try {
this._oInit.main_recommend = strResponse;
this.getRightRecommendRequest();
} catch (error) {
cc.log("Business Exception:Get getRightRecommendRequest..." + error);
}
},
function (strResponse) {
cc.log("Business Error:Get getRightRecommendRequest..." + strResponse);
}, this, "uuid");
},
//渲染推荐框架
getRightRecommendRequest: function () {
var self = this;
var rightNodeLayout = this.targetAry[1].target;
Network.ajax("GET", Common.TOPDRAW_API_SERVER + "main/main_recommend.json", null, null,
function (strResponse) {
try {
// var arrModules = waterfall_model.waterfall; //拿到模拟数据
// var arrModules = this.test_json.json;
var arrModules = JSON.parse(strResponse);
var bgHeight = 0;
this._aBgHeight = [];
this._aBgHeight.push(0);
for (let i = 0; i < arrModules.resultSet.length; i++) {
let nodeLayout = new cc.Node(arrModules.resultSet[i].name); //创建瀑布流的每一层layout
nodeLayout.width = this._iRightRecommendHeight;
nodeLayout.height = arrModules.resultSet[i].height;
var widgetLayout = nodeLayout.addComponent(cc.Widget);
widgetLayout.isAlignTop = true;
widgetLayout.isAlignLeft = true;
widgetLayout.top = bgHeight;
widgetLayout.left = 0;
bgHeight += arrModules.resultSet[i].height; //逐层增加高度
// cc.log("高度" + bgHeight);
if (i == arrModules.resultSet.length - 1) { //最后一个条目不够高,手动加高
bgHeight += 300;
// Network.ajax("GET", Common.TOPDRAW_API_SERVER + "main/main_recommend.json", null, null,
// function (strResponse) {
try {
// var arrModules = waterfall_model.waterfall; //拿到模拟数据
// var arrModules = this.test_json.json;
var arrModules = JSON.parse(this._oInit.main_recommend);
var bgHeight = 0;
this._aBgHeight = [];
this._aBgHeight.push(0);
for (let i = 0; i < arrModules.resultSet.length; i++) {
let nodeLayout = new cc.Node(arrModules.resultSet[i].name); //创建瀑布流的每一层layout
nodeLayout.width = this._iRightRecommendHeight;
nodeLayout.height = arrModules.resultSet[i].height;
var widgetLayout = nodeLayout.addComponent(cc.Widget);
widgetLayout.isAlignTop = true;
widgetLayout.isAlignLeft = true;
widgetLayout.top = bgHeight;
widgetLayout.left = 0;
bgHeight += arrModules.resultSet[i].height; //逐层增加高度
// cc.log("高度" + bgHeight);
if (i == arrModules.resultSet.length - 1) { //最后一个条目不够高,手动加高
bgHeight += 300;
}
this._aBgHeight.push(bgHeight); //
if (arrModules.resultSet[i].hasChildFrame) { //还有子列表
for (let j = 0; j < arrModules.resultSet[i].data.resultSet.length; j++) {
let oModule = arrModules.resultSet[i].data.resultSet[j];
if (oModule.hasChildFrame && oModule.name == "SpecialList") { //子布局需要左右滑动
let specialListAreaNode = cc.find("SpecialListArea", this.node);
let specialListRectNode = cc.find("SpecialListWrapper", specialListAreaNode);
let specialListNode = cc.find("SpecialList", specialListRectNode);
this._specialListRectNode = specialListRectNode;
this._specialListNode = specialListNode;
this._specialListNode.addComponent(TVScrollParameter);
specialListAreaNode.width = 1280 - oModule.position[0];
specialListRectNode.width = 1280 - oModule.position[0];
specialListAreaNode.height = oModule.height;
specialListRectNode.height = oModule.height;
specialListAreaNode.getComponent(cc.Widget).top = oModule.position[1];
specialListAreaNode.getComponent(cc.Widget).left = oModule.position[0];
for (let k = 0; k < oModule.data.resultSet.length; k++) { //渲染子细胞
let node = cc.instantiate(this.PFB_COMMON);
if (oModule.childrenSize[0] && oModule.childrenSize[1]) {
node.height = oModule.childrenSize[1]; //拿子节点的高
node.width = oModule.childrenSize[0];
node.getChildByName('Pic').height = oModule.childrenSize[1]; //拿子节点的高
node.getChildByName('Pic').width = oModule.childrenSize[0];
}
// if (oModule.data.resultSet[k].imageURL) {
// cc.loader.loadRes(oModule.data.resultSet[k].imageURL, cc.Texture2D, function (err, texture) {
// node.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
// });
// }
Network.loadImageInNativeRuntime(
Common.TOPDRAW_IMAGE_SERVER + oModule.data.resultSet[k].imageURL, null,
function (texture, iRequestId) {
node.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
}, function () { }, this
);
node.x = node.width / 2 + k * (node.width + 24) - 20;
// node.getComponent(cc.Widget).top = 0;
// node.getComponent(cc.Widget).left = node.width / 2 + k * (node.width + 24);
specialListNode.addChild(node, 10, "SpecialList" + k);
//准备焦点坐标
let fiNodeBlock = node.addComponent(FocusInfo);
fiNodeBlock.init('', true, null, null, 1.1);
fiNodeBlock.init(
oModule.data.resultSet[k].tvlink, true, null, null, 1.0 //最后一个参数决定要不要放大显示
);
this._aFocusTargets[0]["SpecialList" + k] = node;
}
specialListAreaNode.removeFromParent();
nodeLayout.addChild(specialListAreaNode, 10, "hasChildFrame");
}
this._aBgHeight.push(bgHeight); //
if (arrModules.resultSet[i].hasChildFrame) { //还有子列表
for (let j = 0; j < arrModules.resultSet[i].data.resultSet.length; j++) {
let oModule = arrModules.resultSet[i].data.resultSet[j];
if (oModule.hasChildFrame && oModule.name == "SpecialList") { //子布局需要左右滑动
let specialListAreaNode = cc.find("SpecialListArea", this.node);
let specialListRectNode = cc.find("SpecialListWrapper", specialListAreaNode);
let specialListNode = cc.find("SpecialList", specialListRectNode);
this._specialListRectNode = specialListRectNode;
this._specialListNode = specialListNode;
this._specialListNode.addComponent(TVScrollParameter);
specialListAreaNode.width = 1280 - oModule.position[0];
specialListRectNode.width = 1280 - oModule.position[0];
specialListAreaNode.height = oModule.height;
specialListRectNode.height = oModule.height;
specialListAreaNode.getComponent(cc.Widget).top = oModule.position[1];
specialListAreaNode.getComponent(cc.Widget).left = oModule.position[0];
for (let k = 0; k < oModule.data.resultSet.length; k++) { //渲染子细胞
let node = cc.instantiate(this.PFB_COMMON);
if (oModule.childrenSize[0] && oModule.childrenSize[1]) {
node.height = oModule.childrenSize[1]; //拿子节点的高
node.width = oModule.childrenSize[0];
node.getChildByName('Pic').height = oModule.childrenSize[1]; //拿子节点的高
node.getChildByName('Pic').width = oModule.childrenSize[0];
}
// if (oModule.data.resultSet[k].imageURL) {
// cc.loader.loadRes(oModule.data.resultSet[k].imageURL, cc.Texture2D, function (err, texture) {
// node.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
// });
// }
Network.loadImageInNativeRuntime(
Common.TOPDRAW_IMAGE_SERVER + oModule.data.resultSet[k].imageURL, null,
function (texture, iRequestId) {
node.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
}, function () { }, this
);
node.x = node.width / 2 + k * (node.width + 24) - 20;
// node.getComponent(cc.Widget).top = 0;
// node.getComponent(cc.Widget).left = node.width / 2 + k * (node.width + 24);
specialListNode.addChild(node, 10, "SpecialList" + k);
//准备焦点坐标
let fiNodeBlock = node.addComponent(FocusInfo);
fiNodeBlock.init('', true, null, null, 1.1);
fiNodeBlock.init(
oModule.data.resultSet[k].tvlink, true, null, null, 1.0 //最后一个参数决定要不要放大显示
);
this._aFocusTargets[0]["SpecialList" + k] = node;
else if (oModule.hasChildFrame && oModule.name != "SpecialList") {
let autoNode = new cc.Node(); //创建特殊层的第二层自动填充的布局
let autoNodeLayout = autoNode.addComponent(cc.Layout);
autoNodeLayout.type = cc.Layout.Type.GRID; //网格
autoNodeLayout.resizeMode = cc.Layout.ResizeMode.CHILDREN; //对子节点大小进行缩放
autoNodeLayout.startAxis = cc.Layout.AxisDirection.HORIZONTAL; //排版起始轴
autoNodeLayout.horizontalDirection = cc.Layout.HorizontalDirection.LEFT_TO_RIGHT; //布局方向
let widgetAutoNode = autoNode.addComponent(cc.Widget);
widgetAutoNode.isAlignLeft = true;
widgetAutoNode.isAlignTop = true;
autoNode.width = oModule.width; //获取自动布局宽高
if (oModule.childrenSize[0] && oModule.childrenSize[1]) {
autoNode.height = oModule.childrenSize[1]; //拿子节点的高
autoNodeLayout.cellSize = new cc.size(oModule.childrenSize[0], oModule.childrenSize[1]);
}
if (oModule.childrenMargin[1]) { //细胞间隔小些
autoNodeLayout.spacingX = oModule.childrenMargin[1];
}
if (oModule.position[0] != "undefined" && oModule.position[1] != "undefined") { //确定位置
widgetAutoNode.top = oModule.position[1];
widgetAutoNode.left = oModule.position[0];
}
for (let k = 0; k < oModule.data.resultSet.length; k++) { //渲染子细胞
let node = cc.instantiate(this.PFB_MAIN_HIGH_SCORE);
if (oModule.childrenSize[0] && oModule.childrenSize[1]) {
node.height = oModule.childrenSize[1]; //拿子节点的高
node.width = oModule.childrenSize[0];
if (oModule.name != "highScore") {
node.getChildByName('Pic').height = oModule.childrenSize[1]; //拿子节点的高
node.getChildByName('Pic').width = oModule.childrenSize[0];
}
specialListAreaNode.removeFromParent();
nodeLayout.addChild(specialListAreaNode, 10, "hasChildFrame");
}
else if (oModule.hasChildFrame && oModule.name != "SpecialList") {
let autoNode = new cc.Node(); //创建特殊层的第二层自动填充的布局
let autoNodeLayout = autoNode.addComponent(cc.Layout);
autoNodeLayout.type = cc.Layout.Type.GRID; //网格
autoNodeLayout.resizeMode = cc.Layout.ResizeMode.CHILDREN; //对子节点大小进行缩放
autoNodeLayout.startAxis = cc.Layout.AxisDirection.HORIZONTAL; //排版起始轴
autoNodeLayout.horizontalDirection = cc.Layout.HorizontalDirection.LEFT_TO_RIGHT; //布局方向
let widgetAutoNode = autoNode.addComponent(cc.Widget);
widgetAutoNode.isAlignLeft = true;
widgetAutoNode.isAlignTop = true;
autoNode.width = oModule.width; //获取自动布局宽高
if (oModule.childrenSize[0] && oModule.childrenSize[1]) {
autoNode.height = oModule.childrenSize[1]; //拿子节点的高
autoNodeLayout.cellSize = new cc.size(oModule.childrenSize[0], oModule.childrenSize[1]);
}
if (oModule.childrenMargin[1]) { //细胞间隔小些
autoNodeLayout.spacingX = oModule.childrenMargin[1];
}
if (oModule.position[0] != "undefined" && oModule.position[1] != "undefined") { //确定位置
widgetAutoNode.top = oModule.position[1];
widgetAutoNode.left = oModule.position[0];
}
for (let k = 0; k < oModule.data.resultSet.length; k++) { //渲染子细胞
let node = cc.instantiate(this.PFB_MAIN_HIGH_SCORE);
if (oModule.childrenSize[0] && oModule.childrenSize[1]) {
node.height = oModule.childrenSize[1]; //拿子节点的高
node.width = oModule.childrenSize[0];
if (oModule.name != "highScore") {
node.getChildByName('Pic').height = oModule.childrenSize[1]; //拿子节点的高
node.getChildByName('Pic').width = oModule.childrenSize[0];
}
}
if (oModule.data.resultSet[k].imageURL) {
// cc.loader.loadRes(oModule.data.resultSet[k].imageURL, cc.Texture2D, function (err, texture) {
// node.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
// });
Network.loadImageInNativeRuntime(
Common.TOPDRAW_IMAGE_SERVER + oModule.data.resultSet[k].imageURL, null,
function (texture, iRequestId) {
node.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
}, function () { }, this
);
}
//自动布局的文字填充
if (oModule.data.resultSet[k].title_visible == 1) { //
node.getComponent('pfbMainHighScoreCell').render(oModule.data.resultSet[k], function () { //让细胞自己渲染文字
}, k);
}
autoNode.addChild(node, 10, oModule.data.resultSet[k].code);
//准备焦点坐标
let fiNodeBlock = node.addComponent(FocusInfo);
// fiNodeBlock.init('', true, null, null, 1.1);
fiNodeBlock.init(
oModule.data.resultSet[k].tvlink, true, null, null, 1.1 //最后一个参数决定要不要放大显示
);
this._aFocusTargets[0][oModule.data.resultSet[k].code] = node;
}
// autoNode.parent=nodeLayout;
// cc.log("添加循环子节点"+autoNode.childrenCount);
nodeLayout.addChild(autoNode, 10, "hasChildFrame");
} else {
let node = cc.instantiate(this.PFB_COMMON_WIDGET);
node.width = oModule.width;
node.height = oModule.height;
if (oModule.imageURL) {
if (oModule.name == "backToTop") {
// cc.loader.loadRes(oModule.imageURL, cc.Texture2D, function (err, texture) {
// node.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, oModule.width, oModule.height));
// });
this._oInit.backToTopImg = Common.TOPDRAW_IMAGE_SERVER + oModule.imageURL;
Network.loadImageInNativeRuntime(
Common.TOPDRAW_IMAGE_SERVER + oModule.imageURL, null,
function (texture, iRequestId) {
node.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, oModule.width, oModule.height));
}, function () { }, this
);
} else {
// cc.loader.loadRes(oModule.imageURL, cc.Texture2D, function (err, texture) {
// node.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
// });
Network.loadImageInNativeRuntime(
Common.TOPDRAW_IMAGE_SERVER + oModule.imageURL, null,
function (texture, iRequestId) {
node.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
}, function () { }, this
);
}
}
node.getChildByName('Pic').width = oModule.width;
node.getChildByName('Pic').height = oModule.height;
node.getChildByName('Pic').getComponent(cc.Sprite).sizeMode = cc.Sprite.SizeMode.CUSTOM;
node.getComponent(cc.Widget).top = oModule.top;
node.getComponent(cc.Widget).left = oModule.left;
nodeLayout.addChild(node, 10, oModule.name);
if (!oModule.disable) { //标题不给他焦点
//准备焦点坐标
let fiNodeBlock = node.addComponent(FocusInfo);
fiNodeBlock.init(
oModule.tvlink, true, null, null, 1.06 //最后一个参数决定要不要放大显示
);
this._aFocusTargets[0][oModule.code] = node;
}
if (oModule.data.resultSet[k].imageURL) {
// cc.loader.loadRes(oModule.data.resultSet[k].imageURL, cc.Texture2D, function (err, texture) {
// node.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
// });
Network.loadImageInNativeRuntime(
Common.TOPDRAW_IMAGE_SERVER + oModule.data.resultSet[k].imageURL, null,
function (texture, iRequestId) {
node.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
}, function () { }, this
);
}
//自动布局的文字填充
if (oModule.data.resultSet[k].title_visible == 1) { //
node.getComponent('pfbMainHighScoreCell').render(oModule.data.resultSet[k], function () { //让细胞自己渲染文字
}, k);
}
autoNode.addChild(node, 10, oModule.data.resultSet[k].code);
if (0 == oModule.name.indexOf("blockShadow")) {
node.opacity = 0;
}
//准备焦点坐标
let fiNodeBlock = node.addComponent(FocusInfo);
// fiNodeBlock.init('', true, null, null, 1.1);
fiNodeBlock.init(
oModule.data.resultSet[k].tvlink, true, null, null, 1.1 //最后一个参数决定要不要放大显示
);
// if (oModule.title_visible == 1) { //
// cc.find('Name', node).active = true;
// cc.find('Name', node).width = oModule.width - 10;
// cc.find('Name/NameBg', node).width = oModule.width;
// cc.find('Name/NormalName', node).width = oModule.width - 10;
// cc.find('Name/ActiveName', node).width = oModule.width - 10;
// cc.find('Name/ActiveName/NameContainer', node).width = oModule.width - 10;
// cc.find('Name/ActiveName/NameContainer/NameText', node).width = oModule.width - 10;
// this.normalName.node.width = oModule.width - 10;
// this.activeName1.string = oModule.title;
// this.activeName2.string = oModule.title;
// this.normalName.string = oModule.title;
// this.activeName1._updateRenderData(true);
// this.activeName2._updateRenderData(true);
// this.normalName._updateRenderData(true);
// //调整文字位置
// let nodeCellName = this.node.getChildByName('Name');
// let nodeScreenTitleText = cc.find('ActiveName/NameContainer/NameText', nodeCellName);
// let nodeScreenTitleText1 = nodeScreenTitleText.getChildByName('NameText1');
// if (nodeScreenTitleText1.width > nodeScreenTitleText.width) {
// this.normalName.overflow = cc.Label.Overflow.CLAMP;
// this.normalName.enableWrapText = false;
// this.normalName.horizontalAlign = cc.Label.HorizontalAlign.LEFT;
// }
// }
this._aFocusTargets[0][oModule.data.resultSet[k].code] = node;
}
// autoNode.parent=nodeLayout;
// cc.log("添加循环子节点"+autoNode.childrenCount);
nodeLayout.addChild(autoNode, 10, "hasChildFrame");
} else {
let node = cc.instantiate(this.PFB_COMMON_WIDGET);
node.width = oModule.width;
node.height = oModule.height;
if (oModule.imageURL) {
if (oModule.name == "backToTop") {
// cc.loader.loadRes(oModule.imageURL, cc.Texture2D, function (err, texture) {
// node.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, oModule.width, oModule.height));
// });
this._oInit.backToTopImg = Common.TOPDRAW_IMAGE_SERVER + oModule.imageURL;
Network.loadImageInNativeRuntime(
Common.TOPDRAW_IMAGE_SERVER + oModule.imageURL, null,
function (texture, iRequestId) {
node.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, oModule.width, oModule.height));
}, function () { }, this
);
} else {
// cc.loader.loadRes(oModule.imageURL, cc.Texture2D, function (err, texture) {
// node.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
// });
Network.loadImageInNativeRuntime(
Common.TOPDRAW_IMAGE_SERVER + oModule.imageURL, null,
function (texture, iRequestId) {
node.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
}, function () { }, this
);
}
}
node.getChildByName('Pic').width = oModule.width;
node.getChildByName('Pic').height = oModule.height;
node.getChildByName('Pic').getComponent(cc.Sprite).sizeMode = cc.Sprite.SizeMode.CUSTOM;
node.getComponent(cc.Widget).top = oModule.top;
node.getComponent(cc.Widget).left = oModule.left;
nodeLayout.addChild(node, 10, oModule.name);
if (!oModule.disable) { //标题不给他焦点
//准备焦点坐标
let fiNodeBlock = node.addComponent(FocusInfo);
fiNodeBlock.init(
oModule.tvlink, true, null, null, 1.06 //最后一个参数决定要不要放大显示
);
this._aFocusTargets[0][oModule.code] = node;
}
if (0 == oModule.name.indexOf("blockShadow")) {
node.opacity = 0;
}
// if (oModule.title_visible == 1) { //
// cc.find('Name', node).active = true;
// cc.find('Name', node).width = oModule.width - 10;
// cc.find('Name/NameBg', node).width = oModule.width;
// cc.find('Name/NormalName', node).width = oModule.width - 10;
// cc.find('Name/ActiveName', node).width = oModule.width - 10;
// cc.find('Name/ActiveName/NameContainer', node).width = oModule.width - 10;
// cc.find('Name/ActiveName/NameContainer/NameText', node).width = oModule.width - 10;
// this.normalName.node.width = oModule.width - 10;
// this.activeName1.string = oModule.title;
// this.activeName2.string = oModule.title;
// this.normalName.string = oModule.title;
// this.activeName1._updateRenderData(true);
// this.activeName2._updateRenderData(true);
// this.normalName._updateRenderData(true);
// //调整文字位置
// let nodeCellName = this.node.getChildByName('Name');
// let nodeScreenTitleText = cc.find('ActiveName/NameContainer/NameText', nodeCellName);
// let nodeScreenTitleText1 = nodeScreenTitleText.getChildByName('NameText1');
// if (nodeScreenTitleText1.width > nodeScreenTitleText.width) {
// this.normalName.overflow = cc.Label.Overflow.CLAMP;
// this.normalName.enableWrapText = false;
// this.normalName.horizontalAlign = cc.Label.HorizontalAlign.LEFT;
// }
// }
}
nodeLayout.parent = rightNodeLayout;
// cc.log("子节点:"+nodeLayout.childrenCount);
}
// this.node.getChildByName("scrollContent").height = 2300; //这里暂且写死,scrollView有bug
// this._scrollview.scrollToTop();
} catch (error) {
cc.log("Business Exception:Get getRightRecommendRequest..." + error);
}
},
function (strResponse) {
cc.log("Business Error:Get getRightRecommendRequest..." + strResponse);
}, this, "uuid");
nodeLayout.parent = rightNodeLayout;
// cc.log("子节点:"+nodeLayout.childrenCount);
}
// this.node.getChildByName("scrollContent").height = 2300; //这里暂且写死,scrollView有bug
// this._scrollview.scrollToTop();
} catch (error) {
cc.log("Business Exception:Get getRightRecommendRequest..." + error);
}
// },
// function (strResponse) {
// cc.log("Business Error:Get getRightRecommendRequest..." + strResponse);
// }, this, "uuid");
},
recoverFocusPath: function () {
if (this._oSceneContext._iCurrentLeftIndex == 1) {
if (this._oSceneContext._iPageIndex == 1) {
this.scheduleOnce(()=>{
this.scheduleOnce(() => {
let fiFocusTarget = cc.find(this._oSceneContext.focusPath, this.node).getComponent(FocusInfo);
this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_DOWN, null, null);
return;
},0)
}, 0)
}
let height = this._aBgHeight[this._oSceneContext._iPageIndex - 1] || 0; //-1,打补丁:解决回退回来页面对不上的bug
this.onScrollViewScrollStart();
......@@ -978,34 +1008,36 @@ cc.Class({
iTargetTopUp = fiFocusTarget.node.getParent().getComponent(cc.Widget).top;
}
// cc.log("目标节点: "+fiCurrentFocus.node.name);
let iCurrentFloorBottomUp = this._aBgHeight[this._oSceneContext._iPageIndex - 1] || 0;//当前楼层底部高度
// cc.log(iCurrentFloorBottomUp + "目标节点的高度:" + iTargetTopUp);
if (this._bIsScrollViewMoving) {
return;
}
if (iTargetTopUp < iCurrentFloorBottomUp && fiCurrentFocus.node.name.indexOf("NaviCell") == -1) {
if (this._oSceneContext._iPageIndex > 1) {
//---------------隐藏焦点0.6秒,就看不到焦点框长时间的跳转------------------
this._cFocus.hide();
setTimeout(function () {
if (0 != fiFocusTarget.node.getName().indexOf('view_pager_label')) //补丁:跳到view_pager_label列表不允许显示焦点框
this._cFocus.show();
this.onScrollViewScrollEnd();
}.bind(this), 600);
//----------------------------------------------------------------------
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);
// cc.log("滚动到:" + height);
this.scheduleOnce(function () {
this.keyDownDirection(Common.MOVE_DIRECTION_UP);
}, 0.3);
// setTimeout(function () {
// this.keyDownDirection(Common.MOVE_DIRECTION_UP);
// }.bind(this), 300);
if (this._aBgHeight && this._aBgHeight.length > 0) {
let iCurrentFloorBottomUp = this._aBgHeight[this._oSceneContext._iPageIndex - 1] || 0;//当前楼层底部高度
// cc.log(iCurrentFloorBottomUp + "目标节点的高度:" + iTargetTopUp);
if (this._bIsScrollViewMoving) {
return;
}
if (iTargetTopUp < iCurrentFloorBottomUp && fiCurrentFocus.node.name.indexOf("NaviCell") == -1) {
if (this._oSceneContext._iPageIndex > 1) {
//---------------隐藏焦点0.6秒,就看不到焦点框长时间的跳转------------------
this._cFocus.hide();
setTimeout(function () {
if (0 != fiFocusTarget.node.getName().indexOf('view_pager_label')) //补丁:跳到view_pager_label列表不允许显示焦点框
this._cFocus.show();
this.onScrollViewScrollEnd();
}.bind(this), 600);
//----------------------------------------------------------------------
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);
// cc.log("滚动到:" + height);
this.scheduleOnce(function () {
this.keyDownDirection(Common.MOVE_DIRECTION_UP);
}, 0.3);
// setTimeout(function () {
// this.keyDownDirection(Common.MOVE_DIRECTION_UP);
// }.bind(this), 300);
return;
}
}
}
this.keyDownDirection(Common.MOVE_DIRECTION_UP);
break;
......@@ -1041,34 +1073,36 @@ cc.Class({
} else if (fiFocusTarget.node.getParent().getComponent(cc.Widget)) {
iTargetTop = fiFocusTarget.node.getParent().getComponent(cc.Widget).top;
}
let iCurrentFloorBottom = this._aBgHeight[this._oSceneContext._iPageIndex - 1] || 0;//当前楼层底部高度
// cc.log(iCurrentFloorBottom + "目标节点的高度:" + iTargetTop + "::" + this._oSceneContext._iPageIndex);
if (this._bIsScrollViewMoving) {
return;
}
if (iTargetTop > iCurrentFloorBottom && fiCurrentFocus.node.name.indexOf("NaviCell") == -1 && fiCurrentFocus.node.name.indexOf("TopCell") == -1) {
if (this._oSceneContext._iPageIndex < this._aBgHeight.length - 1) {
//---------------隐藏焦点0.6秒,就看不到焦点框长时间的跳转------------------
this._cFocus.hide();
setTimeout(function () {
if (0 != fiFocusTarget.node.name.indexOf("backToTop"))
this._cFocus.show();
this.onScrollViewScrollEnd();
}.bind(this), 600);
//----------------------------------------------------------------------
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);
// cc.log("滚动到:"+height);
this._oSceneContext._iPageIndex++;
this.scheduleOnce(function () {
this.keyDownDirection(Common.MOVE_DIRECTION_DOWN);
}, 0.3);
// setTimeout(function () {
// this.keyDownDirection(Common.MOVE_DIRECTION_DOWN);
// }.bind(this), 300);
if (this._aBgHeight && this._aBgHeight.length > 0) {
let iCurrentFloorBottom = this._aBgHeight[this._oSceneContext._iPageIndex - 1] || 0;//当前楼层底部高度
// cc.log(iCurrentFloorBottom + "目标节点的高度:" + iTargetTop + "::" + this._oSceneContext._iPageIndex);
if (this._bIsScrollViewMoving) {
return;
}
if (iTargetTop > iCurrentFloorBottom && fiCurrentFocus.node.name.indexOf("NaviCell") == -1 && fiCurrentFocus.node.name.indexOf("TopCell") == -1) {
if (this._oSceneContext._iPageIndex < this._aBgHeight.length - 1) {
//---------------隐藏焦点0.6秒,就看不到焦点框长时间的跳转------------------
this._cFocus.hide();
setTimeout(function () {
if (0 != fiFocusTarget.node.name.indexOf("backToTop"))
this._cFocus.show();
this.onScrollViewScrollEnd();
}.bind(this), 600);
//----------------------------------------------------------------------
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);
// cc.log("滚动到:"+height);
this._oSceneContext._iPageIndex++;
this.scheduleOnce(function () {
this.keyDownDirection(Common.MOVE_DIRECTION_DOWN);
}, 0.3);
// setTimeout(function () {
// this.keyDownDirection(Common.MOVE_DIRECTION_DOWN);
// }.bind(this), 300);
return;
}
}
}
this.keyDownDirection(Common.MOVE_DIRECTION_DOWN);
break;
......@@ -1277,14 +1311,16 @@ cc.Class({
this._oSceneContext._iCurrentLeftIndex = iIndex;
this.scheduleOnce(function () {
// this.requestMediaList(1); //重新渲染CategoryList
this.getSimulateRequest();
}, 0);
// this.renderCategoryList(1);
var rightNodeLayout = this.targetAry[1].target;
if (iIndex == 1) {
this.scheduleOnce(function () {
// this.getRightRecommendRequestData();
}, 0);
cc.find("scrollContent/ViewPagerArea", this.node).active = true;
cc.find("scrollContent/BlockShadow", this.node).active = true;
// cc.find("scrollContent/CategoryListRecommendLayout", this.node).active = false;
......@@ -1513,11 +1549,11 @@ cc.Class({
// this.panel.byteProgress.progress = 0;
this._bAbleHotUpdate = true;
this._iSceneStatus = 1; //焦点框跳转层级
cc.find("update", this.node).active = true; //显示出来更新面板
this._cFocus.show();
let fiHotUpdateBtn = cc.find('update/update_panel/update_btn', this.node).getComponent(FocusInfo); //热更新按钮
this._cFocus.flyFocus(this._fiCurrentFocus, fiHotUpdateBtn, Common.MOVE_DIRECTION_RIGHT, null, null);
// this._iSceneStatus = 1; //焦点框跳转层级
// cc.find("update", this.node).active = true; //显示出来更新面板
// this._cFocus.show();
// let fiHotUpdateBtn = cc.find('update/update_panel/update_btn', this.node).getComponent(FocusInfo); //热更新按钮
// this._cFocus.flyFocus(this._fiCurrentFocus, fiHotUpdateBtn, Common.MOVE_DIRECTION_RIGHT, null, null);
break;
default:
......@@ -1528,9 +1564,9 @@ cc.Class({
this._checkListener = null;
this._updating = false;
// if (this._bAbleHotUpdate) {
// this.hotUpdate(); //放在这里可以静默升级
// }
if (this._bAbleHotUpdate) {
this.hotUpdate(); //放在这里可以静默升级
}
},
hotUpdate: function () {
......

80.8 KB | W: | H:

89.9 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

15.3 KB | W: | H:

20.5 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
......@@ -49,8 +49,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 270,
"height": 192
"width": 221,
"height": 176
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -128,8 +128,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 270,
"height": 152
"width": 221,
"height": 136
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -812,7 +812,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 270,
"width": 221,
"height": 40
},
"_anchorPoint": {
......@@ -825,7 +825,7 @@
"ctor": "Float32Array",
"array": [
0,
-76,
-68,
0,
0,
0,
......@@ -876,7 +876,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 270,
"width": 221,
"height": 40
},
"_anchorPoint": {
......@@ -998,7 +998,7 @@
"__type__": "TypedArray",
"ctor": "Float32Array",
"array": [
-125,
-100.5,
0,
0,
0,
......@@ -1165,7 +1165,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 270,
"width": 221,
"height": 40
},
"_anchorPoint": {
......@@ -1241,7 +1241,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 270,
"width": 221,
"height": 40
},
"_anchorPoint": {
......@@ -1590,7 +1590,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 250,
"width": 200,
"height": 40
},
"_anchorPoint": {
......@@ -1669,7 +1669,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 250,
"width": 200,
"height": 40
},
"_anchorPoint": {
......@@ -2123,7 +2123,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 250,
"width": 200,
"height": 40
},
"_anchorPoint": {
......
......@@ -173,7 +173,7 @@ public class TopdrawSDKWrapper {
_activity.startActivity(intent);
pluginLoaded = false;
_activity.runOnUiThread(new Runnable() { //直接加载游戏,传回去进度是100
_activity.runOnUiThread(new Runnable() {
@Override
public void run() {
singleColorView.setVisibility(View.VISIBLE); //展示单色背景,解决透明度问题
......