Commit 5d82f3a5 authored by kai's avatar kai

fix: 收集听音数据

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