1.解决首页瀑布流和分类页的光标记忆问题
Showing
7 changed files
with
204 additions
and
119 deletions
... | @@ -5708,8 +5708,8 @@ | ... | @@ -5708,8 +5708,8 @@ |
5708 | } | 5708 | } |
5709 | ], | 5709 | ], |
5710 | "_useOriginalSize": false, | 5710 | "_useOriginalSize": false, |
5711 | "_string": "v1.0.2.2020031115", | 5711 | "_string": "v0.9.0.2020031117", |
5712 | "_N$string": "v1.0.2.2020031115", | 5712 | "_N$string": "v0.9.0.2020031117", |
5713 | "_fontSize": 24, | 5713 | "_fontSize": 24, |
5714 | "_lineHeight": 24, | 5714 | "_lineHeight": 24, |
5715 | "_enableWrapText": true, | 5715 | "_enableWrapText": true, | ... | ... |
... | @@ -147,6 +147,39 @@ cc.Class({ | ... | @@ -147,6 +147,39 @@ cc.Class({ |
147 | 147 | ||
148 | }, | 148 | }, |
149 | 149 | ||
150 | onKeyUp: function (event) { | ||
151 | try { | ||
152 | this._super(event); | ||
153 | var fiFocusTarget = null; | ||
154 | var fiCurrentFocus = this._fiCurrentFocus; | ||
155 | var oScrollParameter = null; | ||
156 | |||
157 | let nodeFrom = null; | ||
158 | let nodeTo = null; | ||
159 | if (event.keyCode == cc.macro.KEY.right || event.keyCode == Common.ANDROID_KEY.right) { | ||
160 | if (fiCurrentFocus.node.name == "ProgressBtn" || this._fiCurrentFocus.node.name == "Play") { | ||
161 | this._ComOperation.resumePlayState(); | ||
162 | this._iFakeProgressStep = 0; | ||
163 | this._bFakeProgressStart = false; | ||
164 | this.unschedule(this.fakeStepForward); | ||
165 | } | ||
166 | } | ||
167 | if (event.keyCode == cc.macro.KEY.left || event.keyCode == Common.ANDROID_KEY.left) { | ||
168 | if (fiCurrentFocus.node.name == "ProgressBtn" || this._fiCurrentFocus.node.name == "Play") { | ||
169 | this._ComOperation.resumePlayState(); | ||
170 | this._iFakeProgressStep = 0; | ||
171 | this._bFakeProgressStart = false; | ||
172 | this.unschedule(this.fakeStepBackward); | ||
173 | } | ||
174 | } | ||
175 | } catch (error) { | ||
176 | if (cc.sys.isNative) { | ||
177 | jsb.reflection.callStaticMethod("org/cocos2dx/javascript/AppActivity", "logInSceneI", "(Ljava/lang/String;)V", "onKeyUp Error in VarietyVideo==>" + error); | ||
178 | } | ||
179 | } | ||
180 | |||
181 | }, | ||
182 | |||
150 | onKeyDown: function (event) { | 183 | onKeyDown: function (event) { |
151 | try { | 184 | try { |
152 | this._super(event); | 185 | this._super(event); |
... | @@ -184,19 +217,19 @@ cc.Class({ | ... | @@ -184,19 +217,19 @@ cc.Class({ |
184 | this._strOperationBtnPath = this._bMediaFree ? "VideoArea/PlayPanel/Operation/Play" : "VideoArea/PlayPanel/Operation/Group/Collect"; | 217 | this._strOperationBtnPath = this._bMediaFree ? "VideoArea/PlayPanel/Operation/Play" : "VideoArea/PlayPanel/Operation/Group/Collect"; |
185 | this.showOperationBtns(); | 218 | this.showOperationBtns(); |
186 | } | 219 | } |
187 | else if (this._fiCurrentFocus.node.parent.name == "Operation" || this._fiCurrentFocus.node.parent.parent.name == "Operation") { | 220 | else if (this._fiCurrentFocus.node.parent.name == "Operation" || this._fiCurrentFocus.node.parent.parent.name == "Operation") { |
188 | //这里说什么要做抖动 | 221 | //这里说什么要做抖动 |
189 | fiFocusTarget = this._cFocus.findTarget(this._fiCurrentFocus, this._aFocusTargets, this._iFocusStatus, Common.MOVE_DIRECTION_DOWN); | 222 | fiFocusTarget = this._cFocus.findTarget(this._fiCurrentFocus, this._aFocusTargets, this._iFocusStatus, Common.MOVE_DIRECTION_DOWN); |
190 | fiFocusTarget = this.checkFocusTarget(fiFocusTarget); | 223 | fiFocusTarget = this.checkFocusTarget(fiFocusTarget); |
191 | this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_DOWN, 1.0, oScrollParameter); | 224 | this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_DOWN, 1.0, oScrollParameter); |
192 | } | 225 | } |
193 | else { | 226 | else { |
194 | fiFocusTarget = this._cFocus.findTarget(this._fiCurrentFocus, this._aFocusTargets, this._iFocusStatus, Common.MOVE_DIRECTION_DOWN); | 227 | fiFocusTarget = this._cFocus.findTarget(this._fiCurrentFocus, this._aFocusTargets, this._iFocusStatus, Common.MOVE_DIRECTION_DOWN); |
195 | fiFocusTarget = this.checkFocusTarget(fiFocusTarget); | 228 | fiFocusTarget = this.checkFocusTarget(fiFocusTarget); |
196 | // if (!this._bMediaFree && this._fiCurrentFocus.node.name == "ProgressBtn") { | 229 | // if (!this._bMediaFree && this._fiCurrentFocus.node.name == "ProgressBtn") { |
197 | // fiFocusTarget = cc.find("VideoArea/PlayPanel/Operation/Group/Collect", this.node).getComponent(FocusInfo); | 230 | // fiFocusTarget = cc.find("VideoArea/PlayPanel/Operation/Group/Collect", this.node).getComponent(FocusInfo); |
198 | // } | 231 | // } |
199 | cc.log("向下滑动:"+fiFocusTarget.node.name); | 232 | cc.log("向下滑动:" + fiFocusTarget.node.name); |
200 | this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_DOWN, 1.0, oScrollParameter); | 233 | this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_DOWN, 1.0, oScrollParameter); |
201 | } | 234 | } |
202 | if (this._fiCurrentFocus.node.name == "Play" && this._bShowProgress) { | 235 | if (this._fiCurrentFocus.node.name == "Play" && this._bShowProgress) { |
... | @@ -488,7 +521,7 @@ cc.Class({ | ... | @@ -488,7 +521,7 @@ cc.Class({ |
488 | 521 | ||
489 | this._ComOperation.initPlayer(0, 0, Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, true, true); //测试 | 522 | this._ComOperation.initPlayer(0, 0, Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, true, true); //测试 |
490 | let options = {}; | 523 | let options = {}; |
491 | options.playurl = "https://135zyv5.xw0371.com/2018/10/29/X05c7CG3VB91gi1M/playlist.m3u8"; | 524 | options.playurl = "http://mirror.aarnet.edu.au/pub/TED-talks/911Mothers_2010W-480p.mp4"; |
492 | this._ComOperation.setURL(options); //测试播放地址 | 525 | this._ComOperation.setURL(options); //测试播放地址 |
493 | } catch (error) { | 526 | } catch (error) { |
494 | if (cc.sys.isNative) { | 527 | if (cc.sys.isNative) { | ... | ... |
... | @@ -457,9 +457,9 @@ cc.Topdraw.TVCanvas = | ... | @@ -457,9 +457,9 @@ cc.Topdraw.TVCanvas = |
457 | this._oNextSceneParameter.sceneName = strForwardSceneName; | 457 | this._oNextSceneParameter.sceneName = strForwardSceneName; |
458 | aSceneParameter.push(this._oNextSceneParameter); | 458 | aSceneParameter.push(this._oNextSceneParameter); |
459 | aSceneContext.push(this._oSceneContext); | 459 | aSceneContext.push(this._oSceneContext); |
460 | this._cLog.screenI("跳转场景1111111"); | 460 | // this._cLog.screenI("跳转场景1111111"); |
461 | this._ComOperation && this._ComOperation.end(); | 461 | this._ComOperation && this._ComOperation.end(); |
462 | this._cLog.screenI("跳转场景2222222"); | 462 | // this._cLog.screenI("跳转场景2222222"); |
463 | Common.g_strCurrentSceneName = strForwardSceneName; | 463 | Common.g_strCurrentSceneName = strForwardSceneName; |
464 | cc.director.loadScene(strForwardSceneName); | 464 | cc.director.loadScene(strForwardSceneName); |
465 | } | 465 | } | ... | ... |
... | @@ -26,7 +26,20 @@ cc.Class({ | ... | @@ -26,7 +26,20 @@ cc.Class({ |
26 | this._super(); | 26 | this._super(); |
27 | this._oInit = {}; | 27 | this._oInit = {}; |
28 | this._oSceneContext._iCurrentLeftIndex = 0; | 28 | this._oSceneContext._iCurrentLeftIndex = 0; |
29 | this._oSceneContext.focusPath = "TypeListArea/TypeListWrapper/TypeList/topNavi" + this._oSceneContext._iCurrentLeftIndex; | ||
29 | this._bIsDataListMoving = false; | 30 | this._bIsDataListMoving = false; |
31 | this._bInitCategoryListSuccess = false; | ||
32 | |||
33 | if (this._cApplication.getBackStatus()) { | ||
34 | //恢复上下文 包括 | ||
35 | //光标位置 focusPath | ||
36 | let oSceneContext = this._cApplication.popSceneContext(); | ||
37 | if (oSceneContext) { | ||
38 | this._oSceneContext = oSceneContext; | ||
39 | cc.log(this._oSceneContext); | ||
40 | } | ||
41 | this._cApplication.setBackStatus(false); | ||
42 | } | ||
30 | 43 | ||
31 | this._nodeTypeListWrapper = cc.find("TypeListArea/TypeListWrapper", this.node); | 44 | this._nodeTypeListWrapper = cc.find("TypeListArea/TypeListWrapper", this.node); |
32 | this._nodeTypeList = cc.find("TypeList", this._nodeTypeListWrapper); | 45 | this._nodeTypeList = cc.find("TypeList", this._nodeTypeListWrapper); |
... | @@ -110,7 +123,7 @@ cc.Class({ | ... | @@ -110,7 +123,7 @@ cc.Class({ |
110 | ); | 123 | ); |
111 | this._aFocusTargets[0]["topNavi" + i] = node; | 124 | this._aFocusTargets[0]["topNavi" + i] = node; |
112 | } | 125 | } |
113 | this._oSceneContext.focusPath = "TypeListArea/TypeListWrapper/TypeList/topNavi" + this._oSceneContext._iCurrentLeftIndex; | 126 | // this._oSceneContext.focusPath = "TypeListArea/TypeListWrapper/TypeList/topNavi" + this._oSceneContext._iCurrentLeftIndex; |
114 | this.checkDataReadyAndInitFocus(); | 127 | this.checkDataReadyAndInitFocus(); |
115 | // this.requestMediaList(1); | 128 | // this.requestMediaList(1); |
116 | this.getSimulateRequest(); | 129 | this.getSimulateRequest(); |
... | @@ -258,34 +271,29 @@ cc.Class({ | ... | @@ -258,34 +271,29 @@ cc.Class({ |
258 | iStart1, (lvCategoryList.getShowCellRows() + lvCategoryList.getAlphaCellRows()) * lvCategoryList.getCellCountEachRow(), | 271 | iStart1, (lvCategoryList.getShowCellRows() + lvCategoryList.getAlphaCellRows()) * lvCategoryList.getCellCountEachRow(), |
259 | null, null | 272 | null, null |
260 | ); | 273 | ); |
261 | // lvCategoryList.loadData( | ||
262 | // function (strResponse) { | ||
263 | // cc.log("/////" + this._oInit[this._oSceneContext._iCurrentLeftIndex]); | ||
264 | // let strResponse = this.aCategoryListJson[this._oSceneContext._iCurrentLeftIndex]; | ||
265 | let strResponse = this._oInit[this._oSceneContext._iCurrentLeftIndex]; | 274 | let strResponse = this._oInit[this._oSceneContext._iCurrentLeftIndex]; |
266 | lvCategoryList.renderInitData(strResponse, function () { | 275 | lvCategoryList.loadData( |
267 | // cc.log("InitCategoryList-------------------->"); | 276 | function (strResponse) { |
268 | var oJSONResult = JSON.parse(strResponse); | 277 | lvCategoryList.renderInitData(strResponse, function () { |
269 | // if (oJSONResult.resultSet.length <= 0) { //没有数据就显示占位图 | 278 | var oJSONResult = JSON.parse(strResponse); |
270 | // cc.find('BlankIcon', this.node).opacity = 255; | 279 | // if (oJSONResult.resultSet.length <= 0) { //没有数据就显示占位图 |
271 | // } else { | 280 | // cc.find('BlankIcon', this.node).opacity = 255; |
272 | // cc.find('BlankIcon', this.node).opacity = 0; | 281 | // } else { |
273 | // } | 282 | // cc.find('BlankIcon', this.node).opacity = 0; |
274 | this._bInitCategoryListSuccess = true; | 283 | // } |
275 | this._oSceneContext.categoryRecordIndexOfFirstCell = lvCategoryList.getRecordIndexOfFirstCellInPage(); | 284 | this._bInitCategoryListSuccess = true; |
276 | 285 | this._oSceneContext.categoryRecordIndexOfFirstCell = lvCategoryList.getRecordIndexOfFirstCellInPage(); | |
277 | this.checkDataReadyAndInitFocus(this._bInitCategoryListSuccess); | 286 | |
278 | }); | 287 | this.checkDataReadyAndInitFocus(); |
279 | // }, | 288 | }); |
280 | // null, | 289 | }, null, this, strResponse |
281 | // this | 290 | ); |
282 | // ); | ||
283 | }, | 291 | }, |
284 | 292 | ||
285 | 293 | ||
286 | 294 | ||
287 | checkDataReadyAndInitFocus: function () { | 295 | checkDataReadyAndInitFocus: function () { |
288 | if (!this._bIsFocusInit) { | 296 | if (!this._bIsFocusInit && this._bInitCategoryListSuccess) { |
289 | this.scheduleOnce(() => { //指定0让回调函数在下一帧立即执行 | 297 | this.scheduleOnce(() => { //指定0让回调函数在下一帧立即执行 |
290 | this.initFocus(); | 298 | this.initFocus(); |
291 | }, 0); | 299 | }, 0); |
... | @@ -303,7 +311,10 @@ cc.Class({ | ... | @@ -303,7 +311,10 @@ cc.Class({ |
303 | this._cFocus.init('focusContainer', this, | 311 | this._cFocus.init('focusContainer', this, |
304 | nodeInitFocus.getComponent(FocusInfo), | 312 | nodeInitFocus.getComponent(FocusInfo), |
305 | Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, 10, 6, 1.1, true); | 313 | Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, 10, 6, 1.1, true); |
306 | this._cFocus.hide(); | 314 | |
315 | if (0 == nodeInitFocus.name.indexOf("topNavi")) { | ||
316 | this._cFocus.hide(); | ||
317 | } | ||
307 | 318 | ||
308 | //处理焦点位于下方问题 | 319 | //处理焦点位于下方问题 |
309 | if (this._oSceneContext.typeListY) { | 320 | if (this._oSceneContext.typeListY) { |
... | @@ -378,6 +389,7 @@ cc.Class({ | ... | @@ -378,6 +389,7 @@ cc.Class({ |
378 | // cc.log("当前时多少条目:" + index); | 389 | // cc.log("当前时多少条目:" + index); |
379 | let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView); | 390 | let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView); |
380 | if (lvCategoryList.scrollARowUp(index, this._oInit[this._oSceneContext._iCurrentLeftIndex])) { | 391 | if (lvCategoryList.scrollARowUp(index, this._oInit[this._oSceneContext._iCurrentLeftIndex])) { |
392 | this._oSceneContext.categoryRecordIndexOfFirstCell = lvCategoryList.getRecordIndexOfFirstCellInPage(); | ||
381 | return; | 393 | return; |
382 | } | 394 | } |
383 | } | 395 | } |
... | @@ -396,6 +408,7 @@ cc.Class({ | ... | @@ -396,6 +408,7 @@ cc.Class({ |
396 | var index = parseInt(this._fiCurrentFocus.node.getName().replace('CategoryListCell', '')); | 408 | var index = parseInt(this._fiCurrentFocus.node.getName().replace('CategoryListCell', '')); |
397 | let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView); | 409 | let lvCategoryList = this.node.getChildByName('CategoryList').getComponent(ListView); |
398 | if (lvCategoryList.scrollARowDown(null, index, this._oInit[this._oSceneContext._iCurrentLeftIndex])) { | 410 | if (lvCategoryList.scrollARowDown(null, index, this._oInit[this._oSceneContext._iCurrentLeftIndex])) { |
411 | this._oSceneContext.categoryRecordIndexOfFirstCell = lvCategoryList.getRecordIndexOfFirstCellInPage(); | ||
399 | return; | 412 | return; |
400 | } | 413 | } |
401 | } | 414 | } |
... | @@ -532,12 +545,14 @@ cc.Class({ | ... | @@ -532,12 +545,14 @@ cc.Class({ |
532 | // ); | 545 | // ); |
533 | } | 546 | } |
534 | 547 | ||
535 | this._oSceneContext._iCurrentLeftIndex = iIndex; | 548 | if (0 == fiFrom.node.getName().indexOf('topNavi')) { |
536 | 549 | this._oSceneContext._iCurrentLeftIndex = iIndex; | |
537 | this.scheduleOnce(function () { | 550 | this._oSceneContext.categoryRecordIndexOfFirstCell = 0; //将列表记录置空 |
538 | // this.requestMediaList(1); //重新渲染CategoryList | 551 | this.scheduleOnce(function () { |
539 | this.getSimulateRequest(); | 552 | // this.requestMediaList(1); //重新渲染CategoryList |
540 | }, 0); | 553 | this.getSimulateRequest(); |
554 | }, 0); | ||
555 | } | ||
541 | } | 556 | } |
542 | 557 | ||
543 | if (0 == fiTo.node.getName().indexOf('CategoryListCell')) { | 558 | if (0 == fiTo.node.getName().indexOf('CategoryListCell')) { | ... | ... |
... | @@ -72,7 +72,7 @@ cc.Class({ | ... | @@ -72,7 +72,7 @@ cc.Class({ |
72 | this._bIsDataListMoving = false; | 72 | this._bIsDataListMoving = false; |
73 | this._bIsScrollViewMoving = false; | 73 | this._bIsScrollViewMoving = false; |
74 | this._scrollview = this.node.getComponent(cc.ScrollView); | 74 | this._scrollview = this.node.getComponent(cc.ScrollView); |
75 | this._oSceneContext.focusPath = "scrollContent/TopNavi/topNav2"; | 75 | this._oSceneContext.focusPath = "scrollContent/TopNavi/topNavi1"; |
76 | this._oSceneContext._iPageIndex = 1; | 76 | this._oSceneContext._iPageIndex = 1; |
77 | this._oSceneContext._iCurrentLeftIndex = 1; | 77 | this._oSceneContext._iCurrentLeftIndex = 1; |
78 | this._oSceneContext._iViewPagerIndex = 0; | 78 | this._oSceneContext._iViewPagerIndex = 0; |
... | @@ -86,7 +86,7 @@ cc.Class({ | ... | @@ -86,7 +86,7 @@ cc.Class({ |
86 | // cc.log("current top navi..." + this._oSceneContext._iCurrentLeftIndex); | 86 | // cc.log("current top navi..." + this._oSceneContext._iCurrentLeftIndex); |
87 | // } | 87 | // } |
88 | //有必要的话恢复上下文 | 88 | //有必要的话恢复上下文 |
89 | cc.log("恢复上下文:" + this._cApplication.getBackStatus()); | 89 | // cc.log("恢复上下文:" + this._cApplication.getBackStatus()); |
90 | if (this._cApplication.getBackStatus()) { | 90 | if (this._cApplication.getBackStatus()) { |
91 | //恢复上下文 包括 | 91 | //恢复上下文 包括 |
92 | //光标位置 focusPath | 92 | //光标位置 focusPath |
... | @@ -97,7 +97,7 @@ cc.Class({ | ... | @@ -97,7 +97,7 @@ cc.Class({ |
97 | } | 97 | } |
98 | this._cApplication.setBackStatus(false); | 98 | this._cApplication.setBackStatus(false); |
99 | } | 99 | } |
100 | cc.log("恢复上下文后的光标:" + this._oSceneContext._iCurrentLeftIndex); | 100 | // cc.log("恢复上下文后的光标:" + this._oSceneContext._iPageIndex); |
101 | this._oSceneContext._iCurrentLeftIndex = this._oSceneContext._iCurrentLeftIndex == 0 ? 1 : this._oSceneContext._iCurrentLeftIndex; | 101 | this._oSceneContext._iCurrentLeftIndex = this._oSceneContext._iCurrentLeftIndex == 0 ? 1 : this._oSceneContext._iCurrentLeftIndex; |
102 | this.node.getChildByName("scrollContent").height = 2300; //这里暂且写死,scrollView有bug | 102 | this.node.getChildByName("scrollContent").height = 2300; //这里暂且写死,scrollView有bug |
103 | this._scrollview.scrollToTop(); | 103 | this._scrollview.scrollToTop(); |
... | @@ -105,16 +105,10 @@ cc.Class({ | ... | @@ -105,16 +105,10 @@ cc.Class({ |
105 | //搞轮播图 | 105 | //搞轮播图 |
106 | this.initViewPager(); | 106 | this.initViewPager(); |
107 | this.initViewPagerRightLabel(); | 107 | this.initViewPagerRightLabel(); |
108 | // this.getTopNaviRequest("topNavi"); | ||
109 | // this.getTopNaviRequest("topCell"); | ||
110 | //搞通知框 | 108 | //搞通知框 |
111 | this.initNotifyBox(); | 109 | this.initNotifyBox(); |
112 | // this.getUpdateDesc(); | 110 | // this.getUpdateDesc(); |
113 | this.getMainLayoutJsonRequest(); | 111 | this.getMainLayoutJsonRequest(); |
114 | this.getCategoryListJsonRequest(); | ||
115 | // this.getRecommendModelRequest(); | ||
116 | // this.getRightRecommendRequest(); //渲染右侧导航 | ||
117 | // this.requestMediaList(9); //游戏列表 | ||
118 | this.getCategoryListRecommendRequest(); | 112 | this.getCategoryListRecommendRequest(); |
119 | }, | 113 | }, |
120 | 114 | ||
... | @@ -225,30 +219,6 @@ cc.Class({ | ... | @@ -225,30 +219,6 @@ cc.Class({ |
225 | }, this, "uuid"); | 219 | }, this, "uuid"); |
226 | }, | 220 | }, |
227 | 221 | ||
228 | getCategoryListJsonRequest: function () { | ||
229 | var self = this; | ||
230 | var aJsonList = ["catetory_xxyz_list.json", "catetory_dztg_list.json", "catetory_3dyx_list.json", "catetory_jycl_list.json", "catetory_jsby_list.json"]; | ||
231 | this._oInit.aCategoryListJson = ["", ""]; //先塞两个空数据,方便遍历数组 | ||
232 | if (self._oInit.oMainLayoutJson && self._oInit.oMainLayoutJson.children.length > 0) { | ||
233 | return; | ||
234 | } | ||
235 | for (let i = 0; i < aJsonList.length; i++) { | ||
236 | Network.ajax("GET", Common.TOPDRAW_API_SERVER + "main/" + aJsonList[i], null, null, | ||
237 | function (strResponse) { | ||
238 | try { | ||
239 | // cc.log("远程数据:"+strResponse); | ||
240 | // var oJSONResult = JSON.parse(strResponse); | ||
241 | this._oInit.aCategoryListJson.push(strResponse); | ||
242 | } catch (error) { | ||
243 | cc.log("Business Exception:Get getCategoryListJsonRequest..." + error); | ||
244 | } | ||
245 | }, | ||
246 | function (strResponse) { | ||
247 | cc.log("Business Error:Get getCategoryListJsonRequest..." + strResponse); | ||
248 | }, this, "uuid"); | ||
249 | } | ||
250 | }, | ||
251 | |||
252 | //请求顶部个人中心和订购按钮 | 222 | //请求顶部个人中心和订购按钮 |
253 | getTopNaviRequest: function (strCellName) { | 223 | getTopNaviRequest: function (strCellName) { |
254 | // Network.ajax("GET", Common.TOPDRAW_API_SERVER + "main/main_layout.json", null, null, | 224 | // Network.ajax("GET", Common.TOPDRAW_API_SERVER + "main/main_layout.json", null, null, |
... | @@ -288,20 +258,33 @@ cc.Class({ | ... | @@ -288,20 +258,33 @@ cc.Class({ |
288 | ); | 258 | ); |
289 | this._aFocusTargets[0][strCellName + i] = nodeNav; | 259 | this._aFocusTargets[0][strCellName + i] = nodeNav; |
290 | } | 260 | } |
291 | nodeNav.getComponent('pfbCommonCell').init(aTopNaviJson[i], function () { //让细胞自己渲染 | ||
292 | count--; | ||
293 | if (!count) { | ||
294 | self._bInitLeftNavigationSuccess = true; | ||
295 | 261 | ||
296 | self.checkDataReadyAndInitFocus(); | 262 | nodeNav.width = aTopNaviJson[i].width; |
297 | } | 263 | nodeNav.height = aTopNaviJson[i].height; |
298 | }, strCellName, i, this._oSceneContext._iCurrentLeftIndex); | 264 | nodeNav.getChildByName('Pic').width = aTopNaviJson[i].width; |
265 | nodeNav.getChildByName('Pic').height = aTopNaviJson[i].height; | ||
266 | Network.loadImageInNativeRuntime(Common.TOPDRAW_IMAGE_SERVER + aTopNaviJson[i].imageURL, null, | ||
267 | function (texture, iRequestId) { | ||
268 | if (strCellName == "topNavi") { | ||
269 | nodeNav.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, aTopNaviJson[i].width, aTopNaviJson[i].height)); | ||
270 | if (i == 1 && 1 == this._oSceneContext._iCurrentLeftIndex && this._oSceneContext.focusPath != "scrollContent/TopNavi/topNavi1") {//恢复光标记忆不需要选中状态,将i先改为1,其他导航暂时不做光标记忆,有点复杂,后续考虑做。。。 | ||
271 | nodeNav.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, aTopNaviJson[i].height * 2, aTopNaviJson[i].width, aTopNaviJson[i].height)); | ||
272 | } else if (i == this._oSceneContext._iCurrentLeftIndex) { | ||
273 | nodeNav.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, aTopNaviJson[i].height, aTopNaviJson[i].width, aTopNaviJson[i].height)); | ||
274 | } | ||
275 | } else { | ||
276 | nodeNav.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, aTopNaviJson[i].width, aTopNaviJson[i].height)); | ||
277 | } | ||
278 | }, function () { }, this | ||
279 | ); | ||
280 | if (strCellName == "topNavi" && i > 0) { | ||
281 | nodeNav.getComponent(cc.Widget).top = aTopNaviJson[i].top - aTopNaviJson[i].height / 2; | ||
282 | } else { | ||
283 | nodeNav.getComponent(cc.Widget).top = aTopNaviJson[i].top; | ||
284 | } | ||
285 | nodeNav.getComponent(cc.Widget).left = aTopNaviJson[i].left; | ||
299 | 286 | ||
300 | topNaviLayout.addChild(nodeNav, 10, strCellName + i); | 287 | topNaviLayout.addChild(nodeNav, 10, strCellName + i); |
301 | |||
302 | if (i == this._oSceneContext._iCurrentLeftIndex && strCellName == "topNavi") { //默认焦点框位置 | ||
303 | this._oSceneContext.focusPath = "scrollContent/TopNavi/" + strCellName + i; | ||
304 | } | ||
305 | } | 288 | } |
306 | 289 | ||
307 | this.checkDataReadyAndInitFocus(); | 290 | this.checkDataReadyAndInitFocus(); |
... | @@ -607,14 +590,10 @@ cc.Class({ | ... | @@ -607,14 +590,10 @@ cc.Class({ |
607 | // cc.log("子节点:"+nodeLayout.childrenCount); | 590 | // cc.log("子节点:"+nodeLayout.childrenCount); |
608 | } | 591 | } |
609 | 592 | ||
593 | if (this._oSceneContext._iPageIndex != 1) | ||
594 | this.recoverFocusPath(); //有必要的话去恢复焦点记忆 | ||
610 | // this.node.getChildByName("scrollContent").height = 2300; //这里暂且写死,scrollView有bug | 595 | // this.node.getChildByName("scrollContent").height = 2300; //这里暂且写死,scrollView有bug |
611 | // cc.log("ScrollView高度: " + bgHeight); 2239 | ||
612 | // this._scrollview.scrollToTop(); | 596 | // this._scrollview.scrollToTop(); |
613 | // cc.log("ScrollView相对的偏移量 "+this._scrollview.getMaxScrollOffset()); | ||
614 | |||
615 | // cc.log("子节点个数: "+rightNodeLayout.childrenCount); | ||
616 | |||
617 | // this.getNaviPromotion("page_d14e8acf-db3d-4f74-b535-c98458596eb8");x | ||
618 | } catch (error) { | 597 | } catch (error) { |
619 | cc.log("Business Exception:Get getRightRecommendRequest..." + error); | 598 | cc.log("Business Exception:Get getRightRecommendRequest..." + error); |
620 | } | 599 | } |
... | @@ -624,6 +603,53 @@ cc.Class({ | ... | @@ -624,6 +603,53 @@ cc.Class({ |
624 | }, this, "uuid"); | 603 | }, this, "uuid"); |
625 | }, | 604 | }, |
626 | 605 | ||
606 | recoverFocusPath: function () { | ||
607 | if (this._oSceneContext._iCurrentLeftIndex == 1) { | ||
608 | let height = this._aBgHeight[this._oSceneContext._iPageIndex - 1] || 0; //-1,打补丁:解决回退回来页面对不上的bug | ||
609 | this.onScrollViewScrollStart(); | ||
610 | this._scrollview.scrollToOffset(cc.v2(0, height), 0.5); | ||
611 | var showFocusCallback = function (dt) { | ||
612 | this._cFocus.show(); | ||
613 | this.onScrollViewScrollEnd(); | ||
614 | } | ||
615 | this.scheduleOnce(function () { | ||
616 | // cc.log("执行恢复跳转。。。" + this._oSceneContext.focusPath); | ||
617 | let fiFocusTarget = cc.find(this._oSceneContext.focusPath, this.node).getComponent(FocusInfo); | ||
618 | this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_DOWN, null, null); | ||
619 | this.scheduleOnce(showFocusCallback, 0.2); | ||
620 | }, 0.3); | ||
621 | } | ||
622 | |||
623 | }, | ||
624 | |||
625 | getSimulateRequest: function () { | ||
626 | var self = this; | ||
627 | if (this._oSceneContext._iCurrentLeftIndex <= 1) { | ||
628 | this.requestMediaList(1); | ||
629 | return; | ||
630 | } | ||
631 | |||
632 | var aJsonList = ["", "", "catetory_xxyz_list.json", "catetory_dztg_list.json", "catetory_3dyx_list.json", "catetory_jycl_list.json", "catetory_jsby_list.json"]; | ||
633 | if (this._oInit[this._oSceneContext._iCurrentLeftIndex]) { //已经加载过数据直接取 | ||
634 | self.requestMediaList(1); | ||
635 | } else { | ||
636 | Network.ajax("GET", Common.TOPDRAW_API_SERVER + "main/" + aJsonList[this._oSceneContext._iCurrentLeftIndex], null, null, | ||
637 | function (strResponse) { | ||
638 | try { | ||
639 | this._oInit[this._oSceneContext._iCurrentLeftIndex] = strResponse; | ||
640 | this.scheduleOnce(function () { | ||
641 | self.requestMediaList(1); //重新渲染CategoryList | ||
642 | }, 0); | ||
643 | } catch (error) { | ||
644 | cc.log("Business Exception:Get getSimulateRequest..." + error); | ||
645 | } | ||
646 | }, | ||
647 | function (strResponse) { | ||
648 | cc.log("Business Error:Get getSimulateRequest..." + strResponse); | ||
649 | }, this, "uuid"); | ||
650 | } | ||
651 | }, | ||
652 | |||
627 | requestMediaList: function (cId) { | 653 | requestMediaList: function (cId) { |
628 | var self = this; | 654 | var self = this; |
629 | if (cId) { | 655 | if (cId) { |
... | @@ -736,7 +762,7 @@ cc.Class({ | ... | @@ -736,7 +762,7 @@ cc.Class({ |
736 | // lvCategoryList.loadData( | 762 | // lvCategoryList.loadData( |
737 | // function (strResponse) { | 763 | // function (strResponse) { |
738 | // cc.log("列表:" + JSON.stringify(this._aJsonList[this._oSceneContext._iCurrentLeftIndex])); | 764 | // cc.log("列表:" + JSON.stringify(this._aJsonList[this._oSceneContext._iCurrentLeftIndex])); |
739 | let strResponse = this._oInit.aCategoryListJson[this._oSceneContext._iCurrentLeftIndex]; //这里采用列表 | 765 | let strResponse = this._oInit[this._oSceneContext._iCurrentLeftIndex]; //这里采用列表 |
740 | lvCategoryList.renderInitData(strResponse, function () { | 766 | lvCategoryList.renderInitData(strResponse, function () { |
741 | cc.log("InitCategoryList-------------------->"); | 767 | cc.log("InitCategoryList-------------------->"); |
742 | var oJSONResult = JSON.parse(strResponse); | 768 | var oJSONResult = JSON.parse(strResponse); |
... | @@ -786,8 +812,14 @@ cc.Class({ | ... | @@ -786,8 +812,14 @@ cc.Class({ |
786 | fiCloseBtn.init('', false, null, null, 1.1); | 812 | fiCloseBtn.init('', false, null, null, 1.1); |
787 | this._aFocusTargets[1]['hot_close_btn'] = cc.find('update/update_panel/close_btn', this.node); | 813 | this._aFocusTargets[1]['hot_close_btn'] = cc.find('update/update_panel/close_btn', this.node); |
788 | 814 | ||
789 | cc.log("返回路径:" + this._oSceneContext.focusPath); | 815 | // cc.log("返回路径:" + this._oSceneContext.focusPath); |
790 | var nodeInitFocus = cc.find(this._oSceneContext.focusPath, this.node); | 816 | var nodeInitFocus; |
817 | if (this._oSceneContext._iCurrentLeftIndex == 1) { //只对导航1瀑布流做光标记忆,其他暂不做,以后考虑会做 | ||
818 | nodeInitFocus = cc.find(this._oSceneContext.focusPath, this.node); | ||
819 | }else{ | ||
820 | nodeInitFocus = cc.find("scrollContent/TopNavi/topNavi" + this._oSceneContext._iCurrentLeftIndex, this.node); | ||
821 | } | ||
822 | |||
791 | // cc.log("初始化 "+nodeInitFocus.name); | 823 | // cc.log("初始化 "+nodeInitFocus.name); |
792 | var nodeFocus = new cc.Node('nodeFocus'); | 824 | var nodeFocus = new cc.Node('nodeFocus'); |
793 | this.node.addChild(nodeFocus, 10); | 825 | this.node.addChild(nodeFocus, 10); |
... | @@ -796,8 +828,11 @@ cc.Class({ | ... | @@ -796,8 +828,11 @@ cc.Class({ |
796 | nodeInitFocus.getComponent(FocusInfo), | 828 | nodeInitFocus.getComponent(FocusInfo), |
797 | Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, 10, 6, 1.1, true); | 829 | Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, 10, 6, 1.1, true); |
798 | this._cFocus.hide(); | 830 | this._cFocus.hide(); |
799 | if (this._oSceneContext._iCurrentLeftIndex != 1) { //不是第一个焦点框就跳过去,恢复记忆 | 831 | |
800 | this._cFocus.flyFocus(this._fiCurrentFocus, nodeInitFocus.getComponent(FocusInfo), Common.MOVE_DIRECTION_RIGHT, null, null); | 832 | if (this._oSceneContext._iCurrentLeftIndex > 1) { //不是第一个焦点框就跳过去,恢复记忆 |
833 | this.scheduleOnce(function () { | ||
834 | this._cFocus.flyFocus(this._fiCurrentFocus, nodeInitFocus.getComponent(FocusInfo), Common.MOVE_DIRECTION_RIGHT, null, null); | ||
835 | }, 0); | ||
801 | } | 836 | } |
802 | if (!Common._bIsHotUpdate) { | 837 | if (!Common._bIsHotUpdate) { |
803 | Common._bIsHotUpdate = true; | 838 | Common._bIsHotUpdate = true; |
... | @@ -836,7 +871,7 @@ cc.Class({ | ... | @@ -836,7 +871,7 @@ cc.Class({ |
836 | }, | 871 | }, |
837 | 872 | ||
838 | checkFocusTarget: function (fiFocusTarget, oScrollParameter, Direct) { | 873 | checkFocusTarget: function (fiFocusTarget, oScrollParameter, Direct) { |
839 | cc.log("目标节点名称:" + fiFocusTarget.node.name); | 874 | // cc.log("目标节点名称:" + fiFocusTarget.node.name); |
840 | var leftNavLayout = this.targetAry[0].target; | 875 | var leftNavLayout = this.targetAry[0].target; |
841 | 876 | ||
842 | if (fiFocusTarget && 0 == fiFocusTarget.node.name.indexOf("topNavi") || 0 == fiFocusTarget.node.name.indexOf("topCell")) { | 877 | if (fiFocusTarget && 0 == fiFocusTarget.node.name.indexOf("topNavi") || 0 == fiFocusTarget.node.name.indexOf("topCell")) { |
... | @@ -869,7 +904,7 @@ cc.Class({ | ... | @@ -869,7 +904,7 @@ cc.Class({ |
869 | } | 904 | } |
870 | 905 | ||
871 | if (fiFocusTarget && 0 == fiFocusTarget.node.name.indexOf("SpecialList")) { | 906 | if (fiFocusTarget && 0 == fiFocusTarget.node.name.indexOf("SpecialList")) { |
872 | cc.log(fiFocusTarget.node.x + " : " + fiFocusTarget.node.width / 2 + " : " + this._specialListNode.x + " : " + this._specialListRectNode.width); | 907 | // cc.log(fiFocusTarget.node.x + " : " + fiFocusTarget.node.width / 2 + " : " + this._specialListNode.x + " : " + this._specialListRectNode.width); |
873 | if (fiFocusTarget.node.x + this._specialListNode.x >= this._specialListRectNode.width) { | 908 | if (fiFocusTarget.node.x + this._specialListNode.x >= this._specialListRectNode.width) { |
874 | if (0 != this._fiCurrentFocus.node.name.indexOf("SpecialList")) { | 909 | if (0 != this._fiCurrentFocus.node.name.indexOf("SpecialList")) { |
875 | return [null, oScrollParameter]; | 910 | return [null, oScrollParameter]; |
... | @@ -906,9 +941,9 @@ cc.Class({ | ... | @@ -906,9 +941,9 @@ cc.Class({ |
906 | } | 941 | } |
907 | if (0 == this._fiCurrentFocus.node.getName().indexOf('CategoryListCell')) { | 942 | if (0 == this._fiCurrentFocus.node.getName().indexOf('CategoryListCell')) { |
908 | var index = parseInt(this._fiCurrentFocus.node.getName().replace('CategoryListCell', '')); | 943 | var index = parseInt(this._fiCurrentFocus.node.getName().replace('CategoryListCell', '')); |
909 | cc.log("当前时多少条目:" + index); | 944 | // cc.log("当前时多少条目:" + index); |
910 | let lvCategoryList = this.node.getChildByName("scrollContent").getChildByName('CategoryList').getComponent(ListView); | 945 | let lvCategoryList = this.node.getChildByName("scrollContent").getChildByName('CategoryList').getComponent(ListView); |
911 | if (lvCategoryList.scrollARowUp(index, this._oInit.aCategoryListJson[this._oSceneContext._iCurrentLeftIndex])) { | 946 | if (lvCategoryList.scrollARowUp(index, this._oInit[this._oSceneContext._iCurrentLeftIndex])) { |
912 | return; | 947 | return; |
913 | } | 948 | } |
914 | } | 949 | } |
... | @@ -972,7 +1007,7 @@ cc.Class({ | ... | @@ -972,7 +1007,7 @@ cc.Class({ |
972 | if (0 == this._fiCurrentFocus.node.getName().indexOf('CategoryListCell')) { | 1007 | if (0 == this._fiCurrentFocus.node.getName().indexOf('CategoryListCell')) { |
973 | var index = parseInt(this._fiCurrentFocus.node.getName().replace('CategoryListCell', '')); | 1008 | var index = parseInt(this._fiCurrentFocus.node.getName().replace('CategoryListCell', '')); |
974 | let lvCategoryList = this.node.getChildByName("scrollContent").getChildByName('CategoryList').getComponent(ListView); | 1009 | let lvCategoryList = this.node.getChildByName("scrollContent").getChildByName('CategoryList').getComponent(ListView); |
975 | if (lvCategoryList.scrollARowDown(null, index, this._oInit.aCategoryListJson[this._oSceneContext._iCurrentLeftIndex])) { | 1010 | if (lvCategoryList.scrollARowDown(null, index, this._oInit[this._oSceneContext._iCurrentLeftIndex])) { |
976 | return; | 1011 | return; |
977 | } | 1012 | } |
978 | } | 1013 | } |
... | @@ -990,7 +1025,7 @@ cc.Class({ | ... | @@ -990,7 +1025,7 @@ cc.Class({ |
990 | iTargetTop = fiFocusTarget.node.getParent().getComponent(cc.Widget).top; | 1025 | iTargetTop = fiFocusTarget.node.getParent().getComponent(cc.Widget).top; |
991 | } | 1026 | } |
992 | let iCurrentFloorBottom = this._aBgHeight[this._oSceneContext._iPageIndex - 1] || 0;//当前楼层底部高度 | 1027 | let iCurrentFloorBottom = this._aBgHeight[this._oSceneContext._iPageIndex - 1] || 0;//当前楼层底部高度 |
993 | cc.log(iCurrentFloorBottom + "目标节点的高度:" + iTargetTop + "::" + this._oSceneContext._iPageIndex); | 1028 | // cc.log(iCurrentFloorBottom + "目标节点的高度:" + iTargetTop + "::" + this._oSceneContext._iPageIndex); |
994 | if (this._bIsScrollViewMoving) { | 1029 | if (this._bIsScrollViewMoving) { |
995 | return; | 1030 | return; |
996 | } | 1031 | } |
... | @@ -1063,7 +1098,7 @@ cc.Class({ | ... | @@ -1063,7 +1098,7 @@ cc.Class({ |
1063 | backToTop: function () { | 1098 | backToTop: function () { |
1064 | this._scrollview.scrollToTop(); | 1099 | this._scrollview.scrollToTop(); |
1065 | this._oSceneContext._iPageIndex = 1; //当前页恢复 | 1100 | this._oSceneContext._iPageIndex = 1; //当前页恢复 |
1066 | let fiFocusTarget = cc.find(this._oSceneContext.focusPath, this.node).getComponent(FocusInfo); | 1101 | let fiFocusTarget = cc.find("scrollContent/TopNavi/topNavi1", this.node).getComponent(FocusInfo);//这里写死地址,不然恢复光标记忆时会错乱 |
1067 | setTimeout(function () { //延迟0.8秒跳转 | 1102 | setTimeout(function () { //延迟0.8秒跳转 |
1068 | this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_UP, 1.0, null); | 1103 | this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_UP, 1.0, null); |
1069 | }.bind(this), 300); | 1104 | }.bind(this), 300); |
... | @@ -1172,7 +1207,7 @@ cc.Class({ | ... | @@ -1172,7 +1207,7 @@ cc.Class({ |
1172 | 1207 | ||
1173 | if (0 == fiTo.node.getName().indexOf('topCell')) { | 1208 | if (0 == fiTo.node.getName().indexOf('topCell')) { |
1174 | let iIndex = fiTo.node.name.replace("topCell", ''); | 1209 | let iIndex = fiTo.node.name.replace("topCell", ''); |
1175 | cc.log(iIndex + "图片:" + this._oInit.aTopCellImg[iIndex]); | 1210 | // cc.log(iIndex + "图片:" + this._oInit.aTopCellImg[iIndex]); |
1176 | if (this._oInit.aTopCellImg[iIndex]) { | 1211 | if (this._oInit.aTopCellImg[iIndex]) { |
1177 | // cc.loader.loadRes(this._oInit.aTopCellImg[iIndex], cc.Texture2D, function (err, texture) { | 1212 | // cc.loader.loadRes(this._oInit.aTopCellImg[iIndex], cc.Texture2D, function (err, texture) { |
1178 | // fiTo.node.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height)); | 1213 | // fiTo.node.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height)); |
... | @@ -1205,7 +1240,7 @@ cc.Class({ | ... | @@ -1205,7 +1240,7 @@ cc.Class({ |
1205 | if (0 == fiTo.node.getName().indexOf('topNavi')) { | 1240 | if (0 == fiTo.node.getName().indexOf('topNavi')) { |
1206 | let iIndex = fiTo.node.name.replace("topNavi", ''); | 1241 | let iIndex = fiTo.node.name.replace("topNavi", ''); |
1207 | // fiTo.node.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height)); | 1242 | // fiTo.node.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height)); |
1208 | cc.log(iIndex + " ... " + this._oInit.aTopNaviImg[iIndex]); | 1243 | // cc.log(iIndex + " ... " + this._oInit.aTopNaviImg[iIndex]); |
1209 | if (this._oInit.aTopNaviImg[iIndex - 1]) { | 1244 | if (this._oInit.aTopNaviImg[iIndex - 1]) { |
1210 | // cc.loader.loadRes(this._oInit.aTopNaviImg[iIndex - 1], cc.Texture2D, function (err, texture) { | 1245 | // cc.loader.loadRes(this._oInit.aTopNaviImg[iIndex - 1], cc.Texture2D, function (err, texture) { |
1211 | // fiTo.node.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height)); | 1246 | // fiTo.node.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height)); |
... | @@ -1223,7 +1258,8 @@ cc.Class({ | ... | @@ -1223,7 +1258,8 @@ cc.Class({ |
1223 | 1258 | ||
1224 | this._oSceneContext._iCurrentLeftIndex = iIndex; | 1259 | this._oSceneContext._iCurrentLeftIndex = iIndex; |
1225 | this.scheduleOnce(function () { | 1260 | this.scheduleOnce(function () { |
1226 | this.requestMediaList(1); //重新渲染CategoryList | 1261 | // this.requestMediaList(1); //重新渲染CategoryList |
1262 | this.getSimulateRequest(); | ||
1227 | }, 0); | 1263 | }, 0); |
1228 | // this.renderCategoryList(1); | 1264 | // this.renderCategoryList(1); |
1229 | 1265 | ||
... | @@ -1269,7 +1305,7 @@ cc.Class({ | ... | @@ -1269,7 +1305,7 @@ cc.Class({ |
1269 | } | 1305 | } |
1270 | 1306 | ||
1271 | //这里想统一处理焦点框显示隐藏问题 | 1307 | //这里想统一处理焦点框显示隐藏问题 |
1272 | cc.log("节点名称:" + fiTo.node.getName()); | 1308 | // cc.log("节点名称:" + fiTo.node.getName()); |
1273 | if (0 == fiTo.node.getName().indexOf('view_pager_label') || 0 == fiTo.node.getName().indexOf('topNavi') | 1309 | if (0 == fiTo.node.getName().indexOf('view_pager_label') || 0 == fiTo.node.getName().indexOf('topNavi') |
1274 | || 0 == fiTo.node.getName().indexOf('topCell') || 0 == fiTo.node.getName().indexOf('backToTop')) { | 1310 | || 0 == fiTo.node.getName().indexOf('topCell') || 0 == fiTo.node.getName().indexOf('backToTop')) { |
1275 | this._cFocus.hide(); | 1311 | this._cFocus.hide(); |
... | @@ -1281,13 +1317,14 @@ cc.Class({ | ... | @@ -1281,13 +1317,14 @@ cc.Class({ |
1281 | 1317 | ||
1282 | doCurrentFocusTVLinkAction: function (strAction) { | 1318 | doCurrentFocusTVLinkAction: function (strAction) { |
1283 | let strTVLink = this._fiCurrentFocus.getTVLink(); | 1319 | let strTVLink = this._fiCurrentFocus.getTVLink(); |
1284 | cc.log("tvlink===============" + strTVLink); | 1320 | // cc.log("tvlink===============" + strTVLink); |
1321 | // cc.log("tvlink===============" + this._oSceneContext._iPageIndex); | ||
1285 | try { | 1322 | try { |
1286 | let oTVLink = JSON.parse(strTVLink); | 1323 | let oTVLink = JSON.parse(strTVLink); |
1287 | let aOperationList = oTVLink.click; | 1324 | let aOperationList = oTVLink.click; |
1288 | // var rightNavLayout = this.targetAry[2].target; | 1325 | // var rightNavLayout = this.targetAry[2].target; |
1289 | // rightNavLayout.destroyAllChildren(); //销毁完以前所有的子模块 | 1326 | // rightNavLayout.destroyAllChildren(); //销毁完以前所有的子模块 |
1290 | this._oSceneContext._iPageIndex = 1; | 1327 | // this._oSceneContext._iPageIndex = 1; |
1291 | for (let i = 0; i < aOperationList.length; i++) { | 1328 | for (let i = 0; i < aOperationList.length; i++) { |
1292 | switch (aOperationList[i].action) { | 1329 | switch (aOperationList[i].action) { |
1293 | case "changeLayout": | 1330 | case "changeLayout": | ... | ... |
... | @@ -39,7 +39,7 @@ | ... | @@ -39,7 +39,7 @@ |
39 | "name": "frame1", | 39 | "name": "frame1", |
40 | "resultSet": [ | 40 | "resultSet": [ |
41 | { | 41 | { |
42 | "name": "Carousel0", | 42 | "name": "Carousel1", |
43 | "code": "promotionItem_fd456495-2e32-44e1-9d92-450227d4afa3", | 43 | "code": "promotionItem_fd456495-2e32-44e1-9d92-450227d4afa3", |
44 | "left": 64, | 44 | "left": 64, |
45 | "top": 0, | 45 | "top": 0, |
... | @@ -49,7 +49,7 @@ | ... | @@ -49,7 +49,7 @@ |
49 | "height": 167 | 49 | "height": 167 |
50 | }, | 50 | }, |
51 | { | 51 | { |
52 | "name": "dailyRecommend", | 52 | "name": "dailyRecommend2", |
53 | "code": "promotionItem_4ca66642-33d0-41c9-9913-df131a79a375", | 53 | "code": "promotionItem_4ca66642-33d0-41c9-9913-df131a79a375", |
54 | "left": 359, | 54 | "left": 359, |
55 | "top": 0, | 55 | "top": 0, |
... | @@ -59,7 +59,7 @@ | ... | @@ -59,7 +59,7 @@ |
59 | "height": 167 | 59 | "height": 167 |
60 | }, | 60 | }, |
61 | { | 61 | { |
62 | "name": "dailyRecommend", | 62 | "name": "dailyRecommend3", |
63 | "code": "promotionItem_c5f58c16-48a5-4796-ab52-rwvh6u5j55", | 63 | "code": "promotionItem_c5f58c16-48a5-4796-ab52-rwvh6u5j55", |
64 | "left": 652, | 64 | "left": 652, |
65 | "top": 0, | 65 | "top": 0, |
... | @@ -69,7 +69,7 @@ | ... | @@ -69,7 +69,7 @@ |
69 | "height": 167 | 69 | "height": 167 |
70 | }, | 70 | }, |
71 | { | 71 | { |
72 | "name": "dailyRecommend", | 72 | "name": "dailyRecommend4", |
73 | "code": "promotionItem_c5f58c16-48a5-4796-ab52-41679fc88a6d", | 73 | "code": "promotionItem_c5f58c16-48a5-4796-ab52-41679fc88a6d", |
74 | "left": 946, | 74 | "left": 946, |
75 | "top": 0, | 75 | "top": 0, |
... | @@ -141,19 +141,19 @@ | ... | @@ -141,19 +141,19 @@ |
141 | "code": "promotionItem_e29b33e4-8954-4eerthy6rthg54er" | 141 | "code": "promotionItem_e29b33e4-8954-4eerthy6rthg54er" |
142 | }, | 142 | }, |
143 | { | 143 | { |
144 | "name": "Subject3", | 144 | "name": "Subject4", |
145 | "imageURL": "upload/image/main/block4_4.png", | 145 | "imageURL": "upload/image/main/block4_4.png", |
146 | "tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\"}}]}", | 146 | "tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\"}}]}", |
147 | "code": "promotionItem_e29b33e4-8954-vwregv54thw6" | 147 | "code": "promotionItem_e29b33e4-8954-vwregv54thw6" |
148 | }, | 148 | }, |
149 | { | 149 | { |
150 | "name": "Subject3", | 150 | "name": "Subject5", |
151 | "imageURL": "upload/image/main/block4_5.png", | 151 | "imageURL": "upload/image/main/block4_5.png", |
152 | "tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\"}}]}", | 152 | "tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\"}}]}", |
153 | "code": "promotionItem_e29b33e4-8954-bq4wrjhwbt4t" | 153 | "code": "promotionItem_e29b33e4-8954-bq4wrjhwbt4t" |
154 | }, | 154 | }, |
155 | { | 155 | { |
156 | "name": "Subject4", | 156 | "name": "Subject6", |
157 | "imageURL": "upload/image/main/block4_6.png", | 157 | "imageURL": "upload/image/main/block4_6.png", |
158 | "tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\"}}]}", | 158 | "tvlink": "{\"click\":[{\"action\":\"ChangeScene\",\"parameters\":{\"sceneName\":\"sceneGameCategory\"}}]}", |
159 | "code": "promotionItem_57aea4b3-7716-4we5j56trhgser2" | 159 | "code": "promotionItem_57aea4b3-7716-4we5j56trhgser2" |
... | @@ -184,7 +184,7 @@ | ... | @@ -184,7 +184,7 @@ |
184 | "disable": true | 184 | "disable": true |
185 | }, | 185 | }, |
186 | { | 186 | { |
187 | "name": "SingerList", | 187 | "name": "SingerList1", |
188 | "code": "promotionItem_0a911d4c-9223-4d49-se5hj54uh4w5g45w", | 188 | "code": "promotionItem_0a911d4c-9223-4d49-se5hj54uh4w5g45w", |
189 | "left": 63, | 189 | "left": 63, |
190 | "top": 64, | 190 | "top": 64, |
... | @@ -194,7 +194,7 @@ | ... | @@ -194,7 +194,7 @@ |
194 | "height": 228 | 194 | "height": 228 |
195 | }, | 195 | }, |
196 | { | 196 | { |
197 | "name": "SingerList", | 197 | "name": "SingerList2", |
198 | "code": "promotionItem_c388af5a-0351-43c4-e5sjhu45h54wh45h", | 198 | "code": "promotionItem_c388af5a-0351-43c4-e5sjhu45h54wh45h", |
199 | "left": 653, | 199 | "left": 653, |
200 | "top": 64, | 200 | "top": 64, |
... | @@ -214,7 +214,7 @@ | ... | @@ -214,7 +214,7 @@ |
214 | "name": "frame3", | 214 | "name": "frame3", |
215 | "resultSet": [ | 215 | "resultSet": [ |
216 | { | 216 | { |
217 | "name": "SingerList", | 217 | "name": "SingerList3", |
218 | "code": "promotionItem_c388af5a-0351-43c4we5jh45j45jh54hj", | 218 | "code": "promotionItem_c388af5a-0351-43c4we5jh45j45jh54hj", |
219 | "left": 63, | 219 | "left": 63, |
220 | "top": 24, | 220 | "top": 24, |
... | @@ -224,7 +224,7 @@ | ... | @@ -224,7 +224,7 @@ |
224 | "height": 228 | 224 | "height": 228 |
225 | }, | 225 | }, |
226 | { | 226 | { |
227 | "name": "SingerList", | 227 | "name": "SingerList4", |
228 | "code": "promotionItem_c388af5a-0351-43c4j56j54hw4h54", | 228 | "code": "promotionItem_c388af5a-0351-43c4j56j54hw4h54", |
229 | "left": 456, | 229 | "left": 456, |
230 | "top": 24, | 230 | "top": 24, |
... | @@ -234,7 +234,7 @@ | ... | @@ -234,7 +234,7 @@ |
234 | "height": 228 | 234 | "height": 228 |
235 | }, | 235 | }, |
236 | { | 236 | { |
237 | "name": "SingerList", | 237 | "name": "SingerList5", |
238 | "code": "promotionItem_c388af5a-0351-43c4-w45jh45h54h5h", | 238 | "code": "promotionItem_c388af5a-0351-43c4-w45jh45h54h5h", |
239 | "left": 848, | 239 | "left": 848, |
240 | "top": 24, | 240 | "top": 24, | ... | ... |
-
Please register or sign in to post a comment