Commit 5493ee25 authored by Tt's avatar Tt

1

parent 7f579142
No preview for this file type
......@@ -60,12 +60,13 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
})
pg.event.on('layer_coin_show_coin_end', () => {
// pg.event.emit('layer_ending_show', { coin: 3 })
this.sendData(3).then(() => {
const midd = cc.find('middleLayer');
if (!midd) return this.log("no middleLayer");
let middleLayer = midd.getComponent('middleLayer');
middleLayer.saveGolds(3); // 保存金币数量;num 是获得金币的数量,数字类型;
this.sendData(3)
middleLayer.goNextPage(); // 跳转到下一页
})
})
pg.event.on("gameOver", () => { this.gameOver() })
......@@ -75,10 +76,10 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
sendData(score) {
return new Promise(res => {
let upData: any = {
word_count: this.data.word_count,
sentence_count: this.data.sentence_count,
zi_count: this.data.zi_count,
score: score,
word_count: this.data.word_count || 0,
sentence_count: this.data.sentence_count || 0,
zi_count: this.data.zi_count || 0,
score: score || 0,
};
let recordList = pg.hw.getRecord();
if (recordList && recordList.length > 0) {
......
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