杂务:整理文档并收口 YumiNail 修复
This commit is contained in:
@@ -17,7 +17,12 @@
|
||||
|
||||
<template v-else>
|
||||
<section class="media-section">
|
||||
<img :src="productImages[0] || DEFAULT_PRODUCT_IMAGE" :alt="productTitle" />
|
||||
<a-image
|
||||
class="detail-image-preview"
|
||||
:src="productImages[0] || DEFAULT_PRODUCT_IMAGE"
|
||||
:alt="productTitle"
|
||||
:preview="{ src: productImages[0] || DEFAULT_PRODUCT_IMAGE }"
|
||||
/>
|
||||
</section>
|
||||
|
||||
<section class="info-section">
|
||||
@@ -62,6 +67,7 @@
|
||||
<component :is="isFavorite ? StarFilled : StarOutlined" />
|
||||
{{ product.collectCount || 0 }} 收藏
|
||||
</button>
|
||||
<button type="button" @click="copyShareLink">分享链接</button>
|
||||
</div>
|
||||
|
||||
<div class="tags">
|
||||
@@ -123,7 +129,6 @@
|
||||
import { computed, inject, onMounted, ref } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import {
|
||||
CalendarOutlined,
|
||||
HeartFilled,
|
||||
HeartOutlined,
|
||||
LeftOutlined,
|
||||
@@ -182,6 +187,16 @@ const artistCountText = computed(() => artistCount.value > 0 ? `${artistCount.va
|
||||
/** earliestBookableText is a reactive state variable used by the template and event handlers. */
|
||||
const earliestBookableText = computed(() => shopInfo.value?.businessHours || '以门店安排为准')
|
||||
|
||||
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
|
||||
@@ -335,45 +350,48 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.detail-page { min-height: 100vh; background: #f6f7f9; }
|
||||
.detail-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: rgba(255,255,255,.96); border-bottom: 1px solid #eceff3; backdrop-filter: blur(10px); }
|
||||
.detail-header h1 { flex: 1; margin: 0; font-size: 17px; text-align: center; color: #20232a; }
|
||||
.detail-header .active { color: #e65d7a; }
|
||||
.detail-page { min-height: 100vh; background: linear-gradient(rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.92)), var(--theme-background-image), var(--theme-page-bg); background-size: cover, cover, auto; background-position: center top; }
|
||||
.detail-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--theme-border); backdrop-filter: blur(10px); }
|
||||
.detail-header h1 { flex: 1; margin: 0; font-size: 17px; text-align: center; color: var(--text-primary); }
|
||||
.detail-header .active { color: var(--theme-accent); }
|
||||
.detail-content { max-width: 1040px; margin: 0 auto; padding: 18px 16px 118px; }
|
||||
.media-section { overflow: hidden; border-radius: 8px; background: #fff; }
|
||||
.media-section img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
|
||||
.info-section, .comment-section { margin-top: 14px; padding: 22px; border-radius: 8px; background: #fff; border: 1px solid #edf0f4; }
|
||||
.media-section { overflow: hidden; border-radius: 8px; background: var(--theme-card-bg); }
|
||||
.media-section :deep(.ant-image),
|
||||
.media-section :deep(.ant-image-img),
|
||||
.media-section img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; cursor: zoom-in; }
|
||||
.info-section, .comment-section { margin-top: 14px; padding: 22px; border-radius: 8px; background: var(--theme-card-bg); border: 1px solid var(--theme-border); }
|
||||
.title-row { display: flex; justify-content: space-between; gap: 16px; }
|
||||
.title-row h2 { margin: 0 0 8px; font-size: 24px; color: #20232a; }
|
||||
.price { margin: 0; font-size: 26px; font-weight: 700; color: #d94f69; }
|
||||
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
|
||||
.metrics > div, .metrics > button { display: grid; gap: 4px; padding: 14px; border: 1px solid #edf0f4; border-radius: 8px; background: #fbfcfe; text-align: left; }
|
||||
.metrics svg { color: #3b82f6; }
|
||||
.metrics span { font-size: 12px; color: #7b8494; }
|
||||
.metrics strong { color: #20232a; }
|
||||
.shop-panel { display: grid; gap: 6px; margin-top: 18px; padding: 16px; border-radius: 8px; background: #f7f9fc; cursor: pointer; color: #5f6876; }
|
||||
.shop-panel strong { color: #20232a; }
|
||||
.title-row h2 { margin: 0 0 8px; font-size: 24px; color: var(--text-primary); }
|
||||
.price { margin: 0; font-size: 26px; font-weight: 700; color: var(--theme-accent); }
|
||||
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
|
||||
.metrics > div:nth-of-type(2) { display: none; }
|
||||
.metrics > div, .metrics > button { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--theme-border); border-radius: 8px; background: var(--theme-primary-soft); text-align: left; }
|
||||
.metrics svg { color: var(--theme-primary); }
|
||||
.metrics span { font-size: 12px; color: var(--text-secondary); }
|
||||
.metrics strong { color: var(--text-primary); }
|
||||
.shop-panel { display: none; }
|
||||
.shop-panel strong { color: var(--text-primary); }
|
||||
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
|
||||
.actions-row button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid #edf0f4; border-radius: 999px; background: #fff; color: #5f6876; }
|
||||
.actions-row button.active { color: #d94f69; border-color: #ffd7e0; background: #fff5f7; }
|
||||
.actions-row button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--theme-border); border-radius: 999px; background: var(--theme-card-bg); color: var(--text-secondary); }
|
||||
.actions-row button.active { color: var(--theme-accent); border-color: var(--theme-border); background: var(--theme-primary-soft); }
|
||||
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
|
||||
.description { margin-top: 22px; }
|
||||
.description h3, .section-head h3 { margin: 0; font-size: 18px; color: #20232a; }
|
||||
.description p { margin: 10px 0 0; color: #5f6876; line-height: 1.8; }
|
||||
.description h3, .section-head h3 { margin: 0; font-size: 18px; color: var(--text-primary); }
|
||||
.description p { margin: 10px 0 0; color: var(--text-secondary); line-height: 1.8; }
|
||||
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
|
||||
.section-head span { color: #7b8494; }
|
||||
.comment-editor { padding: 14px; border: 1px solid #edf0f4; border-radius: 8px; background: #fbfcfe; }
|
||||
.section-head span { color: var(--text-secondary); }
|
||||
.comment-editor { padding: 14px; border: 1px solid var(--theme-border); border-radius: 8px; background: var(--theme-primary-soft); }
|
||||
.comment-tools { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
|
||||
.comment-item { padding: 16px 0; border-bottom: 1px solid #edf0f4; }
|
||||
.comment-item { padding: 16px 0; border-bottom: 1px solid var(--theme-border); }
|
||||
.comment-item:last-child { border-bottom: 0; }
|
||||
.comment-main { display: flex; justify-content: space-between; gap: 12px; color: #7b8494; }
|
||||
.comment-main strong { color: #20232a; }
|
||||
.comment-item p { margin: 8px 0; color: #3b4350; line-height: 1.7; }
|
||||
.comment-item button { padding: 0; border: 0; background: transparent; color: #3b82f6; cursor: pointer; }
|
||||
.reply-list { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #f7f9fc; }
|
||||
.reply-item { display: flex; gap: 8px; padding: 6px 0; color: #5f6876; }
|
||||
.reply-item strong { color: #20232a; }
|
||||
.detail-footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: 12px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid #eceff3; backdrop-filter: blur(10px); }
|
||||
.comment-main { display: flex; justify-content: space-between; gap: 12px; color: var(--text-secondary); }
|
||||
.comment-main strong { color: var(--text-primary); }
|
||||
.comment-item p { margin: 8px 0; color: var(--text-primary); line-height: 1.7; }
|
||||
.comment-item button { padding: 0; border: 0; background: transparent; color: var(--theme-primary); cursor: pointer; }
|
||||
.reply-list { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--theme-primary-soft); }
|
||||
.reply-item { display: flex; gap: 8px; padding: 6px 0; color: var(--text-secondary); }
|
||||
.reply-item strong { color: var(--text-primary); }
|
||||
.detail-footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: 12px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--theme-border); backdrop-filter: blur(10px); }
|
||||
.detail-footer :deep(.ant-btn) { flex: 1; height: 46px; border-radius: 999px; font-weight: 700; }
|
||||
@media (max-width: 720px) { .metrics { grid-template-columns: 1fr; } .title-row { flex-direction: column; } }
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user