1.修改首页升级弹窗样式,并且可以网络加载升级内容和版本号
Showing
9 changed files
with
48 additions
and
48 deletions
This diff is collapsed.
Click to expand it.
... | @@ -80,6 +80,8 @@ cc.Class({ | ... | @@ -80,6 +80,8 @@ cc.Class({ |
80 | this._oSceneContext._iViewPagerIndex = 0; | 80 | this._oSceneContext._iViewPagerIndex = 0; |
81 | let oSceneParameter = this._cApplication.getTopSceneParameter(); | 81 | let oSceneParameter = this._cApplication.getTopSceneParameter(); |
82 | let aSceneParameter = this._cApplication.getSceneParameter(); | 82 | let aSceneParameter = this._cApplication.getSceneParameter(); |
83 | cc.find("update/update_panel/update_btn", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 208, 100)); | ||
84 | cc.find("update/update_panel/close_btn", this.node).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 208, 100)); | ||
83 | cc.log("main->aSceneParameter..." + aSceneParameter); | 85 | cc.log("main->aSceneParameter..." + aSceneParameter); |
84 | cc.log("main->oSceneParameter..." + oSceneParameter); | 86 | cc.log("main->oSceneParameter..." + oSceneParameter); |
85 | //首页无参数 | 87 | //首页无参数 |
... | @@ -109,7 +111,7 @@ cc.Class({ | ... | @@ -109,7 +111,7 @@ cc.Class({ |
109 | //搞通知框 | 111 | //搞通知框 |
110 | this.initNotifyBox(); | 112 | this.initNotifyBox(); |
111 | //升级相关 | 113 | //升级相关 |
112 | // this.getUpdateDesc(); | 114 | this.getUpdateDesc(); |
113 | this.getMainLayoutJsonRequest(); | 115 | this.getMainLayoutJsonRequest(); |
114 | }, | 116 | }, |
115 | 117 | ||
... | @@ -143,11 +145,11 @@ cc.Class({ | ... | @@ -143,11 +145,11 @@ cc.Class({ |
143 | this._aFocusTargets[0]["view_pager_label" + i] = nodeNav; | 145 | this._aFocusTargets[0]["view_pager_label" + i] = nodeNav; |
144 | } | 146 | } |
145 | } catch (error) { | 147 | } catch (error) { |
146 | cc.log("Business Exception:Get getUpdateDesc..." + error); | 148 | cc.log("Business Exception:Get initViewPager..." + error); |
147 | } | 149 | } |
148 | }, | 150 | }, |
149 | function (strResponse) { | 151 | function (strResponse) { |
150 | cc.log("Business Error:Get getUpdateDesc..." + strResponse); | 152 | cc.log("Business Error:Get initViewPager..." + strResponse); |
151 | }, this, "uuid"); | 153 | }, this, "uuid"); |
152 | }, | 154 | }, |
153 | 155 | ||
... | @@ -166,17 +168,15 @@ cc.Class({ | ... | @@ -166,17 +168,15 @@ cc.Class({ |
166 | 168 | ||
167 | //升级框内容 | 169 | //升级框内容 |
168 | getUpdateDesc: function () { | 170 | getUpdateDesc: function () { |
171 | let updateTitle = cc.find("update/update_panel/update_title", this.node); | ||
172 | let updateInfo = cc.find("update/update_panel/update_info", this.node); | ||
169 | Network.ajax("GET", Common.TOPDRAW_API_SERVER + "updateDesc.json", null, null, | 173 | Network.ajax("GET", Common.TOPDRAW_API_SERVER + "updateDesc.json", null, null, |
170 | function (strResponse) { | 174 | function (strResponse) { |
171 | try { | 175 | try { |
172 | cc.log("获取升级内容。。。" + strResponse); | 176 | // cc.log("获取升级内容。。。" + strResponse); |
173 | var oJSONResult = JSON.parse(strResponse); | 177 | var oJSONResult = JSON.parse(strResponse); |
174 | var self = this; | 178 | updateTitle.getComponent(cc.Label).string = "发现新版本(" + oJSONResult.versionCode + ")"; |
175 | if (oJSONResult.businessCode == 'success') { | 179 | updateInfo.getComponent(cc.Label).string = oJSONResult.desc; |
176 | |||
177 | } else { | ||
178 | cc.log("Business Error:Get getUpdateDesc..." + oJSONResult.description); | ||
179 | } | ||
180 | } catch (error) { | 180 | } catch (error) { |
181 | cc.log("Business Exception:Get getUpdateDesc..." + error); | 181 | cc.log("Business Exception:Get getUpdateDesc..." + error); |
182 | } | 182 | } |
... | @@ -1230,6 +1230,17 @@ cc.Class({ | ... | @@ -1230,6 +1230,17 @@ cc.Class({ |
1230 | fiFrom.node.getChildByName("Name").active = false; | 1230 | fiFrom.node.getChildByName("Name").active = false; |
1231 | fiFrom.node.getComponent(ListCell).setUIWithoutFocus(); | 1231 | fiFrom.node.getComponent(ListCell).setUIWithoutFocus(); |
1232 | } | 1232 | } |
1233 | |||
1234 | if (0 == fiFrom.node.getName().indexOf('update_btn')) { | ||
1235 | cc.loader.loadRes("Hot_update/btn_update", cc.Texture2D, function (err, texture) { | ||
1236 | fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, fiFrom.node.width, fiFrom.node.height)); | ||
1237 | }); | ||
1238 | } | ||
1239 | if (0 == fiFrom.node.getName().indexOf('close_btn')) { | ||
1240 | cc.loader.loadRes("Hot_update/btn_cancel", cc.Texture2D, function (err, texture) { | ||
1241 | fiFrom.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, fiFrom.node.width, fiFrom.node.height)); | ||
1242 | }); | ||
1243 | } | ||
1233 | }, | 1244 | }, |
1234 | 1245 | ||
1235 | onAfterFocusChange: function (event) { | 1246 | onAfterFocusChange: function (event) { |
... | @@ -1340,12 +1351,24 @@ cc.Class({ | ... | @@ -1340,12 +1351,24 @@ cc.Class({ |
1340 | //这里想统一处理焦点框显示隐藏问题 | 1351 | //这里想统一处理焦点框显示隐藏问题 |
1341 | // cc.log("节点名称:" + fiTo.node.getName()); | 1352 | // cc.log("节点名称:" + fiTo.node.getName()); |
1342 | if (0 == fiTo.node.getName().indexOf('view_pager_label') || 0 == fiTo.node.getName().indexOf('topNavi') | 1353 | if (0 == fiTo.node.getName().indexOf('view_pager_label') || 0 == fiTo.node.getName().indexOf('topNavi') |
1343 | || 0 == fiTo.node.getName().indexOf('topCell') || 0 == fiTo.node.getName().indexOf('backToTop')) { | 1354 | || 0 == fiTo.node.getName().indexOf('topCell') || 0 == fiTo.node.getName().indexOf('backToTop') |
1355 | || 0 == fiTo.node.getName().indexOf('update_btn') || 0 == fiTo.node.getName().indexOf('close_btn')) { | ||
1344 | this._cFocus.hide(); | 1356 | this._cFocus.hide(); |
1345 | } else { | 1357 | } else { |
1346 | if (!this._bIsScrollViewMoving) | 1358 | if (!this._bIsScrollViewMoving) |
1347 | this._cFocus.show(); | 1359 | this._cFocus.show(); |
1348 | } | 1360 | } |
1361 | |||
1362 | if (0 == fiTo.node.getName().indexOf('update_btn')) { | ||
1363 | cc.loader.loadRes("Hot_update/btn_update", cc.Texture2D, function (err, texture) { | ||
1364 | fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height)); | ||
1365 | }); | ||
1366 | } | ||
1367 | if (0 == fiTo.node.getName().indexOf('close_btn')) { | ||
1368 | cc.loader.loadRes("Hot_update/btn_cancel", cc.Texture2D, function (err, texture) { | ||
1369 | fiTo.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height)); | ||
1370 | }); | ||
1371 | } | ||
1349 | }, | 1372 | }, |
1350 | 1373 | ||
1351 | doCurrentFocusTVLinkAction: function (strAction) { | 1374 | doCurrentFocusTVLinkAction: function (strAction) { |
... | @@ -1361,29 +1384,6 @@ cc.Class({ | ... | @@ -1361,29 +1384,6 @@ cc.Class({ |
1361 | for (let i = 0; i < aOperationList.length; i++) { | 1384 | for (let i = 0; i < aOperationList.length; i++) { |
1362 | switch (aOperationList[i].action) { | 1385 | switch (aOperationList[i].action) { |
1363 | case "changeLayout": | 1386 | case "changeLayout": |
1364 | // let model = aOperationList[i].parameters.layoutPath; //获取要加载的框架 | ||
1365 | // if (-1 != model.indexOf("waterfall_recommend")) { | ||
1366 | // this.getRightRecommendRequest(waterfall_recommend); //渲染右侧推荐框架 | ||
1367 | // } else if (-1 != model.indexOf("waterfall_parent")) { | ||
1368 | // this.getRightRecommendRequest(waterfall_parent); | ||
1369 | // } else if (-1 != model.indexOf("waterfall_course")) { | ||
1370 | // this.getRightRecommendRequest(waterfall_course); | ||
1371 | // } else if (-1 != model.indexOf("waterfall_primarySchool")) { | ||
1372 | // this.getRightRecommendRequest(waterfall_primarySchool); | ||
1373 | // } else if (-1 != model.indexOf("waterfall_three2six")) { | ||
1374 | // this.getRightRecommendRequest(waterfall_three2six); | ||
1375 | // } | ||
1376 | // break; | ||
1377 | // case "changeUI": //放在TVCanvas中全局管理 | ||
1378 | // let parameter = aOperationList[i].parameters.uiName; //更换界面的名称 | ||
1379 | // if (parameter=="collection") { //收藏 | ||
1380 | // this.getRightRecommendRequest(waterfall_recommend); | ||
1381 | // } else if (parameter=="history") { //历史 | ||
1382 | // this.getRightRecommendRequest(waterfall_parent); | ||
1383 | // } else if (parameter=="search") { //搜索 | ||
1384 | // this.getRightRecommendRequest(waterfall_course); | ||
1385 | // } | ||
1386 | // break; | ||
1387 | default: | 1387 | default: |
1388 | this.doTVLinkAction(aOperationList[i]); | 1388 | this.doTVLinkAction(aOperationList[i]); |
1389 | break; | 1389 | break; |
... | @@ -1528,11 +1528,11 @@ cc.Class({ | ... | @@ -1528,11 +1528,11 @@ cc.Class({ |
1528 | // this.panel.byteProgress.progress = 0; | 1528 | // this.panel.byteProgress.progress = 0; |
1529 | 1529 | ||
1530 | this._bAbleHotUpdate = true; | 1530 | this._bAbleHotUpdate = true; |
1531 | // this._iSceneStatus = 1; //焦点框跳转层级 | 1531 | this._iSceneStatus = 1; //焦点框跳转层级 |
1532 | // cc.find("update", this.node).active = true; //显示出来更新面板 | 1532 | cc.find("update", this.node).active = true; //显示出来更新面板 |
1533 | // this._cFocus.show(); | 1533 | // this._cFocus.hide(); |
1534 | // let fiHotUpdateBtn = cc.find('update/update_panel/update_btn', this.node).getComponent(FocusInfo); //热更新按钮 | 1534 | let fiHotUpdateBtn = cc.find('update/update_panel/update_btn', this.node).getComponent(FocusInfo); //热更新按钮 |
1535 | // this._cFocus.flyFocus(this._fiCurrentFocus, fiHotUpdateBtn, Common.MOVE_DIRECTION_RIGHT, null, null); | 1535 | this._cFocus.flyFocus(this._fiCurrentFocus, fiHotUpdateBtn, Common.MOVE_DIRECTION_RIGHT, null, null); |
1536 | 1536 | ||
1537 | break; | 1537 | break; |
1538 | default: | 1538 | default: |
... | @@ -1543,20 +1543,20 @@ cc.Class({ | ... | @@ -1543,20 +1543,20 @@ cc.Class({ |
1543 | this._checkListener = null; | 1543 | this._checkListener = null; |
1544 | this._updating = false; | 1544 | this._updating = false; |
1545 | 1545 | ||
1546 | if (this._bAbleHotUpdate) { | 1546 | // if (this._bAbleHotUpdate) { |
1547 | this.hotUpdate(); //放在这里可以静默升级 | 1547 | // this.hotUpdate(); //放在这里可以静默升级 |
1548 | } | 1548 | // } |
1549 | }, | 1549 | }, |
1550 | 1550 | ||
1551 | hotUpdate: function () { | 1551 | hotUpdate: function () { |
1552 | cc.log("hotUpdate start..."); | 1552 | cc.log("hotUpdate start..."); |
1553 | //隐藏更新说明,显示更新进度条 | 1553 | //隐藏更新说明,显示更新进度条 |
1554 | cc.find("update/update_panel/NewLabel", this.node).active = false; | 1554 | // cc.find("update/update_panel/NewLabel", this.node).active = false;//因为新的更新界面没有进度条,先不要显示更新进度 |
1555 | cc.find("update/update_panel/versionLabel", this.node).active = false; | 1555 | // cc.find("update/update_panel/versionLabel", this.node).active = false; |
1556 | cc.find("update/update_panel/update_info", this.node).active = false; | 1556 | // cc.find("update/update_panel/update_info", this.node).active = false; |
1557 | cc.find("update/update_panel/ProgressLabel", this.node).active = true; | 1557 | // cc.find("update/update_panel/ProgressLabel", this.node).active = true; |
1558 | cc.find("update/update_panel/fileProgress", this.node).active = true; | 1558 | // cc.find("update/update_panel/fileProgress", this.node).active = true; |
1559 | cc.find("update/update_panel/filep", this.node).active = true; | 1559 | // cc.find("update/update_panel/filep", this.node).active = true; |
1560 | 1560 | ||
1561 | if (this._am && !this._updating) { | 1561 | if (this._am && !this._updating) { |
1562 | this._am.setEventCallback(this.updateCb.bind(this)); | 1562 | this._am.setEventCallback(this.updateCb.bind(this)); | ... | ... |

37.3 KB
assets/resources/Hot_update/btn_cancel.png
0 → 100644

11.9 KB
assets/resources/Hot_update/btn_update.png
0 → 100644

11.9 KB

54 KB

66.6 KB

160 KB

59.3 KB
-
Please register or sign in to post a comment