feat(worker): 我的订单新增待提交打手资料筛选
- 仅筛 3 天(72h)好友赠送单,口径与提交资料接口一致 - 加法式页签,仍保留在代练中;问题单纳入 - 概览与实时 workerStatuses 同步,提交/重置资料后自动移出/移入 - 显式单号检索忽略该展示筛选
This commit is contained in:
@@ -48,6 +48,25 @@ export function normalizeWorkOrderGiftCooldownMinutes(value: unknown): number {
|
||||
return Math.min(MAX_GIFT_COOLDOWN_MINUTES, Math.max(0, Math.round(minutes)))
|
||||
}
|
||||
|
||||
/** 「3 天赠送」筛选口径:3 天 = 4320 分钟(好友赠送默认冷却)。 */
|
||||
export const THREE_DAY_GIFT_COOLDOWN_MINUTES = 3 * 24 * 60
|
||||
|
||||
/**
|
||||
* 工单实际生效的赠送总冷却分钟数。
|
||||
*
|
||||
* 冷却时长 = gift_cooldown_hours 小时 + gift_cooldown_minutes 分钟;
|
||||
* 两者都为 0 表示历史数据未配置,按默认 72 小时兜底(与建单/确认加好友逻辑一致)。
|
||||
*/
|
||||
export function resolveWorkOrderGiftCooldownTotalMinutes(source: {
|
||||
gift_cooldown_hours?: unknown
|
||||
gift_cooldown_minutes?: unknown
|
||||
}): number {
|
||||
const hours = Math.max(0, Math.round(Number(source.gift_cooldown_hours) || 0))
|
||||
const minutes = Math.max(0, Math.round(Number(source.gift_cooldown_minutes) || 0))
|
||||
if (hours === 0 && minutes === 0) return DEFAULT_GIFT_COOLDOWN_HOURS * 60
|
||||
return hours * 60 + minutes
|
||||
}
|
||||
|
||||
export type WorkOrderGiftSource = {
|
||||
acceptance_mode?: string | null
|
||||
gift_phase?: string | null
|
||||
|
||||
Reference in New Issue
Block a user