功能(网页):新增客户体验流程

This commit is contained in:
xiaowang
2026-05-23 21:56:18 +08:00
parent c2c985b2f8
commit 861eea933b
28 changed files with 2236 additions and 108 deletions
@@ -79,6 +79,17 @@
<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">
@@ -365,8 +376,10 @@ const handleAddToCart = async () => {
/** 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 handleAddToCart()
router.push('/cart')
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. */
@@ -428,8 +441,10 @@ onMounted(() => {
.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: var(--text-primary); }
.description p { margin: 10px 0 0; color: var(--text-secondary); line-height: 1.8; }
.description h3, .guidance-panel h3, .section-head h3 { margin: 0; font-size: 18px; color: var(--text-primary); }
.description p, .guidance-panel p { margin: 10px 0 0; color: var(--text-secondary); line-height: 1.8; white-space: pre-wrap; }
.guidance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.guidance-panel { padding: 14px; border-radius: 8px; border: 1px solid var(--theme-border); background: var(--theme-primary-soft); }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.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); }
@@ -445,5 +460,5 @@ onMounted(() => {
.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; } }
@media (max-width: 720px) { .metrics, .guidance-grid { grid-template-columns: 1fr; } .title-row { flex-direction: column; } }
</style>