更新:增加买书确认订单页面

This commit is contained in:
2025-11-12 16:35:39 +08:00
parent 1daa6367c9
commit d2389b2ed1
11 changed files with 930 additions and 31 deletions

67
types/order.d.ts vendored Normal file
View File

@@ -0,0 +1,67 @@
// types/order.d.ts
/**
* 订单创建参数接口
*/
export interface ICreateOrderParams {
paymentMethod: '4' | '5' // 支付方式: 4-虚拟币, 5-Google Pay
orderMoney: number | string // 订单金额
abroadBookId: number // 图书ID
orderType: 'abroadBook' // 订单类型
}
/**
* Google Pay 验证参数接口
*/
export interface IGooglePayVerifyParams {
purchaseToken: string // 购买凭证
orderSn: string // 订单号
productId: string // 产品ID
}
/**
* 订单创建响应接口
*/
export interface ICreateOrderResponse {
code: number
orderSn: string // 订单号
msg?: string
}
/**
* Google Pay SKU 信息接口
*/
export interface IGooglePaySku {
productId: string
type: string
price: string
price_amount_micros: number
price_currency_code: string
title: string
description: string
}
/**
* Google Pay 支付结果接口
*/
export interface IGooglePayResult {
code: number
data?: Array<{
original: {
purchaseToken: string
orderId: string
packageName: string
productId: string
purchaseTime: number
purchaseState: number
}
}>
}
/**
* 支付方式选项接口
*/
export interface IPaymentOption {
value: '4' | '5'
name: string
}