此刻头像加入宝宝和风景照穿插;我的资料弹窗加退出登录 (v26101003)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-10 03:36:09 +00:00
parent 3f5ef8df13
commit 79e34f196d
17 changed files with 21 additions and 14 deletions

BIN
assets/img/mom/k01.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
assets/img/mom/k02.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
assets/img/mom/k03.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
assets/img/mom/k04.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
assets/img/mom/k05.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
assets/img/mom/k06.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
assets/img/mom/s01.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
assets/img/mom/s02.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
assets/img/mom/s03.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
assets/img/mom/s04.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
assets/img/mom/s05.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
assets/img/mom/s06.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
assets/img/mom/s07.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
assets/img/mom/s08.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -7,7 +7,7 @@
<meta name="mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<title>兜爸心选 · 孕育陪伴</title> <title>兜爸心选 · 孕育陪伴</title>
<!-- V:26101002 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 --> <!-- V:26101003 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
<link rel="stylesheet" href="mama-box.css"> <link rel="stylesheet" href="mama-box.css">
<link rel="stylesheet" href="night.css"> <link rel="stylesheet" href="night.css">
<!-- 夜晚模式:首屏绘制前就按上次的选择加 class,避免先白后黑闪一下(开关在首页右上角 #nightBtn,逻辑见 app.js) --> <!-- 夜晚模式:首屏绘制前就按上次的选择加 class,避免先白后黑闪一下(开关在首页右上角 #nightBtn,逻辑见 app.js) -->
@@ -1197,7 +1197,7 @@
</div> </div>
<!-- 退出授权登录:仅已授权时显示(applyRemoteProfile 控制 style.display)。 <!-- 退出授权登录:仅已授权时显示(applyRemoteProfile 控制 style.display)。
调 box_app /auth/logout —— 只翻授权状态,不清昵称/头像/手机号等资料 --> 调 box_app /auth/logout —— 只翻授权状态,不清昵称/头像/手机号等资料 -->
<button class="me-logout ripple" id="meLogoutCard" style="display:none">退出授权登录</button> <button class="me-logout ripple" id="meLogoutCard" style="display:none">退出登录</button>
<p class="me-ver">兜爸心选 · v3.2.1</p> <p class="me-ver">兜爸心选 · v3.2.1</p>
</div> </div>
</section> </section>
@@ -2039,6 +2039,9 @@
<p class="pg-tip">点头像换张照片</p> <p class="pg-tip">点头像换张照片</p>
</div> </div>
<!-- 2026-10-10 用户:「我的资料」里也要有「退出登录」。显示规则同「我的」页 #meLogoutCard(已授权才显示),共用 doLogout -->
<button type="button" class="pf-logout ripple" id="pfLogout" style="display:none">退出登录</button>
<div class="modal-foot pf-foot"> <div class="modal-foot pf-foot">
<button class="dl-btn ghost" data-modal="close">取消</button> <button class="dl-btn ghost" data-modal="close">取消</button>
<button class="dl-btn main" id="pfSave">保存</button> <button class="dl-btn main" id="pfSave">保存</button>

View File

@@ -3,7 +3,7 @@
(function () { (function () {
'use strict'; 'use strict';
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */ /* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
var VER = '26101002'; var VER = '26101003';
const $ = (s, c) => (c || document).querySelector(s); const $ = (s, c) => (c || document).querySelector(s);
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s)); const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
@@ -3230,7 +3230,7 @@
} }
/* 授权入口:未授权时显示(引导先授权);退出按钮:已授权时显示 */ /* 授权入口:未授权时显示(引导先授权);退出按钮:已授权时显示 */
var _box = $('#meAuthBox'); if (_box) _box.style.display = _authorized ? 'none' : ''; var _box = $('#meAuthBox'); if (_box) _box.style.display = _authorized ? 'none' : '';
var _lx = $('#meLogoutCard'); if (_lx) _lx.style.display = _authorized ? '' : 'none'; ['#meLogoutCard', '#pfLogout'].forEach(function (sel) { var _lx = $(sel); if (_lx) _lx.style.display = _authorized ? '' : 'none'; });
if (!p.userName) { var _ai2 = $('#meAvatarImg'); if (_ai2) _ai2.removeAttribute('src'); } if (!p.userName) { var _ai2 = $('#meAvatarImg'); if (_ai2) _ai2.removeAttribute('src'); }
} }
if (pg && pg.code === 200 && pg.result) { if (pg && pg.code === 200 && pg.result) {
@@ -3513,13 +3513,13 @@
function pulseIco(k, cls) { function pulseIco(k, cls) {
return '<span class="' + cls + '">' + (PULSE_ICO[k] || PULSE_ICO.box) + '</span>'; return '<span class="' + cls + '">' + (PULSE_ICO[k] || PULSE_ICO.box) + '</span>';
} }
/* 妈妈头像(2026-10-10 用户:「此刻的头像换成真实人物的,不要卡通」)→ 12 张 AI 生成的写实头像照片,按 seed 取。 /* 「此刻」头像(2026-10-10 用户:「换成真实人物的,不要卡通」;同日二改:「别都用妈妈的大头贴,
都是 AI 虚构人物,不对应任何真实用户、也不是真人照片(避免肖像权问题);96×96 JPG,共约 32KB,懒加载。 再换一些风景穿插着来,也可以放一部分小孩的、小宝宝的」)→ 26 张写实照片:妈妈 12(m*)、宝宝 6(k*)、风景 8(s*),
原来的 SVG 卡通头像(5 发色 × 3 发型 × 5 底色)见 git 历史 v26101001。 */ 按「妈妈为主、宝宝和风景穿插」排好,按 seed 取模。全部是 AI 生成的虚构画面,不对应任何真实用户、不是真人照片;
const MOM_N = 12; 96×96 JPG,共约 70KB,懒加载。原 SVG 卡通头像见 git 历史 v26101001。 */
const MOM_AVA = ['m01', 'k01', 'm02', 's01', 'm03', 's02', 'm04', 'k02', 'm05', 's03', 'm06', 'k03', 'm07', 's04', 'm08', 's05', 'm09', 'k04', 'm10', 's06', 'm11', 'k05', 'm12', 's07', 's08', 'k06'];
function momAva(seed) { function momAva(seed) {
const n = ('0' + (Math.abs(seed | 0) % MOM_N + 1)).slice(-2); return '<img src="assets/img/mom/' + MOM_AVA[Math.abs(seed | 0) % MOM_AVA.length] + '.jpg" alt="" loading="lazy" decoding="async" width="48" height="48">';
return '<img src="assets/img/mom/m' + n + '.jpg" alt="" loading="lazy" decoding="async" width="48" height="48">';
} }
const strSeed = t => { let x = 7; for (let i = 0; i < t.length; i++) x = (x * 31 + t.charCodeAt(i)) | 0; return Math.abs(x); }; const strSeed = t => { let x = 7; for (let i = 0; i < t.length; i++) x = (x * 31 + t.charCodeAt(i)) | 0; return Math.abs(x); };
/* 「此刻」重绘钩子:足迹 / 档案 / 盲盒状态回来时调用(它们决定「和你比」「今日待办」和孕周) */ /* 「此刻」重绘钩子:足迹 / 档案 / 盲盒状态回来时调用(它们决定「和你比」「今日待办」和孕周) */
@@ -4120,7 +4120,7 @@
if (avs.dataset.seed === String(seed)) return; if (avs.dataset.seed === String(seed)) return;
avs.dataset.seed = seed; avs.dataset.seed = seed;
/* 2026-10-02 用户:「头像现在展示 3 个,给我展示 6 到 8 个」→ 7 个 */ /* 2026-10-02 用户:「头像现在展示 3 个,给我展示 6 到 8 个」→ 7 个 */
avs.innerHTML = [3, 10, 7, 0, 5, 9, 1].map(x => '<i>' + momAva(x + seed) + '</i>').join(''); // 7 个按 12 取模互不相同,叠在一起不撞脸 avs.innerHTML = [3, 10, 7, 0, 5, 9, 1].map(x => '<i>' + momAva(x + seed) + '</i>').join(''); // 7 个按 26 取模互不相同,叠在一起不重复
} }
function paintPeer(p) { function paintPeer(p) {
paintAvs(p.week); paintAvs(p.week);
@@ -5371,8 +5371,8 @@
成功后重载页面 → applyRemoteProfile 重新拉到空显示字段 → 回到未登录态、授权入口重现。 成功后重载页面 → applyRemoteProfile 重新拉到空显示字段 → 回到未登录态、授权入口重现。
⚠️ stopPropagation:me-card 整卡是 data-modal="modalProfile",不阻止冒泡 ⚠️ stopPropagation:me-card 整卡是 data-modal="modalProfile",不阻止冒泡
会顺带打开资料弹窗。 */ 会顺带打开资料弹窗。 */
var meLogout = $('#meLogoutCard'); /* 2026-10-10 用户:「我的」页和「我的资料」弹窗里都要有「退出登录」→ 两个按钮共用 doLogout */
if (meLogout) meLogout.addEventListener('click', function (e) { function doLogout(e) {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
haptic(); haptic();
@@ -5389,7 +5389,8 @@
} }
}) })
.catch(function () { toast('退出失败,请检查网络'); }); .catch(function () { toast('退出失败,请检查网络'); });
}); }
['#meLogoutCard', '#pfLogout'].forEach(function (sel) { var b = $(sel); if (b) b.addEventListener('click', doLogout); });
/* 从商城/后台切回小程序首页时,webview 会再次可见 —— 把 H5 重置回「首页」屏。 /* 从商城/后台切回小程序首页时,webview 会再次可见 —— 把 H5 重置回「首页」屏。
⚠️ 若不处理:切到商城再点「首页」tab,仍是同一个 webview 实例, ⚠️ 若不处理:切到商城再点「首页」tab,仍是同一个 webview 实例,

View File

@@ -4726,3 +4726,6 @@ a.skip:focus{left:16px;top:16px}
radial-gradient(300px 240px at 0 0,rgba(255,170,128,.42),rgba(255,170,128,0) 72%), radial-gradient(300px 240px at 0 0,rgba(255,170,128,.42),rgba(255,170,128,0) 72%),
radial-gradient(280px 230px at 100% 0,rgba(255,160,195,.36),rgba(255,160,195,0) 72%), radial-gradient(280px 230px at 100% 0,rgba(255,160,195,.36),rgba(255,160,195,0) 72%),
linear-gradient(180deg,#FFF1E8 0%,#FAF5F1 340px,#FAF5F1 100%)} linear-gradient(180deg,#FFF1E8 0%,#FAF5F1 340px,#FAF5F1 100%)}
/* 「我的资料」弹窗里的退出登录(2026-10-10) */
.pf-logout{display:block;width:100%;margin-top:14px;padding:12px;border-radius:14px;background:#FFF4F2;font-size:14px;font-weight:700;color:#C33A2E;text-align:center}