feat: 首页顶部加头像昵称问候 + 循环训练秒数步进改为±10
This commit is contained in:
@@ -15,6 +15,10 @@ Page({
|
||||
todayDone: false,
|
||||
todayDuration: 0,
|
||||
todayTargetText: '',
|
||||
// 顶部问候区的用户资料(头像 + 昵称),来自 storage.getProfile()。
|
||||
// 空则回退占位(人形图标 + "运动达人"),settings 改完回首页即刷新。
|
||||
nickName: '',
|
||||
avatarUrl: '',
|
||||
// Ring number font size in rpx. WeChat auto-scales text by the user's
|
||||
// font-size setting (fontSizeScaleFactor) but does NOT scale rpx box
|
||||
// dimensions — so on a real device with enlarged system font the 84rpx
|
||||
@@ -153,6 +157,7 @@ Page({
|
||||
// 分段格子(每天一格)只在计划天数 <= 10 时用;更长则退化为里程碑连续条,避免格子过密
|
||||
const useSegments = plan.totalDays > 0 && plan.totalDays <= 10
|
||||
const planDays = useSegments ? Array.from({ length: plan.totalDays }, (_, i) => i) : []
|
||||
const profile = storage.getProfile()
|
||||
this.setData({
|
||||
theme,
|
||||
icons: iconsMod.build(theme),
|
||||
@@ -166,7 +171,9 @@ Page({
|
||||
planTotal: plan.totalDays,
|
||||
planProgress,
|
||||
useSegments,
|
||||
planDays
|
||||
planDays,
|
||||
nickName: profile.nickname || '',
|
||||
avatarUrl: profile.avatarUrl || ''
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user