feat(consignment): 寄卖配置、内部匹配与打手端升级
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { apiDelete, apiGet, apiPost, apiPostForm, apiPut } from '@/lib/http'
|
||||
import { apiDelete, apiGet, apiPatch, apiPost, apiPostForm, apiPut } from '@/lib/http'
|
||||
import { optimizeImageForUpload } from '@/utils/image-upload'
|
||||
import type {
|
||||
UploadedFile,
|
||||
@@ -31,6 +31,7 @@ import type {
|
||||
ConsignmentBuyerInfo,
|
||||
ConsignmentContactSupporter,
|
||||
ConsignmentSellerInfo,
|
||||
WorkerConsignmentProfile,
|
||||
} from '@/types/consignment'
|
||||
|
||||
import { getWorkerDeviceId } from '@/utils/worker-auth'
|
||||
@@ -373,6 +374,9 @@ export function supplementWorkerAcceptedOrderEvidence(
|
||||
// ---------------- 打手端:我要寄卖与手枪库存 ----------------
|
||||
|
||||
export type WorkerConsignmentPublishPayload = {
|
||||
/** 分类级寄卖配置 id(打手端 tab 对应) */
|
||||
profileId?: number
|
||||
quantity?: number
|
||||
itemName?: string
|
||||
system: string
|
||||
serverZone: string
|
||||
@@ -448,6 +452,17 @@ export type WorkerConsignmentRecord = {
|
||||
diamondLevel: number
|
||||
brillianceCount: number
|
||||
askingPriceFen: number
|
||||
salePriceFen?: number
|
||||
quantity?: number
|
||||
remainingQuantity?: number
|
||||
listedAt?: string | null
|
||||
canEditPrice?: boolean
|
||||
priceDropSuggestion?: {
|
||||
suggestedPriceFen: number
|
||||
dropHours: number
|
||||
dropMode: 'percent' | 'fixed'
|
||||
dropValue: number
|
||||
} | null
|
||||
depositAmountFen: number
|
||||
contactSupporterId?: number | null
|
||||
contactSupporterName?: string
|
||||
@@ -508,6 +523,21 @@ export function publishWorkerConsignment(payload: WorkerConsignmentPublishPayloa
|
||||
return apiPost<WorkerConsignmentItem>('/api/v1/worker/consignment/publish', payload)
|
||||
}
|
||||
|
||||
/** 打手端寄卖页:已发布配置 → 动态 tab。 */
|
||||
export function fetchWorkerConsignmentProfiles() {
|
||||
return apiGet<{ profiles: WorkerConsignmentProfile[] }>('/api/v1/worker/consignment/profiles')
|
||||
}
|
||||
|
||||
/** 打手修改在售寄卖售价(分)。 */
|
||||
export function updateWorkerConsignmentPrice(submissionId: number | string, salePriceFen: number) {
|
||||
return apiPatch<{
|
||||
submissionId: number
|
||||
inventoryId: number
|
||||
salePriceFen: number
|
||||
updatedAt: string
|
||||
}>(`/api/v1/worker/consignment/items/${submissionId}/price`, { salePriceFen })
|
||||
}
|
||||
|
||||
/** 发布寄卖时的「对接客服」下拉(仅启用中的名单)。 */
|
||||
export function fetchWorkerConsignmentContacts() {
|
||||
return apiGet<{ items: ConsignmentContactSupporter[] }>('/api/v1/worker/consignment/contacts')
|
||||
|
||||
Reference in New Issue
Block a user