孕妈广场:话题统一用 #话题# 双井号样式(热门话题、话题头、话题胶囊、卡片话题行、首页话题标签)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -433,9 +433,9 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
<div id="sheet" role="dialog" aria-modal="true"><i class="sg"></i><div class="sbd" id="sbd"></div></div>
|
||||
<div class="toast" id="toast"></div>
|
||||
|
||||
<script src="topics.js?v=26110205"></script>
|
||||
<script src="data.js?v=26110205"></script>
|
||||
<script src="feed.js?v=26110205"></script>
|
||||
<script src="topics.js?v=26110206"></script>
|
||||
<script src="data.js?v=26110206"></script>
|
||||
<script src="feed.js?v=26110206"></script>
|
||||
<script>
|
||||
(function () {
|
||||
'use strict';
|
||||
@@ -557,7 +557,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
else if (sty === 'tg') ov = '<div class="tgt"><b><span>' + esc(n.cover) + '</span></b></div>';
|
||||
return '<button type="button" class="nc' + (sty ? ' s-' + sty : '') + '" data-id="' + n.id + '"><div class="cvw">' +
|
||||
coverHTML(n, 'calc(var(--cw) * ' + r + ')') + ov + '</div>' +
|
||||
'<div class="nb"><h3>' + esc(n.title) + '</h3>' + (showTopic ? '<span class="tp k-' + t.cat + '"># ' + esc(t.name) + '</span>' : '') + '<div class="nf"><img src="' + esc(avOf(n)) + '" alt="" loading="lazy"><span class="nm">' + esc(n.author) + '</span>' + likeHTML(n) + '</div></div></button>';
|
||||
'<div class="nb"><h3>' + esc(n.title) + '</h3>' + (showTopic ? '<span class="tp k-' + t.cat + '">#' + esc(t.name) + '#</span>' : '') + '<div class="nf"><img src="' + esc(avOf(n)) + '" alt="" loading="lazy"><span class="nm">' + esc(n.author) + '</span>' + likeHTML(n) + '</div></div></button>';
|
||||
}
|
||||
|
||||
/* ---------- 列表 ---------- */
|
||||
@@ -599,7 +599,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
'<div class="sh"><svg class="fire"><use href="#i-fire"/></svg><h2>热门话题</h2><button type="button" class="more" data-all="1">全部 ' + hl.length + ' 个<svg class="ic" style="width:13px;height:13px"><use href="#i-right"/></svg></button></div>' +
|
||||
'<div class="hot">' + hl.slice(0, catF ? 10 : 12).map(function (x) {
|
||||
return '<div class="hc k-' + x.cat + '" data-t="' + x.id + '" role="button"><i class="wm" aria-hidden="true">' + esc(x.g) + '</i>' + (x.hot ? '<span class="rk">热</span>' : '') + kbHTML(x.cat) +
|
||||
'<h3># ' + esc(x.name) + '</h3><p>' + esc((D[x.id] || {}).desc || '') + '</p>' +
|
||||
'<h3>#' + esc(x.name) + '#</h3><p>' + esc((D[x.id] || {}).desc || '') + '</p>' +
|
||||
'<button type="button" class="jn" data-join="' + x.id + '"><svg class="ic"><use href="#i-plus"/></svg>参与话题</button></div>';
|
||||
}).join('') + '</div>';
|
||||
if (catF) { fhLevels(fh); return; }
|
||||
@@ -610,7 +610,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
var d = D[t.id] || {};
|
||||
el.innerHTML = '<div class="th k-' + t.cat + '"><i class="wm" aria-hidden="true">' + esc(t.g) + '</i><button type="button" class="x" data-t="" aria-label="看全部"><svg class="ic"><use href="#i-x"/></svg></button>' +
|
||||
'<div class="bc"><button type="button" data-t="">' + kbHTML(t.cat).replace('</span>', ' ›</span>') + '</button><span>话题 · ' + cntT(t.id) + ' 篇</span></div>' +
|
||||
'<h2><em>#</em>' + esc(t.name) + '</h2><p>' + esc(d.desc || '') + '</p>' +
|
||||
'<h2><em>#</em>' + esc(t.name) + '<em>#</em></h2><p>' + esc(d.desc || '') + '</p>' +
|
||||
'<div class="tf"><button type="button" class="join" data-join="' + t.id + '"><svg class="ic"><use href="#i-plus"/></svg>参与话题</button><button type="button" class="sw" data-all="1">换个话题</button></div></div>' + rewardHTML(true);
|
||||
fhLevels(fh);
|
||||
}
|
||||
@@ -623,7 +623,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
fh.innerHTML = '<div class="lv"><h2>' + CATS.filter(function (c) { return c[0] === catF; })[0][1] + '</h2><small>' + tl.length + ' 个话题 · 共 ' + all + ' 篇</small>' +
|
||||
(cur ? '<button type="button" class="ba" data-t="">看这块全部 ›</button>' : '') + '</div>' +
|
||||
'<div class="tcs"><button type="button" data-t=""' + (cur ? '' : ' class="on"') + '>全部<i>' + all + '</i></button>' +
|
||||
tl.map(function (x) { return '<button type="button" data-t="' + x.id + '"' + (cur === x.id ? ' class="on"' : '') + '># ' + esc(x.name) + '<i>' + cntT(x.id) + '</i></button>'; }).join('') + '</div>';
|
||||
tl.map(function (x) { return '<button type="button" data-t="' + x.id + '"' + (cur === x.id ? ' class="on"' : '') + '>#' + esc(x.name) + '#<i>' + cntT(x.id) + '</i></button>'; }).join('') + '</div>';
|
||||
var on = fh.querySelector('.tcs .on'); if (on && cur) fh.querySelector('.tcs').scrollLeft = Math.max(0, on.offsetLeft - 60);
|
||||
}
|
||||
function renderFeed() {
|
||||
@@ -699,7 +699,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
var t = TBY[tid];
|
||||
openSheet('rule', '<h3>话题投稿有奖</h3>' +
|
||||
'<div class="rb"><small>投稿被选中,每篇奖励</small><b>' + REWARD + '</b></div>' +
|
||||
(t ? '<div class="cur-t">你要参与的话题:<b># ' + esc(t.name) + '</b></div>' : '') +
|
||||
(t ? '<div class="cur-t">你要参与的话题:<b>#' + esc(t.name) + '#</b></div>' : '') +
|
||||
'<ol class="stp">' +
|
||||
'<li><b>选一个话题</b><small>在「热门话题」或「全部话题」里挑你有话说的那个</small></li>' +
|
||||
'<li><b>写下你的真实经历</b><small>家里的暖事、踩过的坑、过来人的经验都可以</small></li>' +
|
||||
@@ -710,7 +710,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
function openTopics() {
|
||||
var grp = function (cat) {
|
||||
return '<div class="tl-h">' + kbHTML(cat) + CAT_NAME[cat] + '</div><div class="tl k-' + cat + '">' + T.filter(function (t) { return t.cat === cat; }).map(function (t) {
|
||||
return '<button type="button" data-pick="' + t.id + '" class="' + (cur === t.id ? 'on' : '') + '"># ' + esc(t.name) + (t.hot ? '<i>热</i>' : '') + '</button>';
|
||||
return '<button type="button" data-pick="' + t.id + '" class="' + (cur === t.id ? 'on' : '') + '">#' + esc(t.name) + '#' + (t.hot ? '<i>热</i>' : '') + '</button>';
|
||||
}).join('') + '</div>';
|
||||
};
|
||||
openSheet('topics', '<h3>全部话题</h3>' + (catF ? [catF] : []).concat(CAT_ORDER.filter(function (c) { return c !== catF; })).map(grp).join('') +
|
||||
@@ -797,7 +797,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
var day = 26 + (seed(n.id) % 6), mon = day > 31 ? 11 : 10;
|
||||
var when = n.real ? (function (d) { return (d.getMonth() + 1) + '-' + d.getDate(); })(new Date(n.at)) : mon + '-' + (day > 31 ? day - 31 : day);
|
||||
$('#dsc').innerHTML = '<div class="dcv">' + coverHTML(n, h + 'px') + '</div>' +
|
||||
'<div class="dbody"><div class="dk">' + kbHTML(t.cat) + '<button type="button" class="k-' + t.cat + '" data-go="' + t.id + '"># ' + esc(t.name) + '</button></div>' +
|
||||
'<div class="dbody"><div class="dk">' + kbHTML(t.cat) + '<button type="button" class="k-' + t.cat + '" data-go="' + t.id + '">#' + esc(t.name) + '#</button></div>' +
|
||||
'<h2>' + esc(n.title) + '</h2><div class="tx">' + bodyHTML(n.body) + '</div>' +
|
||||
((n.images || []).length ? '<div class="pics">' + n.images.map(function (u) { return '<img src="' + esc(u) + '" alt="" loading="lazy">'; }).join('') + '</div>' : '') +
|
||||
'<div class="tm">' + [n.stage ? esc(n.stage) : '', n.real ? '妈妈投稿' : ''].filter(Boolean).join(' · ') + '</div></div>' /* 11-02 用户:帖子发布日期先隐藏(when 留着,以后恢复直接拼回去) */ +
|
||||
@@ -934,7 +934,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
else if (!MINE.length) h += '<div class="my-e">还没有投稿,写下你的第一个故事吧</div>';
|
||||
else h += MINE.map(function (p) {
|
||||
var t = TBY[p.topic];
|
||||
return '<div class="my-it"><div class="my-h"><span class="tn"># ' + esc(t ? t.name : p.topicName || '') + '</span><span>' + fmtDay(p.at) + '</span><span class="st ' + p.status + '">' + (ST_NAME[p.status] || '') + '</span></div>' +
|
||||
return '<div class="my-it"><div class="my-h"><span class="tn">#' + esc(t ? t.name : p.topicName || '') + '#</span><span>' + fmtDay(p.at) + '</span><span class="st ' + p.status + '">' + (ST_NAME[p.status] || '') + '</span></div>' +
|
||||
'<b>' + esc(p.title) + '</b>' +
|
||||
(p.status === 'pending' ? '<p>正在审核中,有结果会第一时间提醒你</p>' : '') +
|
||||
(p.status === 'rejected' ? '<p class="why">没通过的原因:' + esc(p.reason || '暂不符合展示要求') + '</p>' : '') +
|
||||
@@ -982,7 +982,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
cpTopic = TBY[id] ? id : '';
|
||||
var t = TBY[cpTopic], b = $('#cpT');
|
||||
b.className = 'cp-t' + (t ? ' k-' + t.cat : '');
|
||||
b.innerHTML = (t ? kbHTML(t.cat) + '<span class="ct2"># ' + esc(t.name) + '</span>' : '<span class="ct2">选择要参与的话题</span>') +
|
||||
b.innerHTML = (t ? kbHTML(t.cat) + '<span class="ct2">#' + esc(t.name) + '#</span>' : '<span class="ct2">选择要参与的话题</span>') +
|
||||
'<span class="ch">' + (t ? '换话题' : '去选') + '<svg class="ic" style="width:13px;height:13px"><use href="#i-right"/></svg></span>';
|
||||
saveDraft();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user