功能(网页):新增客户体验流程

This commit is contained in:
xiaowang
2026-05-23 21:56:18 +08:00
parent c2c985b2f8
commit 861eea933b
28 changed files with 2236 additions and 108 deletions
+64 -2
View File
@@ -9,7 +9,7 @@ import type { IdType } from '@/utils/id'
* Purpose: OrderItem supports order.ts by holding or executing the order item page or API role.
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
*/
interface OrderItem {
export interface OrderItem {
productId: IdType
quantity: number
artistId?: IdType
@@ -20,12 +20,47 @@ interface OrderItem {
* Purpose: CreateOrderRequest supports order.ts by holding or executing the create order request page or API role.
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
*/
interface CreateOrderRequest {
export interface CreateOrderRequest {
couponId?: IdType
couponSourceType?: string
items: OrderItem[]
}
export type CheckoutPreviewRequest = CreateOrderRequest
export interface CheckoutCouponPreview {
id: IdType
couponId?: IdType
userCouponId?: IdType
sourceType?: string
couponName: string
couponType: number
couponTypeName?: string
discountValue?: number
minAmount?: number
reduceAmount?: number
discountAmount?: number
available?: boolean
best?: boolean
vipAuto?: boolean
displayText?: string
savingText?: string
unavailableReason?: string
startTime?: string
endTime?: string
}
export interface CheckoutPreview {
subtotalAmount: number
savedAmount: number
payableAmount: number
bestCoupon?: CheckoutCouponPreview
availableCoupons: CheckoutCouponPreview[]
unavailableCoupons: CheckoutCouponPreview[]
vipTip?: string
summaryText?: string
}
/**
* Purpose: ArtistCalendarAppointment supports order.ts by holding or executing the artist calendar appointment page or API role.
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
@@ -72,6 +107,7 @@ export interface OrderArtistReviewVO {
status?: number
statusText?: string
submitTime?: string
reviewTime?: string
createTime?: string
}
@@ -115,16 +151,34 @@ export interface OrderArtistChangeRequestVO {
productTitle?: string
shopId?: IdType
userId?: IdType
customerId?: IdType
originalArtistId?: IdType
originalArtistName?: string
requestedArtistId?: IdType
requestedArtistName?: string
fromArtistId?: IdType
fromArtistName?: string
toArtistId?: IdType
toArtistName?: string
requesterId?: IdType
requesterName?: string
status?: string
statusText?: string
reason?: string
rejectReason?: string
appointmentTime?: string
timeAffected?: boolean
timeImpactText?: string
originalPrice?: number | string
newPrice?: number | string
priceAffected?: boolean
priceImpactText?: string
reviewerId?: IdType
messageId?: IdType
reviewTime?: string
approvedTime?: string
rejectedTime?: string
expireTime?: string
createTime?: string
}
@@ -161,6 +215,10 @@ export const orderApi = {
createOrder: (data: CreateOrderRequest) => {
return api.post('/order/create', data)
},
checkoutPreview: async (data: CheckoutPreviewRequest): Promise<CheckoutPreview> => {
return await api.post<CheckoutPreview>('/order/checkout-preview', data) as unknown as CheckoutPreview
},
// 获取订单列表
getOrderList: async (): Promise<any[]> => {
@@ -193,6 +251,10 @@ export const orderApi = {
return await api.get<OrderArtistChangeRequestVO[]>('/order/artist-change/my-pending') as unknown as OrderArtistChangeRequestVO[]
},
getOrderArtistChangeRequests: async (orderId: IdType): Promise<OrderArtistChangeRequestVO[]> => {
return await api.get<OrderArtistChangeRequestVO[]>(`/order/${orderId}/artist-change/requests`) as unknown as OrderArtistChangeRequestVO[]
},
approveArtistChange: async (requestId: IdType): Promise<OrderArtistChangeRequestVO> => {
return await api.put<OrderArtistChangeRequestVO>(`/order/artist-change/${requestId}/approve`) as unknown as OrderArtistChangeRequestVO
},