Commit edac4bc5 edac4bc534d0ba9d1769384503bc610d137afcc1 by 金学艇

1.修改走马灯内容在main_layout.json中加载

1 parent 537a48d1
...@@ -287,7 +287,7 @@ cc.Class({ ...@@ -287,7 +287,7 @@ cc.Class({
287 cc.find("Desc/LabelDesc", this.node).getComponent(cc.Label).string = description; 287 cc.find("Desc/LabelDesc", this.node).getComponent(cc.Label).string = description;
288 //搞标签 288 //搞标签
289 let iTitleWidth = cc.find("Desc/Title", this.node).width; 289 let iTitleWidth = cc.find("Desc/Title", this.node).width;
290 let aTag = oJSONResult.resultSet[0].tag.split(""); 290 let aTag = oJSONResult.resultSet[0].tag.split("");
291 // cc.log("tag数量:" + aTag.length); 291 // cc.log("tag数量:" + aTag.length);
292 for (let i = 0; i < aTag.length; i++) { 292 for (let i = 0; i < aTag.length; i++) {
293 if (!aTag[i]) continue; 293 if (!aTag[i]) continue;
......
...@@ -108,8 +108,6 @@ cc.Class({ ...@@ -108,8 +108,6 @@ cc.Class({
108 108
109 //搞轮播图 109 //搞轮播图
110 this.initViewPager(); 110 this.initViewPager();
111 //搞通知框
112 this.initNotifyBox();
113 //升级相关 111 //升级相关
114 this.getUpdateDesc(); 112 this.getUpdateDesc();
115 this.getMainLayoutJsonRequest(); 113 this.getMainLayoutJsonRequest();
...@@ -153,19 +151,6 @@ cc.Class({ ...@@ -153,19 +151,6 @@ cc.Class({
153 }, this, "uuid"); 151 }, this, "uuid");
154 }, 152 },
155 153
156 initNotifyBox: function () {
157 let nodeLabel = cc.find("scrollContent/notify/Label", this.node);
158 nodeLabel.width = 656;
159 let compMarquee = nodeLabel.addComponent("Marquee");
160 compMarquee.active = true;
161 let aStrLabel = [];
162 aStrLabel[0] = "111王者佩奇:我已打卡消耗110卡路里,来和我玩同款【竞技运动】小游戏吧! ";
163 aStrLabel[1] = "222王者佩奇:我已打卡消耗110卡路里,来和我玩同款【竞技运动】小游戏吧! ";
164 aStrLabel[2] = "333王者佩奇:我已打卡消耗110卡路里,来和我玩同款【竞技运动】小游戏吧! ";
165 compMarquee.init(null, aStrLabel);
166 compMarquee.setUIWithFocus();
167 },
168
169 //升级框内容 154 //升级框内容
170 getUpdateDesc: function () { 155 getUpdateDesc: function () {
171 let updateTitle = cc.find("update/update_panel/update_title", this.node); 156 let updateTitle = cc.find("update/update_panel/update_title", this.node);
...@@ -198,6 +183,10 @@ cc.Class({ ...@@ -198,6 +183,10 @@ cc.Class({
198 // cc.log("远程数据:"+strResponse); 183 // cc.log("远程数据:"+strResponse);
199 var oJSONResult = JSON.parse(strResponse); 184 var oJSONResult = JSON.parse(strResponse);
200 self._oInit.oMainLayoutJson = oJSONResult; 185 self._oInit.oMainLayoutJson = oJSONResult;
186 //走马灯数据=========
187 this._oInit.aMarquee = oJSONResult.marquee.split(";");
188 // cc.log("走马灯获取的数据:" + this._oInit.aMarquee[1]);
189 //=========
201 190
202 self.getTopNaviRequest("topNavi"); 191 self.getTopNaviRequest("topNavi");
203 self.getTopNaviRequest("topCell"); 192 self.getTopNaviRequest("topCell");
...@@ -216,6 +205,8 @@ cc.Class({ ...@@ -216,6 +205,8 @@ cc.Class({
216 cc.find("scrollContent/BlockShadow", this.node).active = false; 205 cc.find("scrollContent/BlockShadow", this.node).active = false;
217 } 206 }
218 207
208 //搞通知框
209 this.initNotifyBox();
219 } catch (error) { 210 } catch (error) {
220 cc.log("Business Exception:Get getMainLayoutJsonRequest..." + error); 211 cc.log("Business Exception:Get getMainLayoutJsonRequest..." + error);
221 } 212 }
...@@ -225,6 +216,16 @@ cc.Class({ ...@@ -225,6 +216,16 @@ cc.Class({
225 }, this, "uuid"); 216 }, this, "uuid");
226 }, 217 },
227 218
219 //走马灯通知
220 initNotifyBox: function () {
221 let nodeLabel = cc.find("scrollContent/notify/Label", this.node);
222 nodeLabel.width = 656;
223 let compMarquee = nodeLabel.addComponent("Marquee");
224 compMarquee.active = true;
225 compMarquee.init(null, this._oInit.aMarquee);
226 compMarquee.setUIWithFocus();
227 },
228
228 //请求顶部个人中心和订购按钮 229 //请求顶部个人中心和订购按钮
229 getTopNaviRequest: function (strCellName) { 230 getTopNaviRequest: function (strCellName) {
230 // Network.ajax("GET", Common.TOPDRAW_API_SERVER + "main/main_layout.json", null, null, 231 // Network.ajax("GET", Common.TOPDRAW_API_SERVER + "main/main_layout.json", null, null,
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
3 "name": "首页", 3 "name": "首页",
4 "code": "eb954b1e-712e-415c-ba27-ddcf60f64adf", 4 "code": "eb954b1e-712e-415c-ba27-ddcf60f64adf",
5 "layout": "absolute", 5 "layout": "absolute",
6 "marquee": "111王者佩奇:我已打卡消耗110卡路里,来和我玩同款【竞技运动】小游戏吧! ;222王者佩奇:我已打卡消耗110卡路里,来和我玩同款【竞技运动】小游戏吧! ;333王者佩奇:我已打卡消耗110卡路里,来和我玩同款【竞技运动】小游戏吧! ",
6 "children": [ 7 "children": [
7 { 8 {
8 "name": "Navigator", 9 "name": "Navigator",
......