修复:对齐作品和购物车美甲师可用性

This commit is contained in:
xiaowang
2026-03-27 11:51:43 +08:00
parent b1fc6c3b79
commit d2c693e6a1
6 changed files with 172 additions and 17 deletions
+2
View File
@@ -14,6 +14,8 @@ export interface ProductVO {
estimatedTime: number
approximateDuration?: string
bookableArtists?: string
availableBookableArtistCount?: number
bookableArtistRestricted?: boolean
availableCoupons?: string
category: string
tags?: string
+9 -1
View File
@@ -163,13 +163,21 @@ const loadError = ref('')
const isLoggedIn = computed(() => Boolean(localStorage.getItem('accessToken') || sessionStorage.getItem('accessToken')))
const artistCount = computed(() => {
if (typeof product.value.availableBookableArtistCount === 'number') {
return product.value.availableBookableArtistCount
}
const rawValue = product.value.bookableArtists || ''
return rawValue
.split(',')
.map(id => Number(id.trim()))
.filter(id => Number.isFinite(id) && id > 0).length
})
const artistCountText = computed(() => (artistCount.value > 0 ? `${artistCount.value} 位` : '门店安排'))
const artistCountText = computed(() => {
if (artistCount.value > 0) {
return `${artistCount.value} 位`
}
return product.value.bookableArtistRestricted ? '暂无' : '门店安排'
})
const earliestBookableText = computed(() => estimateEarliestBookable(shopInfo.value?.businessHours))
const parseTimeRange = (businessHours?: string): { start: string; end: string } | null => {