Commit aff6253c authored by yu's avatar yu

调整

parent ead258bc
This diff is collapsed.
......@@ -274,7 +274,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.showLayout();
}
private checkisPicOrText() {
if (this.upArr.length != 4) return false;
if (this.upArr.length == 5) return false;
let t1 = this.upArr[0].type == 1;
let t2 = this.downArr[0].type == 1;
return t1 && t2;
......@@ -286,8 +286,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
lift.removeAllChildren();
right.removeAllChildren();
let isSpY = this.checkisPicOrText();
right.getComponent(cc.Layout).spacingY = isSpY ? 30 : 10;
lift.getComponent(cc.Layout).spacingY = isSpY ? 30 : 10;
right.getComponent(cc.Layout).spacingY = isSpY ? this.upArr.length == 3 ? 60 : 30 : 10;
lift.getComponent(cc.Layout).spacingY = isSpY ? this.upArr.length == 3 ? 60 : 30 : 10;
right.getComponent(cc.Layout).paddingTop = isSpY ? this.upArr.length == 3 ? 30 : 10 : 0;
lift.getComponent(cc.Layout).paddingTop = isSpY ? this.upArr.length == 3 ? 30 : 10 : 0;
this.upArr.forEach((item) => {
if (item.type == 1) {
......@@ -585,9 +587,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
} else if (this.upArr.length == 3) {
if (type == 1) {
item = cc.instantiate(cc.find("items/type6", this.node));
if (isSpY) item = cc.instantiate(cc.find("items/type1", this.node));
else item = cc.instantiate(cc.find("items/type6", this.node));
} else {
item = cc.instantiate(cc.find("items/type6", this.node));
if (isSpY) item = cc.instantiate(cc.find("items/type4", this.node));
else item = cc.instantiate(cc.find("items/type6", this.node));
}
}
return item;
......
......@@ -55,34 +55,34 @@ export const defaultData = {
"audio_url": ""
}
},
{
"up": {
"type": 1,
"pic_url": "",
"text": "郭德付个",
"audio_url": ""
},
"down": {
"type": 1,
"pic_url": "",
"text": "能不能看",
"audio_url": ""
}
},
{
"up": {
"type": 1,
"pic_url": "",
"text": "女包",
"audio_url": ""
},
"down": {
"type": 1,
"pic_url": "",
"text": "牛牛斯蒂芬",
"audio_url": ""
}
}
// {
// "up": {
// "type": 1,
// "pic_url": "",
// "text": "郭德付个",
// "audio_url": ""
// },
// "down": {
// "type": 1,
// "pic_url": "",
// "text": "能不能看",
// "audio_url": ""
// }
// },
// {
// "up": {
// "type": 1,
// "pic_url": "",
// "text": "女包",
// "audio_url": ""
// },
// "down": {
// "type": 1,
// "pic_url": "",
// "text": "牛牛斯蒂芬",
// "audio_url": ""
// }
// }
]
}, {
"title": "非凡哥的",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment