Commit 788b31e9 authored by yu's avatar yu

1

parent 2d362bb8
...@@ -286,6 +286,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -286,6 +286,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
this.playLocalAudio("right"); this.playLocalAudio("right");
if (question.type == "txt") { if (question.type == "txt") {
this.addTxteImg(item);
cc.tween(target).to(0.5, { scale: 1.2 }).to(0.2, { scale: 0.5 }).call(() => { cc.tween(target).to(0.5, { scale: 1.2 }).to(0.2, { scale: 0.5 }).call(() => {
this.wordRight(item).then(() => { this.wordRight(item).then(() => {
this.hideTop(card); this.hideTop(card);
...@@ -307,6 +308,15 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -307,6 +308,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
}).start(); }).start();
} }
private addTxteImg(item) {
let node = new cc.Node();
node.addComponent(cc.Sprite);
pg.view.setNetImg(node, this.cardInfo.picUrl, { w: 110, h: 114 });
let layout_img = cc.find("layout_img", item);
node.parent = layout_img;
let scale = layout_img.parent.scale
node.scale = scale < 0.9 ? 0.9 : scale;
}
private wordRight(item) { private wordRight(item) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let layout_word = cc.find("layout_word", item); let layout_word = cc.find("layout_word", item);
......
...@@ -19,42 +19,42 @@ export const defaultData = { ...@@ -19,42 +19,42 @@ export const defaultData = {
{ {
"type": "img", "type": "img",
"text": "1", "text": "1",
"image": "", "image": "http://staging-teach.cdn.ireadabc.com/5835aa41da46fd1e9d3aab12e8510051.png",
"audio": "", "audio": "",
"idx": "1" "idx": "1"
}, },
{ {
"type": "txt", "type": "txt",
"text": "1", "text": "1",
"image": "", "image": "http://staging-teach.cdn.ireadabc.com/5835aa41da46fd1e9d3aab12e8510051.png",
"audio": "", "audio": "",
"idx": "1" "idx": "1"
}, },
{ {
"type": "txt", "type": "txt",
"text": "2", "text": "2",
"image": "", "image": "http://staging-teach.cdn.ireadabc.com/5835aa41da46fd1e9d3aab12e8510051.png",
"audio": "", "audio": "",
"idx": "2" "idx": "2"
}, },
{ {
"type": "txt", "type": "txt",
"text": "3", "text": "3",
"image": "", "image": "http://staging-teach.cdn.ireadabc.com/5835aa41da46fd1e9d3aab12e8510051.png",
"audio": "", "audio": "",
"idx": "3" "idx": "3"
}, },
{ {
"type": "txt", "type": "txt",
"text": "2", "text": "2",
"image": "", "image": "http://staging-teach.cdn.ireadabc.com/5835aa41da46fd1e9d3aab12e8510051.png",
"audio": "", "audio": "",
"idx": "2" "idx": "2"
}, },
{ {
"type": "txt", "type": "txt",
"text": "4", "text": "4",
"image": "", "image": "http://staging-teach.cdn.ireadabc.com/5835aa41da46fd1e9d3aab12e8510051.png",
"audio": "", "audio": "",
"idx": "4" "idx": "4"
} }
......
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