From 75f50cebba6ef93c1577b1f54a77e8b8cffd973c Mon Sep 17 00:00:00 2001 From: Pine Date: Tue, 25 Aug 2026 19:30:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(tasks):=20=E5=A4=A7=E5=B1=8F=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=8D=A1=E5=B1=95=E7=A4=BA=E5=A2=9E=E5=BC=BA=20?= =?UTF-8?q?=E2=80=94=E2=80=94=20=E6=8E=A5=E5=8D=95=E6=96=B9=E5=BC=8F/?= =?UTF-8?q?=E6=88=AA=E6=AD=A2/=E4=BA=A4=E4=BB=98=E6=97=B6=E9=99=90/?= =?UTF-8?q?=E4=BA=BA=E6=95=B0/=E7=8B=AC=E5=8D=A0/=E5=8F=91=E5=8C=85?= =?UTF-8?q?=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - taskData.js normalizeTask 加 mode/modeLabel/deadline/deliveryDays/headcount/exclusive/publisherName。 - TaskDisplay.jsx 卡片增 接单方式+预算、截止/交付时限/独占|人数 徽标、发包方。 - task-display.css 加 task-meta 行样式。 Co-Authored-By: Claude --- src/pages/TaskDisplay.jsx | 12 ++++++++++-- src/styles/task-display.css | 6 ++++++ src/utils/taskData.js | 11 +++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/pages/TaskDisplay.jsx b/src/pages/TaskDisplay.jsx index 06c2906..7c10173 100644 --- a/src/pages/TaskDisplay.jsx +++ b/src/pages/TaskDisplay.jsx @@ -93,11 +93,19 @@ function TaskCard({ task }) { ))} -
预算 {task.budgetLabel}
+
预算 {task.budgetLabel} · {task.modeLabel}
+ +
+ {task.deadline && 接单截止 {task.deadline}} + {task.deliveryDays > 0 && 交付时限 {task.deliveryDays} 天} + {task.exclusive + ? 独占接单 + : task.headcount > 0 ? 限 {task.headcount} 人 : null} +
- 任务ID + 任务ID · {task.publisherName ? `${task.publisherName} 发包` : '园区发包'} {task.task_code || task.id}
diff --git a/src/styles/task-display.css b/src/styles/task-display.css index ab08d71..0fe821e 100644 --- a/src/styles/task-display.css +++ b/src/styles/task-display.css @@ -80,6 +80,12 @@ .task-budget { font-size: 15px; font-weight: 700; color: var(--bd-blue, #2f6bff); } +.task-meta-row { display: flex; flex-wrap: wrap; gap: 8px; } +.task-meta-item { + font-size: 11px; padding: 2px 8px; border-radius: 6px; + background: rgba(29, 44, 68, 0.05); color: var(--bd-sub, #7d8fa9); +} + .task-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; diff --git a/src/utils/taskData.js b/src/utils/taskData.js index 693c438..e93ba44 100644 --- a/src/utils/taskData.js +++ b/src/utils/taskData.js @@ -18,6 +18,13 @@ function normalizeTask(raw, idx) { budgetMin: Number(t.budget_min) || 0, budgetMax: Number(t.budget_max) || 0, budgetLabel: fmtBudget(t.budget_min, t.budget_max), + mode: t.mode || 'grab', + modeLabel: MODE_LABEL[t.mode] || '抢单', + deadline: t.deadline || '', + deliveryDays: Number(t.delivery_days) || 0, + headcount: Number(t.headcount) || 0, + exclusive: !!t.exclusive, + publisherName: t.publisher_name || '', status: t.status || 'published', claimed: t.status === 'claimed' || t.status === 'doing' || !!t.claimed_by, claimedBy: t.claimed_by || '', @@ -26,6 +33,10 @@ function normalizeTask(raw, idx) { }; } +const MODE_LABEL = { + grab: '抢单', bid: '竞标', assign: '指派', recommend: '推荐', +}; + function fmtBudget(min, max) { const n = Number(min) || 0, x = Number(max) || 0; if (!n && !x) return '面议';