区分线下提号账号来源
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { apiClient } from '@/shared/api/client'
|
||||
import type { ApiResponse, PaginatedResult } from '@/shared/types/types'
|
||||
|
||||
export type PickupAccountSource = 'internal' | 'external_platform_managed'
|
||||
export type AvailableListingSourceType = '' | 'external' | 'internal'
|
||||
|
||||
export interface AdminPickup {
|
||||
id: number
|
||||
pickup_no: string
|
||||
@@ -15,6 +18,8 @@ export interface AdminPickup {
|
||||
admin_id: number
|
||||
platform: string
|
||||
shop_name: string
|
||||
account_source: PickupAccountSource
|
||||
source_channel: string
|
||||
listing_price_cent: number
|
||||
owner_price_cent: number
|
||||
website_profit_cent: number
|
||||
@@ -48,6 +53,11 @@ export interface AvailableListing {
|
||||
website_profit_cent: number
|
||||
seller_ratio: number
|
||||
buyer_ratio: number
|
||||
account_source: PickupAccountSource
|
||||
is_external_upload: boolean
|
||||
source_channel: string
|
||||
handoff_mode: string
|
||||
settlement_mode: string
|
||||
}
|
||||
|
||||
export interface AdminPickupCreateRequest {
|
||||
@@ -75,6 +85,7 @@ export interface AdminPickupListQuery {
|
||||
keyword?: string
|
||||
status?: string
|
||||
shop_name?: string
|
||||
account_source?: PickupAccountSource | ''
|
||||
}
|
||||
|
||||
function cleanParams(query: object) {
|
||||
@@ -109,10 +120,15 @@ export async function fetchAdminPickupShopOptions(platform = '') {
|
||||
return Array.isArray(data.data) ? data.data : []
|
||||
}
|
||||
|
||||
export async function fetchAvailableListings(keyword: string, page = 1, page_size = 20) {
|
||||
export async function fetchAvailableListings(
|
||||
keyword = '',
|
||||
page = 1,
|
||||
page_size = 20,
|
||||
source_type: AvailableListingSourceType = ''
|
||||
) {
|
||||
const { data } = await apiClient.get<ApiResponse<PaginatedResult<AvailableListing>>>(
|
||||
'/admin/pickups/available-listings',
|
||||
{ params: cleanParams({ keyword, page, page_size }) }
|
||||
{ params: cleanParams({ keyword, page, page_size, source_type }) }
|
||||
)
|
||||
const result = data.data
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user