2026-04-03 11:44:32 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="page">
|
|
|
|
|
<main class="content">
|
2026-05-21 18:43:59 +08:00
|
|
|
<a-empty v-if="!cartItems.length" class="empty-cart" description="购物车还是空的">
|
2026-04-03 11:44:32 +08:00
|
|
|
<a-button type="primary" @click="router.push('/products')">去逛作品</a-button>
|
|
|
|
|
</a-empty>
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
<template v-else>
|
|
|
|
|
<section class="checkout-hero" :class="{ 'has-issues': selectedCount && checkoutIssueCount }">
|
|
|
|
|
<div class="hero-main">
|
2026-05-23 21:56:18 +08:00
|
|
|
<p class="hero-eyebrow">{{ isBuyNowMode ? '确认订单' : '购物车' }}</p>
|
|
|
|
|
<h1>{{ cartHeroTitle }}</h1>
|
2026-05-21 18:43:59 +08:00
|
|
|
<p>{{ checkoutStatusText }}</p>
|
2026-04-03 11:44:32 +08:00
|
|
|
</div>
|
2026-05-21 18:43:59 +08:00
|
|
|
<div class="hero-total">
|
|
|
|
|
<span>合计</span>
|
|
|
|
|
<strong>¥{{ totalAmount.toFixed(2) }}</strong>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="hero-metrics">
|
|
|
|
|
<div class="metric">
|
|
|
|
|
<span>已选项目</span>
|
|
|
|
|
<strong>{{ selectedCount }} 项</strong>
|
2026-04-03 11:44:32 +08:00
|
|
|
</div>
|
|
|
|
|
<div
|
2026-05-21 18:43:59 +08:00
|
|
|
class="metric"
|
|
|
|
|
:class="{ 'metric-warning': selectedCount && checkoutIssueCount }"
|
|
|
|
|
@click="focusFirstIssue"
|
2026-04-03 11:44:32 +08:00
|
|
|
>
|
2026-05-21 18:43:59 +08:00
|
|
|
<span>预约状态</span>
|
|
|
|
|
<strong>{{ checkoutIssueCount ? `${checkoutIssueCount} 项待完善` : '已就绪' }}</strong>
|
2026-04-03 11:44:32 +08:00
|
|
|
</div>
|
2026-05-21 18:43:59 +08:00
|
|
|
<div class="metric">
|
|
|
|
|
<span>作品数量</span>
|
|
|
|
|
<strong>{{ totalQuantity }} 件</strong>
|
2026-04-03 11:44:32 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-05-21 18:43:59 +08:00
|
|
|
</section>
|
2026-04-03 11:44:32 +08:00
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
<div v-if="selectedCount && firstCheckoutIssue" class="issue-callout">
|
|
|
|
|
<div>
|
|
|
|
|
<strong>{{ firstCheckoutIssue.message }}</strong>
|
|
|
|
|
<span>还有 {{ checkoutIssueCount }} 项需要处理后才能下单</span>
|
|
|
|
|
</div>
|
|
|
|
|
<a-button size="small" @click="focusFirstIssue">去完善</a-button>
|
2026-04-03 11:44:32 +08:00
|
|
|
</div>
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
<div class="checkout-layout">
|
|
|
|
|
<section class="cart-list">
|
|
|
|
|
<a-card
|
|
|
|
|
v-for="item in cartItems"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:ref="(element: unknown) => setItemRef(item.id, element)"
|
|
|
|
|
class="item-card"
|
|
|
|
|
:class="{ 'issue-card': item.selected && hasItemIssue(item) }"
|
|
|
|
|
>
|
|
|
|
|
<div class="item-row">
|
|
|
|
|
<a-checkbox class="item-check" v-model:checked="item.selected" @change="handleToggleSelect" />
|
|
|
|
|
<div class="thumb" @click="openProduct(item)">
|
|
|
|
|
<img v-if="item.productImage" :src="item.productImage" :alt="item.productTitle" />
|
|
|
|
|
<span v-else>{{ item.productTitle[0] }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="item-main">
|
|
|
|
|
<div class="item-head">
|
|
|
|
|
<div class="item-copy">
|
|
|
|
|
<div class="title" @click="openProduct(item)">{{ item.productTitle }}</div>
|
|
|
|
|
<div class="item-subtitle">
|
|
|
|
|
<span>数量 {{ item.quantity }}</span>
|
|
|
|
|
<span v-if="item.approximateDuration">预计 {{ item.approximateDuration }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="price">¥{{ Number(item.price || 0).toFixed(2) }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
class="appointment-panel"
|
|
|
|
|
:class="{ issue: item.selected && hasItemIssue(item), ready: item.selected && !hasItemIssue(item) }"
|
|
|
|
|
@click="openBookingModal(item)"
|
|
|
|
|
>
|
|
|
|
|
<div class="appointment-content">
|
|
|
|
|
<div class="appointment-head">
|
|
|
|
|
<span>预约信息</span>
|
|
|
|
|
<strong>{{ appointmentStatusText(item) }}</strong>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="appointment-grid">
|
|
|
|
|
<div>
|
|
|
|
|
<span>美甲师</span>
|
|
|
|
|
<strong>{{ item.artist?.name || '待选择' }}</strong>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<span>时间</span>
|
|
|
|
|
<strong>{{ item.appointmentTime ? formatAppointmentDisplay(item.appointmentTime) : '待选择' }}</strong>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<RightOutlined />
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
<div class="actions">
|
|
|
|
|
<div class="qty">
|
|
|
|
|
<a-button size="small" :disabled="item.quantity <= 1" @click="changeQuantity(item, -1)">-</a-button>
|
|
|
|
|
<span>{{ item.quantity }}</span>
|
|
|
|
|
<a-button size="small" :disabled="item.quantity >= 99" @click="changeQuantity(item, 1)">+</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
<a-popconfirm title="确认删除这件作品吗?" ok-text="确认" cancel-text="取消" @confirm="removeItem(item)">
|
|
|
|
|
<a-button type="text" danger size="small">
|
|
|
|
|
<DeleteOutlined />
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</a-card>
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<aside class="checkout-side">
|
|
|
|
|
<button
|
|
|
|
|
v-if="selectedCount"
|
|
|
|
|
type="button"
|
|
|
|
|
class="coupon-panel"
|
|
|
|
|
@click="openCouponModal"
|
|
|
|
|
>
|
|
|
|
|
<div>
|
|
|
|
|
<span>优惠方式</span>
|
|
|
|
|
<strong>{{ selectedCoupon ? formatCouponDisplay(selectedCoupon) : '不使用优惠' }}</strong>
|
|
|
|
|
</div>
|
|
|
|
|
<em v-if="selectedCoupon">-¥{{ discountAmount.toFixed(2) }}</em>
|
|
|
|
|
<RightOutlined />
|
|
|
|
|
</button>
|
|
|
|
|
|
2026-05-23 21:56:18 +08:00
|
|
|
<section v-if="checkoutPreview" class="preview-panel">
|
|
|
|
|
<div class="preview-line">{{ checkoutPreview.summaryText }}</div>
|
|
|
|
|
<div v-if="checkoutPreview.vipTip" class="preview-line vip">{{ checkoutPreview.vipTip }}</div>
|
|
|
|
|
</section>
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
<section class="summary-panel">
|
|
|
|
|
<div class="summary-row"><span>选中项目</span><strong>{{ selectedCount }} 项</strong></div>
|
|
|
|
|
<div class="summary-row"><span>作品数量</span><strong>{{ totalQuantity }} 件</strong></div>
|
2026-05-23 21:56:18 +08:00
|
|
|
<div class="summary-row"><span>商品小计</span><strong>¥{{ subtotal.toFixed(2) }}</strong></div>
|
|
|
|
|
<div v-if="discountAmount > 0" class="summary-row discount"><span>已省</span><strong>-¥{{ discountAmount.toFixed(2) }}</strong></div>
|
2026-05-21 18:43:59 +08:00
|
|
|
<div class="summary-row total"><span>合计</span><strong>¥{{ totalAmount.toFixed(2) }}</strong></div>
|
|
|
|
|
</section>
|
|
|
|
|
</aside>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2026-04-03 11:44:32 +08:00
|
|
|
</main>
|
|
|
|
|
|
|
|
|
|
<footer v-if="cartItems.length" class="footer">
|
2026-05-21 18:43:59 +08:00
|
|
|
<div class="footer-summary">
|
|
|
|
|
<span>{{ selectedCount ? `已选 ${selectedCount} 项` : '还未选择作品' }}</span>
|
|
|
|
|
<strong>¥{{ totalAmount.toFixed(2) }}</strong>
|
|
|
|
|
</div>
|
2026-04-03 11:44:32 +08:00
|
|
|
<a-button
|
|
|
|
|
type="primary"
|
|
|
|
|
size="large"
|
2026-05-21 18:43:59 +08:00
|
|
|
class="checkout-button"
|
2026-04-03 11:44:32 +08:00
|
|
|
:loading="submittingOrder"
|
2026-05-21 18:43:59 +08:00
|
|
|
:disabled="submittingOrder || !selectedCount"
|
2026-04-03 11:44:32 +08:00
|
|
|
@click="checkout"
|
|
|
|
|
>
|
2026-05-21 18:43:59 +08:00
|
|
|
{{ checkoutActionText }}
|
2026-04-03 11:44:32 +08:00
|
|
|
</a-button>
|
|
|
|
|
</footer>
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
<a-modal
|
|
|
|
|
v-model:open="showCouponModal"
|
|
|
|
|
title="选择优惠方式"
|
|
|
|
|
wrap-class-name="cart-coupon-modal-wrap"
|
|
|
|
|
class="cart-coupon-modal"
|
|
|
|
|
ok-text="确认"
|
|
|
|
|
cancel-text="取消"
|
|
|
|
|
:ok-button-props="couponModalOkButtonProps"
|
|
|
|
|
:cancel-button-props="couponModalCancelButtonProps"
|
|
|
|
|
@ok="applyCouponSelection"
|
|
|
|
|
@cancel="showCouponModal = false"
|
|
|
|
|
>
|
2026-04-03 11:44:32 +08:00
|
|
|
<a-radio-group v-model:value="couponSelectionKey" class="coupon-options">
|
|
|
|
|
<a-radio :value="NO_COUPON_KEY">不使用优惠</a-radio>
|
|
|
|
|
<a-radio v-for="coupon in availableCoupons" :key="getCouponKey(coupon)" :value="getCouponKey(coupon)">
|
2026-05-23 21:56:18 +08:00
|
|
|
<span class="coupon-option-copy">
|
|
|
|
|
<strong>{{ formatCouponDisplay(coupon) }}</strong>
|
|
|
|
|
<em>{{ coupon.savingText || `本单可省 ¥${Number(coupon.discountAmount || 0).toFixed(2)}` }}</em>
|
|
|
|
|
</span>
|
2026-04-03 11:44:32 +08:00
|
|
|
</a-radio>
|
|
|
|
|
</a-radio-group>
|
2026-05-23 21:56:18 +08:00
|
|
|
<div v-if="unavailableCoupons.length" class="coupon-unavailable">
|
|
|
|
|
<div v-for="coupon in unavailableCoupons" :key="getCouponKey(coupon)" class="coupon-unavailable-item">
|
|
|
|
|
<span>{{ formatCouponDisplay(coupon) }}</span>
|
|
|
|
|
<em>{{ coupon.unavailableReason || '本单暂不可用' }}</em>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-04-03 11:44:32 +08:00
|
|
|
<div class="coupon-tip">
|
2026-05-23 21:56:18 +08:00
|
|
|
{{ checkoutPreview?.vipTip || '系统会按本次订单金额自动预选减免最高的一张券,也可以手动选择不使用优惠。' }}
|
2026-04-03 11:44:32 +08:00
|
|
|
</div>
|
|
|
|
|
</a-modal>
|
|
|
|
|
|
|
|
|
|
<a-modal v-model:open="showBookingModal" :title="bookingTitle" @ok="confirmBooking" @cancel="closeBookingModal">
|
|
|
|
|
<div class="modal-section">
|
|
|
|
|
<div class="section-title">美甲师</div>
|
|
|
|
|
<div v-if="availableArtists.length" class="artist-list">
|
|
|
|
|
<button
|
|
|
|
|
v-for="artist in availableArtists"
|
|
|
|
|
:key="artist.id"
|
|
|
|
|
type="button"
|
|
|
|
|
class="artist-option"
|
|
|
|
|
:class="{ active: sameId(draftArtistId, artist.id) }"
|
|
|
|
|
@click="draftArtistId = artist.id"
|
|
|
|
|
>
|
|
|
|
|
<img v-if="artist.avatar" :src="artist.avatar" :alt="artist.name" />
|
|
|
|
|
<span>{{ artist.name }}</span>
|
2026-05-18 09:46:11 +08:00
|
|
|
<em v-if="artist.roleLabel">{{ artist.roleLabel }}</em>
|
2026-04-03 11:44:32 +08:00
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<a-empty v-else description="暂无可预约美甲师" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="modal-section">
|
|
|
|
|
<div class="section-title">预约时间</div>
|
|
|
|
|
<a-date-picker
|
|
|
|
|
v-model:value="draftAppointmentTime"
|
|
|
|
|
class="time-picker"
|
2026-05-18 09:46:11 +08:00
|
|
|
popup-class-name="yumi-date-picker-panel yumi-date-time-panel"
|
2026-04-03 11:44:32 +08:00
|
|
|
style="width: 100%"
|
|
|
|
|
format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
input-read-only
|
|
|
|
|
:disabled-date="disablePastAppointmentDate"
|
|
|
|
|
:disabled-time="disablePastAppointmentTime"
|
|
|
|
|
:show-time="{ minuteStep: 30, secondStep: 60, hideDisabledOptions: true }"
|
|
|
|
|
placeholder="请选择预约时间"
|
|
|
|
|
/>
|
2026-05-18 09:46:11 +08:00
|
|
|
<div class="quick-time-grid">
|
|
|
|
|
<button
|
|
|
|
|
v-for="slot in quickAppointmentSlots"
|
|
|
|
|
:key="slot.value"
|
|
|
|
|
type="button"
|
|
|
|
|
class="quick-time"
|
|
|
|
|
:class="{ active: draftAppointmentTime === slot.value }"
|
|
|
|
|
@click="draftAppointmentTime = slot.value"
|
|
|
|
|
>
|
|
|
|
|
<span>{{ slot.label }}</span>
|
|
|
|
|
<strong>{{ slot.time }}</strong>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2026-04-03 11:44:32 +08:00
|
|
|
<div class="helper">{{ bookingHelperText }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</a-modal>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2026-05-18 09:46:11 +08:00
|
|
|
/**
|
|
|
|
|
* CartView page script.
|
|
|
|
|
* Call guide: the template binds the reactive state below, and the methods are triggered by button clicks, lifecycle hooks, or router events.
|
|
|
|
|
*/
|
2026-04-03 11:44:32 +08:00
|
|
|
import { computed, inject, onMounted, ref } from 'vue'
|
2026-05-23 21:56:18 +08:00
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
2026-05-21 18:43:59 +08:00
|
|
|
import { DeleteOutlined, RightOutlined } from '@ant-design/icons-vue'
|
2026-05-23 21:56:18 +08:00
|
|
|
import { message, Modal } from 'ant-design-vue'
|
2026-05-21 18:43:59 +08:00
|
|
|
import type { ButtonProps } from 'ant-design-vue/es/button/buttonTypes'
|
2026-04-03 11:44:32 +08:00
|
|
|
import { cartApi } from '../api/cart'
|
2026-05-23 18:44:57 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: UserCoupon supports CartView.vue by holding or executing the user coupon 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.
|
|
|
|
|
*/
|
2026-04-03 11:44:32 +08:00
|
|
|
import { fileApi } from '../api/index'
|
|
|
|
|
import { orderApi } from '../api/order'
|
2026-05-23 21:56:18 +08:00
|
|
|
import type { CheckoutCouponPreview, CheckoutPreview } from '../api/order'
|
2026-04-03 11:44:32 +08:00
|
|
|
import { shopApi } from '../api/shop'
|
|
|
|
|
import type { IdType } from '@/utils/id'
|
|
|
|
|
import { sameId, toOptionalIdString } from '@/utils/id'
|
|
|
|
|
import { runWithGlobalLoading } from '@/utils/action-loading'
|
2026-05-23 21:56:18 +08:00
|
|
|
import { getBuyNowProductIdFromQuery, isBuyNowCartItem } from '@/utils/buy-now'
|
|
|
|
|
import { buildRecoveryActions, getRecoveryMessage } from '@/utils/recovery'
|
2026-04-03 11:44:32 +08:00
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: router supports CartView.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.
|
|
|
|
|
*/
|
2026-04-03 11:44:32 +08:00
|
|
|
const router = useRouter()
|
2026-05-23 21:56:18 +08:00
|
|
|
/** route exposes cart query parameters, including the one-shot buyNow checkout target. */
|
|
|
|
|
const route = useRoute()
|
2026-05-23 18:44:57 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: updateCartCount supports CartView.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-04-03 11:44:32 +08:00
|
|
|
const updateCartCount = inject<() => Promise<void>>('updateCartCount', async () => {})
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: NO_COUPON_KEY supports CartView.vue by holding or executing the no coupon key 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-04-03 11:44:32 +08:00
|
|
|
const NO_COUPON_KEY = 'NONE'
|
2026-05-23 18:44:57 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: ButtonPropsWithClass supports CartView.vue by holding or executing the button props with class 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.
|
|
|
|
|
*/
|
2026-05-21 18:43:59 +08:00
|
|
|
type ButtonPropsWithClass = ButtonProps & { class?: string }
|
|
|
|
|
const couponModalOkButtonProps: ButtonPropsWithClass = { class: 'cart-coupon-modal__ok' }
|
|
|
|
|
const couponModalCancelButtonProps: ButtonPropsWithClass = { class: 'cart-coupon-modal__cancel' }
|
2026-04-03 11:44:32 +08:00
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: ArtistOption supports CartView.vue by holding or executing the artist option page or API role.
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
*/
|
2026-04-03 11:44:32 +08:00
|
|
|
interface ArtistOption {
|
|
|
|
|
id: IdType
|
|
|
|
|
name: string
|
|
|
|
|
avatar?: string
|
2026-05-18 09:46:11 +08:00
|
|
|
userType?: number
|
|
|
|
|
roleLabel?: string
|
|
|
|
|
participateProduction?: boolean
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: CartItem supports CartView.vue by holding or executing the cart item page or API role.
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
*/
|
2026-04-03 11:44:32 +08:00
|
|
|
interface CartItem {
|
|
|
|
|
id: IdType
|
|
|
|
|
productId: IdType
|
|
|
|
|
shopId?: IdType
|
|
|
|
|
productTitle: string
|
|
|
|
|
productImage: string
|
|
|
|
|
originalProductImage?: string
|
|
|
|
|
price: number
|
|
|
|
|
quantity: number
|
|
|
|
|
totalPrice: number
|
|
|
|
|
tags: string
|
|
|
|
|
tagNames?: string
|
|
|
|
|
approximateDuration?: string
|
|
|
|
|
bookableArtists?: string
|
|
|
|
|
availableBookableArtistCount?: number
|
|
|
|
|
bookableArtistRestricted?: boolean
|
|
|
|
|
availableArtists?: ArtistOption[]
|
|
|
|
|
appointmentTime?: string
|
|
|
|
|
selected: boolean
|
|
|
|
|
artistId?: IdType
|
|
|
|
|
artist?: ArtistOption
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: CheckoutIssue supports CartView.vue by holding or executing the checkout issue page or API role.
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
*/
|
2026-04-03 11:44:32 +08:00
|
|
|
interface CheckoutIssue {
|
|
|
|
|
key: string
|
|
|
|
|
message: string
|
|
|
|
|
itemId?: IdType
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: cartItems supports CartView.vue by holding or executing the cart items 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-04-03 11:44:32 +08:00
|
|
|
const cartItems = ref<CartItem[]>([])
|
2026-05-23 18:44:57 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: imageIdCache supports CartView.vue by holding or executing the image id cache 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-04-03 11:44:32 +08:00
|
|
|
const imageIdCache = ref<Record<string, string>>({})
|
2026-05-23 18:44:57 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: itemRefs supports CartView.vue by holding or executing the item refs 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-04-03 11:44:32 +08:00
|
|
|
const itemRefs = ref<Record<string, HTMLElement>>({})
|
2026-05-23 18:44:57 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: availableCoupons supports CartView.vue by holding or executing the available coupons 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-05-23 21:56:18 +08:00
|
|
|
const availableCoupons = ref<CheckoutCouponPreview[]>([])
|
|
|
|
|
const unavailableCoupons = ref<CheckoutCouponPreview[]>([])
|
|
|
|
|
const checkoutPreview = ref<CheckoutPreview | null>(null)
|
2026-05-23 18:44:57 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: selectedCoupon supports CartView.vue by holding or executing the selected coupon 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-05-23 21:56:18 +08:00
|
|
|
const selectedCoupon = ref<CheckoutCouponPreview | null>(null)
|
2026-05-18 09:46:11 +08:00
|
|
|
/** couponSelectionKey is a reactive state variable used by the template and event handlers. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const couponSelectionKey = ref(NO_COUPON_KEY)
|
2026-05-18 09:46:11 +08:00
|
|
|
/** couponSelectionTouched is a reactive state variable used by the template and event handlers. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const couponSelectionTouched = ref(false)
|
2026-05-18 09:46:11 +08:00
|
|
|
/** showCouponModal is a reactive state variable used by the template and event handlers. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const showCouponModal = ref(false)
|
2026-05-18 09:46:11 +08:00
|
|
|
/** showBookingModal is a reactive state variable used by the template and event handlers. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const showBookingModal = ref(false)
|
2026-05-23 18:44:57 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: currentItem supports CartView.vue by holding or executing the current item 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-04-03 11:44:32 +08:00
|
|
|
const currentItem = ref<CartItem | null>(null)
|
2026-05-23 18:44:57 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: availableArtists supports CartView.vue by holding or executing the available artists 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-04-03 11:44:32 +08:00
|
|
|
const availableArtists = ref<ArtistOption[]>([])
|
2026-05-23 18:44:57 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: draftArtistId supports CartView.vue by holding or executing the draft artist id 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-04-03 11:44:32 +08:00
|
|
|
const draftArtistId = ref<IdType>()
|
2026-05-18 09:46:11 +08:00
|
|
|
/** draftAppointmentTime is a reactive state variable used by the template and event handlers. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const draftAppointmentTime = ref('')
|
2026-05-18 09:46:11 +08:00
|
|
|
/** currentShopHours is a reactive state variable used by the template and event handlers. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const currentShopHours = ref('')
|
2026-05-18 09:46:11 +08:00
|
|
|
/** submittingOrder is a reactive state variable used by the template and event handlers. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const submittingOrder = ref(false)
|
2026-05-23 21:56:18 +08:00
|
|
|
/** buyNowProductId limits checkout selection to the product that opened cart from "立即预约". */
|
|
|
|
|
const buyNowProductId = computed(() => getBuyNowProductIdFromQuery(route.query))
|
|
|
|
|
/** isBuyNowMode switches cart copy into a focused order-confirmation experience. */
|
|
|
|
|
const isBuyNowMode = computed(() => Boolean(buyNowProductId.value))
|
2026-04-03 11:44:32 +08:00
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** selectedItems is a reactive state variable used by the template and event handlers. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const selectedItems = computed(() => cartItems.value.filter(item => item.selected))
|
2026-05-18 09:46:11 +08:00
|
|
|
/** selectedCount is a reactive state variable used by the template and event handlers. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const selectedCount = computed(() => selectedItems.value.length)
|
2026-05-18 09:46:11 +08:00
|
|
|
/** totalQuantity is a reactive state variable used by the template and event handlers. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const totalQuantity = computed(() => selectedItems.value.reduce((sum, item) => sum + item.quantity, 0))
|
2026-05-18 09:46:11 +08:00
|
|
|
/** subtotal is a reactive state variable used by the template and event handlers. */
|
2026-05-23 21:56:18 +08:00
|
|
|
const localSubtotal = computed(() => selectedItems.value.reduce((sum, item) => sum + Number(item.price || 0) * item.quantity, 0))
|
|
|
|
|
const subtotal = computed(() => Number(checkoutPreview.value?.subtotalAmount ?? localSubtotal.value))
|
2026-05-18 09:46:11 +08:00
|
|
|
/** discountAmount is a reactive state variable used by the template and event handlers. */
|
2026-05-23 21:56:18 +08:00
|
|
|
const discountAmount = computed(() => Number(checkoutPreview.value?.savedAmount ?? calculateCouponDiscount(selectedCoupon.value, subtotal.value)))
|
2026-05-18 09:46:11 +08:00
|
|
|
/** totalAmount is a reactive state variable used by the template and event handlers. */
|
2026-05-23 21:56:18 +08:00
|
|
|
const totalAmount = computed(() => Number(checkoutPreview.value?.payableAmount ?? Math.max(0, subtotal.value - discountAmount.value)))
|
|
|
|
|
/** cartHeroTitle names the current checkout mode for the first screen. */
|
|
|
|
|
const cartHeroTitle = computed(() => {
|
|
|
|
|
if (isBuyNowMode.value) {
|
|
|
|
|
return selectedCount.value ? '确认本次预约订单' : '请选择本次预约项目'
|
|
|
|
|
}
|
|
|
|
|
return selectedCount.value ? '确认订单' : '选择要结算的作品'
|
|
|
|
|
})
|
2026-05-18 09:46:11 +08:00
|
|
|
/** bookingTitle is a reactive state variable used by the template and event handlers. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const bookingTitle = computed(() => currentItem.value ? `为 ${currentItem.value.productTitle} 选择预约信息` : '选择预约信息')
|
2026-05-18 09:46:11 +08:00
|
|
|
/** bookingHelperText is a reactive state variable used by the template and event handlers. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const bookingHelperText = computed(() => {
|
|
|
|
|
const texts: string[] = []
|
|
|
|
|
if (currentShopHours.value) texts.push(`门店营业时间:${currentShopHours.value}`)
|
|
|
|
|
if (currentItem.value?.approximateDuration) texts.push(`预计时长:${currentItem.value.approximateDuration}`)
|
|
|
|
|
return texts.join(' · ') || '请选择至少晚于当前 5 分钟的预约时间'
|
|
|
|
|
})
|
2026-05-18 09:46:11 +08:00
|
|
|
/** quickAppointmentSlots is a reactive state variable used by the template and event handlers. */
|
|
|
|
|
const quickAppointmentSlots = computed(() => {
|
|
|
|
|
const now = getMinAppointmentDate()
|
|
|
|
|
const today = new Date(now)
|
|
|
|
|
const nextHour = new Date(now)
|
|
|
|
|
nextHour.setMinutes(now.getMinutes() > 30 ? 0 : 30, 0, 0)
|
|
|
|
|
if (nextHour.getTime() < now.getTime()) {
|
|
|
|
|
nextHour.setHours(nextHour.getHours() + 1)
|
|
|
|
|
}
|
2026-04-03 11:44:32 +08:00
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
const tomorrowMorning = buildAppointmentDate(1, 10, 0)
|
|
|
|
|
const tomorrowAfternoon = buildAppointmentDate(1, 14, 0)
|
|
|
|
|
const afterTomorrowAfternoon = buildAppointmentDate(2, 15, 0)
|
|
|
|
|
const weekendMorning = nextWeekendMorning(today)
|
|
|
|
|
|
|
|
|
|
return [nextHour, tomorrowMorning, tomorrowAfternoon, afterTomorrowAfternoon, weekendMorning]
|
|
|
|
|
.filter((date, index, list) => date.getTime() >= now.getTime() && list.findIndex(item => item.getTime() === date.getTime()) === index)
|
|
|
|
|
.slice(0, 5)
|
|
|
|
|
.map(date => ({
|
|
|
|
|
value: formatAppointmentValue(date),
|
|
|
|
|
label: quickDateLabel(date),
|
|
|
|
|
time: `${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`
|
|
|
|
|
}))
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
/** getMinAppointmentDate is a local helper used by this page script. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const getMinAppointmentDate = () => {
|
|
|
|
|
const date = new Date()
|
|
|
|
|
date.setSeconds(0, 0)
|
|
|
|
|
date.setMinutes(date.getMinutes() + 5)
|
|
|
|
|
return date
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** getDayBoundary is a local helper used by this page script. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const getDayBoundary = (date: Date) => {
|
|
|
|
|
const boundary = new Date(date)
|
|
|
|
|
boundary.setHours(0, 0, 0, 0)
|
|
|
|
|
return boundary.getTime()
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** buildAppointmentDate is a local helper used by this page script. */
|
|
|
|
|
const buildAppointmentDate = (daysFromToday: number, hour: number, minute: number) => {
|
|
|
|
|
const date = new Date()
|
|
|
|
|
date.setDate(date.getDate() + daysFromToday)
|
|
|
|
|
date.setHours(hour, minute, 0, 0)
|
|
|
|
|
return date
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** nextWeekendMorning is a local helper used by this page script. */
|
|
|
|
|
const nextWeekendMorning = (fromDate: Date) => {
|
|
|
|
|
const date = new Date(fromDate)
|
|
|
|
|
const day = date.getDay()
|
|
|
|
|
const offset = day === 0 ? 6 : 6 - day
|
|
|
|
|
date.setDate(date.getDate() + Math.max(1, offset))
|
|
|
|
|
date.setHours(10, 0, 0, 0)
|
|
|
|
|
return date
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** formatAppointmentValue is a local helper used by this page script. */
|
|
|
|
|
const formatAppointmentValue = (date: Date) => {
|
|
|
|
|
/** pad is a local helper used by this page script. */
|
|
|
|
|
const pad = (value: number) => String(value).padStart(2, '0')
|
|
|
|
|
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:00`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** quickDateLabel is a local helper used by this page script. */
|
|
|
|
|
const quickDateLabel = (date: Date) => {
|
|
|
|
|
const today = new Date()
|
|
|
|
|
const tomorrow = new Date()
|
|
|
|
|
tomorrow.setDate(tomorrow.getDate() + 1)
|
|
|
|
|
if (date.toDateString() === today.toDateString()) return '今天'
|
|
|
|
|
if (date.toDateString() === tomorrow.toDateString()) return '明天'
|
|
|
|
|
return `${date.getMonth() + 1}月${date.getDate()}日`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** getCouponKey is a local helper used by this page script. */
|
2026-05-23 21:56:18 +08:00
|
|
|
const getCouponKey = (coupon: CheckoutCouponPreview) => `${coupon.sourceType || 'USER_COUPON'}:${coupon.id}`
|
2026-04-03 11:44:32 +08:00
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** setItemRef is a local helper used by this page script. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const setItemRef = (itemId: IdType, element: unknown) => {
|
|
|
|
|
const refKey = toOptionalIdString(itemId)
|
|
|
|
|
if (!refKey) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (element && (element as any).$el) {
|
|
|
|
|
itemRefs.value[refKey] = (element as any).$el as HTMLElement
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (element instanceof HTMLElement) {
|
|
|
|
|
itemRefs.value[refKey] = element
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
delete itemRefs.value[refKey]
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** formatCouponDisplay is a local helper used by this page script. */
|
2026-05-23 21:56:18 +08:00
|
|
|
const formatCouponDisplay = (coupon: CheckoutCouponPreview) => {
|
|
|
|
|
if (coupon.displayText) {
|
|
|
|
|
return coupon.displayText
|
|
|
|
|
}
|
2026-04-03 11:44:32 +08:00
|
|
|
const badge = coupon.sourceType === 'SYSTEM_VIP' ? '[VIP 自动券]' : '[用户券]'
|
|
|
|
|
const benefit = coupon.couponType === 1
|
|
|
|
|
? `${coupon.discountValue} 折`
|
|
|
|
|
: `满 ${coupon.minAmount} 减 ${coupon.reduceAmount}`
|
|
|
|
|
return `${badge} ${coupon.couponName} ${benefit}`
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** calculateCouponDiscount is a local helper used by this page script. */
|
2026-05-23 21:56:18 +08:00
|
|
|
const calculateCouponDiscount = (coupon: CheckoutCouponPreview | null, amount: number) => {
|
2026-04-03 11:44:32 +08:00
|
|
|
if (!coupon || amount <= 0) {
|
|
|
|
|
return 0
|
|
|
|
|
}
|
2026-05-23 21:56:18 +08:00
|
|
|
if (coupon.discountAmount !== undefined && coupon.discountAmount !== null) {
|
|
|
|
|
return Number(coupon.discountAmount || 0)
|
|
|
|
|
}
|
2026-04-03 11:44:32 +08:00
|
|
|
if (coupon.couponType === 1) {
|
|
|
|
|
const discountValue = Number(coupon.discountValue || 0)
|
|
|
|
|
return discountValue ? amount - amount * discountValue / 10 : 0
|
|
|
|
|
}
|
|
|
|
|
if (coupon.couponType === 2) {
|
|
|
|
|
return Number(coupon.reduceAmount || 0)
|
|
|
|
|
}
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** findBestCoupon is a local helper used by this page script. */
|
2026-05-23 21:56:18 +08:00
|
|
|
const findBestCoupon = (coupons: CheckoutCouponPreview[]) => {
|
2026-04-03 11:44:32 +08:00
|
|
|
return coupons
|
|
|
|
|
.sort((left, right) => calculateCouponDiscount(right, subtotal.value) - calculateCouponDiscount(left, subtotal.value))[0] || null
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** formatAppointmentDisplay is a local helper used by this page script. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const formatAppointmentDisplay = (value?: string) => value ? value.replace('T', ' ').slice(0, 16) : '未选择预约时间'
|
2026-05-18 09:46:11 +08:00
|
|
|
/** isPastAppointment is a local helper used by this page script. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const isPastAppointment = (value?: string) => !!value && new Date(value.replace(' ', 'T')).getTime() < getMinAppointmentDate().getTime()
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** hasItemIssue is a local helper used by this page script. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const hasItemIssue = (item: CartItem) => !item.artistId || !item.appointmentTime || isPastAppointment(item.appointmentTime)
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
/** appointmentStatusText is a local helper used by this page script. */
|
|
|
|
|
const appointmentStatusText = (item: CartItem) => {
|
|
|
|
|
if (!item.selected) {
|
|
|
|
|
return '未选中'
|
|
|
|
|
}
|
|
|
|
|
if (!item.artistId) {
|
|
|
|
|
return '待选美甲师'
|
|
|
|
|
}
|
|
|
|
|
if (!item.appointmentTime) {
|
|
|
|
|
return '待选时间'
|
|
|
|
|
}
|
|
|
|
|
if (isPastAppointment(item.appointmentTime)) {
|
|
|
|
|
return '时间已过期'
|
|
|
|
|
}
|
|
|
|
|
return '已完成'
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-03 11:44:32 +08:00
|
|
|
// 购物车结算口径要求单店铺、单美甲师、完整预约信息,避免后端拆单和排班出现歧义。
|
|
|
|
|
const checkoutIssues = computed<CheckoutIssue[]>(() => {
|
|
|
|
|
const items = selectedItems.value
|
|
|
|
|
const issues: CheckoutIssue[] = []
|
|
|
|
|
const firstMissingArtist = items.find(item => !item.artistId)
|
|
|
|
|
if (firstMissingArtist) {
|
|
|
|
|
issues.push({ key: 'artist', message: `请先为“${firstMissingArtist.productTitle}”选择美甲师`, itemId: firstMissingArtist.id })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const firstMissingTime = items.find(item => !item.appointmentTime)
|
|
|
|
|
if (firstMissingTime) {
|
|
|
|
|
issues.push({ key: 'time', message: `请先为“${firstMissingTime.productTitle}”选择预约时间`, itemId: firstMissingTime.id })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const firstExpiredTime = items.find(item => isPastAppointment(item.appointmentTime))
|
|
|
|
|
if (firstExpiredTime) {
|
|
|
|
|
issues.push({ key: 'expired', message: `“${firstExpiredTime.productTitle}”的预约时间已过期,请重新选择`, itemId: firstExpiredTime.id })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const selectedShopIds = new Set(
|
|
|
|
|
items
|
|
|
|
|
.map(item => toOptionalIdString(item.shopId))
|
|
|
|
|
.filter((shopId): shopId is string => Boolean(shopId))
|
|
|
|
|
)
|
|
|
|
|
if (selectedShopIds.size > 1) {
|
|
|
|
|
issues.push({ key: 'shop', message: '跨店铺项目请分开结算', itemId: items[0]?.id })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const selectedArtistIds = new Set(
|
|
|
|
|
items
|
|
|
|
|
.map(item => toOptionalIdString(item.artistId))
|
|
|
|
|
.filter((artistId): artistId is string => Boolean(artistId))
|
|
|
|
|
)
|
|
|
|
|
if (selectedArtistIds.size > 1) {
|
|
|
|
|
issues.push({ key: 'artist-mix', message: '不同美甲师的项目请分开结算', itemId: items[0]?.id })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return issues
|
|
|
|
|
})
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
/** checkoutIssueCount is a reactive state variable used by the template and event handlers. */
|
|
|
|
|
const checkoutIssueCount = computed(() => checkoutIssues.value.length)
|
|
|
|
|
/** firstCheckoutIssue is a reactive state variable used by the template and event handlers. */
|
|
|
|
|
const firstCheckoutIssue = computed(() => checkoutIssues.value[0])
|
|
|
|
|
/** checkoutStatusText is a reactive state variable used by the template and event handlers. */
|
|
|
|
|
const checkoutStatusText = computed(() => {
|
|
|
|
|
if (!selectedCount.value) {
|
2026-05-23 21:56:18 +08:00
|
|
|
return isBuyNowMode.value ? '本次预约只会提交刚刚选择的作品,不会混入购物车其他项目' : '勾选需要结算的作品,完善预约信息后即可提交订单'
|
2026-05-21 18:43:59 +08:00
|
|
|
}
|
|
|
|
|
if (checkoutIssueCount.value) {
|
|
|
|
|
return `还有 ${checkoutIssueCount.value} 项预约信息待完善`
|
|
|
|
|
}
|
2026-05-23 21:56:18 +08:00
|
|
|
return selectedCoupon.value ? '订单信息已确认,优惠已计算' : '订单信息已确认,可以提交订单'
|
2026-05-21 18:43:59 +08:00
|
|
|
})
|
|
|
|
|
/** checkoutActionText is a reactive state variable used by the template and event handlers. */
|
|
|
|
|
const checkoutActionText = computed(() => {
|
|
|
|
|
if (!selectedCount.value) {
|
|
|
|
|
return '先选择作品'
|
|
|
|
|
}
|
|
|
|
|
return checkoutIssueCount.value ? '完善预约信息' : '去结算'
|
|
|
|
|
})
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** scrollToIssue is a local helper used by this page script. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const scrollToIssue = (issue?: CheckoutIssue) => {
|
|
|
|
|
const itemId = toOptionalIdString(issue?.itemId)
|
|
|
|
|
if (!itemId) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
const target = itemRefs.value[itemId]
|
|
|
|
|
if (target) {
|
|
|
|
|
target.scrollIntoView({ behavior: 'smooth', block: 'center' })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** focusFirstIssue is a local helper used by this page script. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const focusFirstIssue = () => {
|
|
|
|
|
scrollToIssue(checkoutIssues.value[0])
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** loadCartItems is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const loadCartItems = async () => {
|
|
|
|
|
const response = await cartApi.getCartList() as unknown as any[]
|
|
|
|
|
cartItems.value = (response || []).map(item => ({
|
|
|
|
|
...item,
|
2026-05-23 21:56:18 +08:00
|
|
|
selected: isBuyNowMode.value ? isBuyNowCartItem(item.productId, buyNowProductId.value) : true,
|
2026-04-03 11:44:32 +08:00
|
|
|
originalProductImage: item.productImage,
|
|
|
|
|
productImage: '',
|
|
|
|
|
appointmentTime: item.appointmentTime
|
|
|
|
|
}))
|
|
|
|
|
couponSelectionTouched.value = false
|
|
|
|
|
couponSelectionKey.value = NO_COUPON_KEY
|
|
|
|
|
selectedCoupon.value = null
|
|
|
|
|
await Promise.all([loadProductImages(), loadAvailableCoupons()])
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** loadProductImages is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const loadProductImages = async () => {
|
|
|
|
|
for (const item of cartItems.value) {
|
|
|
|
|
if (!item.originalProductImage) continue
|
|
|
|
|
const match = item.originalProductImage.replace(/<[^>]*>/g, '').match(/\/api\/file\/get\/(\d+)/)
|
|
|
|
|
if (!match?.[1]) continue
|
|
|
|
|
const imageId = match[1]
|
|
|
|
|
try {
|
|
|
|
|
if (!imageIdCache.value[imageId]) {
|
|
|
|
|
imageIdCache.value[imageId] = await fileApi.getSignedUrl(imageId) as any
|
|
|
|
|
}
|
|
|
|
|
item.productImage = imageIdCache.value[imageId] || ''
|
|
|
|
|
} catch {
|
|
|
|
|
item.productImage = ''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** loadAvailableCoupons is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const loadAvailableCoupons = async () => {
|
|
|
|
|
const currentSelectedKey = selectedCoupon.value ? getCouponKey(selectedCoupon.value) : couponSelectionKey.value
|
|
|
|
|
|
2026-05-23 21:56:18 +08:00
|
|
|
if (!selectedItems.value.length || localSubtotal.value <= 0) {
|
|
|
|
|
checkoutPreview.value = null
|
2026-04-03 11:44:32 +08:00
|
|
|
availableCoupons.value = []
|
2026-05-23 21:56:18 +08:00
|
|
|
unavailableCoupons.value = []
|
2026-04-03 11:44:32 +08:00
|
|
|
selectedCoupon.value = null
|
|
|
|
|
couponSelectionKey.value = NO_COUPON_KEY
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
2026-05-23 21:56:18 +08:00
|
|
|
const preview = await orderApi.checkoutPreview({
|
|
|
|
|
couponId: selectedCoupon.value?.id,
|
|
|
|
|
couponSourceType: selectedCoupon.value?.sourceType || (couponSelectionTouched.value && currentSelectedKey === NO_COUPON_KEY ? NO_COUPON_KEY : undefined),
|
|
|
|
|
items: selectedItems.value.map(item => ({
|
|
|
|
|
productId: item.productId,
|
|
|
|
|
quantity: item.quantity,
|
|
|
|
|
artistId: item.artistId,
|
|
|
|
|
appointmentTime: item.appointmentTime
|
|
|
|
|
}))
|
2026-04-03 11:44:32 +08:00
|
|
|
})
|
2026-05-23 21:56:18 +08:00
|
|
|
checkoutPreview.value = preview
|
|
|
|
|
availableCoupons.value = Array.isArray(preview.availableCoupons) ? preview.availableCoupons : []
|
|
|
|
|
unavailableCoupons.value = Array.isArray(preview.unavailableCoupons) ? preview.unavailableCoupons : []
|
2026-04-03 11:44:32 +08:00
|
|
|
|
|
|
|
|
const matchedCoupon = availableCoupons.value.find(coupon => getCouponKey(coupon) === currentSelectedKey) || null
|
|
|
|
|
if (matchedCoupon) {
|
|
|
|
|
selectedCoupon.value = matchedCoupon
|
|
|
|
|
couponSelectionKey.value = getCouponKey(matchedCoupon)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (couponSelectionTouched.value && currentSelectedKey === NO_COUPON_KEY) {
|
|
|
|
|
selectedCoupon.value = null
|
|
|
|
|
couponSelectionKey.value = NO_COUPON_KEY
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
couponSelectionTouched.value = false
|
2026-05-16 14:28:42 +08:00
|
|
|
const defaultCoupon = findBestCoupon(availableCoupons.value)
|
|
|
|
|
if (defaultCoupon) {
|
|
|
|
|
selectedCoupon.value = defaultCoupon
|
|
|
|
|
couponSelectionKey.value = getCouponKey(defaultCoupon)
|
2026-04-03 11:44:32 +08:00
|
|
|
} else {
|
|
|
|
|
selectedCoupon.value = null
|
|
|
|
|
couponSelectionKey.value = NO_COUPON_KEY
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('获取可用优惠失败:', error)
|
2026-05-23 21:56:18 +08:00
|
|
|
checkoutPreview.value = null
|
2026-04-03 11:44:32 +08:00
|
|
|
availableCoupons.value = []
|
2026-05-23 21:56:18 +08:00
|
|
|
unavailableCoupons.value = []
|
2026-04-03 11:44:32 +08:00
|
|
|
selectedCoupon.value = null
|
|
|
|
|
couponSelectionKey.value = NO_COUPON_KEY
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** handleToggleSelect is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const handleToggleSelect = async () => {
|
|
|
|
|
await runWithGlobalLoading(() => loadAvailableCoupons())
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** changeQuantity is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const changeQuantity = async (item: CartItem, delta: number) => {
|
|
|
|
|
const next = item.quantity + delta
|
|
|
|
|
if (next < 1 || next > 99) return
|
|
|
|
|
item.quantity = next
|
|
|
|
|
try {
|
|
|
|
|
await runWithGlobalLoading(async () => {
|
|
|
|
|
await cartApi.updateCartQuantity({ productId: item.productId, quantity: next })
|
|
|
|
|
await loadAvailableCoupons()
|
|
|
|
|
})
|
|
|
|
|
await updateCartCount()
|
2026-05-13 12:43:01 +08:00
|
|
|
} catch (error: any) {
|
2026-04-03 11:44:32 +08:00
|
|
|
item.quantity -= delta
|
2026-05-13 12:43:01 +08:00
|
|
|
message.error(error?.message || '更新数量失败')
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** removeItem is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const removeItem = async (item: CartItem) => {
|
|
|
|
|
try {
|
|
|
|
|
await runWithGlobalLoading(async () => {
|
|
|
|
|
await cartApi.removeFromCart(item.productId)
|
|
|
|
|
cartItems.value = cartItems.value.filter(current => !sameId(current.id, item.id))
|
|
|
|
|
await loadAvailableCoupons()
|
|
|
|
|
})
|
|
|
|
|
await updateCartCount()
|
|
|
|
|
message.success('作品已删除')
|
2026-05-13 12:43:01 +08:00
|
|
|
} catch (error: any) {
|
|
|
|
|
message.error(error?.message || '删除作品失败')
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** openProduct is a local helper used by this page script. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const openProduct = (item: CartItem) => {
|
|
|
|
|
router.push('/product/' + item.productId)
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** openBookingModal is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const openBookingModal = async (item: CartItem) => {
|
|
|
|
|
currentItem.value = item
|
|
|
|
|
draftArtistId.value = item.artistId
|
|
|
|
|
draftAppointmentTime.value = item.appointmentTime || ''
|
|
|
|
|
showBookingModal.value = true
|
|
|
|
|
await runWithGlobalLoading(() => Promise.all([loadArtists(item), loadShopHours(item.shopId)]))
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** loadArtists is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const loadArtists = async (item: CartItem) => {
|
|
|
|
|
// 购物车里保存的是后端已经按作品可约范围裁剪过的美甲师列表,这里只做前端展示和 ID 保真。
|
|
|
|
|
availableArtists.value = Array.isArray(item.availableArtists)
|
|
|
|
|
? item.availableArtists
|
|
|
|
|
.filter(artist => artist && artist.id !== undefined && artist.id !== null)
|
|
|
|
|
.map(artist => ({
|
|
|
|
|
id: artist.id,
|
|
|
|
|
name: artist.name,
|
2026-05-18 09:46:11 +08:00
|
|
|
avatar: artist.avatar,
|
|
|
|
|
userType: artist.userType,
|
|
|
|
|
roleLabel: artist.roleLabel,
|
|
|
|
|
participateProduction: artist.participateProduction
|
2026-04-03 11:44:32 +08:00
|
|
|
}))
|
|
|
|
|
: []
|
|
|
|
|
|
|
|
|
|
if (draftArtistId.value && !availableArtists.value.some(artist => sameId(artist.id, draftArtistId.value))) {
|
|
|
|
|
draftArtistId.value = undefined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** loadShopHours is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const loadShopHours = async (shopId?: IdType) => {
|
|
|
|
|
currentShopHours.value = ''
|
|
|
|
|
if (!shopId) return
|
|
|
|
|
try {
|
|
|
|
|
const shop = await shopApi.getShopById(shopId) as any
|
|
|
|
|
currentShopHours.value = shop?.businessHours || ''
|
|
|
|
|
} catch {
|
|
|
|
|
currentShopHours.value = ''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** disablePastAppointmentDate is a local helper used by this page script. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const disablePastAppointmentDate = (current: any) => {
|
|
|
|
|
if (!current) return false
|
|
|
|
|
return current.valueOf() < getDayBoundary(new Date())
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** disablePastAppointmentTime is a local helper used by this page script. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const disablePastAppointmentTime = (current: any) => {
|
|
|
|
|
if (!current || typeof current.format !== 'function') {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
|
|
|
|
const minDate = getMinAppointmentDate()
|
|
|
|
|
const minDateText = [
|
|
|
|
|
minDate.getFullYear(),
|
|
|
|
|
String(minDate.getMonth() + 1).padStart(2, '0'),
|
|
|
|
|
String(minDate.getDate()).padStart(2, '0')
|
|
|
|
|
].join('-')
|
|
|
|
|
if (current.format('YYYY-MM-DD') !== minDateText) {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
|
|
|
|
const minHour = minDate.getHours()
|
|
|
|
|
const minMinute = minDate.getMinutes()
|
|
|
|
|
return {
|
|
|
|
|
disabledHours: () => Array.from({ length: minHour }, (_, index) => index),
|
|
|
|
|
disabledMinutes: (selectedHour: number) => selectedHour === minHour
|
|
|
|
|
? Array.from({ length: minMinute }, (_, index) => index)
|
|
|
|
|
: [],
|
|
|
|
|
disabledSeconds: () => []
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** closeBookingModal is a local helper used by this page script. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const closeBookingModal = () => {
|
|
|
|
|
showBookingModal.value = false
|
|
|
|
|
currentItem.value = null
|
|
|
|
|
draftArtistId.value = undefined
|
|
|
|
|
draftAppointmentTime.value = ''
|
|
|
|
|
availableArtists.value = []
|
|
|
|
|
currentShopHours.value = ''
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** confirmBooking is a local helper used by this page script. */
|
2026-05-23 21:56:18 +08:00
|
|
|
const confirmBooking = async () => {
|
2026-04-03 11:44:32 +08:00
|
|
|
if (!currentItem.value) return closeBookingModal()
|
|
|
|
|
if (!draftArtistId.value) return message.warning('请先选择美甲师')
|
|
|
|
|
if (!draftAppointmentTime.value) return message.warning('请选择预约时间')
|
|
|
|
|
if (isPastAppointment(draftAppointmentTime.value)) return message.warning('预约时间至少需要晚于当前 5 分钟')
|
|
|
|
|
currentItem.value.artistId = draftArtistId.value
|
|
|
|
|
currentItem.value.artist = availableArtists.value.find(artist => sameId(artist.id, draftArtistId.value))
|
|
|
|
|
currentItem.value.appointmentTime = draftAppointmentTime.value
|
|
|
|
|
closeBookingModal()
|
2026-05-23 21:56:18 +08:00
|
|
|
await loadAvailableCoupons()
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** openCouponModal is a local helper used by this page script. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const openCouponModal = () => {
|
|
|
|
|
couponSelectionKey.value = selectedCoupon.value ? getCouponKey(selectedCoupon.value) : NO_COUPON_KEY
|
|
|
|
|
showCouponModal.value = true
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** applyCouponSelection is a local helper used by this page script. */
|
2026-05-23 21:56:18 +08:00
|
|
|
const applyCouponSelection = async () => {
|
2026-04-03 11:44:32 +08:00
|
|
|
couponSelectionTouched.value = true
|
|
|
|
|
if (couponSelectionKey.value === NO_COUPON_KEY) {
|
|
|
|
|
selectedCoupon.value = null
|
|
|
|
|
} else {
|
|
|
|
|
selectedCoupon.value = availableCoupons.value.find(coupon => getCouponKey(coupon) === couponSelectionKey.value) || null
|
|
|
|
|
}
|
|
|
|
|
showCouponModal.value = false
|
2026-05-23 21:56:18 +08:00
|
|
|
await runWithGlobalLoading(() => loadAvailableCoupons())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const openCheckoutRecovery = (error: unknown) => {
|
|
|
|
|
const actions = buildRecoveryActions([
|
|
|
|
|
{ key: 'retry', text: '重试下单' },
|
|
|
|
|
{ key: 'orders', text: '查看订单' }
|
|
|
|
|
])
|
|
|
|
|
const retryAction = actions[0]
|
|
|
|
|
const ordersAction = actions[1]
|
|
|
|
|
Modal.confirm({
|
|
|
|
|
title: '下单失败',
|
|
|
|
|
content: `${getRecoveryMessage(error, '订单创建失败')}。如果担心重复下单,请先查看订单;仍失败时请联系客服。`,
|
|
|
|
|
okText: retryAction?.text || '重试下单',
|
|
|
|
|
cancelText: ordersAction?.text || '查看订单',
|
|
|
|
|
onOk: () => checkout(),
|
|
|
|
|
onCancel: () => router.push(ordersAction?.route || '/orders')
|
|
|
|
|
})
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/** checkout is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
2026-04-03 11:44:32 +08:00
|
|
|
const checkout = async () => {
|
|
|
|
|
if (submittingOrder.value) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
const items = selectedItems.value
|
|
|
|
|
if (!items.length) {
|
|
|
|
|
return message.warning('请先选择要结算的作品')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const firstIssue = checkoutIssues.value[0]
|
|
|
|
|
if (firstIssue) {
|
|
|
|
|
message.warning(firstIssue.message)
|
|
|
|
|
scrollToIssue(firstIssue)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
submittingOrder.value = true
|
|
|
|
|
try {
|
|
|
|
|
await runWithGlobalLoading(() => orderApi.createOrder({
|
|
|
|
|
couponId: selectedCoupon.value?.id,
|
|
|
|
|
couponSourceType: selectedCoupon.value?.sourceType || (couponSelectionTouched.value && !selectedCoupon.value ? NO_COUPON_KEY : undefined),
|
|
|
|
|
items: items.map(item => ({
|
|
|
|
|
productId: item.productId,
|
|
|
|
|
quantity: item.quantity,
|
|
|
|
|
artistId: item.artistId,
|
|
|
|
|
appointmentTime: item.appointmentTime
|
|
|
|
|
}))
|
|
|
|
|
}))
|
|
|
|
|
message.success('订单创建成功')
|
|
|
|
|
|
|
|
|
|
let followupWarningShown = false
|
|
|
|
|
try {
|
|
|
|
|
await runWithGlobalLoading(() => loadCartItems())
|
|
|
|
|
await updateCartCount()
|
|
|
|
|
} catch (followupError) {
|
|
|
|
|
followupWarningShown = true
|
|
|
|
|
console.error('订单创建后刷新购物车失败:', followupError)
|
|
|
|
|
message.warning('订单已创建,但购物车刷新失败,请前往订单页查看')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
await router.push('/orders')
|
|
|
|
|
} catch (navigationError) {
|
|
|
|
|
console.error('订单创建后跳转订单页失败:', navigationError)
|
|
|
|
|
if (!followupWarningShown) {
|
|
|
|
|
message.warning('订单已创建,但跳转订单页失败,请手动前往订单页查看')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (error: any) {
|
|
|
|
|
console.error('创建订单失败:', error)
|
2026-05-23 21:56:18 +08:00
|
|
|
openCheckoutRecovery(error)
|
2026-04-03 11:44:32 +08:00
|
|
|
} finally {
|
|
|
|
|
submittingOrder.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
try {
|
|
|
|
|
await loadCartItems()
|
2026-05-13 12:43:01 +08:00
|
|
|
} catch (error: any) {
|
|
|
|
|
message.error(error?.message || '获取购物车数据失败')
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.page {
|
|
|
|
|
min-height: 100vh;
|
2026-05-21 18:43:59 +08:00
|
|
|
color: var(--text-primary);
|
|
|
|
|
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;
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.content {
|
2026-05-21 18:43:59 +08:00
|
|
|
max-width: 1040px;
|
2026-04-03 11:44:32 +08:00
|
|
|
margin: 0 auto;
|
2026-05-21 18:43:59 +08:00
|
|
|
padding: 16px 16px calc(150px + env(safe-area-inset-bottom));
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
.empty-cart {
|
|
|
|
|
padding: 96px 16px;
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
.checkout-hero {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: minmax(0, 1fr);
|
|
|
|
|
gap: 16px;
|
|
|
|
|
margin-bottom: 14px;
|
|
|
|
|
padding: 18px;
|
|
|
|
|
border: 1px solid var(--theme-border);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
background: var(--theme-gradient-soft);
|
|
|
|
|
box-shadow: 0 16px 38px rgba(48, 37, 44, 0.08);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.checkout-hero.has-issues {
|
|
|
|
|
border-color: var(--theme-accent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hero-main {
|
|
|
|
|
min-width: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hero-eyebrow {
|
|
|
|
|
margin: 0 0 6px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
color: var(--theme-primary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hero-main h1 {
|
|
|
|
|
margin: 0;
|
|
|
|
|
font-size: 26px;
|
|
|
|
|
line-height: 1.18;
|
|
|
|
|
letter-spacing: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hero-main p {
|
|
|
|
|
margin: 8px 0 0;
|
|
|
|
|
color: var(--text-secondary);
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hero-total {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: flex-end;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
padding-top: 2px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hero-total span,
|
|
|
|
|
.metric span,
|
|
|
|
|
.appointment-head span,
|
|
|
|
|
.appointment-grid span,
|
|
|
|
|
.summary-row span,
|
|
|
|
|
.coupon-panel span,
|
|
|
|
|
.footer-summary span,
|
|
|
|
|
.item-subtitle {
|
|
|
|
|
color: var(--text-secondary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hero-total strong {
|
|
|
|
|
color: var(--theme-accent);
|
|
|
|
|
font-size: 30px;
|
|
|
|
|
line-height: 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hero-metrics {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
|
|
|
gap: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.metric {
|
|
|
|
|
min-width: 0;
|
|
|
|
|
padding: 10px;
|
|
|
|
|
border: 1px solid var(--theme-border);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
background: color-mix(in srgb, var(--theme-card-bg) 82%, transparent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.metric span,
|
|
|
|
|
.metric strong {
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.metric span {
|
|
|
|
|
margin-bottom: 4px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.metric strong {
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
color: var(--theme-primary);
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.metric-warning {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
border-color: var(--theme-accent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.metric-warning strong {
|
|
|
|
|
color: var(--theme-accent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.issue-callout {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
margin-bottom: 14px;
|
|
|
|
|
padding: 12px;
|
|
|
|
|
border: 1px solid var(--theme-border);
|
|
|
|
|
border-left: 4px solid var(--theme-accent);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
background: var(--theme-card-bg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.issue-callout strong,
|
|
|
|
|
.issue-callout span {
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.issue-callout strong {
|
|
|
|
|
margin-bottom: 4px;
|
|
|
|
|
color: var(--theme-accent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.issue-callout span {
|
|
|
|
|
color: var(--text-secondary);
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.checkout-layout {
|
|
|
|
|
display: grid;
|
|
|
|
|
gap: 14px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.cart-list {
|
|
|
|
|
display: grid;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.checkout-side {
|
|
|
|
|
display: grid;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
align-content: start;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-card {
|
|
|
|
|
border: 1px solid var(--theme-border);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
background: var(--theme-card-bg);
|
|
|
|
|
box-shadow: 0 12px 30px rgba(48, 37, 44, 0.06);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-card :deep(.ant-card-body) {
|
|
|
|
|
padding: 12px;
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.issue-card {
|
2026-05-21 18:43:59 +08:00
|
|
|
border-color: var(--theme-accent);
|
|
|
|
|
box-shadow: var(--theme-focus-shadow);
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-row {
|
2026-05-21 18:43:59 +08:00
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: auto 84px minmax(0, 1fr);
|
2026-04-03 11:44:32 +08:00
|
|
|
gap: 12px;
|
2026-05-21 18:43:59 +08:00
|
|
|
align-items: start;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-check {
|
|
|
|
|
padding-top: 30px;
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.thumb {
|
|
|
|
|
width: 84px;
|
|
|
|
|
height: 84px;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
overflow: hidden;
|
2026-05-21 18:43:59 +08:00
|
|
|
background: var(--theme-primary-soft);
|
2026-04-03 11:44:32 +08:00
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.thumb img {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
object-fit: cover;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-main {
|
2026-05-21 18:43:59 +08:00
|
|
|
min-width: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-head {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-copy {
|
|
|
|
|
min-width: 0;
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
font-weight: 700;
|
2026-05-21 18:43:59 +08:00
|
|
|
line-height: 1.38;
|
2026-04-03 11:44:32 +08:00
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
.item-subtitle {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
margin-top: 5px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-03 11:44:32 +08:00
|
|
|
.price {
|
2026-05-21 18:43:59 +08:00
|
|
|
flex-shrink: 0;
|
|
|
|
|
color: var(--theme-accent);
|
2026-04-03 11:44:32 +08:00
|
|
|
font-weight: 700;
|
2026-05-21 18:43:59 +08:00
|
|
|
white-space: nowrap;
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
.appointment-panel {
|
|
|
|
|
width: 100%;
|
2026-04-03 11:44:32 +08:00
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
2026-05-21 18:43:59 +08:00
|
|
|
justify-content: space-between;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
padding: 10px;
|
|
|
|
|
border: 1px solid var(--theme-border);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
background: var(--theme-primary-soft);
|
|
|
|
|
color: inherit;
|
|
|
|
|
text-align: left;
|
2026-04-03 11:44:32 +08:00
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
.appointment-panel.issue {
|
|
|
|
|
border-color: var(--theme-accent);
|
|
|
|
|
background: var(--theme-primary-soft);
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
.appointment-panel.ready {
|
|
|
|
|
border-color: var(--theme-border);
|
|
|
|
|
background: var(--theme-card-bg);
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
.appointment-content {
|
2026-04-03 11:44:32 +08:00
|
|
|
flex: 1;
|
2026-05-21 18:43:59 +08:00
|
|
|
min-width: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.appointment-head {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.appointment-head strong {
|
|
|
|
|
color: var(--theme-primary);
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.appointment-panel.issue .appointment-head strong {
|
|
|
|
|
color: var(--theme-accent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.appointment-grid {
|
|
|
|
|
display: grid;
|
|
|
|
|
gap: 6px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.appointment-grid div {
|
|
|
|
|
min-width: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.appointment-grid span,
|
|
|
|
|
.appointment-grid strong {
|
|
|
|
|
display: block;
|
2026-04-03 11:44:32 +08:00
|
|
|
font-size: 13px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-tip,
|
|
|
|
|
.helper {
|
2026-05-21 18:43:59 +08:00
|
|
|
color: var(--text-secondary);
|
2026-04-03 11:44:32 +08:00
|
|
|
font-size: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
.quick-time-grid {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
|
|
|
|
|
gap: 8px;
|
|
|
|
|
margin: 10px 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.quick-time {
|
|
|
|
|
display: grid;
|
|
|
|
|
gap: 2px;
|
|
|
|
|
padding: 10px 12px;
|
2026-05-21 18:43:59 +08:00
|
|
|
border: 1px solid var(--theme-border);
|
2026-05-18 09:46:11 +08:00
|
|
|
border-radius: 8px;
|
2026-05-21 18:43:59 +08:00
|
|
|
background: var(--theme-card-bg);
|
|
|
|
|
color: var(--text-primary);
|
2026-05-18 09:46:11 +08:00
|
|
|
text-align: left;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: border-color .18s ease, background .18s ease, transform .18s ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.quick-time:hover,
|
|
|
|
|
.quick-time.active {
|
2026-05-21 18:43:59 +08:00
|
|
|
border-color: var(--theme-primary);
|
|
|
|
|
background: var(--theme-primary-soft);
|
2026-05-18 09:46:11 +08:00
|
|
|
transform: translateY(-1px);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.quick-time span {
|
2026-05-21 18:43:59 +08:00
|
|
|
color: var(--text-secondary);
|
2026-05-18 09:46:11 +08:00
|
|
|
font-size: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.quick-time strong {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-03 11:44:32 +08:00
|
|
|
.actions,
|
|
|
|
|
.qty,
|
2026-05-21 18:43:59 +08:00
|
|
|
.summary-row {
|
2026-04-03 11:44:32 +08:00
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
.actions {
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-03 11:44:32 +08:00
|
|
|
.qty {
|
|
|
|
|
gap: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
.coupon-panel,
|
2026-05-23 21:56:18 +08:00
|
|
|
.preview-panel,
|
2026-05-21 18:43:59 +08:00
|
|
|
.summary-panel {
|
|
|
|
|
border: 1px solid var(--theme-border);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
background: var(--theme-card-bg);
|
|
|
|
|
box-shadow: 0 12px 30px rgba(48, 37, 44, 0.06);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-panel {
|
|
|
|
|
width: 100%;
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: minmax(0, 1fr) auto auto;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 13px;
|
|
|
|
|
color: inherit;
|
|
|
|
|
text-align: left;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-panel span,
|
|
|
|
|
.coupon-panel strong {
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-panel span {
|
|
|
|
|
margin-bottom: 4px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-panel strong {
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
color: var(--text-primary);
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-panel em {
|
|
|
|
|
color: var(--theme-accent);
|
|
|
|
|
font-style: normal;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-23 21:56:18 +08:00
|
|
|
.preview-panel {
|
|
|
|
|
display: grid;
|
|
|
|
|
gap: 6px;
|
|
|
|
|
padding: 13px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.preview-line {
|
|
|
|
|
color: var(--text-secondary);
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.preview-line.vip {
|
|
|
|
|
color: var(--theme-primary);
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
.summary-panel {
|
|
|
|
|
padding: 13px;
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.summary-row {
|
2026-05-21 18:43:59 +08:00
|
|
|
gap: 12px;
|
|
|
|
|
padding: 8px 0;
|
|
|
|
|
border-bottom: 1px solid var(--theme-border);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.summary-row strong {
|
|
|
|
|
color: var(--text-primary);
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.summary-row.discount strong,
|
|
|
|
|
.summary-row.total strong {
|
|
|
|
|
color: var(--theme-accent);
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.summary-row.total {
|
2026-05-21 18:43:59 +08:00
|
|
|
border-bottom: 0;
|
2026-04-03 11:44:32 +08:00
|
|
|
font-weight: 700;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.footer {
|
2026-05-21 18:43:59 +08:00
|
|
|
position: fixed;
|
|
|
|
|
left: 0;
|
|
|
|
|
right: 0;
|
2026-04-03 11:44:32 +08:00
|
|
|
bottom: 60px;
|
2026-05-21 18:43:59 +08:00
|
|
|
z-index: 20;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
|
|
|
|
|
background: rgba(255, 255, 255, 0.94);
|
|
|
|
|
background: color-mix(in srgb, var(--theme-card-bg) 92%, transparent);
|
|
|
|
|
border-top: 1px solid var(--theme-border);
|
|
|
|
|
box-shadow: 0 -14px 30px rgba(48, 37, 44, 0.08);
|
|
|
|
|
backdrop-filter: blur(16px);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.footer-summary {
|
|
|
|
|
flex: 1;
|
|
|
|
|
min-width: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.footer-summary span,
|
|
|
|
|
.footer-summary strong {
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.footer-summary span {
|
|
|
|
|
margin-bottom: 2px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.footer-summary strong {
|
|
|
|
|
color: var(--theme-accent);
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.checkout-button {
|
|
|
|
|
min-width: 138px;
|
|
|
|
|
height: 44px;
|
|
|
|
|
border: 0;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
background: var(--theme-gradient);
|
|
|
|
|
box-shadow: var(--theme-button-shadow);
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-options {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-23 21:56:18 +08:00
|
|
|
.coupon-option-copy {
|
|
|
|
|
display: grid;
|
|
|
|
|
gap: 2px;
|
|
|
|
|
min-width: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-option-copy strong,
|
|
|
|
|
.coupon-option-copy em {
|
|
|
|
|
overflow-wrap: anywhere;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-option-copy strong {
|
|
|
|
|
color: var(--text-primary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-option-copy em {
|
|
|
|
|
color: var(--theme-accent);
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-style: normal;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-unavailable {
|
|
|
|
|
display: grid;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
margin-top: 14px;
|
|
|
|
|
padding-top: 14px;
|
|
|
|
|
border-top: 1px solid var(--theme-border);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-unavailable-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
color: var(--text-secondary);
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-unavailable-item span {
|
|
|
|
|
min-width: 0;
|
|
|
|
|
color: var(--text-primary);
|
|
|
|
|
overflow-wrap: anywhere;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-unavailable-item em {
|
|
|
|
|
max-width: 180px;
|
|
|
|
|
color: var(--text-secondary);
|
|
|
|
|
font-style: normal;
|
|
|
|
|
text-align: right;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
:global(.cart-coupon-modal-wrap .ant-modal) {
|
|
|
|
|
max-width: calc(100vw - 24px);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.cart-coupon-modal-wrap .ant-modal-content) {
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
padding: 0;
|
|
|
|
|
border: 1px solid var(--theme-border);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
background: var(--theme-card-bg);
|
|
|
|
|
box-shadow: 0 24px 64px rgba(48, 37, 44, 0.26);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.cart-coupon-modal-wrap .ant-modal-header) {
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: 18px 22px 12px;
|
|
|
|
|
border-bottom: 1px solid var(--theme-border);
|
|
|
|
|
background: var(--theme-card-bg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.cart-coupon-modal-wrap .ant-modal-title) {
|
|
|
|
|
color: var(--text-primary);
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: 800;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.cart-coupon-modal-wrap .ant-modal-close) {
|
|
|
|
|
color: var(--text-secondary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.cart-coupon-modal-wrap .ant-modal-body) {
|
|
|
|
|
padding: 18px 22px 14px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.cart-coupon-modal-wrap .ant-modal-footer) {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: 14px 22px 20px;
|
|
|
|
|
border-top: 1px solid var(--theme-border);
|
|
|
|
|
background: var(--theme-card-bg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.cart-coupon-modal-wrap .cart-coupon-modal__cancel),
|
|
|
|
|
:global(.cart-coupon-modal-wrap .cart-coupon-modal__ok) {
|
|
|
|
|
min-width: 82px;
|
|
|
|
|
height: 38px;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.cart-coupon-modal-wrap .cart-coupon-modal__cancel) {
|
|
|
|
|
color: var(--text-primary);
|
|
|
|
|
border-color: var(--theme-border);
|
|
|
|
|
background: var(--theme-card-bg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.cart-coupon-modal-wrap .cart-coupon-modal__cancel:hover),
|
|
|
|
|
:global(.cart-coupon-modal-wrap .cart-coupon-modal__cancel:focus) {
|
|
|
|
|
color: var(--theme-primary);
|
|
|
|
|
border-color: var(--theme-primary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.cart-coupon-modal-wrap .cart-coupon-modal__ok) {
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
border: 0;
|
|
|
|
|
background: var(--theme-gradient);
|
|
|
|
|
box-shadow: var(--theme-button-shadow);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.cart-coupon-modal-wrap .cart-coupon-modal__ok:hover),
|
|
|
|
|
:global(.cart-coupon-modal-wrap .cart-coupon-modal__ok:focus) {
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
background: linear-gradient(135deg, var(--theme-accent) 0%, var(--theme-secondary) 100%);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.cart-coupon-modal-wrap .ant-radio-wrapper) {
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
margin: 0;
|
|
|
|
|
color: var(--text-primary);
|
|
|
|
|
line-height: 1.6;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.cart-coupon-modal-wrap .ant-radio-wrapper + .ant-radio-wrapper) {
|
|
|
|
|
margin-top: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.cart-coupon-modal-wrap .ant-radio-checked .ant-radio-inner) {
|
|
|
|
|
border-color: var(--theme-primary);
|
|
|
|
|
background: var(--theme-primary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.cart-coupon-modal-wrap .ant-radio-wrapper:hover .ant-radio-inner) {
|
|
|
|
|
border-color: var(--theme-primary);
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-03 11:44:32 +08:00
|
|
|
.modal-section + .modal-section {
|
|
|
|
|
margin-top: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.section-title {
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.artist-list {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.artist-option {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
padding: 8px 12px;
|
2026-05-21 18:43:59 +08:00
|
|
|
border: 1px solid var(--theme-border);
|
2026-04-03 11:44:32 +08:00
|
|
|
border-radius: 999px;
|
2026-05-21 18:43:59 +08:00
|
|
|
background: var(--theme-card-bg);
|
2026-04-03 11:44:32 +08:00
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.artist-option.active {
|
2026-05-21 18:43:59 +08:00
|
|
|
border-color: var(--theme-primary);
|
|
|
|
|
color: var(--theme-primary);
|
|
|
|
|
background: var(--theme-primary-soft);
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.artist-option img {
|
|
|
|
|
width: 24px;
|
|
|
|
|
height: 24px;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
object-fit: cover;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
.artist-option em {
|
2026-05-21 18:43:59 +08:00
|
|
|
color: var(--theme-accent);
|
2026-05-18 09:46:11 +08:00
|
|
|
font-size: 12px;
|
|
|
|
|
font-style: normal;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-21 18:43:59 +08:00
|
|
|
@media (min-width: 560px) {
|
|
|
|
|
.checkout-hero {
|
|
|
|
|
grid-template-columns: minmax(0, 1fr) auto;
|
|
|
|
|
align-items: end;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hero-metrics {
|
|
|
|
|
grid-column: 1 / -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.appointment-grid {
|
|
|
|
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (min-width: 900px) {
|
|
|
|
|
.content {
|
|
|
|
|
padding: 24px 24px calc(150px + env(safe-area-inset-bottom));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.checkout-layout {
|
|
|
|
|
grid-template-columns: minmax(0, 1fr) 320px;
|
|
|
|
|
align-items: start;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.checkout-side {
|
|
|
|
|
position: sticky;
|
|
|
|
|
top: 18px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-03 11:44:32 +08:00
|
|
|
@media (max-width: 767px) {
|
|
|
|
|
.content {
|
2026-05-21 18:43:59 +08:00
|
|
|
padding: 14px 14px calc(150px + env(safe-area-inset-bottom));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (max-width: 420px) {
|
|
|
|
|
.hero-metrics {
|
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-row {
|
|
|
|
|
grid-template-columns: auto 74px minmax(0, 1fr);
|
|
|
|
|
gap: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.thumb {
|
|
|
|
|
width: 74px;
|
|
|
|
|
height: 74px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.footer {
|
|
|
|
|
padding-inline: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.checkout-button {
|
|
|
|
|
min-width: 118px;
|
2026-04-03 11:44:32 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|