Commit 5d82f3a5 authored by kai's avatar kai

fix: 收集听音数据

parent 46eb1ba8
...@@ -91,15 +91,16 @@ export default class NewClass extends middleLayerBase { ...@@ -91,15 +91,16 @@ export default class NewClass extends middleLayerBase {
exitGame(data = null) { exitGame(data = null) {
console.log('=========exitGame========='); console.log('=========exitGame=========');
let totalCount = 0;
const tpl = cc.find('Canvas')?.getComponent(this.courseItem.template_name); const tpl = cc.find('Canvas')?.getComponent(this.courseItem.template_name);
console.log(JSON.stringify(tpl['data'])); console.log(JSON.stringify(tpl['data']));
console.log('this.courseItem: ', JSON.stringify(this.courseItem)); console.log('this.courseItem: ', JSON.stringify(this.courseItem));
if(!data) { if(!data && tpl) {
if (tpl) {
data = tpl['data']; data = tpl['data'];
totalCount = tpl['totalCount'];
console.log('tpl-data: ', JSON.stringify(data)); console.log('tpl-data: ', JSON.stringify(data));
} console.log('tpl-totalCount: ', totalCount);
} }
cc.game.removePersistRootNode(this.node); cc.game.removePersistRootNode(this.node);
...@@ -113,6 +114,7 @@ export default class NewClass extends middleLayerBase { ...@@ -113,6 +114,7 @@ export default class NewClass extends middleLayerBase {
template_name: this.courseItem.template_name, template_name: this.courseItem.template_name,
study_duration: Date.now() - this.courseOpenTimeStamp, study_duration: Date.now() - this.courseOpenTimeStamp,
result: JSON.stringify(data), result: JSON.stringify(data),
totalCount
})); }));
this.callNetworkApiPost(`api/dige/v1/user/report`, { this.callNetworkApiPost(`api/dige/v1/user/report`, {
token: this.token, token: this.token,
...@@ -121,6 +123,7 @@ export default class NewClass extends middleLayerBase { ...@@ -121,6 +123,7 @@ export default class NewClass extends middleLayerBase {
template_name: this.courseItem.template_name, template_name: this.courseItem.template_name,
study_duration: Date.now() - this.courseOpenTimeStamp, study_duration: Date.now() - this.courseOpenTimeStamp,
result: JSON.stringify(data), result: JSON.stringify(data),
totalCount
}, (res) => { }, (res) => {
console.log('-----------------'); console.log('-----------------');
console.log(JSON.stringify(res)); console.log(JSON.stringify(res));
......
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