Commit c42acafc c42acafc742ad695f3d2a2201a21dfb0f76cef43 by 金学艇

1.修改详情页

2.优化首页
1 parent bb7b0fc9
Showing 153 changed files with 82 additions and 81 deletions
......@@ -189,7 +189,7 @@
"array": [
0,
0,
271.0601806640625,
271.0609130859375,
0,
0,
0,
......
......@@ -189,7 +189,7 @@
"array": [
0,
0,
265.0037841796875,
271.06060791015625,
0,
0,
0,
......@@ -1228,9 +1228,7 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "25c3545b-49b6-40d0-928d-58a15150d9da"
},
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
......@@ -1364,9 +1362,7 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "25c3545b-49b6-40d0-928d-58a15150d9da"
},
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
......@@ -1500,9 +1496,7 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "25c3545b-49b6-40d0-928d-58a15150d9da"
},
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
......@@ -1636,9 +1630,7 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "25c3545b-49b6-40d0-928d-58a15150d9da"
},
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
......@@ -1962,15 +1954,15 @@
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
"x": 0,
"y": 1
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float32Array",
"array": [
0,
0,
-178,
0,
0,
0,
......@@ -2005,9 +1997,9 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": -100,
"_left": 0,
"_right": 0,
"_top": -100,
"_top": 178,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
......@@ -2262,7 +2254,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1153,
"height": 650
"height": 200
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2286,7 +2278,7 @@
"ctor": "Float32Array",
"array": [
640,
-955,
-750,
0,
0,
0,
......@@ -2340,7 +2332,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1200,
"height": 670
"height": 215
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2410,7 +2402,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1153,
"height": 554
"height": 200
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2434,7 +2426,7 @@
"ctor": "Float32Array",
"array": [
0,
0,
15,
0,
0,
0,
......@@ -3380,7 +3372,7 @@
"_alignFlags": 1,
"_left": 0,
"_right": 0,
"_top": 630,
"_top": 650,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
......@@ -5673,30 +5665,9 @@
"_aTouchContext": [],
"_defaultBackScene": null,
"_oFocusScaleFactorInfo": null,
"layout_json": {
"__uuid__": "2f979325-7c8b-45cc-99a5-30cc9c056bb1"
},
"recommend_json": {
"test_json": {
"__uuid__": "d797e6d8-b99b-4992-be3f-35357c9dcd65"
},
"category_xxyz_list": {
"__uuid__": "3beb596d-4dc5-414e-9751-9cbff50a0a39"
},
"category_dztg_json": {
"__uuid__": "9a8524c5-13e3-414a-91d7-32dcbcef16c0"
},
"category_3dyx_json": {
"__uuid__": "c3913569-3224-4557-aedd-a877a7c75939"
},
"category_jycl_json": {
"__uuid__": "25224060-4e72-44d0-9fa1-caa051cf1249"
},
"category_jsby_json": {
"__uuid__": "0a9757cd-35ad-43d4-8eab-9501998a4345"
},
"test_category_list_recommend_json": {
"__uuid__": "9d3d5ca5-5f87-4dd6-aca0-d18e2f36e990"
},
"PFB_COMMON_WIDGET": {
"__uuid__": "57787725-2430-4ac3-b324-c22c08c3f074"
},
......
......@@ -403,6 +403,7 @@ cc.Class({
return true;
},
//模拟json中,count的值一定得准确,否则滑动出错
loadData: function (onSuccess, onError, oScope, strResponse) {
var oJSONResult = JSON.parse(strResponse);
var oHandleJson = {};
......
......@@ -52,6 +52,8 @@ cc.Topdraw.TVCanvas =
_defaultBackScene: null,//每个场景Canvas都有的 默认返回场景 每个场景自己构造函数内设置值
_oFocusScaleFactorInfo: null,
_bShowExitBox: false,
},
onLoad: function () {
......@@ -315,6 +317,7 @@ cc.Topdraw.TVCanvas =
let aSceneContext = compApplication.getSceneContext();
let aSceneParameter = compApplication.getSceneParameter();
if (aSceneParameter.length) {
this._bShowExitBox = false;
let oSceneParameter = aSceneParameter.pop();
//aSceneParameter[]
compApplication.setBackStatus(true);
......@@ -354,9 +357,17 @@ cc.Topdraw.TVCanvas =
} else {
cc.log("应该退出应用才对");
//cc.director.end();
// this.commonSimpleTip("退出应用", 1);
// cc.game.end();
if (!this._bShowExitBox) { //弹出挽留界面
this.showDetainBox();
} else {
cc.log("退出应用!");
cc.game.end();
}
}
}
} catch (error) {
if (cc.sys.isNative) {
jsb.reflection.callStaticMethod("org/cocos2dx/javascript/AppActivity", "logInSceneI", "(Ljava/lang/String;)V", "backAScene Error in TVCanvas==>" + error);
......@@ -926,20 +937,18 @@ cc.Topdraw.TVCanvas =
*/
showDetainBox: function (fiBackend, bHideBg) {
try {
this._bShowExitBox = true;
if (this._nodeSystemPrompt) {
this._nodeSystemPrompt.opacity = 255;
this._iDetainBoxStatus = this._aFocusTargets.length;
if (null == this._aFocusTargets[this._iDetainBoxStatus]) {
this._aFocusTargets[this._iDetainBoxStatus] = [];
if (null == this._aFocusTargets[1]) { //focus放到第二层级,避免冲突
this._aFocusTargets[1] = [];
}
this._aFocusTargets[this._iDetainBoxStatus]['system_confirm_btn'] = cc.find("PromptBox/Confirm", this._nodeSystemPrompt);
this._aFocusTargets[this._iDetainBoxStatus]['system_cancel_btn'] = cc.find("PromptBox/Cancel", this._nodeSystemPrompt);
this._aFocusTargets[1]['system_confirm_btn'] = cc.find("PromptBox/Confirm", this._nodeSystemPrompt);
this._aFocusTargets[1]['system_cancel_btn'] = cc.find("PromptBox/Cancel", this._nodeSystemPrompt);
this._fiBeforeDetainBox = this._fiCurrentFocus;
this._fiBackend = fiBackend;
this._iStatusBeforeDetainBox = this._iFocusStatus;
this._iFocusStatus = this._iDetainBoxStatus;
this._cFocus.flyFocus(this._fiCurrentFocus, this._aFocusTargets[this._iDetainBoxStatus]['system_confirm_btn'].getComponent(FocusInfo), Common.MOVE_DIRECTION_UP, this._fFocusScaleFactor, null);
this._bShowingDetainBox = true;
this._iSceneStatus = 1;
this._cFocus.flyFocus(this._fiCurrentFocus, this._aFocusTargets[1]['system_confirm_btn'].getComponent(FocusInfo), Common.MOVE_DIRECTION_UP, this._fFocusScaleFactor, null);
this._bIsLoadingPfbSystemPrompt = false;
} else {
this._bIsLoadingPfbSystemPrompt = true;
......@@ -974,17 +983,18 @@ cc.Topdraw.TVCanvas =
hideDetainBox: function () {
try {
this._nodeSystemPrompt.opacity = 0;
delete this._aFocusTargets[this._iDetainBoxStatus]['system_confirm_btn'];
delete this._aFocusTargets[this._iDetainBoxStatus]['system_cancel_btn'];
this._iFocusStatus = this._iStatusBeforeDetainBox;
delete this._aFocusTargets[1]['system_confirm_btn'];
delete this._aFocusTargets[1]['system_cancel_btn'];
this._iSceneStatus = 0;
let iX = Common.SCREEN_WIDTH / 2 + Common.getX(this._fiBeforeDetainBox.node) - this._fiBeforeDetainBox.node.width / 2;
let iY = Common.SCREEN_HEIGHT / 2 - Common.getY(this._fiBeforeDetainBox.node) + this._fiBeforeDetainBox.node.height / 2;
cc.log("记忆焦点:"+this._fiBeforeDetainBox.node.name);
if (this._fiBeforeDetainBox.getEnable() && iX >= 0 && iX <= Common.SCREEN_WIDTH && iY >= 0 && iY <= Common.SCREEN_HEIGHT + 50) {//这里是考虑给播放元素设置了虚拟位置
this._cFocus.flyFocus(this._fiCurrentFocus, this._fiBeforeDetainBox, Common.MOVE_DIRECTION_UP, this._fFocusScaleFactor, null);
} else {
this._cFocus.flyFocus(this._fiCurrentFocus, this._fiBackend, Common.MOVE_DIRECTION_UP, this._fFocusScaleFactor, null);
}
this._bShowingDetainBox = false;
this._bShowExitBox = false;
} catch (error) {
if (cc.sys.isNative) {
jsb.reflection.callStaticMethod("org/cocos2dx/javascript/AppActivity", "logInSceneI", "(Ljava/lang/String;)V", "hideDetainBox Error in TVCanvas==>" + error);
......
......@@ -61,10 +61,16 @@ cc.Class({
// self.pic.spriteFrame = new cc.SpriteFrame(texture);
// }, null, this
// );
cc.log("categoryList..."+oData.image[0].fileUrl);
cc.loader.loadRes(oData.image[0].fileUrl, cc.Texture2D, function (err, texture) {
// cc.log("categoryList..."+oData.image[0].fileUrl);
// cc.loader.loadRes(oData.image[0].fileUrl, cc.Texture2D, function (err, texture) {
// self.pic.spriteFrame = new cc.SpriteFrame(texture);
// });
Network.loadImageInNativeRuntime(
Common.TOPDRAW_IMAGE_SERVER + oData.image[0].fileUrl, null,
function (texture, iRequestId) {
self.pic.spriteFrame = new cc.SpriteFrame(texture);
});
}, function () { }, this
);
}
// cc.log("category list cell location: "+oData.image[0].fileUrl);
this.node.getComponent(FocusInfo).setTVLink(oData.tvlink);
......
......@@ -23,7 +23,24 @@ cc.Class({
this.node.getChildByName('Pic').height = data.height;
if (data.imageURL) {
var self = this;
cc.loader.loadRes(data.imageURL, cc.Texture2D, function (err, texture) {
// cc.loader.loadRes(data.imageURL, cc.Texture2D, function (err, texture) {
// if (strCellName == "topNavi") {
// self.pic.spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, data.width, data.height));
// if (i == iCurrentIndex) {
// self.pic.spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, data.height, data.width, data.height));
// }
// } else {
// self.pic.spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, data.width, data.height));
// }
// // if (null != funCallback && typeof funCallback == 'function') {
// // funCallback.call();
// // }
// });
Network.loadImageInNativeRuntime(
Common.TOPDRAW_IMAGE_SERVER + data.imageURL
, null,
function (texture, iRequestId) {
if (strCellName == "topNavi") {
self.pic.spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, data.width, data.height));
if (i == iCurrentIndex) {
......@@ -32,25 +49,15 @@ cc.Class({
} else {
self.pic.spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, data.width, data.height));
}
// if (null != funCallback && typeof funCallback == 'function') {
// funCallback.call();
// }
});
// Network.loadImageInNativeRuntime(
// Common.TOPDRAW_IMAGE_SERVER_EDU + data.imageURL,
// function (texture) {
// self.pic.spriteFrame = new cc.SpriteFrame(texture,cc.rect(0,0,self.node.width,self.node.height));
// if (null != funCallback && typeof funCallback == 'function') {
// funCallback.call();
// }
// }, null, this
// );
},
function () {
},
this
);
}
if (strCellName == "topNavi" && i>0) {
if (strCellName == "topNavi" && i > 0) {
this.node.getComponent(cc.Widget).top = data.top - data.height / 2;
} else {
this.node.getComponent(cc.Widget).top = data.top;
......
......@@ -10,6 +10,7 @@ cc.Class({
properties: {
id: 0,
pic: cc.Sprite,
mark: cc.Sprite,
activeName1: cc.Label,
activeName2: cc.Label,
normalName: cc.Label,
......@@ -25,7 +26,8 @@ cc.Class({
},
render(oData, iRecordIndex) {
render(oData, iRecordIndex, i) {
var self = this;
this.activeName1.string = oData.name;
this.activeName2.string = oData.name;
this.normalName.string = oData.name;
......@@ -33,6 +35,10 @@ cc.Class({
this.node.getChildByName("Normal").active = true;
cc.loader.loadRes("Main/top" + (i + 1), cc.Texture2D, function (err, texture) {
self.mark.spriteFrame = new cc.SpriteFrame(texture);
});
// this.activeName1._updateRenderData(true);
// this.activeName2._updateRenderData(true);
// this.normalName._updateRenderData(true);
......

22.2 KB | W: | H:

10.9 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

1.61 KB | W: | H:

1.03 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

147 Bytes | W: | H:

937 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin

1.77 KB | W: | H:

1.03 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

149 Bytes | W: | H:

931 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin

141 Bytes | W: | H:

928 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin

1.75 KB | W: | H:

1.02 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

148 Bytes | W: | H:

933 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin

1.67 KB | W: | H:

1.02 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin