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 '面议';