孕期首页版本号统一 (v26102202):关于页顶部/页脚、我的页底一律显示 VER,后台文案里写死的 v3.2.1 也替换成 VER

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
deploy
2026-10-22 02:39:40 +00:00
parent 1c32bce8bd
commit 71a20ad033
2 changed files with 15 additions and 15 deletions

View File

@@ -3,7 +3,7 @@
(function () {
'use strict';
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
var VER = '26102201';
var VER = '26102202';
const $ = (s, c) => (c || document).querySelector(s);
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
@@ -2085,7 +2085,7 @@
},
about: {
title: '关于兜爸心选', more: '当前版本 v3.2.1',
title: '关于兜爸心选', more: '当前版本 v' + VER, /* 2026-10-22(测试会话 150e0991):v3.2.1 是写死的,与页脚 VER 对不上 → 全部改读 VER */
hero: 1,
lead: '兜爸心选想做的事很简单:让你不用记录,也能留下记录。',
groups: [
@@ -2094,10 +2094,13 @@
['txt', '等宝宝出生、等他长大、等你某天忽然想起这段日子,这本档案都还在原地等你。']
] }
],
foot: '兜爸心选 v3.2.1 · 已陪伴 268 万位妈妈'
foot: '兜爸心选 v' + VER + ' · 已陪伴 268 万位妈妈'
}
};
/* 「我的」页底的版本号同样读 VER(index.html 里写死的只是占位) */
{ const mv = document.querySelector('.me-ver'); if (mv) mv.textContent = '兜爸心选 · v' + VER; }
const ABOUT_HERO =
'<div class="st-about">' +
'<div class="st-logo">' +
@@ -2109,7 +2112,7 @@
'</svg>' +
'</div>' +
'<div class="st-appname">兜爸心选</div>' +
'<div class="st-ver">v3.2.1 · 陪你从两条杠到见面</div>' +
'<div class="st-ver">v' + VER + ' · 陪你从两条杠到见面</div>' +
'</div>';
function renderSetting(key) {
@@ -2144,12 +2147,7 @@
}).join('');
$('#stBody').innerHTML = html;
/* 「关于兜爸心选」页底部显示版本号(全站不再有固定底标) */
if (key === 'about') {
let av = document.getElementById('aboutVer');
if (!av) { av = document.createElement('p'); av.id = 'aboutVer'; av.className = 'about-ver'; $('#detailSetting .detail-body').appendChild(av); }
av.textContent = 'v' + VER;
}
/* 「关于兜爸心选」的版本号已经在顶部 / 页脚(都读 VER),原来底部单独追加的 #aboutVer 去掉,免得同一页出现三遍 */
scrollTop($('#detailSetting .detail-body'));
}
@@ -5144,8 +5142,10 @@
function __applyAbout(ct) {
if (!ct) return;
SETTINGS.about.title = ct.title || SETTINGS.about.title;
SETTINGS.about.more = ct.more || SETTINGS.about.more;
SETTINGS.about.foot = ct.foot || SETTINGS.about.foot;
/* 2026-10-22:后台文案里写死的版本号(如 v3.2.1)一律换成当前 VER,关于页 / 页脚 / 我的页底只认这一个版本号 */
const _v = t => String(t).replace(/v\d+(?:\.\d+)+/gi, 'v' + VER);
SETTINGS.about.more = ct.more ? _v(ct.more) : SETTINGS.about.more;
SETTINGS.about.foot = ct.foot ? _v(ct.foot) : SETTINGS.about.foot;
}
function applyRemoteAll() {
var openid = hashParam('openid');