Commit aff6253c authored by yu's avatar yu

调整

parent ead258bc
This diff is collapsed.
...@@ -274,7 +274,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -274,7 +274,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.showLayout(); this.showLayout();
} }
private checkisPicOrText() { private checkisPicOrText() {
if (this.upArr.length != 4) return false; if (this.upArr.length == 5) return false;
let t1 = this.upArr[0].type == 1; let t1 = this.upArr[0].type == 1;
let t2 = this.downArr[0].type == 1; let t2 = this.downArr[0].type == 1;
return t1 && t2; return t1 && t2;
...@@ -286,8 +286,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -286,8 +286,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
lift.removeAllChildren(); lift.removeAllChildren();
right.removeAllChildren(); right.removeAllChildren();
let isSpY = this.checkisPicOrText(); let isSpY = this.checkisPicOrText();
right.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 ? 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) => { this.upArr.forEach((item) => {
if (item.type == 1) { if (item.type == 1) {
...@@ -585,9 +587,11 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -585,9 +587,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
} else if (this.upArr.length == 3) { } else if (this.upArr.length == 3) {
if (type == 1) { 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 { } 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; return item;
......
...@@ -55,34 +55,34 @@ export const defaultData = { ...@@ -55,34 +55,34 @@ export const defaultData = {
"audio_url": "" "audio_url": ""
} }
}, },
{ // {
"up": { // "up": {
"type": 1, // "type": 1,
"pic_url": "", // "pic_url": "",
"text": "郭德付个", // "text": "郭德付个",
"audio_url": "" // "audio_url": ""
}, // },
"down": { // "down": {
"type": 1, // "type": 1,
"pic_url": "", // "pic_url": "",
"text": "能不能看", // "text": "能不能看",
"audio_url": "" // "audio_url": ""
} // }
}, // },
{ // {
"up": { // "up": {
"type": 1, // "type": 1,
"pic_url": "", // "pic_url": "",
"text": "女包", // "text": "女包",
"audio_url": "" // "audio_url": ""
}, // },
"down": { // "down": {
"type": 1, // "type": 1,
"pic_url": "", // "pic_url": "",
"text": "牛牛斯蒂芬", // "text": "牛牛斯蒂芬",
"audio_url": "" // "audio_url": ""
} // }
} // }
] ]
}, { }, {
"title": "非凡哥的", "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