feat: 排行榜虚拟领奖台 + 勋章对齐与尺寸统一
- 领奖台数据不足 3 名时显示虚拟空位(虚线轮廓+虚位以待) - 领奖台勋章与昵称对齐改为等高盒结构性修复(移除 margin 盲推) - 全 app 成就勋章图标尺寸统一为 30rpx(前三名/列表/设置页/记录页一致) - 勋章 SVG 按包围盒精确居中(utils/icons.js) - 设置页/记录页勋章展示配套调整
This commit is contained in:
@@ -156,14 +156,23 @@ Page({
|
||||
},
|
||||
|
||||
onNextMonth() {
|
||||
let { currentYear, currentMonth } = this.data
|
||||
if (currentMonth === 12) {
|
||||
currentYear++
|
||||
currentMonth = 1
|
||||
} else {
|
||||
currentMonth++
|
||||
const { currentYear, currentMonth } = this.data
|
||||
// 计算下一月
|
||||
let nextYear = currentYear
|
||||
let nextMonth = currentMonth + 1
|
||||
if (nextMonth > 12) {
|
||||
nextYear++
|
||||
nextMonth = 1
|
||||
}
|
||||
this.setData({ currentYear, currentMonth })
|
||||
// 上限:不能翻到未来月份。当前月是最新有数据的月份,再往后无意义。
|
||||
const now = new Date()
|
||||
const nowYear = now.getFullYear()
|
||||
const nowMonth = now.getMonth() + 1
|
||||
if (nextYear > nowYear || (nextYear === nowYear && nextMonth > nowMonth)) {
|
||||
wx.showToast({ title: '已经是最新月份', icon: 'none', duration: 1200 })
|
||||
return
|
||||
}
|
||||
this.setData({ currentYear: nextYear, currentMonth: nextMonth })
|
||||
this.refresh()
|
||||
},
|
||||
|
||||
@@ -216,7 +225,7 @@ Page({
|
||||
// 日期部分,直接 === 永远不匹配,必须用 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)
|
||||
const calories = Math.round(totalDur * (config.caloriesPerSecond || 0.068))
|
||||
this.setData({
|
||||
showDayDetail: true,
|
||||
dayDetail: {
|
||||
|
||||
Reference in New Issue
Block a user