功能(网页):新增客户体验流程
This commit is contained in:
@@ -491,6 +491,10 @@ export interface Tag {
|
||||
textColor?: string
|
||||
bgColor?: string
|
||||
borderColor?: string
|
||||
sceneGroup?: string
|
||||
displayName?: string
|
||||
sortOrder?: number
|
||||
frontVisible?: number
|
||||
shopId?: IdType
|
||||
shopName?: string
|
||||
type?: number
|
||||
@@ -524,7 +528,7 @@ export const adminTagApi = {
|
||||
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
||||
* @param data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; shopId?: IdType } caller-supplied value for `data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; shopId?: IdType }`
|
||||
*/
|
||||
createTag: (data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; shopId?: IdType }) => {
|
||||
createTag: (data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; sceneGroup?: string; displayName?: string; sortOrder?: number; frontVisible?: number; shopId?: IdType }) => {
|
||||
return adminApi.post<IdType>('/tag/create', data)
|
||||
},
|
||||
/**
|
||||
@@ -533,7 +537,7 @@ export const adminTagApi = {
|
||||
* @param id: IdType caller-supplied value for `id: IdType`
|
||||
* @param data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; shopId?: IdType } caller-supplied value for `data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; shopId?: IdType }`
|
||||
*/
|
||||
updateTag: (id: IdType, data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; shopId?: IdType }) => {
|
||||
updateTag: (id: IdType, data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; sceneGroup?: string; displayName?: string; sortOrder?: number; frontVisible?: number; shopId?: IdType }) => {
|
||||
return adminApi.put<boolean>(`/tag/update/${id}`, data)
|
||||
},
|
||||
/**
|
||||
@@ -711,6 +715,8 @@ export interface Product {
|
||||
shopName?: string
|
||||
title: string
|
||||
description: string
|
||||
targetAudience?: string
|
||||
precautions?: string
|
||||
price: number
|
||||
approximateDuration?: string
|
||||
tags?: string
|
||||
|
||||
@@ -16,10 +16,13 @@ export const WEB_API_AUTH_FREE_PATHS = [
|
||||
'/product/get/',
|
||||
'/product/list/',
|
||||
'/comment/list/product/',
|
||||
'/nail-artist/',
|
||||
'/shop/get/',
|
||||
'/shop/trust-profile/',
|
||||
'/shop/list/public',
|
||||
'/shop/list/simple',
|
||||
'/tag/list/all',
|
||||
'/tag/list/filter-options',
|
||||
'/file/get-signed-url/',
|
||||
'/admin/auth/login',
|
||||
'/admin/auth/login-shops/',
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
import api from './index'
|
||||
import type { IdType } from '@/utils/id'
|
||||
|
||||
export interface NailArtistAvailabilityVO {
|
||||
startTime: string
|
||||
endTime: string
|
||||
dateText: string
|
||||
timeText: string
|
||||
available: boolean
|
||||
}
|
||||
|
||||
export interface NailArtistWorkVO {
|
||||
id: IdType
|
||||
title?: string
|
||||
description?: string
|
||||
price?: number | string
|
||||
coverImageUrl?: string
|
||||
imageUrls?: string[]
|
||||
tags?: string[]
|
||||
likeCount?: number
|
||||
collectCount?: number
|
||||
}
|
||||
|
||||
export interface NailArtistReviewVO {
|
||||
id: IdType
|
||||
artistId: IdType
|
||||
customerId?: IdType
|
||||
customerName?: string
|
||||
customerAvatar?: string
|
||||
productId?: IdType
|
||||
productTitle?: string
|
||||
rating?: number | string
|
||||
content?: string
|
||||
imageFileIds?: IdType[]
|
||||
imageUrls?: string[]
|
||||
submittedAt?: string
|
||||
}
|
||||
|
||||
export interface NailArtistProfileVO {
|
||||
artistId: IdType
|
||||
artistName?: string
|
||||
avatar?: string
|
||||
identity?: string
|
||||
signature?: string
|
||||
experience?: number
|
||||
status?: number
|
||||
shopId?: IdType
|
||||
shopName?: string
|
||||
rating?: number | string
|
||||
serviceCount?: number | string
|
||||
workStartTime?: string
|
||||
workEndTime?: string
|
||||
styleTags?: string[]
|
||||
works?: NailArtistWorkVO[]
|
||||
reviews?: NailArtistReviewVO[]
|
||||
availability?: NailArtistAvailabilityVO[]
|
||||
}
|
||||
|
||||
export const nailArtistApi = {
|
||||
getPublicProfile: async (artistId: IdType): Promise<NailArtistProfileVO> => {
|
||||
return await api.get<NailArtistProfileVO>(`/nail-artist/profile/${artistId}`) as unknown as NailArtistProfileVO
|
||||
},
|
||||
getAvailability: async (artistId: IdType): Promise<NailArtistAvailabilityVO[]> => {
|
||||
return await api.get<NailArtistAvailabilityVO[]>(`/nail-artist/${artistId}/availability`) as unknown as NailArtistAvailabilityVO[]
|
||||
},
|
||||
listReviews: async (artistId: IdType): Promise<NailArtistReviewVO[]> => {
|
||||
return await api.get<NailArtistReviewVO[]>(`/nail-artist/${artistId}/reviews`) as unknown as NailArtistReviewVO[]
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
},
|
||||
|
||||
@@ -16,6 +16,8 @@ export interface ProductVO {
|
||||
name: string
|
||||
title?: string
|
||||
description: string
|
||||
targetAudience?: string
|
||||
precautions?: string
|
||||
image: string
|
||||
imageFileIds?: string
|
||||
imageUrls?: string[]
|
||||
@@ -57,6 +59,8 @@ export interface ListProductsParams {
|
||||
page: number
|
||||
size: number
|
||||
keyword?: string
|
||||
tag?: string
|
||||
tagIds?: string
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,5 +124,9 @@ export const productApi = {
|
||||
keyword: keyword
|
||||
}
|
||||
}) as unknown as ProductVO[]
|
||||
},
|
||||
|
||||
getProductPage: async (params: ListProductsParams): Promise<{ list: ProductVO[]; total: number; page: number; size: number }> => {
|
||||
return await api.get('/product/list/page', { params }) as unknown as { list: ProductVO[]; total: number; page: number; size: number }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,56 @@ export interface ShopSimpleVO {
|
||||
name?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: ShopTrustProfileVO carries public trust signals for a shop detail page.
|
||||
* Usage: fetch it with getTrustProfile and render ratings, recent reviews, environment images, and booking hints.
|
||||
*/
|
||||
export interface ShopTrustProfileVO {
|
||||
shopId: IdType
|
||||
shopName?: string
|
||||
businessHoursText?: string
|
||||
businessStatusText?: string
|
||||
locationAvailable?: boolean
|
||||
distanceCapabilityText?: string
|
||||
navigationAvailable?: boolean
|
||||
stats?: {
|
||||
averageRating?: number
|
||||
reviewCount?: number
|
||||
productCount?: number
|
||||
recentReviewCount?: number
|
||||
}
|
||||
environmentImages?: string[]
|
||||
featuredProducts?: Array<{
|
||||
id: IdType
|
||||
title?: string
|
||||
imageUrl?: string
|
||||
price?: number
|
||||
likeCount?: number
|
||||
collectCount?: number
|
||||
availableBookableArtistCount?: number
|
||||
bookingHint?: string
|
||||
}>
|
||||
recentReviews?: Array<{
|
||||
id: IdType
|
||||
productId?: IdType
|
||||
productTitle?: string
|
||||
ratingScore?: number
|
||||
content?: string
|
||||
imageUrls?: string[]
|
||||
submittedAt?: string
|
||||
}>
|
||||
availabilitySummary?: {
|
||||
available?: boolean
|
||||
summaryText?: string
|
||||
nextSlots?: string[]
|
||||
}
|
||||
contactSummary?: {
|
||||
actionText?: string
|
||||
phoneExposed?: boolean
|
||||
phone?: string
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: ListShopsParams supports shop.ts by holding or executing the list shops params 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.
|
||||
@@ -124,5 +174,9 @@ export const shopApi = {
|
||||
|
||||
getShopById: async (id: IdType): Promise<ShopVO> => {
|
||||
return await api.get<ShopVO>(`/shop/get/${id}`) as unknown as ShopVO
|
||||
},
|
||||
|
||||
getTrustProfile: async (id: IdType): Promise<ShopTrustProfileVO> => {
|
||||
return await api.get<ShopTrustProfileVO>(`/shop/trust-profile/${id}`) as unknown as ShopTrustProfileVO
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,23 @@ export interface TagVO {
|
||||
textColor: string
|
||||
bgColor: string
|
||||
borderColor: string
|
||||
sceneGroup?: string
|
||||
displayName?: string
|
||||
sortOrder?: number
|
||||
frontVisible?: number
|
||||
createTime: string
|
||||
updateTime: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: TagFilterGroupVO groups public tags for scene filters.
|
||||
* Usage: render each group as one filter row and pass selected tag ids to product list APIs.
|
||||
*/
|
||||
export interface TagFilterGroupVO {
|
||||
groupName: string
|
||||
tags: TagVO[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: TagDTO supports tag.ts by holding or executing the tag dto 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.
|
||||
@@ -28,6 +41,10 @@ export interface TagDTO {
|
||||
textColor: string
|
||||
bgColor: string
|
||||
borderColor: string
|
||||
sceneGroup?: string
|
||||
displayName?: string
|
||||
sortOrder?: number
|
||||
frontVisible?: number
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,6 +60,16 @@ export const tagApi = {
|
||||
return api.get<TagVO[]>('/tag/list/all')
|
||||
},
|
||||
|
||||
/**
|
||||
* `getFilterOptions` API call. Use this method to load customer-facing scene filters.
|
||||
* Call guide: optionally pass shopId, await the grouped tags, then query products with tagIds.
|
||||
*/
|
||||
getFilterOptions: (shopId?: IdType | null) => {
|
||||
return api.get<TagFilterGroupVO[]>('/tag/list/filter-options', {
|
||||
params: shopId ? { shopId } : undefined
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* `getTagById` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
||||
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
||||
|
||||
@@ -13,6 +13,10 @@ export interface WishlistItem {
|
||||
id: IdType
|
||||
userId: IdType
|
||||
productId: IdType
|
||||
groupId?: IdType | null
|
||||
groupName?: string | null
|
||||
note?: string | null
|
||||
sortOrder?: number | null
|
||||
product: {
|
||||
id: IdType
|
||||
shopId: IdType | null
|
||||
@@ -35,6 +39,39 @@ export interface WishlistItem {
|
||||
}
|
||||
}
|
||||
|
||||
export interface WishlistGroup {
|
||||
id: IdType
|
||||
name: string
|
||||
sortOrder: number
|
||||
itemCount: number
|
||||
items?: WishlistItem[]
|
||||
}
|
||||
|
||||
export interface WishlistInspiration {
|
||||
total: number
|
||||
groups: WishlistGroup[]
|
||||
}
|
||||
|
||||
export interface WishlistGroupPayload {
|
||||
name: string
|
||||
sortOrder?: number
|
||||
}
|
||||
|
||||
export interface WishlistAddWithGroupPayload {
|
||||
productId: IdType
|
||||
groupId?: IdType | null
|
||||
note?: string
|
||||
sortOrder?: number
|
||||
}
|
||||
|
||||
export interface WishlistMovePayload {
|
||||
wishlistId?: IdType
|
||||
productId?: IdType
|
||||
groupId?: IdType | null
|
||||
note?: string
|
||||
sortOrder?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* wishlistApi groups all API calls for this page domain.
|
||||
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
||||
@@ -54,5 +91,33 @@ export const wishlistApi = {
|
||||
|
||||
getWishlist: async (): Promise<WishlistItem[]> => {
|
||||
return await api.get<WishlistItem[]>('/wishlist/list') as unknown as WishlistItem[]
|
||||
},
|
||||
|
||||
getGroups: async (): Promise<WishlistGroup[]> => {
|
||||
return await api.get<WishlistGroup[]>('/wishlist/groups') as unknown as WishlistGroup[]
|
||||
},
|
||||
|
||||
createGroup: async (payload: WishlistGroupPayload): Promise<IdType> => {
|
||||
return await api.post<IdType>('/wishlist/groups', payload) as unknown as IdType
|
||||
},
|
||||
|
||||
updateGroup: async (id: IdType, payload: WishlistGroupPayload): Promise<boolean> => {
|
||||
return await api.put<boolean>(`/wishlist/groups/${id}`, payload) as unknown as boolean
|
||||
},
|
||||
|
||||
deleteGroup: async (id: IdType): Promise<boolean> => {
|
||||
return await api.delete<boolean>(`/wishlist/groups/${id}`) as unknown as boolean
|
||||
},
|
||||
|
||||
addWithGroup: async (payload: WishlistAddWithGroupPayload): Promise<boolean> => {
|
||||
return await api.post<boolean>('/wishlist/add-with-group', payload) as unknown as boolean
|
||||
},
|
||||
|
||||
moveWishlist: async (payload: WishlistMovePayload): Promise<boolean> => {
|
||||
return await api.post<boolean>('/wishlist/move', payload) as unknown as boolean
|
||||
},
|
||||
|
||||
getInspiration: async (): Promise<WishlistInspiration> => {
|
||||
return await api.get<WishlistInspiration>('/wishlist/inspiration') as unknown as WishlistInspiration
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user