93 lines
1.8 KiB
TypeScript
93 lines
1.8 KiB
TypeScript
/**
|
|
* 商品信息
|
|
**/
|
|
export interface IGoods {
|
|
productId: number
|
|
productName: string
|
|
productImages: string
|
|
price: number
|
|
vipPrice: number | null
|
|
activityPrice: number | null
|
|
isVipPrice: number // 是否有VIP优惠 0-否 1-是
|
|
productAmount: number // 购买数量
|
|
delFlag?: number // 删除标记 -1-已下架
|
|
}
|
|
|
|
/**
|
|
* 订单接口
|
|
*/
|
|
export interface IOrder {
|
|
id: number
|
|
orderSn: string
|
|
orderMoney: number
|
|
paymentMethod: string // '4'-虚拟货币, '5'-真实货币
|
|
createTime: string
|
|
[key: string]: any
|
|
}
|
|
|
|
/**
|
|
* 订单创建参数接口
|
|
*/
|
|
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
|
|
}
|