- 修复 FindOrder 在收号站模式(two_party_distributor_receive / three_party)下的 403 权限判定,放行参与方站点成员并精准计算收益 - 串联 distribution_site_payment_channels 至 payment.Start 核心支付发起流程,分销订单优先使用绑定的专属商户通道 - 修复数据大盘 GetDashboardAnalytics 趋势中 ReceivedCount 恒为 0 的问题,并对齐今日订单与 GMV 统计 - 修复 dispute/arbitration.go 仲裁完成时向分销租客发放成长积分的泄漏风险 - 提现管理新增 distribution_site_name/distribution_site_code 字段并在后台列表与详情弹窗中区分展示分销站 - GetPublicSiteInfo 增加 X-Distribution-Site-Code 请求头兜底支持
88 lines
2.1 KiB
TypeScript
88 lines
2.1 KiB
TypeScript
import { apiClient } from '@/shared/api/client'
|
|
|
|
import type { ApiResponse, PaginatedResult } from '@/shared/types/types'
|
|
|
|
// 管理员端提现详情接口
|
|
export interface WithdrawalDetail {
|
|
id: number
|
|
withdraw_no: string
|
|
user_id: number
|
|
distribution_site_id?: number
|
|
distribution_site_name?: string
|
|
distribution_site_code?: string
|
|
user_nickname: string
|
|
user_phone: string
|
|
amount_cent: number
|
|
fee_cent: number
|
|
actual_amount_cent: number
|
|
payment_account_id: number | null
|
|
account_type: string
|
|
account_name: string
|
|
account_no: string // 管理员可见完整账号
|
|
bank_name: string
|
|
bank_branch: string
|
|
certificate_urls: string[] // 收款二维码图片
|
|
status: string
|
|
reviewed_by: number | null
|
|
reviewed_by_name: string
|
|
reviewed_at: string | null
|
|
review_remark: string
|
|
paid_by: number | null
|
|
paid_by_name: string
|
|
paid_at: string | null
|
|
payment_proof_url: string
|
|
payment_remark: string
|
|
created_at: string
|
|
updated_at: string
|
|
}
|
|
|
|
// 审核请求
|
|
export interface ReviewWithdrawalRequest {
|
|
approved: boolean
|
|
remark: string
|
|
}
|
|
|
|
// 确认打款请求
|
|
export interface ConfirmPaymentRequest {
|
|
payment_proof_url?: string
|
|
remark: string
|
|
}
|
|
|
|
// ========== 管理员端提现管理 API ==========
|
|
|
|
export async function fetchAdminWithdrawals(params: {
|
|
status?: string
|
|
user_id?: number
|
|
page?: number
|
|
page_size?: number
|
|
}) {
|
|
const { data } = await apiClient.get<ApiResponse<PaginatedResult<WithdrawalDetail>>>(
|
|
'/admin/withdrawals',
|
|
{
|
|
params,
|
|
}
|
|
)
|
|
return data.data
|
|
}
|
|
|
|
export async function fetchAdminWithdrawal(id: number) {
|
|
const { data } = await apiClient.get<ApiResponse<WithdrawalDetail>>(`/admin/withdrawals/${id}`)
|
|
return data.data
|
|
}
|
|
|
|
export async function reviewWithdrawal(id: number, req: ReviewWithdrawalRequest) {
|
|
const { data } = await apiClient.post<ApiResponse<WithdrawalDetail>>(
|
|
`/admin/withdrawals/${id}/review`,
|
|
req
|
|
)
|
|
return data.data
|
|
}
|
|
|
|
export async function confirmPayment(id: number, req: ConfirmPaymentRequest) {
|
|
const { data } = await apiClient.post<ApiResponse<WithdrawalDetail>>(
|
|
`/admin/withdrawals/${id}/confirm-payment`,
|
|
req
|
|
)
|
|
return data.data
|
|
}
|