Commit 885f708a authored by Tt's avatar Tt

1

parent c285f217
...@@ -193,6 +193,7 @@ export default class LayerRecord extends cc.Component { ...@@ -193,6 +193,7 @@ export default class LayerRecord extends cc.Component {
}); //结束录音 }); //结束录音
} }
async recrodEnd(data) { async recrodEnd(data) {
pg.hw.addRecord(data)
this.recordAudio = data.audioUrl; this.recordAudio = data.audioUrl;
this.showPlay(); this.showPlay();
let score = data.result.overall; let score = data.result.overall;
......
...@@ -387,9 +387,9 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent { ...@@ -387,9 +387,9 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
sendData(score) { sendData(score) {
return new Promise(res => { return new Promise(res => {
let upData: any = { let upData: any = {
word_count: this.data.word_count, word_count: this.data.word_count || 0,
sentence_count: this.data.sentence_count, sentence_count: this.data.sentence_count || 0,
zi_count: this.data.zi_count, zi_count: this.data.zi_count || 0,
score: score, score: score,
}; };
let recordList = pg.hw.getRecord(); let recordList = pg.hw.getRecord();
...@@ -408,10 +408,11 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent { ...@@ -408,10 +408,11 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
// pg.event.emit('layer_ending_show', { coin: this.coin }) // pg.event.emit('layer_ending_show', { coin: this.coin })
const midd = cc.find('middleLayer'); const midd = cc.find('middleLayer');
if (!midd) return this.log("no middleLayer"); if (!midd) return this.log("no middleLayer");
this.sendData(this.coin); this.sendData(this.coin).then(()=>{
let middleLayer = midd.getComponent('middleLayer'); let middleLayer = midd.getComponent('middleLayer');
middleLayer.saveGolds(this.coin); // 保存金币数量;num 是获得金币的数量,数字类型; middleLayer.saveGolds(this.coin); // 保存金币数量;num 是获得金币的数量,数字类型;
middleLayer.goNextPage(); // 跳转到下一页 middleLayer.goNextPage(); // 跳转到下一页
})
} }
......
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