feat(小程序): 任务广场 + 任务详情 + 抢单/报名(与 web 同步)

- utils/tasks.js 增 listSquare/getTask/grabById(/opc/tasks 平台公开端点,带 token 取 can_accept)
- pages/tasks 任务广场(公开可见,卡片含可接/条件不符徽标+原因,点击进详情,抢单)
- pages/task-detail 任务详情(说明/预算/模式/截止/交付/发包方 + 按 can_accept 放行抢单/报名)
- app.config 注册两页;「我的」页加「任务广场」入口(在扫码接单前)
- Soft UI 浅色柔彩样式;build:weapp 通过
This commit is contained in:
Pine
2026-08-27 19:18:22 +08:00
parent 7547de82ec
commit 384b957617
9 changed files with 254 additions and 0 deletions
+15
View File
@@ -14,6 +14,21 @@ export async function getMyTasks() {
return request('GET', '/api/tasks/my', {}, true);
}
/** 任务广场(公开):已发布 + C端可见任务,登录后附带 can_accept/accept_reasons */
export async function listSquare(withAuth = false) {
return request('GET', '/opc/tasks', {}, withAuth);
}
/** 任务详情(公开) */
export async function getTask(id, withAuth = false) {
return request('GET', `/opc/tasks/${encodeURIComponent(id)}`, {}, withAuth);
}
/** 抢单/报名(需登录) */
export async function grabById(id) {
return request('POST', `/opc/tasks/${encodeURIComponent(id)}/grab`, {}, true);
}
/** 解析扫码文本 → task_code:支持纯短码 / URL(?c=、?task_code=、末段) */
export function parseTaskCode(raw) {
const s = (raw || '').trim();