Commit 08e9d720 authored by 李维's avatar 李维

修正学习时长不准的问题

parent d3ffbd8e
{"ver":"1.1.2","uuid":"c35bb2f6-f24a-4850-ae44-643f2fdc7541","isBundle":false,"bundleName":"","priority":1,"compressionType":{"android":"default","ios":"default"},"optimizeHotUpdate":{"android":false,"ios":false},"inlineSpriteFrames":{"android":false,"ios":false},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {
"android": "default",
"ios": "default"
},
"optimizeHotUpdate": {
"android": false,
"ios": false
},
"inlineSpriteFrames": {
"android": false,
"ios": false
},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
......@@ -113,11 +113,13 @@ export default class LessonReportClass extends cc.Component {
this.last_play.string = lastDate ? `${dateFormate("yyyy.MM.dd", lastDate)} 学习过` : "未学过"
this.question_right_percent1.string = ""; // _data.question_right_percent // 正确率 - 白色描边
this.question_right_percent2.string = _data.question_right_percent // 正确率 - 主体红字
this.study_duration.string = _data.study_duration > 999 ? Math.floor(_data.study_duration / 60 * 10) / 10 : _data.study_duration // 学习时长
this.study_duration_unit.string = _data.study_duration > 999 ? "小时" : "分钟";
this.question_times.string = _data.question_times // 练习次数
this.record_times.string = _data.record_times // 开口次数
const timeUnit = this.getTimeString(_data.study_duration)
this.study_duration.string = timeUnit.str;
this.study_duration_unit.string = timeUnit.unit;
for (let i = 1; i <= 5; i++) {
let _star = this.stars.getChildByName(`icon_star${i}`)
_star.active = _data.question_right_percent >= 20 * i
......@@ -195,6 +197,21 @@ export default class LessonReportClass extends cc.Component {
this.reportSV.scrollToTop()
}
getTimeString(duration) {
const min = duration / (60 * 1000);
if(min <= 999) {
return {
str: Math.floor(min * 10) / 10 + "",
unit: "分钟"
}
} else {
return {
str: Math.floor(min / 60 * 10) / 10 + "",
unit: "小时"
}
}
}
createItem(v, parent) {
let _node = cc.instantiate(this.pronounceItem)
_node.active = true
......
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