Commit 85d32df4 authored by Tt's avatar Tt

1

parent eb715451
No preview for this file type
...@@ -87,10 +87,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -87,10 +87,10 @@ export default class SceneComponent 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 || 0,
}; };
let recordList = pg.hw.getRecord(); let recordList = pg.hw.getRecord();
if (recordList && recordList.length > 0) { if (recordList && recordList.length > 0) {
...@@ -109,10 +109,11 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -109,10 +109,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
// this.replay(); // this.replay();
// }) // })
// pg.event.emit('layer_ending_show', { coin: this.data.questions.length * 3 }) // pg.event.emit('layer_ending_show', { coin: this.data.questions.length * 3 })
const middleLayer = cc.find('middleLayer').getComponent('middleLayer'); this.sendData(this.data.questions.length * 3).then(() => {
middleLayer.saveGolds(this.data.questions.length * 3); // 保存金币数量;num 是获得金币的数量,数字类型; const middleLayer = cc.find('middleLayer').getComponent('middleLayer');
this.sendData(this.data.questions.length * 3); middleLayer.saveGolds(this.data.questions.length * 3); // 保存金币数量;num 是获得金币的数量,数字类型;
middleLayer.goNextPage(); // 跳转到下一页 middleLayer.goNextPage(); // 跳转到下一页
})
} }
private rightList: Array<any>; private rightList: Array<any>;
private createCount: number; private createCount: number;
......
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