diff --git a/apps/admin/src/pages/SocialData.tsx b/apps/admin/src/pages/SocialData.tsx index fed360a..87987ca 100644 --- a/apps/admin/src/pages/SocialData.tsx +++ b/apps/admin/src/pages/SocialData.tsx @@ -2,7 +2,7 @@ * 游民社区 · UGC 数据台 * 前端提交数据可视化:加入线索 / 消息 / 花名册 / 评价 / 技能 / 核验 / 预约 / 行程 / 举报 … */ -import { useCallback, useEffect, useState } from 'react' +import { useCallback, useEffect, useMemo, useState } from 'react' import { Link } from 'react-router-dom' import { api } from '../api' import { WxEmpty, WxHead, WxTabs, WxToast } from '../components/wxUi' @@ -120,12 +120,32 @@ function joinLiveCell(it: Record): string { return '未核验' } +function feedbackPersonLabel(it: Record): string { + const meta = + it.meta && typeof it.meta === 'object' && !Array.isArray(it.meta) + ? (it.meta as Record) + : {} + const email = String(meta.email || '').trim() + const contact = String(it.contact || '').trim() + const name = String(meta.name || '').trim() + const key = String(it.userKey || '') + if (email) return email + if (contact) return contact + if (name) return name + if (key.startsWith('email:')) return key.slice(6) + if (key.startsWith('contact:')) return key.slice(8) + if (key.startsWith('guest:')) return `访客 ${key.slice(6, 18)}` + if (key.startsWith('weak:')) return `未登录 · ${key.slice(5, 13)}` + return key || String(it.guestId || '未知访客') +} + export default function SocialData() { const [tab, setTab] = useState('joins') const [overview, setOverview] = useState(null) const [items, setItems] = useState([]) const [total, setTotal] = useState(0) const [q, setQ] = useState('') + const [personKey, setPersonKey] = useState('') const [loading, setLoading] = useState(true) const [busy, setBusy] = useState(false) const [err, setErr] = useState('') @@ -153,7 +173,14 @@ export default function SocialData() { } const qs = new URLSearchParams() if (q.trim()) qs.set('q', q.trim()) - qs.set('limit', '100') + if (tab === 'feedback' && personKey) { + qs.set('userKey', personKey) + qs.set('limit', '100') + } else if (tab === 'feedback') { + qs.set('limit', '200') + } else { + qs.set('limit', '100') + } const data = await api(`${ENDPOINTS[tab]}?${qs}`) setItems(data.items || []) setTotal(data.total || 0) @@ -164,7 +191,7 @@ export default function SocialData() { } finally { setLoading(false) } - }, [tab, q]) + }, [tab, q, personKey]) useEffect(() => { loadOverview().catch((e) => setErr(e.message || '概览失败')) @@ -174,6 +201,34 @@ export default function SocialData() { void loadList() }, [loadList]) + useEffect(() => { + setPersonKey('') + }, [tab]) + + const feedbackPeople = useMemo(() => { + if (tab !== 'feedback' || personKey) return [] + const map = new Map() + for (const row of items) { + const key = String(row.userKey || '').trim() + if (!key) continue + const prev = map.get(key) + if (!prev || row.isGroupHead) { + map.set(key, { + ...row, + userCount: Number(row.userCount || prev?.userCount || 1) || 1, + }) + } else if (prev) { + const n = Math.max( + Number(prev.userCount || 1), + Number(row.userCount || 1), + Number(row.userIndex || 1), + ) + map.set(key, { ...prev, userCount: n }) + } + } + return [...map.values()] + }, [tab, personKey, items]) + async function remove(kind: Tab, id: string) { if (!DELETABLE.has(kind)) return if (!confirm('软删除?内容会写入存档(social_archives),不会物理抹除。')) return @@ -345,12 +400,103 @@ export default function SocialData() { ) } + if (tab === 'feedback' && !personKey) { + return ( + setPersonKey(String(it.userKey || ''))} + > + + {feedbackPersonLabel(it)} +
+ {cell(it.userKey, 40)} +
+ + + {it.kind} · {cell(it.text, 80)} + + {it.contact || '—'} + + + {String(it.userCount || 1)}/{String(it.userMax || 10)} + + + {it.at} + + + + + ) + } if (tab === 'feedback') { + const imgs = Array.isArray(it.images) ? (it.images as string[]) : [] + const meta = it.meta && typeof it.meta === 'object' ? (it.meta as Record) : {} + const userKey = String(it.userKey || '') + const userCount = Number(it.userCount || 0) || 0 + const userIndex = Number(it.userIndex || 0) || 0 + const userMax = Number(it.userMax || 10) || 10 + const metaBits = [ + meta.email ? `邮箱 ${String(meta.email)}` : '', + meta.name ? `昵称 ${String(meta.name)}` : '', + it.guestId ? `guest ${String(it.guestId)}` : '', + meta.href ? String(meta.href) : '', + meta.userAgent ? String(meta.userAgent).slice(0, 80) : '', + meta.timezone ? `时区 ${String(meta.timezone)}` : '', + meta.serverIp ? `IP ${String(meta.serverIp)}` : '', + ].filter(Boolean) return ( - {it.kind} - {cell(it.text, 140)} + +
{it.kind}
+
+ {userIndex}/{userCount || '?'} · 上限 {userMax} +
+ + +
{cell(it.text, 140)}
+ {imgs.length ? ( +
+ {imgs.slice(0, 4).map((url) => ( + + + + ))} +
+ ) : null} + {it.contact || '—'} + +
+ {userKey ? ( +
+ user {cell(userKey, 36)} +
+ ) : null} + {metaBits.length ? metaBits.map((b) =>
{b}
) : '—'} + {Object.keys(meta).length ? ( +
+ 全部详情 +
+                    {JSON.stringify(meta, null, 2)}
+                  
+
+ ) : null} +
+ {it.at} + + {feedbackPersonLabel(items[0] || { userKey: personKey })} + + 共 {items.length} 条反馈 + 上限 10 + + ) : section === 'feedback' ? ( +
+ 点「访客」看全部归类 + 共 {total} 条 +
) : section !== 'catalog' ? (
共 {total} 条 @@ -626,29 +699,59 @@ export default function Social() { )} - {loading ? '加载中…' : `第 ${pageFrom || 0}–${pageTo} / ${total}`} + {loading + ? '加载中…' + : section === 'feedback' && personKey + ? `该访客 ${items.length} 条` + : section === 'feedback' + ? `共 ${total} 条 · 点访客看归类` + : `第 ${pageFrom || 0}–${pageTo} / ${total}`} - - + {section === 'feedback' && personKey ? ( + + ) : null} + {section !== 'feedback' ? ( + <> + + + + ) : null}
{loading && !items.length ? (

加载中…

+ ) : section === 'feedback' && personKey && !items.length ? ( +
+

该访客暂无反馈

+ +
) : !items.length ? (

本列表暂无数据

@@ -657,6 +760,77 @@ export default function Social() {

) : ( + <> + {section === 'feedback' && personKey && items[0] ? ( +
+
+ {feedbackPersonLabel(items[0])} + + {items.length}/{String(items[0].userMax || 10)} 条 + + +
+
+
+ userKey {personKey} +
+
+ guestId{' '} + + {String(items[0].guestId || items[0].guest_id || '—')} + +
+
联系 {String(items[0].contact || '—')}
+ {(() => { + const meta = + items[0].meta && + typeof items[0].meta === 'object' && + !Array.isArray(items[0].meta) + ? (items[0].meta as Record) + : {} + const bits = [ + meta.email ? `邮箱 ${meta.email}` : '', + meta.name ? `昵称 ${meta.name}` : '', + meta.href ? `页面 ${meta.href}` : '', + meta.timezone ? `时区 ${meta.timezone}` : '', + meta.platform ? `平台 ${meta.platform}` : '', + meta.serverIp ? `IP ${meta.serverIp}` : '', + meta.userAgent + ? `UA ${String(meta.userAgent).slice(0, 100)}` + : '', + ].filter(Boolean) + return bits.length ? ( +
+ {bits.map((b) => ( +
{String(b)}
+ ))} +
+ 全部 meta +
+                              {JSON.stringify(meta, null, 2)}
+                            
+
+
+ ) : null + })()} +
+
+ ) : null} {section === 'messages' ? ( @@ -701,10 +875,10 @@ export default function Social() { ) : null} {section === 'feedback' ? ( - - - - + + + + @@ -821,10 +995,15 @@ export default function Social() { section === 'joins' || section === 'roster' ? Boolean(rowLivePeer(row, presence.peers)) : false + const feedbackPersonMode = section === 'feedback' && !!personKey + const feedbackFlatMode = section === 'feedback' && !personKey + const visitorKey = String(row.userKey || '') return ( openDetail(row)} onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { @@ -895,19 +1074,89 @@ export default function Social() { ) : null} - {section === 'feedback' ? ( + {feedbackFlatMode ? ( <> - - + ) : null} + {feedbackPersonMode ? ( + <> + + + + + + + ) : null} {section === 'joins' ? ( <>
类型内容联系访客{personKey ? '#' : '类型'}{personKey ? '类型' : '内容'}{personKey ? '内容 / 截图' : '联系'}{personKey ? '联系' : '访客'} 时间 操作
{fmtTime(row.at || row.created_at)} {String(row.kind || '—')} + {Number(row.userCount || 0) > 1 ? ( +
+ 同人 {String(row.userIndex)}/{String(row.userCount)} +
+ ) : null}
{short(row.text, 56)}{short(row.contact, 24)} - {short(row.guestId || row.guest_id, 14)} + {short(row.contact, 24) || '—'} { + e.stopPropagation() + if (visitorKey) openFeedbackPerson(visitorKey) + }} + > + +
+ {Number(row.userCount || 1)} 条 · 点访客看全部 +
{fmtTime(row.created_at || row.createdAt || row.at)} + + {String(row.userIndex || '—')}/{String(row.userCount || items.length)} + + + {String(row.kind || '—')} + +
{short(row.text, 72)}
+ {Array.isArray(row.images) && row.images.length ? ( +
e.stopPropagation()} + > + {(row.images as unknown[]) + .filter((u): u is string => typeof u === 'string') + .slice(0, 4) + .map((url) => ( + + + + ))} +
+ ) : null} +
{short(row.contact, 24) || '—'}{fmtTime(row.created_at || row.createdAt || row.at)} @@ -1181,6 +1430,15 @@ export default function Social() { ) : null} e.stopPropagation()}>
+ {feedbackFlatMode && visitorKey ? ( + + ) : null} {href ? ( 详情 @@ -1217,6 +1475,7 @@ export default function Social() { })}
+ )}
diff --git a/apps/com/admin/src/pages/SocialDetail.tsx b/apps/com/admin/src/pages/SocialDetail.tsx index 2d1b525..b371257 100644 --- a/apps/com/admin/src/pages/SocialDetail.tsx +++ b/apps/com/admin/src/pages/SocialDetail.tsx @@ -263,11 +263,13 @@ function PrimaryFields({ item, media, roster, + lane = 'cn', }: { entity: string item: Record media?: Record roster?: Record + lane?: string }) { if (entity === 'joinLeads') { return @@ -387,6 +389,10 @@ function PrimaryFields({ ) } if (entity === 'feedback') { + const userKey = String(val(item, 'userKey', 'user_key') || '') + const imgs = Array.isArray(item.images) + ? (item.images as unknown[]).filter((u): u is string => typeof u === 'string') + : [] return (
@@ -394,13 +400,35 @@ function PrimaryFields({ {String(val(item, 'kind') ?? '—')}
{String(val(item, 'text') ?? '—')}
+ {imgs.length ? ( + ({ + key: `img-${i}`, + label: `截图 ${i + 1}`, + value: url, + }))} + /> + ) : null}
联系 {String(val(item, 'contact') ?? '—')} + + 身份 {userKey || '—'} + 访客 {String(val(item, 'guestId', 'guest_id') ?? '—')} {fmtTime(val(item, 'at', 'created_at', 'createdAt'))}
+ {userKey ? ( +

+ + 查看该访客全部反馈 + +

+ ) : null}
) } @@ -470,6 +498,7 @@ export default function SocialDetail() { const nav = useNavigate() const base = `/${lane}/social` const [data, setData] = useState(null) + const [siblings, setSiblings] = useState[]>([]) const [err, setErr] = useState('') const [msg, setMsg] = useState('') const [busy, setBusy] = useState(false) @@ -517,6 +546,23 @@ export default function SocialDetail() { bio: String(item.bio || ''), }) } + if (entity === 'feedback') { + const uk = String(item.userKey || item.user_key || '').trim() + if (uk) { + try { + const sib = await api<{ items?: Record[] }>( + `/api/admin/social/ugc/feedback?userKey=${encodeURIComponent(uk)}&limit=100`, + ) + setSiblings(Array.isArray(sib.items) ? sib.items : []) + } catch { + setSiblings([]) + } + } else { + setSiblings([]) + } + } else { + setSiblings([]) + } } finally { setLoading(false) } @@ -685,10 +731,55 @@ export default function SocialDetail() { item={item} media={data.media} roster={data.roster} + lane={lane} /> ) : null} + {!loading && !err && entity === 'feedback' && siblings.length > 0 ? ( +
+

该访客全部反馈({siblings.length})

+
+ + + + + + + + + + + {siblings.map((row) => { + const rid = String(row.id || '') + const active = rid === id + return ( + { + if (!rid || active) return + nav(`${base}/feedback/${encodeURIComponent(rid)}`) + }} + > + + + + + + ) + })} + +
#类型内容时间
+ {String(row.userIndex || '—')}/{String(row.userCount || siblings.length)} + {active ? ' · 当前' : ''} + + {String(row.kind || '—')} + {short(row.text, 72)}{fmtTime(row.at || row.created_at || row.createdAt)}
+
+
+ ) : null} + {edit && entity === 'roster' ? (

编辑资料

diff --git a/apps/com/admin/src/pages/socialMeta.ts b/apps/com/admin/src/pages/socialMeta.ts index 61c569b..bba8373 100644 --- a/apps/com/admin/src/pages/socialMeta.ts +++ b/apps/com/admin/src/pages/socialMeta.ts @@ -80,7 +80,7 @@ export const SECTION_DESC: Record = { reports: '用户举报,优先处理。', blocks: '拉黑记录。', files: '聊天与资料里上传的文件。', - feedback: '用户反馈。', + feedback: '按访客整理;点访客看全部反馈。', archives: '已移入存档的记录(加入细节在「加入线索」里看)。', catalog: '社区目录内容配置。', } diff --git a/src/app/api/portal/feedback/route.ts b/src/app/api/portal/feedback/route.ts index 8559654..0647a23 100644 --- a/src/app/api/portal/feedback/route.ts +++ b/src/app/api/portal/feedback/route.ts @@ -2,6 +2,11 @@ import { NextRequest, NextResponse } from "next/server"; import { promises as fs } from "node:fs"; import path from "node:path"; import { requireAdminSession } from "~/lib/admin-auth"; +import { + FEEDBACK_MAX_PER_USER, + feedbackUserKey, + rowMatchesFeedbackUser, +} from "~/lib/feedback-identity"; export const runtime = "nodejs"; export const dynamic = "force-dynamic"; @@ -14,6 +19,9 @@ type Item = { text: string; contact: string; guestId: string; + userKey: string; + images: string[]; + meta: Record; at: string; source: string; }; @@ -54,6 +62,30 @@ function uid(): string { return `fb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`; } +function normalizeImages(raw: unknown): string[] { + if (!Array.isArray(raw)) return []; + return raw + .filter((u): u is string => typeof u === "string") + .map((u) => u.trim()) + .filter((u) => /^https?:\/\//i.test(u)) + .slice(0, 8) + .map((u) => u.slice(0, 500)); +} + +function countForUser(store: Store, userKey: string): number { + return store.items.filter((row) => + rowMatchesFeedbackUser( + { + userKey: row.userKey, + guestId: row.guestId, + contact: row.contact, + meta: row.meta, + }, + userKey, + ), + ).length; +} + /** Admin / debug list — local offline seed. */ export async function GET(req: NextRequest) { if (!(await requireAdminSession())) { @@ -78,6 +110,7 @@ export async function GET(req: NextRequest) { { ok: true, total: rows.length, + maxPerUser: FEEDBACK_MAX_PER_USER, items: rows.slice(offset, offset + limit), }, { headers: { "Cache-Control": "no-store" } }, @@ -106,6 +139,33 @@ export async function POST(req: NextRequest) { const guestId = String( body.guestId || req.headers.get("x-social-guest-id") || "", ).slice(0, 120); + const images = normalizeImages(body.images); + const meta = + body.meta && typeof body.meta === "object" && !Array.isArray(body.meta) + ? { ...(body.meta as Record) } + : {}; + const headerEmail = (req.headers.get("x-social-email") || "").trim().slice(0, 160); + if (headerEmail && !meta.email) meta.email = headerEmail; + meta.serverUserAgent = (req.headers.get("user-agent") || "").slice(0, 400); + meta.serverIp = + req.headers.get("x-forwarded-for")?.split(",")[0]?.trim() || + req.headers.get("x-real-ip") || + ""; + const userKey = feedbackUserKey({ guestId, contact, meta }); + const store = await readStore(); + const used = countForUser(store, userKey); + if (used >= FEEDBACK_MAX_PER_USER) { + return withCors( + NextResponse.json( + { + detail: `每人最多提交 ${FEEDBACK_MAX_PER_USER} 条反馈`, + used, + max: FEEDBACK_MAX_PER_USER, + }, + { status: 429 }, + ), + ); + } const now = new Date().toISOString(); const item: Item = { id: uid(), @@ -113,31 +173,30 @@ export async function POST(req: NextRequest) { text, contact, guestId, + userKey, + images, + meta, at: now, source: "portal-local", }; - const store = await readStore(); store.items.unshift(item); store.items = store.items.slice(0, 2000); await writeStore(store); // Best-effort forward to social_svc (PB) — failure does not fail the request - const payload = JSON.stringify({ kind, text, contact }); + const payload = JSON.stringify({ kind, text, contact, images, meta }); const headers = { "Content-Type": "application/json", "X-Social-Guest-Id": guestId || "portal", }; - for (const raw of [ - process.env.SOCIAL_API_URL, - process.env.API_URL, - "http://127.0.0.1:8080", - ]) { + for (const raw of [process.env.SOCIAL_API_URL, process.env.API_URL]) { const base = (raw || "").replace(/\/$/, ""); - if (!base) continue; + if (!base || /127\.0\.0\.1|localhost/i.test(base)) continue; void fetch(`${base}/api/social/v1/feedback`, { method: "POST", headers, body: payload, + signal: AbortSignal.timeout(4000), }).catch(() => undefined); } @@ -148,9 +207,13 @@ export async function POST(req: NextRequest) { kind: item.kind, text: item.text, contact: item.contact, + images: item.images, + userKey: item.userKey, guestId: item.guestId, at: item.at, stored: "local", + remaining: Math.max(0, FEEDBACK_MAX_PER_USER - used - 1), + max: FEEDBACK_MAX_PER_USER, }), ); } diff --git a/src/lib/feedback-identity.ts b/src/lib/feedback-identity.ts new file mode 100644 index 0000000..09faf23 --- /dev/null +++ b/src/lib/feedback-identity.ts @@ -0,0 +1,53 @@ +/** Stable identity for feedback rate-limit + admin clustering. */ + +export const FEEDBACK_MAX_PER_USER = 10; + +export function feedbackUserKey(input: { + guestId?: string; + contact?: string; + meta?: Record | null; +}): string { + const meta = input.meta && typeof input.meta === "object" ? input.meta : {}; + const email = String(meta.email || "") + .trim() + .toLowerCase(); + if (email.includes("@")) return `email:${email.slice(0, 160)}`; + + const contact = String(input.contact || "") + .trim() + .toLowerCase() + .slice(0, 120); + if (contact.includes("@")) return `email:${contact}`; + if (contact) return `contact:${contact}`; + + const guest = String(input.guestId || meta.guestId || "") + .trim() + .slice(0, 120); + if (guest) return `guest:${guest}`; + + const ua = String(meta.userAgent || meta.serverUserAgent || "").slice(0, 96); + const tz = String(meta.timezone || ""); + const weak = `${ua}|${tz}|${String(meta.platform || "")}`; + let h = 0; + for (let i = 0; i < weak.length; i++) h = (h * 31 + weak.charCodeAt(i)) >>> 0; + return `weak:${h.toString(16)}`; +} + +export function rowMatchesFeedbackUser( + row: { + userKey?: string; + guestId?: string; + contact?: string; + meta?: Record | null; + }, + key: string, +): boolean { + if (row.userKey && row.userKey === key) return true; + return ( + feedbackUserKey({ + guestId: row.guestId, + contact: row.contact, + meta: row.meta, + }) === key + ); +} diff --git a/src/lib/remote-config.ts b/src/lib/remote-config.ts index c3296d4..70a7c6a 100644 --- a/src/lib/remote-config.ts +++ b/src/lib/remote-config.ts @@ -675,11 +675,11 @@ export const DEFAULT_REMOTE_CONFIG: NomadroRemoteConfig = { "先选城市,再挑适合见面的咖啡馆。看完介绍、聊过天之后,出来见一面会更自然。", }, team: { - eyebrow: "不只好玩,也能做事", - title: "一起,做点事", - accent: "招聘", + eyebrow: "一起做事", + title: "招聘", + accent: "帮手 · 兼职 · 全职", description: - "有人在招帮手、兼职伙伴;也有人一起做共创(小册与视频)。点卡片看看详情。", + "帮手、兼职、全职都在这里。点一条看看详情,感兴趣就留个联系方式。", }, gigs: { eyebrow: "帮得上忙的机会", diff --git a/src/modules/social/app/studio.css b/src/modules/social/app/studio.css index 9f947c7..08f5373 100644 --- a/src/modules/social/app/studio.css +++ b/src/modules/social/app/studio.css @@ -749,3 +749,329 @@ min-height: 42px; } } + +/* —— 招聘看板(/social/team)—— */ +.social-hire { + display: flex; + flex-direction: column; + gap: 18px; +} +.social-hire-hero { + display: flex; + flex-direction: column; + gap: 12px; + padding: 8px 0 4px; +} +.social-hire-eyebrow { + margin: 0; + font-size: 12px; + letter-spacing: 0.12em; + color: var(--sx-mint, #4ecdc4); +} +.social-hire-hero h1 { + margin: 0; + display: flex; + flex-wrap: wrap; + align-items: baseline; + gap: 10px 14px; + font-family: var(--font-display, inherit); + line-height: 1.1; +} +.social-hire-title { + font-size: clamp(34px, 7vw, 56px); + font-weight: 700; + letter-spacing: -0.05em; + color: var(--text-primary); +} +.social-hire-accent { + font-size: clamp(14px, 2.2vw, 18px); + font-weight: 550; + color: var(--text-secondary); +} +.social-hire-desc { + margin: 0; + max-width: 36rem; + color: var(--text-secondary); + font-size: 14px; + line-height: 1.6; +} +.social-hire-switch { + display: inline-flex; + align-items: center; + gap: 4px; + padding: 4px; + border-radius: 999px; + border: 1px solid var(--sx-line, rgba(255, 255, 255, 0.1)); + background: rgba(255, 255, 255, 0.03); +} +.social-hire-switch-on, +.social-hire-switch-off { + display: inline-flex; + align-items: center; + gap: 7px; + min-height: 40px; + padding: 0 14px; + border-radius: 999px; + font-size: 13px; + font-weight: 600; + text-decoration: none; + color: var(--text-secondary); + transition: + background 0.25s ease, + color 0.25s ease, + transform 0.25s ease; +} +.social-hire-switch-on { + color: #0a0e17; + background: var(--sx-mint, #4ecdc4); +} +.social-hire-switch-off:hover { + color: var(--text-primary); + background: rgba(255, 255, 255, 0.06); +} +.social-hire-rail { + display: flex; + flex-direction: column; + gap: 12px; + padding: 14px; + border-radius: 18px; + border: 1px solid var(--sx-line, rgba(255, 255, 255, 0.08)); + background: + linear-gradient(180deg, rgba(78, 205, 196, 0.06), transparent 60%), + rgba(17, 24, 39, 0.55); +} +.social-hire-kinds { + display: flex; + flex-wrap: wrap; + gap: 8px; +} +.social-hire-kinds > button { + min-height: 40px; + padding: 0 14px; + border-radius: 999px; + border: 1px solid rgba(255, 255, 255, 0.1); + background: transparent; + color: var(--text-secondary); + font-size: 12px; + font-weight: 550; + cursor: pointer; + transition: + background 0.2s ease, + border-color 0.2s ease, + color 0.2s ease, + transform 0.2s ease; +} +.social-hire-kinds > button.is-on, +.social-hire-saved.is-on { + color: #0a0e17; + background: var(--sx-mint, #4ecdc4); + border-color: transparent; +} +.social-hire-kinds > button:hover:not(.is-on) { + color: var(--text-primary); + border-color: rgba(78, 205, 196, 0.35); +} +.social-hire-saved { + margin-left: auto; +} +.social-hire-count { + display: flex; + align-items: baseline; + gap: 8px; + flex-wrap: wrap; + font-size: 13px; + color: var(--text-secondary); +} +.social-hire-count strong { + font-family: var(--font-display, inherit); + font-size: 28px; + font-weight: 650; + letter-spacing: -0.04em; + color: var(--text-primary); + line-height: 1; +} +.social-hire-reset { + margin-left: auto; + border: 0; + background: transparent; + color: var(--sx-mint, #4ecdc4); + font-size: 12px; + cursor: pointer; + min-height: 36px; + padding: 0 4px; +} +.social-hire-board { + display: flex; + flex-direction: column; + gap: 12px; +} +.social-hire-row { + display: grid; + grid-template-columns: 48px minmax(0, 1fr) auto; + gap: 12px 14px; + align-items: start; + padding: 14px 16px; + border-radius: 16px; + border: 1px solid rgba(255, 255, 255, 0.08); + background: rgba(17, 24, 39, 0.72); + position: relative; + overflow: hidden; + transition: + border-color 0.25s ease, + transform 0.25s ease, + background 0.25s ease, + box-shadow 0.25s ease; +} +.social-hire-row::before { + content: ""; + position: absolute; + inset: 0 auto 0 0; + width: 3px; + background: var(--sx-mint, #4ecdc4); + opacity: 0.85; +} +.social-hire-row.tone-volunteer::before { + background: var(--sx-coral, #ff6b6b); +} +.social-hire-row.tone-fulltime::before { + background: var(--sx-gold, #ffe66d); +} +.social-hire-row:hover { + border-color: rgba(78, 205, 196, 0.28); + background: rgba(22, 32, 48, 0.92); + transform: translateY(-2px); + box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28); +} +.social-hire-row-mark { + display: grid; + place-items: center; + width: 52px; + height: 52px; + border-radius: 16px; + border: 1px solid rgba(78, 205, 196, 0.22); + color: var(--sx-mint, #4ecdc4); + background: rgba(78, 205, 196, 0.08); +} +.social-hire-row.tone-volunteer .social-hire-row-mark { + color: var(--sx-coral, #ff6b6b); + border-color: rgba(255, 107, 107, 0.25); + background: rgba(255, 107, 107, 0.08); +} +.social-hire-row.tone-fulltime .social-hire-row-mark { + color: var(--sx-gold, #ffe66d); + border-color: rgba(255, 230, 109, 0.28); + background: rgba(255, 230, 109, 0.08); +} +.social-hire-row-body { + display: flex; + flex-direction: column; + gap: 6px; + min-width: 0; +} +.social-hire-row-top { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; +} +.social-hire-kind { + font-size: 11px; + letter-spacing: 0.06em; + color: var(--sx-mint, #4ecdc4); + text-transform: none; +} +.social-hire-row.tone-volunteer .social-hire-kind { + color: var(--sx-coral, #ff6b6b); +} +.social-hire-row.tone-fulltime .social-hire-kind { + color: var(--sx-gold, #ffe66d); +} +.social-hire-row-body h2 { + margin: 0; + font-family: var(--font-display, inherit); + font-size: clamp(17px, 2.4vw, 22px); + font-weight: 650; + letter-spacing: -0.03em; + line-height: 1.25; +} +.social-hire-row-body > p { + margin: 0; + color: var(--text-secondary); + font-size: 13px; + line-height: 1.55; +} +.social-hire-meta { + display: flex; + flex-wrap: wrap; + gap: 10px 16px; + align-items: center; + font-size: 12px; + color: var(--text-muted); +} +.social-hire-meta > span { + display: inline-flex; + align-items: center; + gap: 6px; +} +.social-hire-pay { + color: var(--text-primary); + font-weight: 600; +} +.social-hire-tags { + margin: 2px 0 0; +} +.social-hire-row-cta { + display: flex; + align-items: center; + align-self: center; +} +.social-hire-row-cta .social-btn { + white-space: nowrap; +} +.social-apply-hero.tone-volunteer { + border-color: rgba(255, 107, 107, 0.28); +} +.social-apply-hero.tone-fulltime { + border-color: rgba(255, 230, 109, 0.28); +} + +@media (max-width: 720px) { + .social-hire-row { + grid-template-columns: 44px minmax(0, 1fr); + } + .social-hire-row-mark { + width: 44px; + height: 44px; + border-radius: 14px; + } + .social-hire-row-cta { + grid-column: 1 / -1; + width: 100%; + } + .social-hire-row-cta .social-btn { + width: 100%; + justify-content: center; + min-height: 44px; + } + .social-hire-saved { + margin-left: 0; + } + .social-hire-rail { + padding: 12px; + } +} + +@media (min-width: 960px) { + .social-hire-rail { + flex-direction: row; + align-items: center; + } + .social-hire-rail .social-search { + flex: 1; + min-width: 220px; + } + .social-hire-kinds { + flex: 1.2; + justify-content: flex-end; + } +} diff --git a/src/modules/social/components/CommunityWelcome.tsx b/src/modules/social/components/CommunityWelcome.tsx index 7a9ec48..96194b0 100644 --- a/src/modules/social/components/CommunityWelcome.tsx +++ b/src/modules/social/components/CommunityWelcome.tsx @@ -85,10 +85,14 @@ export function CommunityFeedback() { lock.current = true; setBusy(true); try { + const { collectFeedbackClientMeta } = await import( + "@social/lib/feedbackMeta" + ); await socialApi.postFeedback({ ...draft, text: draft.text.trim(), contact: draft.contact.trim(), + meta: collectFeedbackClientMeta({ ui: "feedback-page" }), }); setDelivery("sent"); setStatus(socialTx("已提交,感谢反馈。")); @@ -141,19 +145,6 @@ export function CommunityFeedback() { ) : (
void submit(event)}>
-
- {(["建议", "反馈"] as const).map((kind) => ( - - ))} -