清理Salon管理页面电商残留
This commit is contained in:
@@ -205,7 +205,6 @@ const checkPopupMessages = async () => {
|
||||
}
|
||||
|
||||
watch(() => route.path, async () => {
|
||||
// 检查当前是否是后台页面,如果是则不加载购物车数据
|
||||
const isAdminPage = route.matched.some(r => r.meta.isAdmin)
|
||||
await refreshShopTheme(isAdminPage ? adminThemeRefreshOptions : customerThemeRefreshOptions)
|
||||
if (!isAdminPage) {
|
||||
|
||||
@@ -578,86 +578,6 @@ export const adminArtistApi = {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: Coupon supports admin.ts by holding or executing the coupon 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.
|
||||
*/
|
||||
export interface Coupon {
|
||||
id: IdType
|
||||
couponCode?: string
|
||||
couponName: string
|
||||
couponType: number
|
||||
couponTypeName?: string
|
||||
discountValue?: string
|
||||
minAmount?: number
|
||||
reduceAmount?: string
|
||||
totalCount?: number
|
||||
usedCount?: number
|
||||
remainingCount?: number
|
||||
startTime: string
|
||||
endTime: string
|
||||
status?: number
|
||||
statusName?: string
|
||||
shopId?: IdType
|
||||
shopName?: string
|
||||
couponScene?: string
|
||||
requiredVipLevel?: string
|
||||
autoMatch?: number
|
||||
availableTags?: Tag[]
|
||||
unavailableTags?: Tag[]
|
||||
createTime: string
|
||||
updateTime: string
|
||||
}
|
||||
|
||||
/**
|
||||
* adminCouponApi 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.
|
||||
*/
|
||||
export const adminCouponApi = {
|
||||
/**
|
||||
* `listAllCoupons` 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.
|
||||
* @param shopId?: IdType caller-supplied value for `shopId?: IdType`
|
||||
*/
|
||||
listAllCoupons: (shopId?: IdType) => {
|
||||
const params = shopId ? { shopId } : {}
|
||||
return adminApi.get<Coupon[]>('/coupon/list/all', { params }) as unknown as Promise<Coupon[]>
|
||||
},
|
||||
/**
|
||||
* `createCoupon` 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.
|
||||
* @param data: any caller-supplied value for `data: any`
|
||||
*/
|
||||
createCoupon: (data: any) => {
|
||||
return adminApi.post<IdType>('/coupon/create', data)
|
||||
},
|
||||
/**
|
||||
* `updateCoupon` 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.
|
||||
* @param id: IdType caller-supplied value for `id: IdType`
|
||||
* @param data: any caller-supplied value for `data: any`
|
||||
*/
|
||||
updateCoupon: (id: IdType, data: any) => {
|
||||
return adminApi.put<boolean>(`/coupon/update/${id}`, data)
|
||||
},
|
||||
/**
|
||||
* `deleteCoupon` 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.
|
||||
* @param id: IdType caller-supplied value for `id: IdType`
|
||||
*/
|
||||
deleteCoupon: (id: IdType) => {
|
||||
return adminApi.delete<boolean>(`/coupon/delete/${id}`)
|
||||
},
|
||||
/**
|
||||
* `distributeCoupon` 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.
|
||||
* @param data: any caller-supplied value for `data: any`
|
||||
*/
|
||||
distributeCoupon: (data: any) => {
|
||||
return adminApi.post<boolean>('/coupon/distribute', null, { params: data })
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: AdminCommentVO supports admin.ts by holding or executing the admin comment vo 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.
|
||||
@@ -719,11 +639,8 @@ export interface Product {
|
||||
imageFileIds?: string
|
||||
imageUrls?: string[]
|
||||
bookableArtists?: string
|
||||
availableCoupons?: string
|
||||
frontVisible?: number
|
||||
sourceType?: string
|
||||
likeCount?: number
|
||||
collectCount?: number
|
||||
createTime: string
|
||||
updateTime: string
|
||||
}
|
||||
@@ -1014,22 +931,6 @@ export interface ArtistScheduleQuery {
|
||||
endDate?: string
|
||||
}
|
||||
|
||||
export interface PaymentOrderVO {
|
||||
id: IdType
|
||||
payNo?: string
|
||||
orderId: IdType
|
||||
orderNo?: string
|
||||
userId?: IdType
|
||||
shopId?: IdType
|
||||
channel?: string
|
||||
status?: string
|
||||
payAmount?: number
|
||||
paidAmount?: number
|
||||
payTime?: string
|
||||
expireTime?: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
export interface AfterSaleVO {
|
||||
id: IdType
|
||||
afterSaleNo?: string
|
||||
@@ -1086,33 +987,6 @@ export interface InventoryAdjustRequest {
|
||||
remark?: string
|
||||
}
|
||||
|
||||
export interface CampaignVO {
|
||||
id: IdType
|
||||
shopId?: IdType
|
||||
title: string
|
||||
description?: string
|
||||
scene?: string
|
||||
productIds?: string
|
||||
couponIds?: string
|
||||
status?: number
|
||||
startTime?: string
|
||||
endTime?: string
|
||||
sortOrder?: number
|
||||
}
|
||||
|
||||
export interface CampaignRequest {
|
||||
shopId?: IdType
|
||||
title?: string
|
||||
description?: string
|
||||
scene?: string
|
||||
productIds?: string
|
||||
couponIds?: string
|
||||
status?: number
|
||||
startTime?: string
|
||||
endTime?: string
|
||||
sortOrder?: number
|
||||
}
|
||||
|
||||
export interface SalonDashboardOverviewVO {
|
||||
date: string
|
||||
degraded?: boolean
|
||||
@@ -1151,14 +1025,6 @@ export const adminArtistScheduleApi = {
|
||||
}
|
||||
}
|
||||
|
||||
export const adminPaymentApi = {
|
||||
manualConfirmOrder: (orderId: IdType, remark?: string) => {
|
||||
return adminApi.post<PaymentOrderVO>(`/payment/order/${orderId}/manual-confirm`, undefined, {
|
||||
params: { remark }
|
||||
}) as unknown as Promise<PaymentOrderVO>
|
||||
}
|
||||
}
|
||||
|
||||
export const adminAfterSaleApi = {
|
||||
listAfterSales: (params: AfterSaleQuery) => {
|
||||
return adminApi.get<PageResult<AfterSaleVO>>('/after-sale/list', { params }) as unknown as Promise<PageResult<AfterSaleVO>>
|
||||
@@ -1183,15 +1049,6 @@ export const adminInventoryApi = {
|
||||
}
|
||||
}
|
||||
|
||||
export const adminCampaignApi = {
|
||||
listCampaigns: (params: { status?: number; page: number; size: number }) => {
|
||||
return adminApi.get<PageResult<CampaignVO>>('/campaign/list', { params }) as unknown as Promise<PageResult<CampaignVO>>
|
||||
},
|
||||
saveCampaign: (data: CampaignRequest) => {
|
||||
return adminApi.post<CampaignVO>('/campaign/save', data) as unknown as Promise<CampaignVO>
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* adminUserApi 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.
|
||||
@@ -1296,110 +1153,6 @@ export const adminUserApi = {
|
||||
getUserInfo: () => {
|
||||
return adminApi.get<UserVO>('/user/info') as unknown as Promise<UserVO>
|
||||
},
|
||||
/**
|
||||
* `getUserAsset` 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.
|
||||
* @param id: IdType caller-supplied value for `id: IdType`
|
||||
*/
|
||||
getUserAsset: (id: IdType) => {
|
||||
return adminApi.get<UserAssetVO>(`/user/${id}/asset`) as unknown as Promise<UserAssetVO>
|
||||
},
|
||||
/**
|
||||
* `getUserBalanceHistory` 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.
|
||||
* @param id: IdType caller-supplied value for `id: IdType`
|
||||
*/
|
||||
getUserBalanceHistory: (id: IdType) => {
|
||||
return adminApi.get<UserBalanceHistoryItem[]>(`/user/${id}/balance/history`) as unknown as Promise<UserBalanceHistoryItem[]>
|
||||
},
|
||||
/**
|
||||
* `changeUserBalance` 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.
|
||||
* @param id: IdType caller-supplied value for `id: IdType`
|
||||
* @param data: AdminUserBalanceChangeRequest caller-supplied value for `data: AdminUserBalanceChangeRequest`
|
||||
*/
|
||||
changeUserBalance: (id: IdType, data: AdminUserBalanceChangeRequest) => {
|
||||
return adminApi.post<UserAssetVO>(`/user/${id}/balance/change`, data) as unknown as Promise<UserAssetVO>
|
||||
},
|
||||
/**
|
||||
* `overrideUserVip` 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.
|
||||
* @param id: IdType caller-supplied value for `id: IdType`
|
||||
* @param data: AdminUserVipOverrideRequest caller-supplied value for `data: AdminUserVipOverrideRequest`
|
||||
*/
|
||||
overrideUserVip: (id: IdType, data: AdminUserVipOverrideRequest) => {
|
||||
return adminApi.post<UserAssetVO>(`/user/${id}/vip/override`, data) as unknown as Promise<UserAssetVO>
|
||||
},
|
||||
/**
|
||||
* `recalculateUserVip` 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.
|
||||
* @param id: IdType caller-supplied value for `id: IdType`
|
||||
*/
|
||||
recalculateUserVip: (id: IdType) => {
|
||||
return adminApi.post<UserAssetVO>(`/user/${id}/vip/recalculate`) as unknown as Promise<UserAssetVO>
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: UserAssetVO supports admin.ts by holding or executing the user asset vo 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.
|
||||
*/
|
||||
export interface UserAssetVO {
|
||||
userId: IdType
|
||||
nickname: string
|
||||
balance: number
|
||||
totalRechargeAmount: number
|
||||
lastRechargeTime?: string
|
||||
vipInfoId?: IdType
|
||||
vipLevel: string
|
||||
benefitId?: IdType
|
||||
benefitInfo?: string
|
||||
manualOverride: boolean
|
||||
vipStartTime?: string
|
||||
vipExpireTime?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: UserBalanceHistoryItem supports admin.ts by holding or executing the user balance history 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.
|
||||
*/
|
||||
export interface UserBalanceHistoryItem {
|
||||
id: IdType
|
||||
userId: IdType
|
||||
userNickname?: string
|
||||
amount: number
|
||||
type?: string
|
||||
currentBalance?: number
|
||||
beforeBalance?: number
|
||||
afterBalance?: number
|
||||
changeScene?: string
|
||||
relatedOrderId?: IdType
|
||||
relatedOrderNo?: string
|
||||
externalOrderNo?: string
|
||||
operatorId?: IdType
|
||||
remark?: string
|
||||
changeTime: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: AdminUserBalanceChangeRequest supports admin.ts by holding or executing the admin user balance change 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.
|
||||
*/
|
||||
export interface AdminUserBalanceChangeRequest {
|
||||
amount: number
|
||||
changeScene: string
|
||||
relatedOrderId?: IdType
|
||||
externalOrderNo?: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: AdminUserVipOverrideRequest supports admin.ts by holding or executing the admin user vip override 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.
|
||||
*/
|
||||
export interface AdminUserVipOverrideRequest {
|
||||
vipLevel: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1486,9 +1239,6 @@ export const adminOrderApi = {
|
||||
updateOrderStatus: (id: IdType, status: number) => {
|
||||
return adminApi.put<boolean>(`/order/update-status/${id}`, {}, { params: { status } })
|
||||
},
|
||||
manualConfirmPayment: (id: IdType, remark?: string) => {
|
||||
return adminPaymentApi.manualConfirmOrder(id, remark)
|
||||
},
|
||||
submitQuote: (id: IdType, data: { remark?: string; items: Array<{ orderItemId: IdType; quotedPrice: number }> }) => {
|
||||
return adminApi.post<OrderVO>(`/order/${id}/quote`, data)
|
||||
},
|
||||
@@ -1720,91 +1470,6 @@ export const adminAnnouncementApi = {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: VipRechargePlanVO supports admin.ts by holding or executing the vip recharge plan vo 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.
|
||||
*/
|
||||
export interface VipRechargePlanVO {
|
||||
id: IdType
|
||||
shopId: IdType
|
||||
shopName?: string
|
||||
title: string
|
||||
rechargeAmount: number
|
||||
giftAmount: number
|
||||
vipLevel: string
|
||||
description?: string
|
||||
sortOrder?: number
|
||||
status: number
|
||||
createTime?: string
|
||||
updateTime?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: VipRechargePlanRequest supports admin.ts by holding or executing the vip recharge plan 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.
|
||||
*/
|
||||
export interface VipRechargePlanRequest {
|
||||
shopId?: IdType
|
||||
title: string
|
||||
rechargeAmount: number
|
||||
giftAmount: number
|
||||
vipLevel: string
|
||||
description?: string
|
||||
sortOrder?: number
|
||||
status?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* adminVipRechargePlanApi 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.
|
||||
*/
|
||||
export const adminVipRechargePlanApi = {
|
||||
/**
|
||||
* `listPlans` 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.
|
||||
* @param shopId?: IdType caller-supplied value for `shopId?: IdType`
|
||||
*/
|
||||
listPlans: (shopId?: IdType) => {
|
||||
const params = shopId ? { shopId } : {}
|
||||
return adminApi.get<VipRechargePlanVO[]>('/vip-recharge-plan/admin/list', { params }) as unknown as Promise<VipRechargePlanVO[]>
|
||||
},
|
||||
/**
|
||||
* `createPlan` 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.
|
||||
* @param data: VipRechargePlanRequest caller-supplied value for `data: VipRechargePlanRequest`
|
||||
*/
|
||||
createPlan: (data: VipRechargePlanRequest) => {
|
||||
return adminApi.post<IdType>('/vip-recharge-plan/admin/create', data)
|
||||
},
|
||||
/**
|
||||
* `updatePlan` 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.
|
||||
* @param id: IdType caller-supplied value for `id: IdType`
|
||||
* @param data: VipRechargePlanRequest caller-supplied value for `data: VipRechargePlanRequest`
|
||||
*/
|
||||
updatePlan: (id: IdType, data: VipRechargePlanRequest) => {
|
||||
return adminApi.put<boolean>(`/vip-recharge-plan/admin/${id}`, data)
|
||||
},
|
||||
/**
|
||||
* `updateStatus` 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.
|
||||
* @param id: IdType caller-supplied value for `id: IdType`
|
||||
* @param status: number caller-supplied value for `status: number`
|
||||
*/
|
||||
updateStatus: (id: IdType, status: number) => {
|
||||
return adminApi.put<boolean>(`/vip-recharge-plan/admin/${id}/status`, null, { params: { status } })
|
||||
},
|
||||
/**
|
||||
* `listVipLevelOptions` 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.
|
||||
* @param shopId?: IdType caller-supplied value for `shopId?: IdType`
|
||||
*/
|
||||
listVipLevelOptions: (shopId?: IdType) => {
|
||||
const params = shopId ? { shopId } : {}
|
||||
return adminApi.get<string[]>('/vip-recharge-plan/admin/vip-level-options', { params }) as unknown as Promise<string[]>
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: MessageHubPushConfigVO supports admin.ts by holding or executing the message hub push config vo 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,14 +28,11 @@ export interface ProductVO {
|
||||
bookableArtists?: string
|
||||
availableBookableArtistCount?: number
|
||||
bookableArtistRestricted?: boolean
|
||||
availableCoupons?: string
|
||||
category: string
|
||||
tags?: string
|
||||
tagList?: string[]
|
||||
tagInfos?: TagInfo[]
|
||||
status: number
|
||||
likeCount?: number
|
||||
collectCount?: number
|
||||
createTime: string
|
||||
updateTime: string
|
||||
}
|
||||
@@ -111,14 +108,6 @@ export const productApi = {
|
||||
return await api.get<ProductVO[]>(`/product/list/tag/${tag}`) as unknown as ProductVO[]
|
||||
},
|
||||
|
||||
likeProduct: async (productId: IdType): Promise<boolean> => {
|
||||
return await api.post<boolean>(`/product-like/like/${productId}`) as unknown as boolean
|
||||
},
|
||||
|
||||
unlikeProduct: async (productId: IdType): Promise<boolean> => {
|
||||
return await api.post<boolean>(`/product-like/unlike/${productId}`) as unknown as boolean
|
||||
},
|
||||
|
||||
searchProducts: async (keyword: string): Promise<ProductVO[]> => {
|
||||
return await api.get<ProductVO[]>('/product/list/search', {
|
||||
params: {
|
||||
|
||||
@@ -206,46 +206,6 @@ export interface UpdatePhoneRequest {
|
||||
verificationCode: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: UserAssetVO supports user.ts by holding or executing the user asset vo 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.
|
||||
*/
|
||||
export interface UserAssetVO {
|
||||
userId: IdType
|
||||
nickname: string
|
||||
balance: number
|
||||
totalRechargeAmount: number
|
||||
lastRechargeTime?: string
|
||||
vipInfoId?: IdType
|
||||
vipLevel: string
|
||||
benefitId?: IdType
|
||||
benefitInfo?: string
|
||||
manualOverride?: boolean
|
||||
vipStartTime?: string
|
||||
vipExpireTime?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: BalanceHistoryItem supports user.ts by holding or executing the balance history 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.
|
||||
*/
|
||||
export interface BalanceHistoryItem {
|
||||
id: IdType
|
||||
userId: IdType
|
||||
userNickname?: string
|
||||
amount: number
|
||||
type?: string
|
||||
currentBalance?: number
|
||||
beforeBalance?: number
|
||||
afterBalance?: number
|
||||
changeScene?: string
|
||||
relatedOrderId?: IdType
|
||||
relatedOrderNo?: string
|
||||
externalOrderNo?: string
|
||||
remark?: string
|
||||
changeTime?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: SystemMessageVO supports user.ts by holding or executing the system message vo 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.
|
||||
@@ -284,23 +244,6 @@ export interface AnnouncementVO {
|
||||
publishTime?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: VipRechargePlanVO supports user.ts by holding or executing the vip recharge plan vo 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.
|
||||
*/
|
||||
export interface VipRechargePlanVO {
|
||||
id: IdType
|
||||
shopId: IdType
|
||||
shopName?: string
|
||||
title: string
|
||||
rechargeAmount: number
|
||||
giftAmount: number
|
||||
vipLevel: string
|
||||
description?: string
|
||||
sortOrder?: number
|
||||
status: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: ContactInfoVO supports user.ts by holding or executing the contact info vo 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.
|
||||
@@ -398,12 +341,6 @@ export const userApi = {
|
||||
switchShop: (shopId?: string | number) => {
|
||||
return api.post('/user/switch-shop', { shopId })
|
||||
},
|
||||
getMyAsset: async (): Promise<UserAssetVO> => {
|
||||
return await api.get<UserAssetVO>('/user/asset/me') as unknown as UserAssetVO
|
||||
},
|
||||
getMyBalanceHistory: async (): Promise<BalanceHistoryItem[]> => {
|
||||
return await api.get<BalanceHistoryItem[]>('/user/balance/history/me') as unknown as BalanceHistoryItem[]
|
||||
},
|
||||
listMyMessages: async (): Promise<SystemMessageVO[]> => {
|
||||
return await api.get<SystemMessageVO[]>('/system-message/my/list') as unknown as SystemMessageVO[]
|
||||
},
|
||||
@@ -435,9 +372,6 @@ export const userApi = {
|
||||
listMyAnnouncements: async (): Promise<AnnouncementVO[]> => {
|
||||
return await api.get<AnnouncementVO[]>('/announcement/my/list') as unknown as AnnouncementVO[]
|
||||
},
|
||||
listMyVipRechargePlans: async (): Promise<VipRechargePlanVO[]> => {
|
||||
return await api.get<VipRechargePlanVO[]>('/vip-recharge-plan/my/list') as unknown as VipRechargePlanVO[]
|
||||
},
|
||||
getMyRelation: async (): Promise<UserRelationVO> => {
|
||||
return await api.get<UserRelationVO>('/user/relation/me') as unknown as UserRelationVO
|
||||
},
|
||||
|
||||
@@ -3,7 +3,6 @@ import { computed, onMounted, ref, shallowRef } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import {
|
||||
CalendarOutlined,
|
||||
HeartOutlined,
|
||||
LeftOutlined,
|
||||
MessageOutlined,
|
||||
SafetyCertificateOutlined,
|
||||
@@ -166,8 +165,6 @@ const mapProductToWork = (product: ProductVO): NailArtistWorkVO & { imageFileIds
|
||||
imageUrls: product.imageUrls,
|
||||
imageFileIds: product.imageFileIds,
|
||||
tags: product.tagList || product.tags?.split(/[;,,、]/).map(tag => tag.trim()).filter(Boolean),
|
||||
likeCount: product.likeCount,
|
||||
collectCount: product.collectCount
|
||||
})
|
||||
|
||||
const loadSupplementWorks = async (existingWorks: NailArtistWorkVO[]): Promise<NailArtistWorkVO[]> => {
|
||||
@@ -433,10 +430,6 @@ onMounted(loadProfile)
|
||||
<MessageOutlined />
|
||||
<span>咨询</span>
|
||||
</button>
|
||||
<button type="button" class="bar-icon-btn" @click="message.info('收藏功能即将开放')">
|
||||
<HeartOutlined />
|
||||
<span>收藏</span>
|
||||
</button>
|
||||
<button type="button" class="book-btn" @click="handleBookNow">
|
||||
<CalendarOutlined />
|
||||
<span>立即预约</span>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<a-input-search
|
||||
v-model:value="keyword"
|
||||
class="admin-toolbar__grow"
|
||||
placeholder="搜索订单号、用户 ID 或优惠券"
|
||||
placeholder="搜索订单号、用户 ID、客户或款式"
|
||||
@search="loadOrders"
|
||||
/>
|
||||
</div>
|
||||
@@ -76,14 +76,6 @@
|
||||
<template v-else-if="column.key === 'actions'">
|
||||
<a-space>
|
||||
<a-button type="link" size="small" @click="openDetail(record)">查看</a-button>
|
||||
<a-button
|
||||
v-if="canManualConfirmPayment(record)"
|
||||
type="link"
|
||||
size="small"
|
||||
@click="openManualPay(record)"
|
||||
>
|
||||
手动确认支付
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="canOpenAfterSales(record)"
|
||||
type="link"
|
||||
@@ -150,10 +142,6 @@
|
||||
<span>实付金额</span>
|
||||
<strong>{{ formatMoney(item.actualAmount) }}</strong>
|
||||
</div>
|
||||
<div class="admin-mobile-card__row">
|
||||
<span>优惠券</span>
|
||||
<strong>{{ item.couponName || '无' }}</strong>
|
||||
</div>
|
||||
<div class="admin-mobile-card__row">
|
||||
<span>预约项目</span>
|
||||
<strong>{{ item.items?.length || 0 }} 个</strong>
|
||||
@@ -161,13 +149,6 @@
|
||||
</div>
|
||||
<div class="admin-mobile-card__actions">
|
||||
<a-button size="small" @click="openDetail(item)">查看详情</a-button>
|
||||
<a-button
|
||||
v-if="canManualConfirmPayment(item)"
|
||||
size="small"
|
||||
@click="openManualPay(item)"
|
||||
>
|
||||
确认支付
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="canOpenAfterSales(item)"
|
||||
size="small"
|
||||
@@ -211,7 +192,6 @@
|
||||
<a-descriptions-item label="用户ID">{{ currentOrder.userId }}</a-descriptions-item>
|
||||
<a-descriptions-item label="订单总额">{{ formatMoney(currentOrder.totalAmount) }}</a-descriptions-item>
|
||||
<a-descriptions-item label="实付金额">{{ formatMoney(currentOrder.actualAmount) }}</a-descriptions-item>
|
||||
<a-descriptions-item label="优惠券">{{ currentOrder.couponName || '无' }}</a-descriptions-item>
|
||||
<a-descriptions-item label="订单状态">{{ orderStatusText(currentOrder) }}</a-descriptions-item>
|
||||
<a-descriptions-item label="订单来源">{{ currentOrder.orderSource === 'HISTORICAL_BACKFILL' ? '历史补单' : '正常订单' }}</a-descriptions-item>
|
||||
<a-descriptions-item label="创建时间" :span="isMobile ? 1 : 2">{{ currentOrder.createTime }}</a-descriptions-item>
|
||||
@@ -351,28 +331,6 @@
|
||||
</template>
|
||||
</AdminResponsiveModal>
|
||||
|
||||
<AdminResponsiveModal
|
||||
v-model:open="manualPayOpen"
|
||||
title="手动确认支付"
|
||||
:desktop-width="560"
|
||||
:confirm-loading="manualPayLoading"
|
||||
@ok="submitManualPay"
|
||||
@cancel="closeManualPay"
|
||||
>
|
||||
<a-form layout="vertical">
|
||||
<a-alert
|
||||
v-if="manualPayOrder"
|
||||
class="order-action-alert"
|
||||
type="warning"
|
||||
show-icon
|
||||
:message="manualPayOrder.orderNo"
|
||||
:description="`将把订单标记为已支付,实付金额 ¥${moneyText(manualPayOrder.actualAmount || manualPayOrder.totalAmount)}`"
|
||||
/>
|
||||
<a-form-item label="确认备注">
|
||||
<a-textarea v-model:value="manualPayRemark" :rows="3" :maxlength="200" placeholder="例如:线下现金已核验" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</AdminResponsiveModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -418,10 +376,6 @@ const shopLoading = ref(false)
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const currentOrder = ref<any | null>(null)
|
||||
const manualPayOpen = ref(false)
|
||||
const manualPayLoading = ref(false)
|
||||
const manualPayOrder = ref<any | null>(null)
|
||||
const manualPayRemark = ref('')
|
||||
const quoteSubmitting = ref(false)
|
||||
const quoteConfirming = ref(false)
|
||||
const quoteForm = reactive({
|
||||
@@ -502,7 +456,6 @@ const detailVisible = computed({
|
||||
})
|
||||
/** canProcessOrders is a reactive state variable used by the template and event handlers. */
|
||||
const canProcessOrders = computed(() => hasPermission('order:process'))
|
||||
const canManagePayments = computed(() => hasPermission('payment:manage'))
|
||||
const canViewAfterSales = computed(() => hasPermission('after_sale:view'))
|
||||
/** isArtist is a reactive state variable used by the template and event handlers. */
|
||||
const isArtist = computed(() => currentUserType.value === 3)
|
||||
@@ -552,7 +505,6 @@ const filteredOrders = computed(() => {
|
||||
const haystack = [
|
||||
order.orderNo,
|
||||
order.userId,
|
||||
order.couponName,
|
||||
order.customerRemark,
|
||||
order.quoteStatusText,
|
||||
...(order.items || []).map((item: any) => `${item.productTitle || ''} ${item.artistName || ''}`)
|
||||
@@ -613,7 +565,6 @@ const columns = [
|
||||
{ title: '用户ID', dataIndex: 'userId', key: 'userId', width: 100 },
|
||||
{ title: '订单总额', key: 'totalAmount', width: 120 },
|
||||
{ title: '实付金额', key: 'actualAmount', width: 120 },
|
||||
{ title: '优惠券', dataIndex: 'couponName', key: 'couponName', width: 140 },
|
||||
{ title: '状态', key: 'status', width: 100 },
|
||||
{ title: '创建时间', dataIndex: 'createTime', key: 'createTime', width: 180 },
|
||||
{ title: '操作', key: 'actions', width: 180 }
|
||||
@@ -651,11 +602,6 @@ const isQuoteOrder = (order: any) => Number(order?.status) === 0
|
||||
|
||||
const orderStatusText = (order: any) => order?.statusText || (isQuoteOrder(order) ? '确认价格中' : '--')
|
||||
|
||||
const moneyText = (value?: unknown) => {
|
||||
const amount = Number(value ?? 0)
|
||||
return Number.isFinite(amount) ? amount.toFixed(2) : '0.00'
|
||||
}
|
||||
|
||||
const formatMoney = (value?: unknown) => {
|
||||
if (value === undefined || value === null || value === '') return '--'
|
||||
const amount = Number(value)
|
||||
@@ -705,10 +651,6 @@ const canQuoteOrder = (order: any) => {
|
||||
|
||||
const canQuoteCurrentOrder = computed(() => canQuoteOrder(currentOrder.value))
|
||||
|
||||
const canManualConfirmPayment = (order: any) => {
|
||||
return canManagePayments.value && !isQuoteOrder(order) && order?.paymentStatus !== 'PAID'
|
||||
}
|
||||
|
||||
const canOpenAfterSales = (order: any) => canViewAfterSales.value && !isQuoteOrder(order)
|
||||
|
||||
const quoteHistory = (order: any) => Array.isArray(order?.quoteMessages) ? order.quoteMessages : []
|
||||
@@ -912,36 +854,6 @@ const process = async (orderId: IdType, status: number) => {
|
||||
}
|
||||
}
|
||||
|
||||
const openManualPay = (order: any) => {
|
||||
manualPayOrder.value = order
|
||||
manualPayRemark.value = ''
|
||||
manualPayOpen.value = true
|
||||
}
|
||||
|
||||
const closeManualPay = () => {
|
||||
manualPayOpen.value = false
|
||||
manualPayOrder.value = null
|
||||
manualPayRemark.value = ''
|
||||
}
|
||||
|
||||
const submitManualPay = async () => {
|
||||
if (!manualPayOrder.value) return
|
||||
manualPayLoading.value = true
|
||||
try {
|
||||
await runWithGlobalLoading(async () => {
|
||||
await adminOrderApi.manualConfirmPayment(manualPayOrder.value.id, manualPayRemark.value.trim() || undefined)
|
||||
await loadOrders()
|
||||
})
|
||||
message.success('支付已确认')
|
||||
closeManualPay()
|
||||
} catch (error: any) {
|
||||
console.error('手动确认支付失败:', error)
|
||||
message.error(error?.message || '手动确认支付失败')
|
||||
} finally {
|
||||
manualPayLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const openAfterSales = (order: any) => {
|
||||
router.push({
|
||||
path: '/admin/after-sales',
|
||||
|
||||
@@ -49,9 +49,6 @@
|
||||
{{ shop.shopName }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-select v-model:value="vipLevelFilter" allow-clear placeholder="VIP等级" style="width: 140px" @change="handleSearch">
|
||||
<a-select-option v-for="level in vipLevelOptions" :key="level" :value="level">{{ level }}</a-select-option>
|
||||
</a-select>
|
||||
<a-select v-model:value="statusFilter" allow-clear placeholder="账号状态" style="width: 140px" @change="handleSearch">
|
||||
<a-select-option :value="1">启用</a-select-option>
|
||||
<a-select-option :value="0">停用</a-select-option>
|
||||
@@ -115,14 +112,6 @@
|
||||
<a-button v-if="hasPermission('user:edit')" type="link" size="small" @click="showEditModal(record)">
|
||||
编辑
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="canOpenAssetPanel"
|
||||
type="link"
|
||||
size="small"
|
||||
@click="showAssetModal(record)"
|
||||
>
|
||||
余额/VIP
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="hasPermission('user:reset_password')"
|
||||
type="link"
|
||||
@@ -174,10 +163,6 @@
|
||||
<span>所属店铺</span>
|
||||
<strong>{{ getShopDisplay(item) || '-' }}</strong>
|
||||
</div>
|
||||
<div class="admin-mobile-card__row">
|
||||
<span>VIP 等级</span>
|
||||
<strong>{{ item.level || '普通' }}</strong>
|
||||
</div>
|
||||
<div class="admin-mobile-card__row">
|
||||
<span>状态</span>
|
||||
<strong>{{ item.status === 1 ? '正常' : '禁用' }}</strong>
|
||||
@@ -186,7 +171,6 @@
|
||||
<div class="admin-mobile-card__actions">
|
||||
<a-button v-if="hasPermission('user:view')" size="small" @click="showViewModal(item)">查看</a-button>
|
||||
<a-button v-if="hasPermission('user:edit')" size="small" @click="showEditModal(item)">编辑</a-button>
|
||||
<a-button v-if="canOpenAssetPanel" size="small" @click="showAssetModal(item)">余额/VIP</a-button>
|
||||
<a-button v-if="hasPermission('user:reset_password')" size="small" @click="handleResetPassword(item)">
|
||||
重置密码
|
||||
</a-button>
|
||||
@@ -342,15 +326,13 @@
|
||||
<a-descriptions-item label="手机号">{{ viewRecord?.phone || '-' }}</a-descriptions-item>
|
||||
<a-descriptions-item label="所属店铺">{{ getShopDisplay(viewRecord) || '-' }}</a-descriptions-item>
|
||||
<a-descriptions-item label="用户类型">{{ getUserTypeText(viewRecord?.type || 0) }}</a-descriptions-item>
|
||||
<a-descriptions-item label="VIP 等级">{{ viewRecord?.level || '普通' }}</a-descriptions-item>
|
||||
<a-descriptions-item label="状态">{{ viewRecord?.status === 1 ? '正常' : '禁用' }}</a-descriptions-item>
|
||||
<a-descriptions-item label="创建时间">{{ viewRecord?.createTime || '-' }}</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</AdminResponsiveModal>
|
||||
|
||||
<AdminResponsiveModal
|
||||
<AdminMobileFab
|
||||
:visible="isMobile && canCreateUser && !modalVisible && !viewModalVisible && !assetModalVisible"
|
||||
:visible="isMobile && canCreateUser && !modalVisible && !viewModalVisible"
|
||||
label="新增店长"
|
||||
@click="showAddModal"
|
||||
/>
|
||||
@@ -362,7 +344,7 @@
|
||||
* UsersView page script.
|
||||
* Call guide: the template binds the reactive state below, and the methods are triggered by button clicks, lifecycle hooks, or router events.
|
||||
*/
|
||||
import { computed, h, onMounted, reactive, ref } from 'vue'
|
||||
import { computed, h, onMounted, reactive, ref, watch } from 'vue'
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import type { FormInstance, UploadProps } from 'ant-design-vue'
|
||||
import { PlusOutlined } from '@ant-design/icons-vue'
|
||||
@@ -380,15 +362,9 @@ import {
|
||||
adminShopApi,
|
||||
adminSystemParameterConfigApi,
|
||||
adminUserApi,
|
||||
adminVipRechargePlanApi,
|
||||
type AdminUserBalanceChangeRequest,
|
||||
type AdminUserVipOverrideRequest,
|
||||
type Shop,
|
||||
type UserAssetVO,
|
||||
type UserBalanceHistoryItem,
|
||||
type UserVO
|
||||
} from '@/api/admin'
|
||||
import type { IdType } from '@/utils/id'
|
||||
import { sameId } from '@/utils/id'
|
||||
import { usePermission } from '@/utils/permission'
|
||||
import { runWithGlobalLoading } from '@/utils/action-loading'
|
||||
@@ -399,7 +375,7 @@ import AdminMobileFab from '@/components/admin/AdminMobileFab.vue'
|
||||
import AdminFilterPanel from '@/components/admin/AdminFilterPanel.vue'
|
||||
import AdminResponsiveModal from '@/components/admin/AdminResponsiveModal.vue'
|
||||
|
||||
const { hasPermission, hasAnyPermission, loadUserPermissions } = usePermission()
|
||||
const { hasPermission, loadUserPermissions } = usePermission()
|
||||
const { isMobile } = useAdminViewport()
|
||||
const FALLBACK_ADMIN_DEFAULT_PASSWORD = 'Fingertip@123'
|
||||
|
||||
@@ -502,11 +478,6 @@ const shopFilter = ref<string | undefined>()
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const typeFilter = ref<number | undefined>(2)
|
||||
/**
|
||||
* Purpose: vipLevelFilter supports UsersView.vue by holding or executing the vip level filter page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const vipLevelFilter = ref<string | undefined>()
|
||||
/**
|
||||
* Purpose: statusFilter supports UsersView.vue by holding or executing the status filter page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
@@ -542,11 +513,6 @@ const userList = ref<UserVO[]>([])
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const shopList = ref<Shop[]>([])
|
||||
/**
|
||||
* Purpose: vipLevelOptions supports UsersView.vue by holding or executing the vip level options page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const vipLevelOptions = ref<string[]>(['普通', '青铜', '白银', '黄金'])
|
||||
/**
|
||||
* Purpose: currentUser supports UsersView.vue by holding or executing the current user page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
@@ -563,42 +529,6 @@ const viewRecord = ref<UserVO | null>(null)
|
||||
*/
|
||||
const draftSavedAt = ref<number | null>(null)
|
||||
|
||||
/** assetModalVisible is a reactive state variable used by the template and event handlers. */
|
||||
const assetModalVisible = ref(false)
|
||||
/** assetLoading is a reactive state variable used by the template and event handlers. */
|
||||
const assetLoading = ref(false)
|
||||
/** assetSaving is a reactive state variable used by the template and event handlers. */
|
||||
const assetSaving = ref(false)
|
||||
/**
|
||||
* Purpose: assetTargetUser supports UsersView.vue by holding or executing the asset target user page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const assetTargetUser = ref<UserVO | null>(null)
|
||||
/**
|
||||
* Purpose: assetData supports UsersView.vue by holding or executing the asset data page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const assetData = ref<UserAssetVO | null>(null)
|
||||
/**
|
||||
* Purpose: balanceHistory supports UsersView.vue by holding or executing the balance history page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const balanceHistory = ref<UserBalanceHistoryItem[]>([])
|
||||
/**
|
||||
* Purpose: balanceDraftSavedAt supports UsersView.vue by holding or executing the balance draft saved at page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const balanceDraftSavedAt = ref<number | null>(null)
|
||||
/**
|
||||
* Purpose: vipDraftSavedAt supports UsersView.vue by holding or executing the vip draft saved at page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const vipDraftSavedAt = ref<number | null>(null)
|
||||
|
||||
/** canOpenAssetPanel is a reactive state variable used by the template and event handlers. */
|
||||
const canOpenAssetPanel = computed(() =>
|
||||
hasAnyPermission(['user:balance:view', 'user:balance:manage', 'user:vip:manage'])
|
||||
)
|
||||
/** currentUserType is a reactive state variable used by the template and event handlers. */
|
||||
const currentUserType = computed(() => normalizeUserType(currentUserInfo?.type))
|
||||
/** availableUserTypeOptions is a reactive state variable used by the template and event handlers. */
|
||||
@@ -641,7 +571,6 @@ const activeMobileFilterCount = computed(() => {
|
||||
const values = [
|
||||
currentUserType.value === 4 ? shopFilter.value : undefined,
|
||||
typeFilter.value,
|
||||
vipLevelFilter.value,
|
||||
statusFilter.value,
|
||||
createdRange.value,
|
||||
hasPhoneFilter.value,
|
||||
@@ -805,106 +734,6 @@ const validateOptionalPasswordStrength = (value?: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: balanceForm supports UsersView.vue by holding or executing the balance form page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const balanceForm = reactive<AdminUserBalanceChangeRequest>({
|
||||
changeScene: 'RECHARGE',
|
||||
amount: undefined as unknown as number,
|
||||
relatedOrderId: undefined,
|
||||
externalOrderNo: '',
|
||||
remark: ''
|
||||
})
|
||||
|
||||
/**
|
||||
* Purpose: vipForm supports UsersView.vue by holding or executing the vip form page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const vipForm = reactive<AdminUserVipOverrideRequest>({
|
||||
vipLevel: '普通',
|
||||
remark: ''
|
||||
})
|
||||
|
||||
/** getBalanceDraftKey is a local helper used by this page script. */
|
||||
const getBalanceDraftKey = () => buildDraftStorageKey('admin-user-assets', 'balance', assetTargetUser.value?.id ?? 'unknown')
|
||||
/** getVipDraftKey is a local helper used by this page script. */
|
||||
const getVipDraftKey = () => buildDraftStorageKey('admin-user-assets', 'vip', assetTargetUser.value?.id ?? 'unknown')
|
||||
|
||||
/** restoreBalanceDraft is a local helper used by this page script. */
|
||||
const restoreBalanceDraft = () => {
|
||||
const draft = loadDraftRecord<{
|
||||
changeScene: string
|
||||
amount?: number
|
||||
relatedOrderId?: number
|
||||
externalOrderNo: string
|
||||
remark: string
|
||||
}>(getBalanceDraftKey())
|
||||
if (!draft) {
|
||||
balanceDraftSavedAt.value = null
|
||||
return
|
||||
}
|
||||
Object.assign(balanceForm, draft.payload)
|
||||
balanceDraftSavedAt.value = draft.savedAt
|
||||
message.success('已恢复余额变动暂存')
|
||||
}
|
||||
|
||||
/** handleSaveBalanceDraft is a local helper used by this page script. */
|
||||
const handleSaveBalanceDraft = () => {
|
||||
const draft = saveDraftRecord(getBalanceDraftKey(), {
|
||||
changeScene: balanceForm.changeScene,
|
||||
amount: balanceForm.amount,
|
||||
relatedOrderId: balanceForm.relatedOrderId,
|
||||
externalOrderNo: balanceForm.externalOrderNo,
|
||||
remark: balanceForm.remark
|
||||
})
|
||||
balanceDraftSavedAt.value = draft.savedAt
|
||||
message.success('余额变动已暂存到本地')
|
||||
}
|
||||
|
||||
/** handleClearBalanceDraft is a local helper used by this page script. */
|
||||
const handleClearBalanceDraft = (showMessage = true) => {
|
||||
clearDraftRecord(getBalanceDraftKey())
|
||||
balanceDraftSavedAt.value = null
|
||||
if (showMessage) {
|
||||
message.success('已清除余额变动暂存')
|
||||
}
|
||||
}
|
||||
|
||||
/** restoreVipDraft is a local helper used by this page script. */
|
||||
const restoreVipDraft = () => {
|
||||
const draft = loadDraftRecord<{
|
||||
vipLevel: string
|
||||
remark: string
|
||||
}>(getVipDraftKey())
|
||||
if (!draft) {
|
||||
vipDraftSavedAt.value = null
|
||||
return
|
||||
}
|
||||
Object.assign(vipForm, draft.payload)
|
||||
vipDraftSavedAt.value = draft.savedAt
|
||||
message.success('已恢复 VIP 暂存')
|
||||
}
|
||||
|
||||
/** handleSaveVipDraft is a local helper used by this page script. */
|
||||
const handleSaveVipDraft = () => {
|
||||
const draft = saveDraftRecord(getVipDraftKey(), {
|
||||
vipLevel: vipForm.vipLevel,
|
||||
remark: vipForm.remark || ''
|
||||
})
|
||||
vipDraftSavedAt.value = draft.savedAt
|
||||
message.success('VIP 设置已暂存到本地')
|
||||
}
|
||||
|
||||
/** handleClearVipDraft is a local helper used by this page script. */
|
||||
const handleClearVipDraft = (showMessage = true) => {
|
||||
clearDraftRecord(getVipDraftKey())
|
||||
vipDraftSavedAt.value = null
|
||||
if (showMessage) {
|
||||
message.success('已清除 VIP 暂存')
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: formRules supports UsersView.vue by holding or executing the form rules page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
@@ -977,25 +806,11 @@ const columns = [
|
||||
{ title: '手机号', dataIndex: 'phone', key: 'phone' },
|
||||
{ title: '所属店铺', key: 'shopName', width: 140 },
|
||||
{ title: '用户类型', key: 'type', width: 110 },
|
||||
{ title: 'VIP 等级', key: 'level', width: 110 },
|
||||
{ title: '状态', key: 'status', width: 100 },
|
||||
{ title: '创建时间', dataIndex: 'createTime', key: 'createTime', width: 180 },
|
||||
{ title: '操作', key: 'actions', width: 280, fixed: 'right' as const }
|
||||
]
|
||||
|
||||
/**
|
||||
* Purpose: historyColumns supports UsersView.vue by holding or executing the history columns page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const historyColumns = [
|
||||
{ title: '场景', key: 'changeScene', width: 120 },
|
||||
{ title: '金额', key: 'amount', width: 110 },
|
||||
{ title: '余额变化', key: 'balanceRange', width: 170 },
|
||||
{ title: '关联单号', key: 'relatedOrder', width: 180 },
|
||||
{ title: '备注', dataIndex: 'remark', key: 'remark' },
|
||||
{ title: '时间', key: 'changeTime', width: 180 }
|
||||
]
|
||||
|
||||
/** getUserTypeText is a local helper used by this page script. */
|
||||
const getUserTypeText = (type: number) => {
|
||||
const map: Record<number, string> = {
|
||||
@@ -1045,34 +860,6 @@ const getUnbindConfirmText = (record: Partial<UserVO> | Record<string, any>) =>
|
||||
return '确定要解绑该用户与当前店铺的关系吗?'
|
||||
}
|
||||
|
||||
/** getSceneText is a local helper used by this page script. */
|
||||
const getSceneText = (scene?: string) => {
|
||||
const map: Record<string, string> = {
|
||||
RECHARGE: '充值',
|
||||
MANUAL_ADD: '手工增加',
|
||||
MANUAL_DEDUCT: '手工扣减',
|
||||
ORDER_CONSUME: '订单消费',
|
||||
ORDER_REFUND: '订单退款'
|
||||
}
|
||||
return scene ? map[scene] || scene : '-'
|
||||
}
|
||||
|
||||
/** formatMoney is a local helper used by this page script. */
|
||||
const formatMoney = (value?: number | string | null) => {
|
||||
if (value === undefined || value === null || value === '') {
|
||||
return '0.00'
|
||||
}
|
||||
return Number(value).toFixed(2)
|
||||
}
|
||||
|
||||
/** formatDate is a local helper used by this page script. */
|
||||
const formatDate = (value?: string) => {
|
||||
if (!value) {
|
||||
return '-'
|
||||
}
|
||||
return value.replace('T', ' ').slice(0, 19)
|
||||
}
|
||||
|
||||
/** filterVisibleUsers is a local helper used by this page script. */
|
||||
const filterVisibleUsers = (list: UserVO[]) => {
|
||||
if (!currentUserInfo || currentUserType.value === 4) {
|
||||
@@ -1173,7 +960,6 @@ const fetchUserList = async () => {
|
||||
size: pagination.pageSize,
|
||||
keyword: searchText.value || undefined,
|
||||
type: typeFilter.value,
|
||||
vipLevel: vipLevelFilter.value,
|
||||
status: statusFilter.value,
|
||||
createdFrom: createdRange.value?.[0],
|
||||
createdTo: createdRange.value?.[1],
|
||||
@@ -1206,7 +992,6 @@ const resetFilters = () => {
|
||||
searchText.value = ''
|
||||
shopFilter.value = currentUserType.value !== 4 ? normalizeShopId(currentUserInfo?.shopId) : undefined
|
||||
typeFilter.value = 2
|
||||
vipLevelFilter.value = undefined
|
||||
statusFilter.value = undefined
|
||||
createdRange.value = undefined
|
||||
hasPhoneFilter.value = undefined
|
||||
@@ -1335,62 +1120,6 @@ const showViewModal = (record: any) => {
|
||||
viewModalVisible.value = true
|
||||
}
|
||||
|
||||
/** loadUserAssetData is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
||||
const loadUserAssetData = async (userId: IdType) => {
|
||||
const [asset, history] = await Promise.all([
|
||||
adminUserApi.getUserAsset(userId),
|
||||
adminUserApi.getUserBalanceHistory(userId)
|
||||
])
|
||||
assetData.value = asset
|
||||
balanceHistory.value = history || []
|
||||
vipForm.vipLevel = asset.vipLevel || '普通'
|
||||
}
|
||||
|
||||
/** resetAssetForms is a local helper used by this page script. */
|
||||
const resetAssetForms = () => {
|
||||
Object.assign(balanceForm, {
|
||||
changeScene: 'RECHARGE',
|
||||
amount: undefined,
|
||||
relatedOrderId: undefined,
|
||||
externalOrderNo: '',
|
||||
remark: ''
|
||||
})
|
||||
Object.assign(vipForm, {
|
||||
vipLevel: assetData.value?.vipLevel || '普通',
|
||||
remark: ''
|
||||
})
|
||||
}
|
||||
|
||||
/** showAssetModal is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
||||
const showAssetModal = async (record: any) => {
|
||||
assetTargetUser.value = record
|
||||
assetModalVisible.value = true
|
||||
assetLoading.value = true
|
||||
assetData.value = null
|
||||
balanceHistory.value = []
|
||||
resetAssetForms()
|
||||
try {
|
||||
await runWithGlobalLoading(() => loadUserAssetData(record.id))
|
||||
resetAssetForms()
|
||||
restoreBalanceDraft()
|
||||
restoreVipDraft()
|
||||
} catch (error) {
|
||||
console.error('获取用户资产失败:', error)
|
||||
message.error('获取用户资产失败')
|
||||
} finally {
|
||||
assetLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** handleAssetModalCancel is a local helper used by this page script. */
|
||||
const handleAssetModalCancel = () => {
|
||||
assetModalVisible.value = false
|
||||
assetTargetUser.value = null
|
||||
assetData.value = null
|
||||
balanceHistory.value = []
|
||||
resetAssetForms()
|
||||
}
|
||||
|
||||
/** handleModalOk is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
||||
const handleModalOk = async () => {
|
||||
try {
|
||||
@@ -1553,140 +1282,6 @@ const handleUnbind = async (record: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
/** refreshAssetPanel is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
||||
const refreshAssetPanel = async () => {
|
||||
if (!assetTargetUser.value) {
|
||||
return
|
||||
}
|
||||
assetLoading.value = true
|
||||
try {
|
||||
await loadUserAssetData(assetTargetUser.value.id)
|
||||
const matchedUser = userList.value.find(user => sameId(user.id, assetTargetUser.value?.id))
|
||||
if (matchedUser && assetData.value) {
|
||||
matchedUser.level = assetData.value.vipLevel
|
||||
matchedUser.vipId = assetData.value.vipInfoId
|
||||
}
|
||||
} finally {
|
||||
assetLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** handleBalanceChange is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
||||
const handleBalanceChange = async () => {
|
||||
if (!assetTargetUser.value) {
|
||||
return
|
||||
}
|
||||
const targetUserId = assetTargetUser.value.id
|
||||
if (!balanceForm.amount || Number(balanceForm.amount) <= 0) {
|
||||
message.warning('请输入大于 0 的金额')
|
||||
return
|
||||
}
|
||||
if (
|
||||
balanceForm.changeScene === 'MANUAL_DEDUCT'
|
||||
&& !balanceForm.relatedOrderId
|
||||
&& !balanceForm.externalOrderNo?.trim()
|
||||
) {
|
||||
message.warning('手工扣减余额时必须填写系统订单 ID 或外部单号')
|
||||
return
|
||||
}
|
||||
|
||||
assetSaving.value = true
|
||||
try {
|
||||
await runWithGlobalLoading(async () => {
|
||||
await adminUserApi.changeUserBalance(targetUserId, {
|
||||
amount: Number(balanceForm.amount),
|
||||
changeScene: balanceForm.changeScene,
|
||||
relatedOrderId: balanceForm.relatedOrderId,
|
||||
externalOrderNo: balanceForm.externalOrderNo?.trim() || undefined,
|
||||
remark: balanceForm.remark?.trim() || undefined
|
||||
})
|
||||
message.success('余额变动已保存')
|
||||
handleClearBalanceDraft(false)
|
||||
Object.assign(balanceForm, {
|
||||
amount: undefined,
|
||||
relatedOrderId: undefined,
|
||||
externalOrderNo: '',
|
||||
remark: ''
|
||||
})
|
||||
await refreshAssetPanel()
|
||||
})
|
||||
} catch (error: any) {
|
||||
console.error('余额变动失败:', error)
|
||||
message.error(error.message || '余额变动失败')
|
||||
} finally {
|
||||
assetSaving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** handleVipOverride is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
||||
const handleVipOverride = async () => {
|
||||
if (!assetTargetUser.value) {
|
||||
return
|
||||
}
|
||||
const targetUserId = assetTargetUser.value.id
|
||||
assetSaving.value = true
|
||||
try {
|
||||
await runWithGlobalLoading(async () => {
|
||||
await adminUserApi.overrideUserVip(targetUserId, {
|
||||
vipLevel: vipForm.vipLevel,
|
||||
remark: vipForm.remark?.trim() || undefined
|
||||
})
|
||||
message.success('VIP 已更新')
|
||||
handleClearVipDraft(false)
|
||||
vipForm.remark = ''
|
||||
await refreshAssetPanel()
|
||||
})
|
||||
} catch (error: any) {
|
||||
console.error('VIP 更新失败:', error)
|
||||
message.error(error.message || 'VIP 更新失败')
|
||||
} finally {
|
||||
assetSaving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** handleVipRecalculate is a local helper used by this page script. */
|
||||
const handleVipRecalculate = () => {
|
||||
if (!assetTargetUser.value) {
|
||||
return
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '恢复自动判级',
|
||||
content: '恢复后会清除手工指定状态,并按累计充值金额重新计算 VIP 等级,是否继续?',
|
||||
async onOk() {
|
||||
assetSaving.value = true
|
||||
try {
|
||||
await runWithGlobalLoading(async () => {
|
||||
await adminUserApi.recalculateUserVip(assetTargetUser.value!.id)
|
||||
message.success('已恢复自动判级')
|
||||
handleClearVipDraft(false)
|
||||
vipForm.remark = ''
|
||||
await refreshAssetPanel()
|
||||
})
|
||||
} catch (error: any) {
|
||||
console.error('恢复自动判级失败:', error)
|
||||
message.error(error.message || '恢复自动判级失败')
|
||||
} finally {
|
||||
assetSaving.value = false
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: fetchVipLevelOptions supports UsersView.vue by holding or executing the fetch vip level options page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const fetchVipLevelOptions = async () => {
|
||||
try {
|
||||
const levels = await adminVipRechargePlanApi.listVipLevelOptions(currentUserInfo?.shopId)
|
||||
if (Array.isArray(levels) && levels.length) {
|
||||
vipLevelOptions.value = ['普通', ...levels.filter(level => level !== '普通')]
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('VIP 等级选项加载失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
watch(() => formState.type, type => {
|
||||
if (Number(type) === 4) {
|
||||
formState.shopIds = []
|
||||
@@ -1696,7 +1291,7 @@ watch(() => formState.type, type => {
|
||||
|
||||
onMounted(async () => {
|
||||
await loadUserPermissions()
|
||||
await Promise.all([fetchShopList(), fetchVipLevelOptions()])
|
||||
await fetchShopList()
|
||||
await fetchUserList()
|
||||
})
|
||||
</script>
|
||||
@@ -1706,12 +1301,6 @@ onMounted(async () => {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.asset-modal {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.mobile-user-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -1737,65 +1326,6 @@ onMounted(async () => {
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.asset-summary,
|
||||
.asset-actions,
|
||||
.history-card {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.summary-value {
|
||||
font-size: 22px;
|
||||
font-weight: 600;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.summary-sub {
|
||||
margin-top: 8px;
|
||||
color: var(--text-secondary);
|
||||
font-size: 12px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.vip-note {
|
||||
margin-top: 12px;
|
||||
color: var(--text-secondary);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.amount-plus {
|
||||
color: #52c41a;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.amount-minus {
|
||||
color: #ff4d4f;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.asset-summary,
|
||||
.asset-actions {
|
||||
row-gap: 12px;
|
||||
}
|
||||
|
||||
.asset-summary :deep(.ant-col),
|
||||
.asset-actions :deep(.ant-col) {
|
||||
flex: 0 0 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.asset-actions :deep(.ant-space) {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px !important;
|
||||
}
|
||||
|
||||
.asset-actions :deep(.ant-space-item) {
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
:global(.default-password-notice) {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
|
||||
Reference in New Issue
Block a user