feat:寄卖增加对接客服,db脚本迁移修复
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { apiGet, apiPatch, apiPost, apiPut } from '@/lib/http'
|
||||
import { apiDelete, apiGet, apiPatch, apiPost, apiPut } from '@/lib/http'
|
||||
import type {
|
||||
ConsignmentContactSupporter,
|
||||
ConsignmentInventory,
|
||||
ConsignmentStatsSummary,
|
||||
ConsignmentSubmission,
|
||||
@@ -8,6 +9,43 @@ import type {
|
||||
WorkOrderInventoryMatchOptions,
|
||||
} from '@/types/consignment'
|
||||
|
||||
// --- 对接客服名单 ---
|
||||
|
||||
export function fetchAdminConsignmentContacts(params?: { keyword?: string; enabled?: string }) {
|
||||
return apiGet<{ items: ConsignmentContactSupporter[]; total: number }>(
|
||||
'/api/v1/admin/worker-platform/consignment/contacts',
|
||||
params,
|
||||
)
|
||||
}
|
||||
|
||||
export function createAdminConsignmentContact(payload: Record<string, unknown>) {
|
||||
return apiPost<ConsignmentContactSupporter>(
|
||||
'/api/v1/admin/worker-platform/consignment/contacts',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function updateAdminConsignmentContact(
|
||||
id: number | string,
|
||||
payload: Record<string, unknown>,
|
||||
) {
|
||||
return apiPut<ConsignmentContactSupporter>(
|
||||
`/api/v1/admin/worker-platform/consignment/contacts/${id}`,
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function setAdminConsignmentContactEnabled(id: number | string, enabled: boolean) {
|
||||
return apiPatch<ConsignmentContactSupporter>(
|
||||
`/api/v1/admin/worker-platform/consignment/contacts/${id}/enabled`,
|
||||
{ enabled },
|
||||
)
|
||||
}
|
||||
|
||||
export function deleteAdminConsignmentContact(id: number | string) {
|
||||
return apiDelete<{ deleted: boolean }>(`/api/v1/admin/worker-platform/consignment/contacts/${id}`)
|
||||
}
|
||||
|
||||
// --- 库存管理 ---
|
||||
|
||||
export function fetchAdminConsignmentInventories(params?: Record<string, unknown>) {
|
||||
|
||||
@@ -25,7 +25,11 @@ import type {
|
||||
WorkerUser,
|
||||
WorkerWalletLedger,
|
||||
} from '@/types/worker-platform'
|
||||
import type { ConsignmentBuyerInfo, ConsignmentSellerInfo } from '@/types/consignment'
|
||||
import type {
|
||||
ConsignmentBuyerInfo,
|
||||
ConsignmentContactSupporter,
|
||||
ConsignmentSellerInfo,
|
||||
} from '@/types/consignment'
|
||||
|
||||
import { getWorkerDeviceId } from '@/utils/worker-auth'
|
||||
|
||||
@@ -392,6 +396,8 @@ export type WorkerConsignmentPublishPayload = {
|
||||
screenshotsJson: string[]
|
||||
sellerNote?: string
|
||||
depositAmountFen?: number
|
||||
/** 对接客服名单 id(必填,发布时选定) */
|
||||
contactSupporterId: number
|
||||
}
|
||||
|
||||
export type WorkerConsignmentItem = {
|
||||
@@ -409,6 +415,10 @@ export type WorkerConsignmentItem = {
|
||||
resultInventoryId?: number | string | null
|
||||
screenshotsJson: string[]
|
||||
contentJson: Record<string, unknown>
|
||||
contactSupporterId?: number | null
|
||||
contactSupporterName?: string
|
||||
contactSupporterPhone?: string
|
||||
contactSupporterWechat?: string
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
@@ -450,6 +460,10 @@ export type WorkerConsignmentRecord = {
|
||||
brillianceCount: number
|
||||
askingPriceFen: number
|
||||
depositAmountFen: number
|
||||
contactSupporterId?: number | null
|
||||
contactSupporterName?: string
|
||||
contactSupporterPhone?: string
|
||||
contactSupporterWechat?: string
|
||||
reviewNote: string
|
||||
screenshotsJson: string[]
|
||||
giftEvidenceImages?: string[]
|
||||
@@ -507,6 +521,11 @@ export function publishWorkerConsignment(payload: WorkerConsignmentPublishPayloa
|
||||
return apiPost<WorkerConsignmentItem>('/api/v1/worker/consignment/publish', payload)
|
||||
}
|
||||
|
||||
/** 发布寄卖时的「对接客服」下拉(仅启用中的名单)。 */
|
||||
export function fetchWorkerConsignmentContacts() {
|
||||
return apiGet<{ items: ConsignmentContactSupporter[] }>('/api/v1/worker/consignment/contacts')
|
||||
}
|
||||
|
||||
export function fetchWorkerConsignments(params: WorkerConsignmentListParams = {}) {
|
||||
return apiGet<WorkerConsignmentListResponse>(
|
||||
'/api/v1/worker/consignment/my-items',
|
||||
|
||||
Reference in New Issue
Block a user