Commit d2244c55 authored by Tt's avatar Tt

1

parent cbd577e0
...@@ -124,10 +124,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -124,10 +124,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.orgData.word_count, word_count: this.orgData.word_count || 0,
sentence_count: this.orgData.sentence_count, sentence_count: this.orgData.sentence_count || 0,
zi_count: this.orgData.zi_count, zi_count: this.orgData.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) {
...@@ -146,12 +146,12 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -146,12 +146,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.showAni().then((coin: number) => { this.showAni().then((coin: number) => {
this.score = coin; this.score = coin;
this.sendData(this.score).then(() => { this.sendData(this.score).then(() => {
})
pg.event.once('layer_coin_show_coin_end', () => { pg.event.once('layer_coin_show_coin_end', () => {
this.onClose(); this.onClose();
}) // 动画回调 }) // 动画回调
pg.event.emit('layer_coin_show_coin', coin) //1 2 3硬币数量 pg.event.emit('layer_coin_show_coin', coin) //1 2 3硬币数量
}) })
})
} }
showAni() { showAni() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
......
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