好友赠送单确认加好友后取消扣押金覆盖撤单撤回取消指派撤单申请与超时问题单处置

This commit is contained in:
yml2213
2026-08-23 11:23:17 +08:00
parent 70b31f4874
commit 360c5ea20e
6 changed files with 170 additions and 25 deletions
@@ -44,6 +44,7 @@ export type WorkOrderGiftSource = {
acceptance_mode?: string | null
gift_phase?: string | null
gift_available_at?: string | null
friend_added_at?: string | null
}
export function isWorkOrderGiftAvailable(source: WorkOrderGiftSource): boolean {
@@ -52,6 +53,11 @@ export function isWorkOrderGiftAvailable(source: WorkOrderGiftSource): boolean {
return Number.isFinite(availableAt) && availableAt <= Date.now()
}
/** 好友赠送单已由后台确认加好友后,取消/脱离打手不再退还押金,押金只能经验收结算。 */
export function isWorkOrderGiftDepositForfeitable(source: WorkOrderGiftSource): boolean {
return isFriendGiftAcceptanceMode(source.acceptance_mode) && Boolean(source.friend_added_at)
}
/** 返回当前赠送阶段;冷却到点后返回实时计算的 gift_ready。 */
export function resolveWorkOrderGiftPhase(source: WorkOrderGiftSource): string {
if (!isFriendGiftAcceptanceMode(source.acceptance_mode)) return ''