Files
JayuCloud/YumiNail-Frontend/src/views/ProductDetailView.vue
T

1178 lines
36 KiB
Vue
Raw Normal View History

<template>
<div class="detail-page">
2026-05-29 13:30:56 +08:00
<header class="detail-header" aria-label="作品详情导航">
<a-button class="nav-button" type="text" aria-label="返回" @click="router.back()">
<LeftOutlined />
</a-button>
<div class="detail-title" aria-live="polite">
<span>作品详情</span>
<strong>{{ productTitle }}</strong>
</div>
<a-button class="nav-button" type="text" :aria-label="isFavorite ? '取消收藏' : '收藏作品'" @click="handleFavoriteClick">
<component :is="isFavorite ? StarFilled : StarOutlined" :class="{ active: isFavorite }" />
</a-button>
</header>
2026-05-29 13:30:56 +08:00
<main class="detail-content" :class="{ 'detail-content-error': loadError }">
<a-result v-if="loadError" status="warning" title="暂时无法查看作品详情" :sub-title="loadError">
<template #extra>
<a-button type="primary" @click="router.back()">返回上一页</a-button>
</template>
</a-result>
<template v-else>
2026-05-29 13:30:56 +08:00
<section class="hero-section" :style="heroSectionStyle" aria-label="作品图片">
<a-carousel
v-if="productImages.length > 1"
class="hero-carousel"
dots
autoplay
:autoplay-speed="3500"
>
<div v-for="(image, index) in productImages" :key="`${image}-${index}`" class="hero-slide-frame">
<a-image
class="hero-slide"
:src="image"
:alt="`${productTitle} 图片 ${index + 1}`"
:preview="{ src: image }"
:loading="index === 0 ? 'eager' : 'lazy'"
decoding="async"
/>
</div>
</a-carousel>
<div v-else-if="productImagesReady || productImages.length" class="hero-carousel hero-carousel-single">
<a-image
v-for="(image, index) in (productImages.length ? productImages : [DEFAULT_PRODUCT_IMAGE])"
:key="`${image}-${index}`"
class="hero-slide"
:src="image"
:alt="`${productTitle} 图片 ${index + 1}`"
:preview="{ src: image }"
:loading="index === 0 ? 'eager' : 'lazy'"
decoding="async"
/>
</div>
<div v-else class="hero-carousel hero-carousel-single" aria-hidden="true"></div>
</section>
<section class="info-section">
2026-05-29 13:30:56 +08:00
<div class="product-hero-copy">
<div class="product-heading">
<h1>{{ productTitle }}</h1>
<div class="duration-chip">
<CalendarOutlined />
<span>{{ product.approximateDuration || '以门店确认为准' }}</span>
</div>
</div>
2026-05-29 13:30:56 +08:00
<p class="price">¥{{ Number(product.price || 0).toFixed(2) }}</p>
</div>
2026-05-29 13:30:56 +08:00
<div class="service-grid">
<div class="service-item">
<CalendarOutlined />
<span>可约时间</span>
<strong>{{ earliestBookableText }}</strong>
</div>
2026-05-29 13:30:56 +08:00
<div class="service-item">
<TeamOutlined />
<span>美甲师</span>
<strong>{{ artistCountText }}</strong>
</div>
</div>
2026-05-29 13:30:56 +08:00
<button class="shop-card" type="button" :disabled="!shopInfo?.id" @click="openShopDetail">
<span class="shop-icon">
<ShopOutlined />
</span>
<span class="shop-copy">
<span class="eyebrow">服务门店</span>
<strong>{{ shopInfo?.shopName || '暂未绑定门店' }}</strong>
<span>{{ shopInfo?.address || '门店地址待完善' }}</span>
<span>{{ shopInfo?.businessHours || '营业时间待完善' }}</span>
</span>
<span class="shop-more">›</span>
</button>
<div class="artist-card">
<div class="artist-avatar">
<TeamOutlined />
</div>
<div class="artist-copy">
<span class="eyebrow">预约服务</span>
<strong>{{ artistCountText }}美甲师可服务</strong>
<span>最终接待人员与时段以门店排班确认为准</span>
</div>
</div>
2026-05-29 13:30:56 +08:00
<div class="quick-actions">
<button class="action-pill" type="button" :class="{ active: isLiked }" @click="handleLikeClick">
<component :is="isLiked ? HeartFilled : HeartOutlined" />
{{ product.likeCount || 0 }} 点赞
</button>
2026-05-29 13:30:56 +08:00
<button class="action-pill" type="button" :class="{ active: isFavorite }" @click="handleFavoriteClick">
<component :is="isFavorite ? StarFilled : StarOutlined" />
{{ product.collectCount || 0 }} 收藏
</button>
2026-05-29 13:30:56 +08:00
<button class="action-pill" type="button" @click="copyShareLink">分享链接</button>
</div>
<div class="tags">
2026-05-29 13:30:56 +08:00
<a-tag v-for="tag in product.tagInfos || []" :key="tag.id" class="detail-tag">{{ tag.tagName }}</a-tag>
<a-tag v-if="!product.tagInfos?.length" class="detail-tag">暂无标签</a-tag>
</div>
<div class="description">
<h3>款式说明</h3>
<p>{{ product.description || '店家暂未补充作品说明。' }}</p>
</div>
<div v-if="product.targetAudience || product.precautions" class="guidance-grid">
<section v-if="product.targetAudience" class="guidance-panel">
<h3>适合人群</h3>
<p>{{ product.targetAudience }}</p>
</section>
<section v-if="product.precautions" class="guidance-panel">
<h3>注意事项</h3>
<p>{{ product.precautions }}</p>
</section>
</div>
</section>
<section class="comment-section">
<div class="section-head">
<h3>作品评论</h3>
2026-05-29 13:30:56 +08:00
<span>{{ comments.length }}条</span>
</div>
<div class="comment-editor">
2026-05-29 13:30:56 +08:00
<a-textarea
v-model:value="commentText"
:maxlength="300"
:rows="3"
:placeholder="replyTarget ? `回复 ${replyTarget.userNickname || '用户'}` : '说说你的看法'"
/>
<div class="comment-tools">
<a-button v-if="replyTarget" type="text" @click="replyTarget = null">取消回复</a-button>
<a-button type="primary" :loading="submittingComment" @click="submitComment">发布</a-button>
</div>
</div>
<a-empty v-if="!comments.length" description="还没有评论,来写第一条吧" />
<div v-for="comment in comments" :key="comment.id" class="comment-item">
<div class="comment-main">
<strong>{{ comment.userNickname || '用户' }}</strong>
<span>{{ formatTime(comment.createTime) }}</span>
</div>
<p>{{ comment.commentContent }}</p>
<button type="button" @click="replyTarget = comment">回复</button>
<div v-if="comment.replies?.length" class="reply-list">
<div v-for="reply in comment.replies" :key="reply.id" class="reply-item">
<strong>{{ reply.userNickname || '用户' }}</strong>
<span>{{ reply.commentContent }}</span>
</div>
</div>
</div>
</section>
</template>
</main>
<footer v-if="!loadError" class="detail-footer">
2026-05-29 13:30:56 +08:00
<div class="footer-inner">
<a-button class="footer-favorite" size="large" :aria-label="isFavorite ? '取消收藏' : '收藏作品'" @click="handleFavoriteClick">
<component :is="isFavorite ? StarFilled : StarOutlined" :class="{ active: isFavorite }" />
</a-button>
<a-button class="cart-button" size="large" @click="handleAddToCart">
<ShoppingCartOutlined />加入购物车
</a-button>
<a-button class="book-button" type="primary" size="large" @click="handleBuyNow">
<ThunderboltOutlined />立即预约
</a-button>
</div>
</footer>
</div>
</template>
<script setup lang="ts">
/**
* ProductDetailView 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, inject, onMounted, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import {
CalendarOutlined,
HeartFilled,
HeartOutlined,
LeftOutlined,
ShoppingCartOutlined,
ShopOutlined,
StarFilled,
StarOutlined,
TeamOutlined,
ThunderboltOutlined
} from '@ant-design/icons-vue'
import { message } from 'ant-design-vue'
import { cartApi } from '@/api/cart'
2026-05-23 18:44:57 +08:00
/**
* Purpose: CommentVO supports ProductDetailView.vue by holding or executing the comment vo page or API role.
* Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow.
*/
import { commentApi, type CommentVO } from '@/api/comment'
2026-05-23 18:44:57 +08:00
/**
* Purpose: ProductVO supports ProductDetailView.vue by holding or executing the product vo page or API role.
* Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow.
*/
import { productApi, type ProductVO } from '@/api/product'
import { productLikeApi } from '@/api/productLike'
2026-05-23 18:44:57 +08:00
/**
* Purpose: ShopVO supports ProductDetailView.vue by holding or executing the shop vo page or API role.
* Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow.
*/
import { shopApi, type ShopVO } from '@/api/shop'
import { wishlistApi } from '@/api/wishlist'
import { DEFAULT_PRODUCT_IMAGE } from '@/constants'
2026-03-27 14:55:41 +08:00
import type { IdType } from '@/utils/id'
import { toOptionalIdString } from '@/utils/id'
import { runWithGlobalLoading } from '@/utils/action-loading'
2026-05-29 13:30:56 +08:00
import { getCachedSignedImageUrls, getCachedSignedImageUrlsSync, parseImageFileIds } from '@/utils/signed-image-cache'
2026-05-23 18:44:57 +08:00
/**
* Purpose: route supports ProductDetailView.vue by holding or executing the route 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 route = useRoute()
2026-05-23 18:44:57 +08:00
/**
* Purpose: router supports ProductDetailView.vue by holding or executing the router 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 router = useRouter()
2026-05-23 18:44:57 +08:00
/**
* Purpose: updateCartCount supports ProductDetailView.vue by holding or executing the update cart count 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.
*/
2026-02-28 17:09:45 +08:00
const updateCartCount = inject<() => Promise<void>>('updateCartCount', async () => {})
2026-05-23 18:44:57 +08:00
/**
* Purpose: product supports ProductDetailView.vue by holding or executing the product 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 product = ref<ProductVO>({} as ProductVO)
2026-05-23 18:44:57 +08:00
/**
* Purpose: shopInfo supports ProductDetailView.vue by holding or executing the shop info 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 shopInfo = ref<ShopVO | null>(null)
2026-05-23 18:44:57 +08:00
/**
* Purpose: productImages supports ProductDetailView.vue by holding or executing the product images 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.
*/
2026-02-26 11:16:24 +08:00
const productImages = ref<string[]>([])
2026-05-29 13:30:56 +08:00
/** productImageRatios stores natural height / width values for gallery layout. */
const productImageRatios = ref<Record<string, number>>({})
/** productImagesReady prevents the default fallback image from flashing before cached URLs are restored. */
const productImagesReady = ref(false)
2026-05-23 18:44:57 +08:00
/**
* Purpose: comments supports ProductDetailView.vue by holding or executing the comments 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 comments = ref<CommentVO[]>([])
/** commentText is a reactive state variable used by the template and event handlers. */
const commentText = ref('')
2026-05-23 18:44:57 +08:00
/**
* Purpose: replyTarget supports ProductDetailView.vue by holding or executing the reply target 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 replyTarget = ref<CommentVO | null>(null)
/** submittingComment is a reactive state variable used by the template and event handlers. */
const submittingComment = ref(false)
/** isFavorite is a reactive state variable used by the template and event handlers. */
const isFavorite = ref(false)
/** isLiked is a reactive state variable used by the template and event handlers. */
const isLiked = ref(false)
/** loadError is a reactive state variable used by the template and event handlers. */
const loadError = ref('')
/** isLoggedIn is a reactive state variable used by the template and event handlers. */
const isLoggedIn = computed(() => Boolean(localStorage.getItem('accessToken') || sessionStorage.getItem('accessToken')))
/** productTitle is a reactive state variable used by the template and event handlers. */
const productTitle = computed(() => product.value.title || product.value.name || '作品详情')
/** artistCount is a reactive state variable used by the template and event handlers. */
const artistCount = computed(() => {
if (typeof product.value.availableBookableArtistCount === 'number') return product.value.availableBookableArtistCount
return String(product.value.bookableArtists || '').split(',').map(id => id.trim()).filter(Boolean).length
})
/** artistCountText is a reactive state variable used by the template and event handlers. */
const artistCountText = computed(() => artistCount.value > 0 ? `${artistCount.value} 位` : (product.value.bookableArtistRestricted ? '暂无可约' : '门店安排'))
/** earliestBookableText is a reactive state variable used by the template and event handlers. */
const earliestBookableText = computed(() => shopInfo.value?.businessHours || '以门店安排为准')
2026-05-29 13:30:56 +08:00
/** heroMaxHeightRatio keeps the carousel height aligned to the tallest image. */
const heroMaxHeightRatio = computed(() => {
const ratios = productImages.value
.map(url => productImageRatios.value[url])
.filter((ratio): ratio is number => Number.isFinite(ratio) && ratio > 0)
return ratios.length ? Math.max(...ratios) : 1.25
})
/** heroSectionStyle lets shorter images center inside the tallest-image frame. */
const heroSectionStyle = computed(() => ({
aspectRatio: `1 / ${heroMaxHeightRatio.value}`
}))
2026-05-23 18:44:57 +08:00
/**
* Purpose: copyShareLink supports ProductDetailView.vue by holding or executing the copy share link 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 copyShareLink = async () => {
const url = `${window.location.origin}/product/${route.params.id}`
try {
await navigator.clipboard.writeText(url)
message.success('分享链接已复制,未登录用户也可以查看详情')
} catch {
message.warning(url)
}
}
/** requireLogin is a local helper used by this page script. */
const requireLogin = (actionText: string) => {
if (isLoggedIn.value) return true
message.info(`${actionText}前请先登录`)
router.push('/')
return false
2026-03-05 15:15:59 +08:00
}
2026-05-29 13:30:56 +08:00
const sameImageList = (left: string[], right: string[]) =>
left.length === right.length && left.every((url, index) => url === right[index])
const measureImageRatio = (url: string) => new Promise<number | null>((resolve) => {
const image = new Image()
image.onload = () => {
if (image.naturalWidth > 0 && image.naturalHeight > 0) {
resolve(image.naturalHeight / image.naturalWidth)
return
}
resolve(null)
}
image.onerror = () => resolve(null)
image.src = url
})
const prepareProductImageLayout = async (urls: string[]) => {
const entries = await Promise.all(urls.map(async url => [url, await measureImageRatio(url)] as const))
if (!sameImageList(urls, productImages.value)) return
const nextRatios: Record<string, number> = {}
entries.forEach(([url, ratio]) => {
if (ratio && Number.isFinite(ratio) && ratio > 0) nextRatios[url] = ratio
})
productImageRatios.value = nextRatios
}
/** loadProductImages is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
2026-02-26 11:16:24 +08:00
const loadProductImages = async () => {
2026-05-29 13:30:56 +08:00
productImagesReady.value = false
const fileIds = parseImageFileIds(product.value.imageFileIds)
if (!fileIds.length) {
2026-05-29 13:30:56 +08:00
const fallbackImages = [DEFAULT_PRODUCT_IMAGE]
productImages.value = fallbackImages
productImagesReady.value = true
void prepareProductImageLayout(fallbackImages)
return
}
2026-05-29 13:30:56 +08:00
const cachedImages = getCachedSignedImageUrlsSync(fileIds)
if (cachedImages.length) {
productImages.value = cachedImages
productImagesReady.value = true
void prepareProductImageLayout(cachedImages)
}
2026-05-29 13:30:56 +08:00
const nextImages = await getCachedSignedImageUrls(fileIds, DEFAULT_PRODUCT_IMAGE)
productImages.value = nextImages
productImagesReady.value = true
void prepareProductImageLayout(nextImages)
}
/** loadShopInfo is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
2026-03-27 14:55:41 +08:00
const loadShopInfo = async (shopId?: IdType | null) => {
shopInfo.value = shopId ? await shopApi.getShopById(shopId).catch(() => null) : null
2026-02-26 11:16:24 +08:00
}
/** loadComments is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
const loadComments = async () => {
if (!product.value.id) return
comments.value = await commentApi.listByProduct(product.value.id).catch(() => [])
}
/** checkInteractionStatus is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
const checkInteractionStatus = async () => {
if (!isLoggedIn.value || !product.value.id) {
isFavorite.value = false
isLiked.value = false
return
}
const [favorite, liked] = await Promise.all([
wishlistApi.checkWishlist(product.value.id).catch(() => false),
productLikeApi.checkLikeStatus(product.value.id).catch(() => false)
])
isFavorite.value = Boolean(favorite)
isLiked.value = Boolean(liked)
}
/** fetchProductDetail is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
const fetchProductDetail = async () => {
loadError.value = ''
try {
2026-03-27 14:55:41 +08:00
const productId = toOptionalIdString(route.params.id)
if (!productId) throw new Error('作品不存在')
const response = await productApi.getProductById(productId)
if (!response?.id) throw new Error('作品不存在或已下架')
product.value = response
await Promise.all([loadProductImages(), loadShopInfo(response.shopId), checkInteractionStatus(), loadComments()])
} catch (error: any) {
loadError.value = error?.message || '网络异常,请稍后再试'
}
2026-02-26 11:16:24 +08:00
}
/** openShopDetail is a local helper used by this page script. */
const openShopDetail = () => {
if (shopInfo.value?.id) router.push(`/shop/${shopInfo.value.id}`)
}
/** handleFavoriteClick is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
const handleFavoriteClick = async () => {
if (!product.value.id || !requireLogin('收藏作品')) return
await runWithGlobalLoading(async () => {
if (isFavorite.value) {
await wishlistApi.removeFromWishlist(product.value.id)
product.value.collectCount = Math.max(0, Number(product.value.collectCount || 0) - 1)
message.success('已取消收藏')
} else {
await wishlistApi.addToWishlist(product.value.id)
product.value.collectCount = Number(product.value.collectCount || 0) + 1
message.success('已加入收藏')
}
isFavorite.value = !isFavorite.value
}).catch((error: any) => message.error(error?.message || '收藏操作失败'))
}
/** handleLikeClick is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
2026-03-05 15:15:59 +08:00
const handleLikeClick = async () => {
if (!product.value.id || !requireLogin('点赞作品')) return
await runWithGlobalLoading(async () => {
if (isLiked.value) {
await productLikeApi.unlikeProduct(product.value.id)
product.value.likeCount = Math.max(0, Number(product.value.likeCount || 0) - 1)
message.success('已取消点赞')
} else {
await productLikeApi.likeProduct(product.value.id)
product.value.likeCount = Number(product.value.likeCount || 0) + 1
message.success('已点赞')
}
2026-03-05 15:15:59 +08:00
isLiked.value = !isLiked.value
}).catch((error: any) => message.error(error?.message || '点赞操作失败'))
2026-03-05 15:15:59 +08:00
}
/** handleAddToCart is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
const handleAddToCart = async () => {
if (!product.value.id || !requireLogin('加入购物车')) return
await runWithGlobalLoading(() => cartApi.addToCart({ productId: product.value.id, quantity: 1 }))
await updateCartCount()
message.success('已加入购物车')
}
/** handleBuyNow is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
const handleBuyNow = async () => {
if (!product.value.id || !requireLogin('预约下单')) return
await runWithGlobalLoading(() => cartApi.addToCart({ productId: product.value.id, quantity: 1 }))
await updateCartCount()
message.success('已加入确认订单')
router.push({ path: '/cart', query: { mode: 'buyNow', productId: String(product.value.id) } })
}
/** submitComment is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
const submitComment = async () => {
if (!product.value.id || !requireLogin('发表评论')) return
const content = commentText.value.trim()
if (!content) return message.warning('请输入评论内容')
submittingComment.value = true
try {
await commentApi.create({
productId: product.value.id,
shopId: product.value.shopId,
parentCommentId: replyTarget.value?.id,
commentContent: content
})
commentText.value = ''
replyTarget.value = null
await loadComments()
message.success('评论已发布')
} catch (error: any) {
message.error(error?.message || '评论发布失败')
} finally {
submittingComment.value = false
}
}
2026-02-24 09:59:22 +08:00
/** formatTime is a local helper used by this page script. */
const formatTime = (value?: string) => value ? value.replace('T', ' ').slice(0, 16) : ''
2026-02-24 09:59:22 +08:00
onMounted(() => {
void fetchProductDetail()
2026-02-24 09:59:22 +08:00
})
</script>
<style scoped>
2026-05-29 13:30:56 +08:00
.detail-page {
--detail-bg: var(--theme-page-bg);
--detail-surface: var(--theme-card-bg);
--detail-surface-soft: color-mix(in srgb, var(--theme-primary) 10%, var(--theme-card-bg));
--detail-surface-high: color-mix(in srgb, var(--theme-secondary) 16%, var(--theme-card-bg));
--detail-surface-muted: color-mix(in srgb, var(--theme-neutral) 10%, var(--theme-card-bg));
--detail-text: var(--text-primary);
--detail-muted: var(--text-secondary);
--detail-primary: var(--theme-primary-action);
--detail-primary-soft: var(--theme-primary-soft);
--detail-blush: var(--theme-primary);
--detail-gold: var(--theme-secondary);
--detail-gold-soft: var(--theme-secondary-soft);
--detail-border: var(--theme-border);
--detail-glass: color-mix(in srgb, var(--theme-card-bg) 80%, transparent);
--detail-glass-strong: color-mix(in srgb, var(--theme-card-bg) 92%, transparent);
--detail-hero-scrim: color-mix(in srgb, var(--theme-neutral) 20%, transparent);
--detail-shadow: 0 20px 44px color-mix(in srgb, var(--theme-neutral) 14%, transparent);
--detail-shadow-soft: 0 12px 30px color-mix(in srgb, var(--theme-neutral) 8%, transparent);
box-sizing: border-box;
min-height: 100vh;
overflow-x: hidden;
background:
radial-gradient(circle at top left, var(--detail-primary-soft), transparent 34%),
linear-gradient(180deg, var(--detail-bg) 0%, var(--detail-surface-soft) 100%);
color: var(--detail-text);
font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.detail-page *,
.detail-page *::before,
.detail-page *::after {
box-sizing: border-box;
}
.detail-header {
position: sticky;
top: 0;
z-index: 40;
display: grid;
grid-template-columns: 44px minmax(0, 1fr) 44px;
gap: 10px;
width: min(100%, 460px);
margin: 0 auto;
align-items: center;
padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
border-bottom: 1px solid var(--detail-border);
background: var(--detail-glass-strong);
box-shadow: 0 10px 28px color-mix(in srgb, var(--theme-neutral) 8%, transparent);
backdrop-filter: blur(18px);
}
.nav-button {
justify-self: start;
}
.nav-button:last-child {
justify-self: end;
}
.detail-title {
display: grid;
min-width: 0;
gap: 2px;
text-align: center;
}
.detail-title span {
color: var(--detail-muted);
font-size: 11px;
font-weight: 600;
line-height: 1.1;
}
.detail-title strong {
min-width: 0;
overflow: hidden;
color: var(--detail-text);
font-size: 15px;
font-weight: 700;
line-height: 1.25;
text-overflow: ellipsis;
white-space: nowrap;
}
.detail-header :deep(.ant-btn) {
display: inline-flex;
width: 40px;
height: 40px;
align-items: center;
justify-content: center;
border: 1px solid var(--detail-border);
border-radius: 999px;
background: var(--detail-glass);
box-shadow: var(--detail-shadow-soft);
color: var(--detail-muted);
backdrop-filter: blur(16px);
}
.detail-header :deep(.ant-btn:hover),
.detail-header :deep(.ant-btn:focus) {
color: var(--detail-primary);
border-color: var(--detail-blush);
background: var(--detail-glass-strong);
}
.detail-header .active {
color: var(--detail-gold);
}
.detail-content {
width: min(100%, 460px);
margin: 0 auto;
padding: 0 0 calc(112px + env(safe-area-inset-bottom));
}
.detail-content-error {
min-height: 100vh;
padding: 36px 18px 120px;
}
.hero-section {
position: relative;
overflow: hidden;
width: 100%;
aspect-ratio: 4 / 5;
transition: aspect-ratio 0.2s ease;
background: var(--detail-surface-high);
}
.hero-section::after {
position: absolute;
inset: 0;
z-index: 2;
display: block;
pointer-events: none;
content: "";
background: linear-gradient(180deg, var(--detail-hero-scrim) 0%, transparent 30%, transparent 72%, var(--detail-bg) 100%);
}
.hero-carousel {
position: relative;
width: 100%;
height: 100%;
}
.hero-carousel :deep(.slick-list),
.hero-carousel :deep(.slick-track),
.hero-carousel :deep(.slick-slide),
.hero-carousel :deep(.slick-slide > div),
.hero-slide-frame {
height: 100%;
}
.hero-slide {
width: 100%;
height: 100%;
cursor: zoom-in;
}
.hero-slide :deep(.ant-image),
.hero-slide :deep(.ant-image-img) {
display: block;
width: 100%;
height: 100%;
}
.hero-slide :deep(.ant-image-img) {
object-fit: contain;
object-position: center;
}
.hero-carousel :deep(.slick-dots) {
z-index: 3;
bottom: 26px;
}
.hero-carousel :deep(.slick-dots li button) {
width: 7px;
height: 7px;
border-radius: 999px;
background: var(--detail-glass);
box-shadow: var(--detail-shadow-soft);
opacity: 1;
}
.hero-carousel :deep(.slick-dots li.slick-active button) {
width: 18px;
background: var(--detail-surface);
}
.info-section {
position: relative;
z-index: 3;
margin-top: -32px;
padding: 28px 20px 26px;
border-radius: 32px 32px 0 0;
background: var(--detail-bg);
}
.product-hero-copy {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
gap: 16px;
align-items: start;
}
.product-heading {
min-width: 0;
}
.product-heading h1 {
margin: 0;
color: var(--detail-text);
font-family: "Playfair Display", Georgia, serif;
font-size: clamp(27px, 7vw, 34px);
font-weight: 600;
line-height: 1.16;
letter-spacing: 0;
overflow-wrap: anywhere;
}
.duration-chip {
display: inline-flex;
max-width: 100%;
align-items: center;
gap: 6px;
margin-top: 10px;
padding: 7px 10px;
border: 1px solid var(--detail-border);
border-radius: 999px;
background: var(--detail-glass);
color: var(--detail-muted);
font-size: 12px;
line-height: 1.2;
}
.duration-chip svg {
flex: 0 0 auto;
color: var(--detail-primary);
}
.duration-chip span {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.price {
margin: 0;
color: var(--detail-primary);
font-family: "Playfair Display", Georgia, serif;
font-size: clamp(28px, 7vw, 34px);
font-weight: 600;
line-height: 1.1;
white-space: nowrap;
}
.service-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px;
margin-top: 22px;
}
.service-item {
display: grid;
min-width: 0;
gap: 5px;
padding: 14px;
border: 1px solid var(--detail-border);
border-radius: 18px;
background: linear-gradient(180deg, var(--detail-surface) 0%, var(--detail-surface-soft) 100%);
box-shadow: var(--detail-shadow-soft);
}
.service-item svg {
color: var(--detail-primary);
}
.service-item span {
color: var(--detail-muted);
font-size: 12px;
line-height: 1.3;
}
.service-item strong {
min-width: 0;
color: var(--detail-text);
font-size: 14px;
line-height: 1.35;
overflow-wrap: anywhere;
}
.shop-card,
.artist-card {
display: flex;
width: 100%;
min-width: 0;
align-items: center;
gap: 14px;
margin-top: 14px;
padding: 16px;
border: 1px solid var(--detail-border);
border-radius: 22px;
background: var(--detail-glass);
box-shadow: var(--detail-shadow-soft);
color: var(--detail-text);
text-align: left;
backdrop-filter: blur(16px);
}
.shop-card {
cursor: pointer;
}
.shop-card:disabled {
cursor: default;
}
.shop-icon,
.artist-avatar {
display: inline-flex;
flex: 0 0 48px;
width: 48px;
height: 48px;
align-items: center;
justify-content: center;
border-radius: 18px;
background: var(--detail-primary-soft);
color: var(--detail-primary);
}
.shop-copy,
.artist-copy {
display: grid;
min-width: 0;
gap: 3px;
flex: 1;
}
.eyebrow {
color: var(--detail-muted);
font-size: 11px;
font-weight: 600;
line-height: 1.2;
text-transform: uppercase;
letter-spacing: 0;
}
.shop-copy strong,
.artist-copy strong {
color: var(--detail-text);
font-size: 15px;
line-height: 1.35;
overflow-wrap: anywhere;
}
.shop-copy span:not(.eyebrow),
.artist-copy span:not(.eyebrow) {
color: var(--detail-muted);
font-size: 12px;
line-height: 1.45;
overflow-wrap: anywhere;
}
.shop-more {
flex: 0 0 auto;
color: var(--detail-primary);
font-size: 26px;
line-height: 1;
}
.quick-actions {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 18px;
}
.action-pill {
display: inline-flex;
min-height: 38px;
align-items: center;
justify-content: center;
gap: 7px;
padding: 8px 13px;
border: 1px solid var(--detail-border);
border-radius: 999px;
background: var(--detail-surface);
color: var(--detail-muted);
font-size: 13px;
line-height: 1.2;
}
.action-pill.active {
color: var(--detail-gold);
border-color: var(--detail-gold-soft);
background: var(--detail-surface);
}
.tags {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 20px;
}
.detail-tag {
border: 0;
border-radius: 999px;
background: var(--detail-surface-high);
color: var(--detail-muted);
font-size: 12px;
}
.description {
margin-top: 26px;
}
.description h3,
.guidance-panel h3,
.section-head h3 {
margin: 0;
color: var(--detail-text);
font-size: 15px;
font-weight: 700;
line-height: 1.3;
}
.description p,
.guidance-panel p {
margin: 10px 0 0;
color: var(--detail-muted);
font-size: 14px;
line-height: 1.8;
white-space: pre-wrap;
}
.guidance-grid {
display: grid;
gap: 12px;
margin-top: 18px;
}
.guidance-panel {
padding: 15px;
border: 1px solid var(--detail-border);
border-radius: 18px;
background: var(--detail-surface-soft);
}
.comment-section {
padding: 8px 20px 22px;
background: var(--detail-surface-soft);
}
.section-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
margin-bottom: 14px;
}
.section-head span {
color: var(--detail-muted);
font-size: 12px;
white-space: nowrap;
}
.comment-editor {
padding: 14px;
border: 1px solid var(--detail-border);
border-radius: 20px;
background: var(--detail-glass);
box-shadow: var(--detail-shadow-soft);
}
.comment-editor :deep(.ant-input) {
border: 0;
border-radius: 14px;
background: var(--detail-surface);
color: var(--detail-text);
resize: none;
}
.comment-editor :deep(.ant-input:focus) {
box-shadow: 0 0 0 2px var(--detail-primary-soft);
}
.comment-tools {
display: flex;
justify-content: flex-end;
gap: 8px;
margin-top: 10px;
}
.comment-tools :deep(.ant-btn-primary),
.detail-content-error :deep(.ant-btn-primary) {
border-color: var(--detail-primary);
background: var(--detail-primary);
box-shadow: none;
}
.comment-item {
padding: 18px 0;
border-bottom: 1px solid var(--detail-border);
}
.comment-item:last-child {
border-bottom: 0;
}
.comment-main {
display: flex;
justify-content: space-between;
gap: 12px;
color: var(--detail-muted);
font-size: 12px;
}
.comment-main strong {
color: var(--detail-text);
font-size: 14px;
}
.comment-item p {
margin: 8px 0;
color: var(--detail-text);
font-size: 14px;
line-height: 1.75;
}
.comment-item button {
padding: 0;
border: 0;
background: transparent;
color: var(--detail-primary);
cursor: pointer;
font-size: 13px;
}
.reply-list {
display: grid;
gap: 8px;
margin-top: 12px;
padding: 12px;
border-radius: 16px;
background: var(--detail-bg);
}
.reply-item {
display: grid;
gap: 3px;
color: var(--detail-muted);
font-size: 13px;
}
.reply-item strong {
color: var(--detail-text);
}
.detail-footer {
position: fixed;
right: auto;
bottom: 0;
left: 50%;
z-index: 35;
width: min(100%, var(--frontend-page-max-width));
padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
border-top: 1px solid var(--detail-border);
background: var(--detail-glass-strong);
box-shadow: 0 -14px 30px color-mix(in srgb, var(--theme-neutral) 8%, transparent);
backdrop-filter: blur(18px);
transform: translateX(-50%);
}
.footer-inner {
display: grid;
max-width: 430px;
grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1.18fr);
gap: 10px;
margin: 0 auto;
}
.detail-footer :deep(.ant-btn) {
display: inline-flex;
min-width: 0;
height: 52px;
align-items: center;
justify-content: center;
gap: 7px;
border-radius: 18px;
font-size: 14px;
font-weight: 700;
line-height: 1.2;
white-space: nowrap;
}
.footer-favorite {
border-color: var(--detail-border);
background: var(--detail-surface-high);
color: var(--detail-primary);
}
.footer-favorite .active {
color: var(--detail-gold);
}
.cart-button {
border-color: var(--detail-border);
background: var(--detail-surface-muted);
color: var(--detail-text);
}
.book-button {
border-color: var(--detail-primary);
background: var(--detail-primary);
color: var(--detail-surface);
box-shadow: 0 12px 22px color-mix(in srgb, var(--theme-primary-action) 20%, transparent);
}
@media (min-width: 461px) {
.detail-page {
padding-inline: 14px;
}
.hero-section {
border-radius: 0 0 26px 26px;
}
}
@media (max-width: 374px) {
.product-hero-copy,
.service-grid {
grid-template-columns: 1fr;
}
.price {
justify-self: start;
}
.footer-inner {
grid-template-columns: 50px minmax(0, 1fr) minmax(0, 1.1fr);
gap: 8px;
}
.detail-footer :deep(.ant-btn) {
font-size: 13px;
}
}
2026-03-05 15:15:59 +08:00
</style>