首页孕妈广场:横滑话题卡隔一张换成真实照片卡;v26110122
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
14
js/app.js
14
js/app.js
@@ -3,7 +3,7 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
|
||||
var VER = '26110121';
|
||||
var VER = '26110122';
|
||||
const $ = (s, c) => (c || document).querySelector(s);
|
||||
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
|
||||
|
||||
@@ -4208,14 +4208,16 @@
|
||||
}
|
||||
function paint(cat) {
|
||||
const list = pick(cat);
|
||||
row.innerHTML = list.map(t =>
|
||||
'<button type="button" class="gch-card" data-t="' + esc(t.id) + '" style="--c1:' + t.c[0] + ';--c2:' + t.c[1] + ';--ink:' + t.ink + '">' +
|
||||
'<i class="gb" aria-hidden="true"></i><span class="gg" aria-hidden="true">' + esc(t.g) + '</span>' +
|
||||
/* 隔一张换成真实照片卡(11-01 用户:首页广场也放一些真实图),照片取 topics.js 的 ph;没图的照旧渐变卡 */
|
||||
row.innerHTML = list.map((t, i) => {
|
||||
const ph = i % 2 === 0 && t.ph;
|
||||
return '<button type="button" class="gch-card' + (ph ? ' ph' : '') + '" data-t="' + esc(t.id) + '" style="--c1:' + t.c[0] + ';--c2:' + t.c[1] + ';--ink:' + t.ink + '">' +
|
||||
(ph ? '<img class="gp" src="' + esc(t.ph) + '" alt="" loading="lazy">' : '<i class="gb" aria-hidden="true"></i><span class="gg" aria-hidden="true">' + esc(t.g) + '</span>') +
|
||||
(t.hot ? '<span class="gh">热</span>' : '') +
|
||||
'<span class="gk">' + ({ family: '家庭', marriage: '婚姻', work: '职场', baby: '母婴' }[t.cat] || '') + '</span>' +
|
||||
'<span class="gn">' + esc(t.name) + '</span>' +
|
||||
'<span class="gm">' + kfmt(t.n) + ' 篇 · ' + kfmt(t.talk) + ' 人在聊</span></button>'
|
||||
).join('') +
|
||||
'<span class="gm">' + kfmt(t.n) + ' 篇 · ' + kfmt(t.talk) + ' 人在聊</span></button>';
|
||||
}).join('') +
|
||||
'<button type="button" class="gch-card all" data-t=""><span class="ga" aria-hidden="true">›</span><b>全部话题</b><small>' + T.length + ' 个话题</small></button>';
|
||||
row.scrollLeft = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user