更新:课程确认订单和订单支付功能初步完成
This commit is contained in:
148
types/order.d.ts
vendored
148
types/order.d.ts
vendored
@@ -26,61 +26,127 @@ export interface IOrder {
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单创建参数接口
|
||||
* 课程订单商品信息
|
||||
*/
|
||||
export interface ICreateOrderParams {
|
||||
paymentMethod: '4' | '5' // 支付方式: 4-虚拟币, 5-Google Pay
|
||||
orderMoney: number | string // 订单金额
|
||||
abroadBookId: number // 图书ID
|
||||
orderType: 'abroadBook' // 订单类型
|
||||
export interface IOrderGoods {
|
||||
productId: number
|
||||
productName: string
|
||||
productImages: string
|
||||
price: number
|
||||
vipPrice: number | null
|
||||
activityPrice: number | null
|
||||
isVipPrice: number // 是否有VIP优惠 0-否 1-是
|
||||
productAmount: number // 购买数量
|
||||
goodsType: string // 商品类型 "05" for course
|
||||
}
|
||||
|
||||
/**
|
||||
* Google Pay 验证参数接口
|
||||
* 优惠券实体信息
|
||||
*/
|
||||
export interface IGooglePayVerifyParams {
|
||||
purchaseToken: string // 购买凭证
|
||||
orderSn: string // 订单号
|
||||
productId: string // 产品ID
|
||||
export interface ICouponEntity {
|
||||
id: number
|
||||
couponName: string
|
||||
couponAmount: number
|
||||
useLevel: number // 满多少可用
|
||||
couponRange: number // 0-全场 1-指定课程 2-指定品类
|
||||
remark?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单创建响应接口
|
||||
* 优惠券信息
|
||||
*/
|
||||
export interface ICreateOrderResponse {
|
||||
code: number
|
||||
orderSn: string // 订单号
|
||||
msg?: string
|
||||
export interface ICoupon {
|
||||
id: number
|
||||
couponId: number
|
||||
canUse: number // 0-不可用 1-可用
|
||||
canUseReason?: string
|
||||
effectType: number // 0-永久有效
|
||||
endTime?: string
|
||||
couponEntity: ICouponEntity
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ICourseOrderCreateParams {
|
||||
buyType: number // 0-商品页直接下单 1-购物车结算
|
||||
userId: number
|
||||
paymentMethod: number // 4-天医币
|
||||
orderMoney: number // 订单金额
|
||||
realMoney: number // 实收金额
|
||||
jfDeduction: number // 积分抵扣
|
||||
couponId?: number // 优惠券ID
|
||||
couponName?: string // 优惠券名称
|
||||
vipDiscountAmount: number // VIP折扣金额
|
||||
districtMoney: number // 地区优惠金额
|
||||
remark?: string // 备注
|
||||
productList: Array<{
|
||||
productId: number
|
||||
quantity: number
|
||||
}>
|
||||
orderType: string // "order"
|
||||
addressId: number // 0 for course products
|
||||
appName: string // "wumen"
|
||||
come: number // 2
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单初始化数据
|
||||
*/
|
||||
export interface IOrderInitData {
|
||||
user: {
|
||||
id: number
|
||||
jf: number // 积分
|
||||
peanutCoin: number // 天医币余额
|
||||
vip?: number // VIP状态
|
||||
}
|
||||
is_course: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单路由参数
|
||||
*/
|
||||
export interface IOrderRouteParams {
|
||||
goods: IOrderGoods[]
|
||||
typeId: number
|
||||
sourceType?: string
|
||||
navTitle?: string
|
||||
title?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 价格明细项
|
||||
*/
|
||||
export interface IPriceBreakdownItem {
|
||||
type: number // 1-商品总价 2-运费 3-优惠券 4-积分 5-活动立减 6-VIP立减
|
||||
text: string
|
||||
imgUrl?: string
|
||||
icon?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
*/
|
||||
export interface IOrderState {
|
||||
orderData: IOrderRouteParams
|
||||
goodsList: IOrderGoods[]
|
||||
initData: IOrderInitData | null
|
||||
totalPrice: number
|
||||
vipPrice: number
|
||||
districtAmount: number
|
||||
actualPayment: number
|
||||
jfNumber: number
|
||||
jfNumberMax: number
|
||||
jfNumberShow: string
|
||||
couponList: ICoupon[]
|
||||
selectedCoupon: ICoupon | null
|
||||
showCouponPopup: boolean
|
||||
remark: string
|
||||
showRemarkPopup: boolean
|
||||
payType: number
|
||||
loading: boolean
|
||||
submitting: boolean
|
||||
buyingFlag: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user