fix: 修复头像存储、日历详情数据与弹窗定位问题
- settings: 补上缺失的 util 导入,onChooseAvatar 不再抛 ReferenceError,头像走 data URI 永久存储主路径 - records: 日历详情改用 dateOnly 比较,修复详情永远显示 0 次/0 时长 - records: 日历详情弹窗从 ui-modal 改为普通 view + fixed, 修复被底部 dock 遮挡/不居中;补暗黑阴影描边与滚动穿透处理 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -108,7 +108,9 @@ Page({
|
||||
const { year, month, day } = e.detail
|
||||
const dateStr = `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`
|
||||
const allRecords = Object.values(storage.getRecords()).flat()
|
||||
const sessions = allRecords.filter(r => r.date === dateStr)
|
||||
// record.date 是 "YYYY-MM-DD HH:MM:SS"(formatDate 生成),dateStr 只有
|
||||
// 日期部分,直接 === 永远不匹配,必须用 dateOnly 截取后再比。
|
||||
const sessions = allRecords.filter(r => util.dateOnly(r.date) === dateStr)
|
||||
const totalDur = sessions.reduce((sum, r) => sum + r.duration, 0)
|
||||
const calories = Math.round(totalDur * 0.068)
|
||||
this.setData({
|
||||
@@ -127,6 +129,9 @@ Page({
|
||||
this.setData({ showDayDetail: false })
|
||||
},
|
||||
|
||||
// Swallow touchmove on the popup so the background page doesn't scroll.
|
||||
onNoop() { /* swallow */ },
|
||||
|
||||
onLongPressDelete(e) {
|
||||
this.onDeleteRecord(e)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user