diff --git a/config.js b/config.js index e4f452b..7f603e6 100644 --- a/config.js +++ b/config.js @@ -7,7 +7,7 @@ module.exports = { version: 'v3.2', /** 最后更新日期,外显在设置页「关于」 */ - updatedAt: '2026-08-04', + updatedAt: '2026-08-11', /** 开发者名称 / 微信号,设置页点击可复制 */ developer: '三口一瓶', diff --git a/pages/index/index.js b/pages/index/index.js index 440c8e6..8904c39 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -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 || '' }) }, diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 7741fed..06fedfe 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,12 +1,19 @@ - + - - - {{todayDone ? '太棒了!' : '准备好了吗?'}} + + + + + + {{nickName || '运动达人'}},{{todayDone ? '太棒了!' : '准备好了吗?'}} + {{todayDone ? '继续保持这个势头' : '今天的平板支撑等着你'}} - {{todayDone ? '继续保持这个势头' : '今天的平板支撑等着你'}} @@ -172,9 +179,9 @@ 每组时长 - + {{cHold}}秒 - + + + @@ -190,9 +197,9 @@ 组间休息 - + {{cRest}}秒 - + + + diff --git a/pages/index/index.wxss b/pages/index/index.wxss index a9a4e04..285cb7e 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -1,33 +1,57 @@ /* ---- greeting ---- */ .greeting-row { + display: flex; + align-items: center; + gap: 20rpx; padding: 16rpx 8rpx 24rpx; animation: cardIn 0.4s ease both; } -.greeting-text { +/* 圆形头像:外层 overflow:hidden + 内层 image border-radius:50% 双保险, + 避免远程(cloud://)头像裁不出圆角而露直角。无头像时显示人形图标占位, + 加浅色底让占位更有质感;有头像时去掉底,避免深色头像边缘露白缝。 */ +.greeting-avatar { + width: 88rpx; + height: 88rpx; + flex-shrink: 0; + border-radius: 50%; + overflow: hidden; + background: var(--bg-soft); display: flex; align-items: center; - margin-bottom: 8rpx; + justify-content: center; } -.greeting-icon { - width: 44rpx; - height: 44rpx; - margin-right: 12rpx; +.greeting-avatar-img { + width: 100%; + height: 100%; + border-radius: 50%; + display: block; +} + +.greeting-avatar.has-avatar { + background: transparent; +} + +.greeting-main { + flex: 1; + min-width: 0; } .greeting-title { + display: block; font-size: 40rpx; font-weight: 700; color: var(--text); - line-height: 1.2; + line-height: 1.3; } .greeting-sub { + display: block; font-size: 26rpx; color: var(--text-secondary); - margin-left: 60rpx; - line-height: 1; + margin-top: 4rpx; + line-height: 1.2; } /* ---- header card ---- */