feat(miniprogram): 用 karuo-316 替换小程序目录
- 从 github/karuo-316 覆盖 miniprogram/ - 排除 project.private.config.json 与 *.backup Made-with: Cursor
This commit is contained in:
@@ -170,10 +170,10 @@ class ReadingTracker {
|
||||
const userId = app.globalData.userInfo?.id
|
||||
if (!userId) return
|
||||
|
||||
// 计算本次上报的时长(仅发送增量 delta,后端会累加,避免重复累加导致阅读分钟数异常)
|
||||
// 计算本次上报的时长
|
||||
const now = Date.now()
|
||||
const delta = Math.round((now - this.activeTracker.lastScrollTime) / 1000)
|
||||
this.activeTracker.totalDuration += delta
|
||||
const duration = Math.round((now - this.activeTracker.lastScrollTime) / 1000)
|
||||
this.activeTracker.totalDuration += duration
|
||||
this.activeTracker.lastScrollTime = now
|
||||
|
||||
try {
|
||||
@@ -183,7 +183,7 @@ class ReadingTracker {
|
||||
userId,
|
||||
sectionId: this.activeTracker.sectionId,
|
||||
progress: this.activeTracker.maxProgress,
|
||||
duration: Math.max(0, delta),
|
||||
duration: this.activeTracker.totalDuration,
|
||||
status: this.activeTracker.isCompleted ? 'completed' : 'reading',
|
||||
completedAt: this.activeTracker.completedAt
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user