新增: 微信配置-代理充值
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m58s

This commit is contained in:
sexygoat
2026-03-17 14:06:38 +08:00
parent f4ccf9ed24
commit e975e6af4b
19 changed files with 2940 additions and 81 deletions

View File

@@ -0,0 +1,65 @@
/**
* 代理充值相关类型定义
*/
// 充值状态
export enum AgentRechargeStatus {
PENDING = 1, // 待支付
COMPLETED = 2, // 已完成
CANCELLED = 3 // 已取消
}
// 支付方式
export type AgentRechargePaymentMethod = 'wechat' | 'offline'
// 支付通道
export type AgentRechargePaymentChannel = 'wechat_direct' | 'fuyou' | 'offline'
// 代理充值订单
export interface AgentRecharge {
id: number
recharge_no: string
agent_wallet_id: number
shop_id: number
shop_name: string
amount: number // 充值金额(单位:分)
status: AgentRechargeStatus
payment_method: AgentRechargePaymentMethod
payment_channel: AgentRechargePaymentChannel
payment_config_id: number | null
payment_transaction_id: string
created_at: string
paid_at: string | null
completed_at: string | null
updated_at: string
}
// 查询代理充值订单列表参数
export interface AgentRechargeQueryParams {
page?: number
page_size?: number
shop_id?: number
status?: AgentRechargeStatus
start_date?: string
end_date?: string
}
// 代理充值订单列表响应
export interface AgentRechargeListResponse {
page: number
page_size: number
total: number
list: AgentRecharge[]
}
// 创建代理充值订单请求
export interface CreateAgentRechargeRequest {
amount: number // 充值金额(单位:分),范围 10000 ~ 100000000
payment_method: AgentRechargePaymentMethod
shop_id: number
}
// 确认线下充值请求
export interface ConfirmOfflinePaymentRequest {
operation_password: string
}

View File

@@ -79,3 +79,9 @@ export * from './order'
// 资产管理相关
export * from './asset'
// 代理充值相关
export * from './agentRecharge'
// 微信支付配置相关
export * from './wechatConfig'

View File

@@ -17,7 +17,7 @@ export type OrderType = 'single_card' | 'device'
export type BuyerType = 'personal' | 'agent'
// 订单支付方式
export type OrderPaymentMethod = 'wallet' | 'wechat' | 'alipay'
export type OrderPaymentMethod = 'wallet' | 'wechat' | 'alipay' | 'offline'
// 订单佣金状态
export enum OrderCommissionStatus {
@@ -84,7 +84,25 @@ export interface CreateOrderRequest {
package_ids: number[]
iot_card_id?: number | null
device_id?: number | null
payment_method: OrderPaymentMethod // 支付方式
}
// 创建订单响应 (返回订单详情)
export type CreateOrderResponse = Order
// 套餐购买预检请求
export interface PurchaseCheckRequest {
order_type: OrderType // 订单类型 (single_card:单卡购买, device:设备购买)
package_ids: number[] // 套餐ID列表
resource_id: number // 资源ID (IoT卡ID或设备ID)
}
// 套餐购买预检响应
export interface PurchaseCheckResponse {
need_force_recharge: boolean // 是否需要强充
force_recharge_amount?: number // 强充金额(分)
total_package_amount?: number // 套餐总价(分)
actual_payment?: number // 实际支付金额(分)
wallet_credit?: number // 钱包到账金额(分)
message?: string // 提示信息
}

View File

@@ -0,0 +1,135 @@
/**
* 微信支付配置管理相关类型定义
*/
// 支付渠道类型
export type PaymentProviderType = 'wechat' | 'fuiou'
// 微信支付配置
export interface WechatConfig {
id: number
name: string
description: string
provider_type: PaymentProviderType
is_active: boolean
// 小程序配置
miniapp_app_id: string
miniapp_app_secret: string
// 公众号配置
oa_app_id: string
oa_app_secret: string
oa_token: string
oa_aes_key: string
oa_oauth_redirect_url: string
// 微信支付配置
wx_mch_id: string
wx_api_v2_key: string
wx_api_v3_key: string
wx_notify_url: string
wx_serial_no: string
wx_cert_content: string
wx_key_content: string
// 富友支付配置
fy_api_url: string
fy_ins_cd: string
fy_mchnt_cd: string
fy_term_id: string
fy_notify_url: string
fy_private_key: string
fy_public_key: string
created_at: string
updated_at: string
}
// 查询参数
export interface WechatConfigQueryParams {
page?: number
page_size?: number
provider_type?: PaymentProviderType
is_active?: boolean
}
// 列表响应
export interface WechatConfigListResponse {
items: WechatConfig[]
page: number
page_size: number
total: number
}
// 创建微信支付配置请求
export interface CreateWechatConfigRequest {
name: string
provider_type: PaymentProviderType
description?: string
// 小程序配置
miniapp_app_id?: string
miniapp_app_secret?: string
// 公众号配置
oa_app_id?: string
oa_app_secret?: string
oa_token?: string
oa_aes_key?: string
oa_oauth_redirect_url?: string
// 微信支付配置
wx_mch_id?: string
wx_api_v2_key?: string
wx_api_v3_key?: string
wx_notify_url?: string
wx_serial_no?: string
wx_cert_content?: string
wx_key_content?: string
// 富友支付配置
fy_api_url?: string
fy_ins_cd?: string
fy_mchnt_cd?: string
fy_term_id?: string
fy_notify_url?: string
fy_private_key?: string
fy_public_key?: string
}
// 更新微信支付配置请求
export interface UpdateWechatConfigRequest {
name?: string
description?: string
provider_type?: PaymentProviderType
// 小程序配置
miniapp_app_id?: string
miniapp_app_secret?: string
// 公众号配置
oa_app_id?: string
oa_app_secret?: string
oa_token?: string
oa_aes_key?: string
oa_oauth_redirect_url?: string
// 微信支付配置
wx_mch_id?: string
wx_api_v2_key?: string
wx_api_v3_key?: string
wx_notify_url?: string
wx_serial_no?: string
wx_cert_content?: string
wx_key_content?: string
// 富友支付配置
fy_api_url?: string
fy_ins_cd?: string
fy_mchnt_cd?: string
fy_term_id?: string
fy_notify_url?: string
fy_private_key?: string
fy_public_key?: string
}