修复:对齐作品和购物车美甲师可用性
This commit is contained in:
@@ -14,6 +14,8 @@ export interface ProductVO {
|
||||
estimatedTime: number
|
||||
approximateDuration?: string
|
||||
bookableArtists?: string
|
||||
availableBookableArtistCount?: number
|
||||
bookableArtistRestricted?: boolean
|
||||
availableCoupons?: string
|
||||
category: string
|
||||
tags?: string
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user