Commit e2155944 authored by Tt's avatar Tt

修改完成

parent 00f1008c
......@@ -21,7 +21,8 @@ export default class LayerEnding extends cc.Component {
pg.view.touchOn(this.replay_btn, this.onTouchReplay, this)
pg.view.touchOn(this.next_btn, this.onTouchNext, this)
pg.event.on('layer_ending_show', (data) => {
this.showLayer(data);
// this.showLayer(data);
this.onTouchNext();
})
}
showLayer(data) {
......
This diff is collapsed.
......@@ -109,6 +109,34 @@ export default class SceneComponent extends MyCocosSceneComponent {
gameOver() {
this.state = State.Over;
this.showAni().then(coin => {
pg.event.once('layer_coin_show_coin_end', () => {
pg.event.emit('layer_ending_show')
}) // 动画回调
pg.event.emit('layer_coin_show_coin', coin) //1 2 3硬币数量
})
}
showAni() {
return new Promise((resolve, reject) => {
let percent = this.right / this.data.options.length;
if (percent < 0.3) {
pg.event.once('layer_right_show_tryagain_end', () => {
resolve(1);
})
pg.event.emit('layer_right_show_tryagain')
} else if (percent < 0.6) {
pg.event.once('layer_right_show_good_end', () => {
resolve(2);
})
pg.event.emit('layer_right_show_good')
} else {
pg.event.once('layer_right_show_excellent_end', () => {
resolve(3);
})
pg.event.emit('layer_right_show_excellent')
}
});
}
showCamera() {
courseware && courseware.openRecognitionCamera({
......
......@@ -10,7 +10,8 @@ export const defaultData =
{
"type": "img", "image": "http://staging-teach.cdn.ireadabc.com/5e0afcb2626cb97395fa80688d0da26e.png", "audio": "http://staging-teach.cdn.ireadabc.com/a5fb06cfafd5c74d143d00b8cafbed2e_l.mp3", "text": "push", "right": false, "audioName": "正确.mp3"
},
{ "type": "", "image": "http://staging-teach.cdn.ireadabc.com/d1905036a1cbe59e269641576bf025cb.png", "audio": "http://staging-teach.cdn.ireadabc.com/141bd6c7ce281deb3c2a6ceb66e2148e_l.mp3", "text": "yun", "right": false, "audioName": "错误.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/65732948abd635b143bcca6bf30e1ae3.png", "audio": "http://staging-teach.cdn.ireadabc.com/5eeac1448c75db6dda78519ae7986dd2_l.mp3", "text": "right", "right": false, "audioName": "星星变虎头.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/017549d06d93f449af1ca4e1306cc970.png", "audio": "http://staging-teach.cdn.ireadabc.com/6d742645880f902efae878facc78da07_l.mp3", "text": "star", "right": false, "audioName": "请在5秒内说出正确答案.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/5e0afcb2626cb97395fa80688d0da26e.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/e6ea7e0efa41ddfbcbbd6e01581a1d2f.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/e6ea7e0efa41ddfbcbbd6e01581a1d2f.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/5e0afcb2626cb97395fa80688d0da26e.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/e6ea7e0efa41ddfbcbbd6e01581a1d2f.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/5e0afcb2626cb97395fa80688d0da26e.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/65732948abd635b143bcca6bf30e1ae3.png", "audio": "http://staging-teach.cdn.ireadabc.com/5eeac1448c75db6dda78519ae7986dd2_l.mp3", "text": "right", "right": false, "audioName": "星星变虎头.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/d1905036a1cbe59e269641576bf025cb.png", "audio": "http://staging-teach.cdn.ireadabc.com/141bd6c7ce281deb3c2a6ceb66e2148e_l.mp3", "text": "yun", "right": false, "audioName": "错误.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/65732948abd635b143bcca6bf30e1ae3.png", "audio": "http://staging-teach.cdn.ireadabc.com/5eeac1448c75db6dda78519ae7986dd2_l.mp3", "text": "right", "right": false, "audioName": "星星变虎头.mp3" }], "audioName": "请在5秒内说出正确答案.mp3"
{ "type": "", "image": "http://staging-teach.cdn.ireadabc.com/d1905036a1cbe59e269641576bf025cb.png", "audio": "http://staging-teach.cdn.ireadabc.com/141bd6c7ce281deb3c2a6ceb66e2148e_l.mp3", "text": "yun", "right": false, "audioName": "错误.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/65732948abd635b143bcca6bf30e1ae3.png", "audio": "http://staging-teach.cdn.ireadabc.com/5eeac1448c75db6dda78519ae7986dd2_l.mp3", "text": "right", "right": false, "audioName": "星星变虎头.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/017549d06d93f449af1ca4e1306cc970.png", "audio": "http://staging-teach.cdn.ireadabc.com/6d742645880f902efae878facc78da07_l.mp3", "text": "star", "right": false, "audioName": "请在5秒内说出正确答案.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/5e0afcb2626cb97395fa80688d0da26e.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/e6ea7e0efa41ddfbcbbd6e01581a1d2f.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/e6ea7e0efa41ddfbcbbd6e01581a1d2f.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/5e0afcb2626cb97395fa80688d0da26e.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/e6ea7e0efa41ddfbcbbd6e01581a1d2f.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/5e0afcb2626cb97395fa80688d0da26e.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/65732948abd635b143bcca6bf30e1ae3.png", "audio": "http://staging-teach.cdn.ireadabc.com/5eeac1448c75db6dda78519ae7986dd2_l.mp3", "text": "right", "right": false, "audioName": "星星变虎头.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/d1905036a1cbe59e269641576bf025cb.png", "audio": "http://staging-teach.cdn.ireadabc.com/141bd6c7ce281deb3c2a6ceb66e2148e_l.mp3", "text": "yun", "right": false, "audioName": "错误.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/65732948abd635b143bcca6bf30e1ae3.png", "audio": "http://staging-teach.cdn.ireadabc.com/5eeac1448c75db6dda78519ae7986dd2_l.mp3", "text": "right", "right": false, "audioName": "星星变虎头.mp3" }
], "audioName": "请在5秒内说出正确答案.mp3"
}], "bgAudio": "", "bgAudioName": "", "audioName": ""
}
......
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