Commit edac4bc5 edac4bc534d0ba9d1769384503bc610d137afcc1 by 金学艇

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

1 parent 537a48d1
......@@ -287,7 +287,7 @@ cc.Class({
cc.find("Desc/LabelDesc", this.node).getComponent(cc.Label).string = description;
//搞标签
let iTitleWidth = cc.find("Desc/Title", this.node).width;
let aTag = oJSONResult.resultSet[0].tag.split("");
let aTag = oJSONResult.resultSet[0].tag.split("");
// cc.log("tag数量:" + aTag.length);
for (let i = 0; i < aTag.length; i++) {
if (!aTag[i]) continue;
......
......@@ -108,8 +108,6 @@ cc.Class({
//搞轮播图
this.initViewPager();
//搞通知框
this.initNotifyBox();
//升级相关
this.getUpdateDesc();
this.getMainLayoutJsonRequest();
......@@ -153,19 +151,6 @@ cc.Class({
}, this, "uuid");
},
initNotifyBox: function () {
let nodeLabel = cc.find("scrollContent/notify/Label", this.node);
nodeLabel.width = 656;
let compMarquee = nodeLabel.addComponent("Marquee");
compMarquee.active = true;
let aStrLabel = [];
aStrLabel[0] = "111王者佩奇:我已打卡消耗110卡路里,来和我玩同款【竞技运动】小游戏吧! ";
aStrLabel[1] = "222王者佩奇:我已打卡消耗110卡路里,来和我玩同款【竞技运动】小游戏吧! ";
aStrLabel[2] = "333王者佩奇:我已打卡消耗110卡路里,来和我玩同款【竞技运动】小游戏吧! ";
compMarquee.init(null, aStrLabel);
compMarquee.setUIWithFocus();
},
//升级框内容
getUpdateDesc: function () {
let updateTitle = cc.find("update/update_panel/update_title", this.node);
......@@ -198,6 +183,10 @@ cc.Class({
// cc.log("远程数据:"+strResponse);
var oJSONResult = JSON.parse(strResponse);
self._oInit.oMainLayoutJson = oJSONResult;
//走马灯数据=========
this._oInit.aMarquee = oJSONResult.marquee.split(";");
// cc.log("走马灯获取的数据:" + this._oInit.aMarquee[1]);
//=========
self.getTopNaviRequest("topNavi");
self.getTopNaviRequest("topCell");
......@@ -216,6 +205,8 @@ cc.Class({
cc.find("scrollContent/BlockShadow", this.node).active = false;
}
//搞通知框
this.initNotifyBox();
} catch (error) {
cc.log("Business Exception:Get getMainLayoutJsonRequest..." + error);
}
......@@ -225,6 +216,16 @@ cc.Class({
}, this, "uuid");
},
//走马灯通知
initNotifyBox: function () {
let nodeLabel = cc.find("scrollContent/notify/Label", this.node);
nodeLabel.width = 656;
let compMarquee = nodeLabel.addComponent("Marquee");
compMarquee.active = true;
compMarquee.init(null, this._oInit.aMarquee);
compMarquee.setUIWithFocus();
},
//请求顶部个人中心和订购按钮
getTopNaviRequest: function (strCellName) {
// Network.ajax("GET", Common.TOPDRAW_API_SERVER + "main/main_layout.json", null, null,
......
......@@ -3,6 +3,7 @@
"name": "首页",
"code": "eb954b1e-712e-415c-ba27-ddcf60f64adf",
"layout": "absolute",
"marquee": "111王者佩奇:我已打卡消耗110卡路里,来和我玩同款【竞技运动】小游戏吧! ;222王者佩奇:我已打卡消耗110卡路里,来和我玩同款【竞技运动】小游戏吧! ;333王者佩奇:我已打卡消耗110卡路里,来和我玩同款【竞技运动】小游戏吧! ",
"children": [
{
"name": "Navigator",
......