Commit 3ba05101 authored by yu's avatar yu

2

parent cf8fcf02
...@@ -5020,7 +5020,7 @@ ...@@ -5020,7 +5020,7 @@
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 220, "width": 220,
"height": 50.4 "height": 70
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -5074,7 +5074,7 @@ ...@@ -5074,7 +5074,7 @@
"_string": "", "_string": "",
"_N$string": "", "_N$string": "",
"_fontSize": 40, "_fontSize": 40,
"_lineHeight": 40, "_lineHeight": 45,
"_enableWrapText": true, "_enableWrapText": true,
"_N$file": null, "_N$file": null,
"_isSystemFontUsed": true, "_isSystemFontUsed": true,
...@@ -5813,7 +5813,7 @@ ...@@ -5813,7 +5813,7 @@
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 200, "width": 200,
"height": 50.4 "height": 90
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -5867,7 +5867,7 @@ ...@@ -5867,7 +5867,7 @@
"_string": "", "_string": "",
"_N$string": "", "_N$string": "",
"_fontSize": 40, "_fontSize": 40,
"_lineHeight": 40, "_lineHeight": 45,
"_enableWrapText": true, "_enableWrapText": true,
"_N$file": null, "_N$file": null,
"_isSystemFontUsed": true, "_isSystemFontUsed": true,
...@@ -6411,7 +6411,7 @@ ...@@ -6411,7 +6411,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 528.22, "width": 540,
"height": 90.4 "height": 90.4
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -6477,7 +6477,7 @@ ...@@ -6477,7 +6477,7 @@
"_N$horizontalAlign": 1, "_N$horizontalAlign": 1,
"_N$verticalAlign": 1, "_N$verticalAlign": 1,
"_N$fontFamily": "Muli", "_N$fontFamily": "Muli",
"_N$overflow": 0, "_N$overflow": 2,
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "9eYhsD8IhP/ZcglYwgkAnW" "_id": "9eYhsD8IhP/ZcglYwgkAnW"
}, },
......
...@@ -265,52 +265,6 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -265,52 +265,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.showLayout(); this.showLayout();
} }
private getItemNode(type) {
let item;
if (this.upArr.length == 5) {
if (type == 1) {
item = cc.instantiate(cc.find("items/type1", this.node));
} else {
item = cc.instantiate(cc.find("items/type4", this.node));
}
} else if (this.upArr.length == 4) {
if (type == 1) {
item = cc.instantiate(cc.find("items/type2", this.node));
} else {
item = cc.instantiate(cc.find("items/type5", this.node));
}
} else if (this.upArr.length == 3) {
if (type == 1) {
item = cc.instantiate(cc.find("items/type3", this.node));
} else {
item = cc.instantiate(cc.find("items/type6", this.node));
}
}
return item;
}
private getHeadSize(type) {
let size = {};
if (this.upArr.length == 5) {
if (type == 1) {
size = { w: 50, h: 50 }
} else {
size = { w: 400, h: 60 }
}
} else if (this.upArr.length == 4) {
if (type == 1) {
size = { w: 90, h: 90 }
} else {
size = { w: 255, h: 80 }
}
} else if (this.upArr.length == 3) {
if (type == 1) {
size = { w: 120, h: 115 }
} else {
size = { w: 255, h: 120 }
}
}
return size;
}
private showLayout() { private showLayout() {
let data = this.data.item.group; let data = this.data.item.group;
let lift = cc.find("lift", this.node); let lift = cc.find("lift", this.node);
...@@ -345,6 +299,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -345,6 +299,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
textItem.parent = right; textItem.parent = right;
} }
}); });
setTimeout(() => {
this.updateItemWidth(lift);
this.updateItemWidth(right);
}, 60);
} }
private showQuestion() { private showQuestion() {
...@@ -386,7 +344,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -386,7 +344,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
let img_laba02 = item.getChildByName("img_close"); let img_laba02 = item.getChildByName("img_close");
let desc = item.getChildByName("desc"); let desc = item.getChildByName("desc");
desc.getComponent(cc.Label).string = data.text; desc.getComponent(cc.Label).string = data.text;
if (type == 1 && item.width - desc.width > 10) { if (item.width - desc.width > 10) {
setTimeout(() => { setTimeout(() => {
item.width = desc.width + 30; item.width = desc.width + 30;
}, 30); }, 30);
...@@ -405,6 +363,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -405,6 +363,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}); });
} }
item.x = 0; item.x = 0;
item.opacity = 0.1;
} }
private initPicItem(item, data, size) { private initPicItem(item, data, size) {
...@@ -430,6 +389,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -430,6 +389,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}); });
} }
item.x = 0; item.x = 0;
item.opacity = 0.1;
} }
private checkLing() { private checkLing() {
...@@ -550,8 +510,63 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -550,8 +510,63 @@ export default class SceneComponent extends MyCocosSceneComponent {
}, 1800); }, 1800);
} }
} }
private updateItemWidth(layout: cc.Node) {
let width = 0;
layout.children.forEach((ch) => {
if (ch.width > width) width = ch.width;
});
layout.children.forEach((ch) => {
ch.width = width;
ch.opacity = 255;
});
}
private getItemNode(type) {
let item;
if (this.upArr.length == 5) {
if (type == 1) {
item = cc.instantiate(cc.find("items/type1", this.node));
} else {
item = cc.instantiate(cc.find("items/type4", this.node));
}
} else if (this.upArr.length == 4) {
if (type == 1) {
item = cc.instantiate(cc.find("items/type5", this.node));
} else {
item = cc.instantiate(cc.find("items/type5", this.node));
}
} else if (this.upArr.length == 3) {
if (type == 1) {
item = cc.instantiate(cc.find("items/type6", this.node));
} else {
item = cc.instantiate(cc.find("items/type6", this.node));
}
}
return item;
}
private getHeadSize(type) {
let size = {};
if (this.upArr.length == 5) {
if (type == 1) {
size = { w: 50, h: 50 }
} else {
size = { w: 400, h: 60 }
}
} else if (this.upArr.length == 4) {
if (type == 1) {
size = { w: 90, h: 90 }
} else {
size = { w: 255, h: 80 }
}
} else if (this.upArr.length == 3) {
if (type == 1) {
size = { w: 120, h: 115 }
} else {
size = { w: 255, h: 120 }
}
}
return size;
}
......
...@@ -13,33 +13,36 @@ export const defaultData ={ ...@@ -13,33 +13,36 @@ export const defaultData ={
"time": 1 "time": 1
}, },
"item": { "item": {
"group": [{ "group": [
"up": { // {
"type": 1, // "up": {
"pic_url": "", // "type": 1,
"text": "1fdshkdshfksdhkfhdskdsk", // "pic_url": "http://staging-teach.cdn.ireadabc.com/e359730cf593c396a58e020333026fac.png",
"audio_url": "" // "text": "",
}, // "audio_url": ""
"down": { // },
"type": 1, // "down": {
"pic_url": "http://staging-teach.cdn.ireadabc.com/6689e11c1646fba838a51c212b7770d2.png", // "type": 1,
"text": "第三位发送到", // "pic_url": "http://staging-teach.cdn.ireadabc.com/6689e11c1646fba838a51c212b7770d2.png",
"audio_url": "http://staging-teach.cdn.ireadabc.com/71348a317c47ec2a0b3056b0d7ca2e99.mp3" // "text": "第三位发送到gdfkgdfgdfgdf",
} // "audio_url": "http://staging-teach.cdn.ireadabc.com/71348a317c47ec2a0b3056b0d7ca2e99.mp3"
}, { // }
"up": { // },
"type": 0, // {
"pic_url": "http://staging-teach.cdn.ireadabc.com/e359730cf593c396a58e020333026fac.png", // "up": {
"text": "2", // "type": 0,
"audio_url": "" // "pic_url": "http://staging-teach.cdn.ireadabc.com/e359730cf593c396a58e020333026fac.png",
}, // "text": "2",
"down": { // "audio_url": ""
"type": 1, // },
"pic_url": "", // "down": {
"text": "4534543", // "type": 1,
"audio_url": "http://staging-teach.cdn.ireadabc.com/526624b47ba5e46f698add9e152a4b4e.mp3" // "pic_url": "",
} // "text": "4534543",
}, { // "audio_url": "http://staging-teach.cdn.ireadabc.com/526624b47ba5e46f698add9e152a4b4e.mp3"
// }
// },
{
"up": { "up": {
"type": 0, "type": 0,
"pic_url": "http://staging-teach.cdn.ireadabc.com/bcc13bb8f504b17ee9d07d8f5204b12f.png", "pic_url": "http://staging-teach.cdn.ireadabc.com/bcc13bb8f504b17ee9d07d8f5204b12f.png",
...@@ -67,22 +70,22 @@ export const defaultData ={ ...@@ -67,22 +70,22 @@ export const defaultData ={
"audio_url": "http://staging-teach.cdn.ireadabc.com/9df3f14bc88bcffc49b6717c40428ed8.mp3" "audio_url": "http://staging-teach.cdn.ireadabc.com/9df3f14bc88bcffc49b6717c40428ed8.mp3"
} }
}, },
// { {
// "up": { "up": {
// "type": 0, "type": 0,
// "pic_url": "http://staging-teach.cdn.ireadabc.com/ce43980b533f674f9debe6ce9cae7b8d.png", "pic_url": "http://staging-teach.cdn.ireadabc.com/ce43980b533f674f9debe6ce9cae7b8d.png",
// "text": "5", "text": "5",
// "audio_url": "" "audio_url": ""
// }, },
// "down": { "down": {
// "type": 1, "type": 1,
// "pic_url": "", "pic_url": "",
// "text": "5345344343", "text": "5345344343",
// "audio_url": "" "audio_url": ""
// } }
// } }
], ],
"title": "电话客服劵花费", "title": "电话客服劵花费电话客服劵花费电话客服劵花费电话客服劵花费电话客服劵花费",
"audio_title": "http://staging-teach.cdn.ireadabc.com/f7fb9f71ab7d460ac2f78c85efba7610.mp3" "audio_title": "http://staging-teach.cdn.ireadabc.com/f7fb9f71ab7d460ac2f78c85efba7610.mp3"
} }
} }
......
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