Commit 66300a50 authored by Tt's avatar Tt

1

parent 61a84dd0
......@@ -130,9 +130,9 @@ export default class SceneComponent 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,
word_count: this.data.word_count || 0,
sentence_count: this.data.sentence_count || 0,
zi_count: this.data.zi_count || 0,
score: score,
};
let recordList = pg.hw.getRecord();
......@@ -147,13 +147,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
}
gameOver() {
this.onDestroy();
const middleLayer = cc.find('middleLayer');
if (!middleLayer) return;
this.sendData(this.wordDataList.length * 3)
const middleLayerComponent = middleLayer.getComponent('middleLayer');
middleLayerComponent.saveGolds(this.wordDataList.length * 3); // 保存金币数量;num 是获得金币的数量,数字类型;
middleLayerComponent.goNextPage(); // 跳转到下一页
this.sendData(this.wordDataList.length * 3).then(() => {
this.onDestroy();
const middleLayer = cc.find('middleLayer');
if (!middleLayer) return;
const middleLayerComponent = middleLayer.getComponent('middleLayer');
middleLayerComponent.saveGolds(this.wordDataList.length * 3); // 保存金币数量;num 是获得金币的数量,数字类型;
middleLayerComponent.goNextPage(); // 跳转到下一页
})
// pg.event.once('layer_ending_touch_replay', () => {
// this.replay();
// })
......
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