Files
JayuCloud/FD-Frontend/src/views/CartView.vue
T

3027 lines
86 KiB
Vue
Raw Normal View History

2026-04-03 11:44:32 +08:00
<template>
<div class="page">
2026-05-31 18:36:52 +08:00
<header class="cart-appbar" aria-label="购物车导航">
<div class="cart-appbar-inner">
<span class="cart-topbar-spacer" aria-hidden="true"></span>
<strong class="cart-brand">{{ checkoutShopName }}</strong>
<span class="cart-topbar-spacer" aria-hidden="true"></span>
</div>
</header>
2026-05-29 13:30:56 +08:00
2026-05-31 18:36:52 +08:00
<main class="content cart-content">
2026-06-04 16:39:06 +08:00
<div v-if="cartLoading && !cartLoaded" class="cart-loading-state" role="status" aria-label="加载购物车">
<a-spin />
</div>
<a-empty v-else-if="cartLoaded && !cartItems.length" class="empty-cart" description="购物车还是空的">
2026-05-29 13:30:56 +08:00
<a-button type="primary" class="empty-action" @click="router.push('/products')">去逛作品</a-button>
2026-04-03 11:44:32 +08:00
</a-empty>
<template v-else>
2026-05-31 18:36:52 +08:00
<section class="cart-section cart-section-items" aria-label="购物车商品">
<div class="cart-section-head">
<h2>我的选择</h2>
<span>{{ selectedCount }} / {{ cartItems.length }} 项已选</span>
2026-04-03 11:44:32 +08:00
</div>
2026-05-31 18:36:52 +08:00
<div class="cart-item-list">
<article
v-for="item in cartItems"
:key="item.id"
:ref="(element: unknown) => setItemRef(item.id, element)"
class="cart-product-card"
:class="{ selected: item.selected, warning: item.selected && hasItemIssue(item) }"
2026-04-03 11:44:32 +08:00
>
2026-05-31 18:36:52 +08:00
<a-checkbox class="product-check" v-model:checked="item.selected" @change="handleToggleSelect" />
<button type="button" class="product-thumb" @click="openProduct(item)">
<img v-if="item.productImage" :src="item.productImage" :alt="item.productTitle" loading="lazy" decoding="async" />
<span v-else>{{ item.productTitle?.[0] || 'Y' }}</span>
</button>
<div class="product-info">
<div class="product-title-row">
<button type="button" class="product-title" @click="openProduct(item)">{{ item.productTitle }}</button>
<a-popconfirm title="确认删除这件作品吗?" ok-text="确认" cancel-text="取消" @confirm="removeItem(item)">
<button type="button" class="product-delete" aria-label="删除作品">
<DeleteOutlined />
</button>
</a-popconfirm>
</div>
<p class="product-meta">
<span>{{ item.tagNames || item.tags || checkoutShopName }}</span>
2026-06-04 16:39:06 +08:00
<span>预计 {{ displayCartDuration(item) }}</span>
2026-05-31 18:36:52 +08:00
</p>
<div class="product-bottom">
2026-06-04 16:39:06 +08:00
<strong class="product-price">参考价 ¥{{ Number(item.price || 0).toFixed(2) }}</strong>
2026-05-31 18:36:52 +08:00
<div class="product-qty" aria-label="调整数量">
<button type="button" :disabled="item.quantity <= 1" @click="changeQuantity(item, -1)">−</button>
<span>{{ item.quantity }}</span>
<button type="button" :disabled="item.quantity >= 99" @click="changeQuantity(item, 1)">+</button>
</div>
</div>
</div>
</article>
2026-04-03 11:44:32 +08:00
</div>
</section>
2026-04-03 11:44:32 +08:00
2026-05-31 18:36:52 +08:00
<section class="cart-section service-section" aria-label="服务详情">
<div class="cart-section-head">
<h2>服务详情</h2>
<span>{{ checkoutIssueCount ? `${checkoutIssueCount} 项待完善` : '预约已就绪' }}</span>
</div>
2026-04-03 11:44:32 +08:00
2026-05-31 18:36:52 +08:00
<div v-if="selectedCount && firstCheckoutIssue" class="issue-callout stitch-issue">
<div>
<strong>{{ firstCheckoutIssue.message }}</strong>
2026-06-04 16:39:06 +08:00
<span>完善服务信息后即可发起询价预约</span>
2026-05-29 13:30:56 +08:00
</div>
2026-05-31 18:36:52 +08:00
<a-button size="small" @click="focusFirstIssue">去完善</a-button>
</div>
2026-05-29 13:30:56 +08:00
2026-05-31 18:36:52 +08:00
<div v-if="selectedItems.length" class="service-card-list">
<article
v-for="item in selectedItems"
:key="`booking-${item.id}`"
class="service-detail-card"
:class="{ ready: !hasItemIssue(item), warning: hasItemIssue(item) }"
>
2026-05-31 18:36:52 +08:00
<button type="button" class="service-detail-main" @click="openBookingModal(item)">
<div class="service-icon">
<img
v-if="item.productImage"
:src="item.productImage"
:alt="item.productTitle"
loading="lazy"
decoding="async"
/>
<span v-else>{{ item.productTitle?.[0] || 'Y' }}</span>
</div>
<div class="service-copy">
<span>{{ item.productTitle }}</span>
<strong>{{ item.artist?.name || '选择美甲师' }}</strong>
<em>{{ item.appointmentTime ? formatAppointmentDisplay(item.appointmentTime) : '选择预约时间' }}</em>
</div>
<span class="service-state">{{ appointmentStatusText(item) }}</span>
<RightOutlined />
</button>
<div v-if="item.availableArtists?.length" class="service-artist-strip">
<span class="service-label">选择美甲师</span>
<div class="service-artist-list">
<button
v-for="artist in item.availableArtists"
:key="artist.id"
type="button"
class="service-artist-option"
:class="{ active: sameId(item.artistId, artist.id) }"
@click="selectInlineArtist(item, artist)"
>
<img v-if="artist.avatar" :src="artist.avatar" :alt="artist.name" loading="lazy" decoding="async" />
<span v-else>{{ artist.name?.[0] || 'Y' }}</span>
<em>{{ artist.name }}</em>
</button>
</div>
</div>
2026-05-31 18:36:52 +08:00
<div class="service-time-panel">
<div class="service-time-head">
<span class="service-label">预约时间</span>
<button type="button" @click="openBookingModal(item)">自定义</button>
</div>
<div class="service-time-grid">
<button
2026-06-04 16:39:06 +08:00
v-for="slot in getQuickAppointmentSlots(item)"
2026-05-31 18:36:52 +08:00
:key="`${item.id}-${slot.value}`"
type="button"
class="service-time-option"
:class="{ active: item.appointmentTime === slot.value }"
@click="selectInlineTime(item, slot.value)"
>
<span>{{ slot.label }}</span>
<strong>{{ slot.time }}</strong>
</button>
</div>
</div>
</article>
</div>
<a-empty v-else class="service-empty" description="请先选择要结算的作品" />
</section>
2026-05-31 18:36:52 +08:00
<section class="cart-section offer-section" aria-label="优惠券">
<button
type="button"
class="offer-card"
:disabled="!selectedCount"
@click="openCouponModal"
>
<span class="offer-icon">
<TagsOutlined />
</span>
<span class="offer-copy">
<strong>选择优惠券</strong>
<em>{{ selectedCoupon ? formatCouponDisplay(selectedCoupon) : `${availableCoupons.length} 张可用` }}</em>
</span>
<span v-if="discountAmount > 0" class="offer-save">-¥{{ discountAmount.toFixed(2) }}</span>
<RightOutlined />
</button>
<div v-if="checkoutPreview" class="preview-panel stitch-preview">
<div class="preview-line">{{ checkoutPreview.summaryText }}</div>
<div v-if="checkoutPreview.vipTip" class="preview-line vip">{{ checkoutPreview.vipTip }}</div>
</div>
</section>
2026-06-04 16:39:06 +08:00
<section class="cart-section summary-panel stitch-summary" aria-label="询价预约摘要">
<h3>询价预约摘要</h3>
<label class="quote-remark-field">
<span>备注</span>
<a-textarea v-model:value="quoteRemark" :rows="3" :maxlength="300" placeholder="可填写款式偏好、到店需求或其他说明" />
</label>
<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>
<div class="summary-row total"><span>预估应付</span><strong>¥{{ totalAmount.toFixed(2) }}</strong></div>
2026-05-31 18:36:52 +08:00
</section>
</template>
2026-04-03 11:44:32 +08:00
</main>
2026-05-31 18:36:52 +08:00
<footer v-if="cartItems.length" class="footer cart-footer">
2026-04-03 11:44:32 +08:00
<a-button
type="primary"
size="large"
class="checkout-button"
2026-04-03 11:44:32 +08:00
:loading="submittingOrder"
2026-06-04 16:39:06 +08:00
:disabled="submittingOrder || !selectedCount || Boolean(firstCheckoutIssue)"
2026-04-03 11:44:32 +08:00
@click="checkout"
>
2026-05-31 18:36:52 +08:00
<CheckCircleOutlined />
2026-06-04 16:39:06 +08:00
发起询价预约
2026-04-03 11:44:32 +08:00
</a-button>
</footer>
<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)">
<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>
<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-06-04 16:39:06 +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"
>
2026-05-29 13:30:56 +08:00
<img v-if="artist.avatar" :src="artist.avatar" :alt="artist.name" loading="lazy" decoding="async" />
2026-04-03 11:44:32 +08:00
<span>{{ artist.name }}</span>
<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"
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="请选择预约时间"
/>
<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">
/**
* 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'
import { useRoute, useRouter } from 'vue-router'
2026-05-31 18:36:52 +08:00
import {
CheckCircleOutlined,
DeleteOutlined,
RightOutlined,
TagsOutlined
} from '@ant-design/icons-vue'
import { message, Modal } from 'ant-design-vue'
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 { orderApi } from '../api/order'
2026-06-04 16:39:06 +08:00
import type { CheckoutCouponPreview, CheckoutIssue as ApiCheckoutIssue, 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'
import { getBuyNowProductIdFromQuery, isBuyNowCartItem } from '@/utils/buy-now'
import { buildRecoveryActions, getRecoveryMessage } from '@/utils/recovery'
2026-05-29 13:30:56 +08:00
import { extractLegacyFileId, getCachedSignedImageUrl, getCachedSignedImageUrlSync } from '@/utils/signed-image-cache'
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()
/** 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.
*/
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
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
2026-05-30 18:31:35 +08:00
shopName?: string
2026-04-03 11:44:32 +08:00
productTitle: string
productImage: string
originalProductImage?: string
price: number
quantity: number
totalPrice: number
tags: string
tagNames?: string
approximateDuration?: string
2026-06-04 16:39:06 +08:00
serviceDurationMinutes?: number
estimatedTime?: number
businessHours?: string
2026-04-03 11:44:32 +08:00
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-06-04 16:39:06 +08:00
productId?: IdType
productTitle?: string
2026-04-03 11:44:32 +08:00
}
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-06-04 16:39:06 +08:00
const cartLoading = ref(false)
const cartLoaded = ref(false)
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.
*/
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.
*/
const selectedCoupon = ref<CheckoutCouponPreview | null>(null)
2026-06-04 16:39:06 +08:00
const quoteRemark = ref('')
/** 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)
/** 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)
/** 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)
/** 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>()
/** draftAppointmentTime is a reactive state variable used by the template and event handlers. */
2026-04-03 11:44:32 +08:00
const draftAppointmentTime = ref('')
/** 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-06-04 16:39:06 +08:00
const shopHoursById = ref<Record<string, string>>({})
/** 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)
/** 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
/** 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-30 18:31:35 +08:00
const checkoutShopName = computed(() => {
const itemWithShopName = selectedItems.value.find(item => item.shopName) || cartItems.value.find(item => item.shopName)
if (itemWithShopName?.shopName) {
return itemWithShopName.shopName
}
if (typeof window !== 'undefined') {
try {
const raw = localStorage.getItem('userInfo')
2026-05-31 18:36:52 +08:00
const storedUser = raw ? JSON.parse(raw) as { shopName?: string; shopNames?: string[] } : null
const cachedShopName = storedUser?.shopName || storedUser?.shopNames?.find(Boolean)
if (cachedShopName) {
return cachedShopName
2026-05-30 18:31:35 +08:00
}
} catch {
// Ignore malformed cached user data and fall back to the neutral shop label.
}
}
return '当前门店'
})
/** 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)
/** subtotal is a reactive state variable used by the template and event handlers. */
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))
/** discountAmount is a reactive state variable used by the template and event handlers. */
const discountAmount = computed(() => Number(checkoutPreview.value?.savedAmount ?? calculateCouponDiscount(selectedCoupon.value, subtotal.value)))
/** totalAmount is a reactive state variable used by the template and event handlers. */
const totalAmount = computed(() => Number(checkoutPreview.value?.payableAmount ?? Math.max(0, subtotal.value - discountAmount.value)))
/** 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} 选择预约信息` : '选择预约信息')
/** 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}`)
2026-06-04 16:39:06 +08:00
if (currentItem.value) texts.push(`预计时长:${displayCartDuration(currentItem.value)}`)
2026-04-03 11:44:32 +08:00
return texts.join(' · ') || '请选择至少晚于当前 5 分钟的预约时间'
})
/** quickAppointmentSlots is a reactive state variable used by the template and event handlers. */
const quickAppointmentSlots = computed(() => {
2026-06-04 16:39:06 +08:00
if (currentItem.value) {
return getQuickAppointmentSlots(currentItem.value)
}
return buildQuickAppointmentSlots()
})
const buildQuickAppointmentSlots = (item?: CartItem) => {
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
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]
2026-06-04 16:39:06 +08:00
.filter((date, index, list) =>
date.getTime() >= now.getTime()
&& list.findIndex(current => current.getTime() === date.getTime()) === index
&& isAppointmentWithinBusinessHours(date, item)
)
.slice(0, 5)
.map(date => ({
value: formatAppointmentValue(date),
label: quickDateLabel(date),
time: `${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`
}))
2026-06-04 16:39:06 +08:00
}
const getQuickAppointmentSlots = (item: CartItem) => buildQuickAppointmentSlots(item)
/** 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
}
/** 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()
}
/** 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`
}
2026-06-04 16:39:06 +08:00
const parseDurationMinutes = (value?: string | number | null): number | null => {
if (value == null || value === '') return null
if (typeof value === 'number') return Number.isFinite(value) && value > 0 ? value : null
const text = String(value).trim()
const hourMatch = text.match(/(\d+(?:\.\d+)?)\s*(?:小时|h|hour)/i)
const minuteMatch = text.match(/(\d+(?:\.\d+)?)\s*(?:分钟|min|minute)/i)
if (hourMatch || minuteMatch) {
const hours = hourMatch ? Number(hourMatch[1]) : 0
const minutes = minuteMatch ? Number(minuteMatch[1]) : 0
const total = Math.round(hours * 60 + minutes)
return total > 0 ? total : null
}
const numberMatch = text.match(/\d+(?:\.\d+)?/)
if (!numberMatch) return null
const total = Math.round(Number(numberMatch[0]))
return total > 0 ? total : null
}
const getCartDurationMinutes = (item: CartItem): number | null => {
return parseDurationMinutes(item.approximateDuration)
?? parseDurationMinutes(item.serviceDurationMinutes)
?? parseDurationMinutes(item.estimatedTime)
}
const displayCartDuration = (item: CartItem) => {
const duration = item.approximateDuration?.trim()
if (duration) return duration
const minutes = getCartDurationMinutes(item)
return minutes ? `${minutes}分钟` : '时长待定'
}
const parseBusinessHoursRange = (value?: string | null): { open: number; close: number } | null => {
const text = String(value || '').replace(/[:]/g, ':').replace(/[-—–]/g, '-')
const match = text.match(/(\d{1,2}):(\d{2})\s*-\s*(\d{1,2}):(\d{2})/)
if (!match) return null
const open = Number(match[1]) * 60 + Number(match[2])
const close = Number(match[3]) * 60 + Number(match[4])
if (!Number.isFinite(open) || !Number.isFinite(close) || close <= open) return null
return { open, close }
}
const getItemBusinessHours = (item?: CartItem) => {
if (!item) return ''
const shopKey = toOptionalIdString(item.shopId)
return item.businessHours || (shopKey ? shopHoursById.value[shopKey] : '') || ''
}
const isAppointmentWithinBusinessHours = (date: Date, item?: CartItem) => {
const range = parseBusinessHoursRange(getItemBusinessHours(item))
if (!range) return true
const start = date.getHours() * 60 + date.getMinutes()
const duration = item ? getCartDurationMinutes(item) || 0 : 0
return start >= range.open && start + duration <= range.close
}
/** 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. */
const getCouponKey = (coupon: CheckoutCouponPreview) => `${coupon.sourceType || 'USER_COUPON'}:${coupon.id}`
2026-04-03 11:44:32 +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]
}
/** formatCouponDisplay is a local helper used by this page script. */
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}`
}
/** calculateCouponDiscount is a local helper used by this page script. */
const calculateCouponDiscount = (coupon: CheckoutCouponPreview | null, amount: number) => {
2026-04-03 11:44:32 +08:00
if (!coupon || amount <= 0) {
return 0
}
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
}
/** findBestCoupon is a local helper used by this page script. */
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
}
/** 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) : '未选择预约时间'
/** 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()
/** 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)
/** 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-06-04 16:39:06 +08:00
const mapApiCheckoutIssue = (issue: ApiCheckoutIssue): CheckoutIssue | null => {
if (!issue?.message) return null
const matchedItem = selectedItems.value.find(item => issue.itemId != null && sameId(item.id, issue.itemId))
|| selectedItems.value.find(item => issue.productId != null && sameId(item.productId, issue.productId))
return {
key: `server-${issue.code || issue.message}`,
message: issue.message,
itemId: matchedItem?.id || issue.itemId,
productId: issue.productId,
productTitle: issue.productTitle || matchedItem?.productTitle
}
}
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 })
}
2026-06-04 16:39:06 +08:00
const apiIssues = checkoutPreview.value?.bookingIssues || []
apiIssues
.map(mapApiCheckoutIssue)
.filter((issue): issue is CheckoutIssue => Boolean(issue))
.forEach(issue => issues.push(issue))
2026-04-03 11:44:32 +08:00
return issues
})
/** 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])
/** 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' })
}
}
/** 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-06-04 16:39:06 +08:00
const isDisplayableImageSource = (value?: string | null) => {
const source = String(value || '').trim()
return source.startsWith('http://')
|| source.startsWith('https://')
|| source.startsWith('/')
|| source.startsWith('data:image/')
|| source.startsWith('blob:')
}
const getInitialCartImage = (rawImage?: string, previousImage?: string) => {
const imageId = extractLegacyFileId(rawImage)
const cachedUrl = imageId ? getCachedSignedImageUrlSync(imageId) : ''
if (cachedUrl) return cachedUrl
if (previousImage) return previousImage
return isDisplayableImageSource(rawImage) ? String(rawImage) : ''
}
/** 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 () => {
2026-06-04 16:39:06 +08:00
cartLoading.value = true
try {
const response = await cartApi.getCartList() as unknown as any[]
const previousItems = cartItems.value
cartItems.value = (response || []).map(item => {
const previous = previousItems.find(current => sameId(current.id, item.id))
|| previousItems.find(current => sameId(current.productId, item.productId))
const originalProductImage = item.productImage || previous?.originalProductImage || ''
const shopKey = toOptionalIdString(item.shopId)
return {
...item,
selected: isBuyNowMode.value ? isBuyNowCartItem(item.productId, buyNowProductId.value) : previous?.selected ?? true,
originalProductImage,
productImage: getInitialCartImage(originalProductImage, previous?.productImage),
appointmentTime: item.appointmentTime,
businessHours: item.businessHours || previous?.businessHours || (shopKey ? shopHoursById.value[shopKey] : '')
}
})
couponSelectionTouched.value = false
couponSelectionKey.value = NO_COUPON_KEY
selectedCoupon.value = null
await Promise.all([loadProductImages(), loadCartItemShopHours()])
await loadAvailableCoupons()
} finally {
cartLoading.value = false
cartLoaded.value = true
}
2026-04-03 11:44:32 +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) {
2026-06-04 16:39:06 +08:00
if (!item.originalProductImage) {
continue
}
2026-05-29 13:30:56 +08:00
const imageId = extractLegacyFileId(item.originalProductImage)
2026-06-04 16:39:06 +08:00
if (!imageId) {
if (!item.productImage && isDisplayableImageSource(item.originalProductImage)) {
item.productImage = item.originalProductImage
}
continue
}
2026-05-29 13:30:56 +08:00
const cachedUrl = getCachedSignedImageUrlSync(imageId)
if (cachedUrl) item.productImage = cachedUrl
2026-06-04 16:39:06 +08:00
const signedUrl = await getCachedSignedImageUrl(imageId, item.productImage || item.originalProductImage)
if (signedUrl) item.productImage = signedUrl
2026-04-03 11:44:32 +08:00
}
}
2026-06-04 16:39:06 +08:00
const loadCartItemShopHours = async () => {
const shopIds = Array.from(new Set(
cartItems.value
.map(item => toOptionalIdString(item.shopId))
.filter((shopId): shopId is string => Boolean(shopId))
.filter(shopId => !shopHoursById.value[shopId])
))
await Promise.all(shopIds.map(async shopId => {
try {
const shop = await shopApi.getShopById(shopId) as any
const businessHours = String(shop?.businessHours || '')
if (businessHours) {
shopHoursById.value = { ...shopHoursById.value, [shopId]: businessHours }
}
} catch {
shopHoursById.value = { ...shopHoursById.value, [shopId]: '' }
}
}))
cartItems.value.forEach(item => {
const shopKey = toOptionalIdString(item.shopId)
if (shopKey && !item.businessHours && shopHoursById.value[shopKey]) {
item.businessHours = shopHoursById.value[shopKey]
}
})
}
/** 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
if (!selectedItems.value.length || localSubtotal.value <= 0) {
checkoutPreview.value = null
2026-04-03 11:44:32 +08:00
availableCoupons.value = []
unavailableCoupons.value = []
2026-04-03 11:44:32 +08:00
selectedCoupon.value = null
couponSelectionKey.value = NO_COUPON_KEY
return
}
try {
const preview = await orderApi.checkoutPreview({
couponId: selectedCoupon.value?.id,
couponSourceType: selectedCoupon.value?.sourceType || (couponSelectionTouched.value && currentSelectedKey === NO_COUPON_KEY ? NO_COUPON_KEY : undefined),
2026-06-04 16:39:06 +08:00
remark: quoteRemark.value.trim() || 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
})
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
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)
checkoutPreview.value = null
2026-04-03 11:44:32 +08:00
availableCoupons.value = []
unavailableCoupons.value = []
2026-04-03 11:44:32 +08:00
selectedCoupon.value = null
couponSelectionKey.value = NO_COUPON_KEY
}
}
/** 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())
}
/** 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()
} catch (error: any) {
2026-04-03 11:44:32 +08:00
item.quantity -= delta
message.error(error?.message || '更新数量失败')
2026-04-03 11:44:32 +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('作品已删除')
} catch (error: any) {
message.error(error?.message || '删除作品失败')
2026-04-03 11:44:32 +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-31 18:36:52 +08:00
/** selectInlineArtist updates a cart item's artist from the page-level service detail controls. */
const selectInlineArtist = async (item: CartItem, artist: ArtistOption) => {
item.artistId = artist.id
item.artist = artist
await runWithGlobalLoading(() => loadAvailableCoupons())
}
/** selectInlineTime updates a cart item's appointment slot from the page-level service detail controls. */
const selectInlineTime = async (item: CartItem, appointmentTime: string) => {
item.appointmentTime = appointmentTime
await runWithGlobalLoading(() => loadAvailableCoupons())
}
/** 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)]))
}
/** 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,
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
}
}
/** 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
2026-06-04 16:39:06 +08:00
const shopKey = toOptionalIdString(shopId)
if (shopKey && shopHoursById.value[shopKey]) {
currentShopHours.value = shopHoursById.value[shopKey]
return
}
2026-04-03 11:44:32 +08:00
try {
const shop = await shopApi.getShopById(shopId) as any
currentShopHours.value = shop?.businessHours || ''
2026-06-04 16:39:06 +08:00
if (shopKey) {
shopHoursById.value = { ...shopHoursById.value, [shopKey]: currentShopHours.value }
}
2026-04-03 11:44:32 +08:00
} catch {
currentShopHours.value = ''
}
}
/** 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())
}
/** 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: () => []
}
}
/** 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 = ''
}
/** confirmBooking is a local helper used by this page script. */
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()
await loadAvailableCoupons()
2026-04-03 11:44:32 +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
}
/** applyCouponSelection is a local helper used by this page script. */
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
await runWithGlobalLoading(() => loadAvailableCoupons())
}
const openCheckoutRecovery = (error: unknown) => {
const actions = buildRecoveryActions([
2026-06-04 16:39:06 +08:00
{ key: 'retry', text: '重试发起询价' },
{ key: 'orders', text: '查看订单' }
])
const retryAction = actions[0]
const ordersAction = actions[1]
Modal.confirm({
2026-06-04 16:39:06 +08:00
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
}
const buildClientRequestId = () => {
if (typeof globalThis.crypto?.randomUUID === 'function') {
return `web-order-${Date.now()}-${globalThis.crypto.randomUUID()}`
}
return `web-order-${Date.now()}-${Math.random().toString(36).slice(2, 12)}`
}
/** 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 {
2026-06-04 16:39:06 +08:00
await runWithGlobalLoading(() => orderApi.createInquiryAppointment({
2026-04-03 11:44:32 +08:00
couponId: selectedCoupon.value?.id,
couponSourceType: selectedCoupon.value?.sourceType || (couponSelectionTouched.value && !selectedCoupon.value ? NO_COUPON_KEY : undefined),
2026-06-04 16:39:06 +08:00
remark: quoteRemark.value.trim() || undefined,
clientRequestId: buildClientRequestId(),
2026-04-03 11:44:32 +08:00
items: items.map(item => ({
productId: item.productId,
quantity: item.quantity,
artistId: item.artistId,
appointmentTime: item.appointmentTime
}))
}))
2026-06-04 16:39:06 +08:00
message.success('询价预约已发起,等待门店确认价格')
2026-04-03 11:44:32 +08:00
let followupWarningShown = false
try {
await runWithGlobalLoading(() => loadCartItems())
await updateCartCount()
} catch (followupError) {
followupWarningShown = true
2026-06-04 16:39:06 +08:00
console.error('询价预约发起后刷新购物车失败:', followupError)
message.warning('询价预约已发起,但购物车刷新失败,请前往订单页查看')
2026-04-03 11:44:32 +08:00
}
try {
await router.push('/orders')
} catch (navigationError) {
2026-06-04 16:39:06 +08:00
console.error('询价预约发起后跳转订单页失败:', navigationError)
2026-04-03 11:44:32 +08:00
if (!followupWarningShown) {
2026-06-04 16:39:06 +08:00
message.warning('询价预约已发起,但跳转订单页失败,请手动前往订单页查看')
2026-04-03 11:44:32 +08:00
}
}
} catch (error: any) {
console.error('创建订单失败:', error)
openCheckoutRecovery(error)
2026-04-03 11:44:32 +08:00
} finally {
submittingOrder.value = false
}
}
onMounted(async () => {
try {
await loadCartItems()
} catch (error: any) {
message.error(error?.message || '获取购物车数据失败')
2026-04-03 11:44:32 +08:00
}
})
</script>
<style scoped>
.page {
2026-05-29 13:30:56 +08:00
--cart-radius-lg: 24px;
--cart-radius-md: 18px;
--cart-bottom-offset: 60px;
2026-05-30 18:31:35 +08:00
--cart-shell-width: var(--frontend-page-max-width);
2026-04-03 11:44:32 +08:00
min-height: 100vh;
color: var(--text-primary);
2026-05-31 18:36:52 +08:00
font-family: "Plus Jakarta Sans", "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
background:
2026-05-29 13:30:56 +08:00
radial-gradient(circle at 14% -8%, color-mix(in srgb, var(--theme-primary) 28%, transparent), transparent 34%),
linear-gradient(180deg, color-mix(in srgb, var(--theme-page-bg) 88%, var(--theme-card-bg)), var(--theme-page-bg));
2026-04-03 11:44:32 +08:00
}
.content {
2026-05-30 18:31:35 +08:00
width: min(100%, var(--cart-shell-width));
2026-04-03 11:44:32 +08:00
margin: 0 auto;
2026-05-29 13:30:56 +08:00
padding: 0 16px calc(168px + env(safe-area-inset-bottom));
}
.cart-header {
position: sticky;
top: 0;
z-index: 12;
display: grid;
grid-template-columns: 40px minmax(0, 1fr) 40px;
align-items: center;
gap: 10px;
height: 56px;
margin: 0 -16px 14px;
padding: 8px 16px;
border-bottom: 1px solid color-mix(in srgb, var(--theme-border) 80%, transparent);
background: color-mix(in srgb, var(--theme-page-bg) 88%, transparent);
backdrop-filter: blur(18px);
}
2026-05-31 18:36:52 +08:00
.header-spacer {
2026-05-29 13:30:56 +08:00
width: 36px;
height: 36px;
2026-05-31 18:36:52 +08:00
justify-self: center;
2026-05-29 13:30:56 +08:00
}
.header-title {
min-width: 0;
text-align: center;
}
.header-title strong {
display: block;
}
.header-title strong {
overflow: hidden;
color: var(--text-primary);
2026-05-30 18:31:35 +08:00
font-size: 16px;
2026-05-29 13:30:56 +08:00
line-height: 1.25;
text-overflow: ellipsis;
white-space: nowrap;
2026-04-03 11:44:32 +08:00
}
.empty-cart {
2026-05-29 13:30:56 +08:00
margin-top: 64px;
padding: 44px 18px;
border: 1px solid var(--theme-border);
border-radius: var(--cart-radius-lg);
background: color-mix(in srgb, var(--theme-card-bg) 88%, transparent);
box-shadow: 0 18px 44px color-mix(in srgb, var(--theme-neutral) 8%, transparent);
2026-04-03 11:44:32 +08:00
}
2026-06-04 16:39:06 +08:00
.cart-loading-state {
display: grid;
min-height: 56vh;
place-items: center;
}
2026-05-29 13:30:56 +08:00
.empty-cart :deep(.ant-empty-description) {
color: var(--text-secondary);
}
.empty-action {
min-width: 128px;
height: 42px;
border: 0;
border-radius: 999px;
color: var(--theme-accent);
font-weight: 800;
background: var(--theme-primary);
box-shadow: var(--theme-button-shadow);
}
.status-card {
display: grid;
gap: 16px;
margin-bottom: 14px;
2026-05-29 13:30:56 +08:00
padding: 20px;
border: 1px solid var(--theme-border);
2026-05-29 13:30:56 +08:00
border-radius: var(--cart-radius-lg);
background:
linear-gradient(145deg, color-mix(in srgb, var(--theme-card-bg) 92%, transparent), color-mix(in srgb, var(--theme-primary-soft) 72%, var(--theme-page-bg))),
var(--theme-gradient-soft);
box-shadow: 0 18px 44px color-mix(in srgb, var(--theme-neutral) 8%, transparent);
}
2026-05-29 13:30:56 +08:00
.status-card.has-issues {
border-color: var(--theme-secondary);
}
2026-05-29 13:30:56 +08:00
.status-copy {
min-width: 0;
}
2026-05-29 13:30:56 +08:00
.status-eyebrow {
margin: 0 0 6px;
2026-05-29 13:30:56 +08:00
color: var(--theme-secondary);
font-size: 11px;
font-weight: 800;
}
2026-05-29 13:30:56 +08:00
.status-copy h1 {
margin: 0;
2026-05-29 13:30:56 +08:00
color: var(--text-primary);
2026-05-31 18:36:52 +08:00
font-size: 20px;
2026-05-29 13:30:56 +08:00
line-height: 1.2;
letter-spacing: 0;
}
2026-05-29 13:30:56 +08:00
.status-copy p {
margin: 8px 0 0;
color: var(--text-secondary);
2026-05-29 13:30:56 +08:00
font-size: 13px;
line-height: 1.55;
}
2026-05-29 13:30:56 +08:00
.status-total {
display: flex;
2026-05-29 13:30:56 +08:00
align-items: center;
justify-content: space-between;
gap: 12px;
2026-05-29 13:30:56 +08:00
padding: 12px 14px;
border: 1px solid color-mix(in srgb, var(--theme-primary) 36%, var(--theme-border));
border-radius: 18px;
background: color-mix(in srgb, var(--theme-card-bg) 76%, transparent);
}
2026-05-29 13:30:56 +08:00
.status-total span,
.status-metric span,
.appointment-head span,
.appointment-grid span,
.summary-row span,
.coupon-panel span,
.footer-summary span,
2026-05-29 13:30:56 +08:00
.item-subtitle,
.item-total span {
color: var(--text-secondary);
}
2026-05-29 13:30:56 +08:00
.status-total strong {
color: var(--theme-accent);
2026-05-31 18:36:52 +08:00
font-size: 26px;
line-height: 1;
}
2026-05-29 13:30:56 +08:00
.status-metrics {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 8px;
}
2026-05-29 13:30:56 +08:00
.status-metric {
min-width: 0;
padding: 10px;
2026-05-29 13:30:56 +08:00
border: 1px solid color-mix(in srgb, var(--theme-border) 82%, transparent);
border-radius: 16px;
background: color-mix(in srgb, var(--theme-card-bg) 70%, transparent);
}
2026-05-29 13:30:56 +08:00
.status-metric span,
.status-metric strong {
display: block;
}
2026-05-29 13:30:56 +08:00
.status-metric span {
margin-bottom: 4px;
2026-05-29 13:30:56 +08:00
font-size: 11px;
}
2026-05-29 13:30:56 +08:00
.status-metric strong {
overflow: hidden;
2026-05-29 13:30:56 +08:00
color: var(--theme-accent);
font-size: 13px;
text-overflow: ellipsis;
white-space: nowrap;
}
.metric-warning {
cursor: pointer;
2026-05-29 13:30:56 +08:00
border-color: var(--theme-secondary);
}
.metric-warning strong {
2026-05-29 13:30:56 +08:00
color: var(--theme-secondary);
}
.issue-callout {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
margin-bottom: 14px;
2026-05-29 13:30:56 +08:00
padding: 14px;
border: 1px solid var(--theme-border);
2026-05-29 13:30:56 +08:00
border-left: 4px solid var(--theme-secondary);
border-radius: 18px;
background: color-mix(in srgb, var(--theme-card-bg) 88%, transparent);
}
.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;
}
2026-05-29 13:30:56 +08:00
.issue-callout :deep(.ant-btn) {
border-radius: 999px;
color: var(--theme-accent);
border-color: var(--theme-secondary);
background: color-mix(in srgb, var(--theme-secondary) 16%, var(--theme-card-bg));
}
.checkout-layout {
display: grid;
gap: 14px;
}
2026-05-29 13:30:56 +08:00
.cart-group-card,
.coupon-panel,
.preview-panel,
.summary-panel {
border: 1px solid var(--theme-border);
border-radius: var(--cart-radius-lg);
background: color-mix(in srgb, var(--theme-card-bg) 90%, transparent);
box-shadow: 0 18px 44px color-mix(in srgb, var(--theme-neutral) 8%, transparent);
}
.cart-group-card {
padding: 14px;
}
.group-head {
display: grid;
grid-template-columns: 42px minmax(0, 1fr) auto;
gap: 10px;
align-items: center;
padding-bottom: 12px;
border-bottom: 1px solid color-mix(in srgb, var(--theme-border) 78%, transparent);
}
.shop-mark {
width: 42px;
height: 42px;
display: grid;
place-items: center;
border-radius: 16px;
color: var(--theme-accent);
font-weight: 900;
background: var(--theme-primary);
box-shadow: 0 10px 24px color-mix(in srgb, var(--theme-primary) 26%, transparent);
}
.group-copy {
min-width: 0;
}
.group-copy span,
.group-copy strong {
display: block;
}
.group-copy span {
overflow: hidden;
color: var(--text-primary);
font-size: 15px;
font-weight: 800;
text-overflow: ellipsis;
white-space: nowrap;
}
.group-copy strong {
margin-top: 2px;
color: var(--text-secondary);
font-size: 12px;
font-weight: 600;
}
.group-head em {
display: inline-flex;
align-items: center;
min-height: 26px;
padding: 0 10px;
border-radius: 999px;
color: var(--theme-secondary);
font-size: 12px;
font-style: normal;
font-weight: 800;
background: color-mix(in srgb, var(--theme-secondary) 16%, var(--theme-card-bg));
white-space: nowrap;
}
.cart-list {
display: grid;
2026-05-29 13:30:56 +08:00
margin-top: 12px;
gap: 12px;
}
.checkout-side {
display: grid;
gap: 12px;
align-content: start;
}
.item-card {
2026-05-29 13:30:56 +08:00
display: grid;
grid-template-columns: auto 76px minmax(0, 1fr);
gap: 10px;
align-items: start;
min-width: 0;
padding: 12px;
border: 1px solid color-mix(in srgb, var(--theme-border) 88%, transparent);
border-radius: var(--cart-radius-md);
background: color-mix(in srgb, var(--theme-card-bg) 94%, transparent);
transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
2026-05-29 13:30:56 +08:00
.item-card.is-selected {
border-color: color-mix(in srgb, var(--theme-primary) 58%, var(--theme-border));
box-shadow: 0 12px 28px color-mix(in srgb, var(--theme-primary) 12%, transparent);
2026-04-03 11:44:32 +08:00
}
.issue-card {
2026-05-29 13:30:56 +08:00
border-color: var(--theme-secondary);
box-shadow: var(--theme-focus-shadow);
2026-04-03 11:44:32 +08:00
}
2026-05-29 13:30:56 +08:00
.item-check {
padding-top: 28px;
}
2026-05-29 13:30:56 +08:00
.item-check :deep(.ant-checkbox-inner) {
width: 18px;
height: 18px;
border-radius: 6px;
border-color: var(--theme-border);
background: var(--theme-card-bg);
}
.item-check :deep(.ant-checkbox-checked .ant-checkbox-inner) {
border-color: var(--theme-primary);
background: var(--theme-primary);
2026-04-03 11:44:32 +08:00
}
.thumb {
display: flex;
align-items: center;
justify-content: center;
2026-05-29 13:30:56 +08:00
width: 76px;
height: 76px;
overflow: hidden;
border: 0;
border-radius: 18px;
color: var(--theme-accent);
background: var(--theme-primary-soft);
2026-04-03 11:44:32 +08:00
cursor: pointer;
}
.thumb img {
width: 100%;
height: 100%;
object-fit: cover;
}
2026-05-29 13:30:56 +08:00
.thumb span {
font-size: 22px;
font-weight: 900;
}
2026-04-03 11:44:32 +08:00
.item-main {
min-width: 0;
}
.item-head {
display: flex;
2026-05-29 13:30:56 +08:00
align-items: flex-start;
justify-content: space-between;
2026-05-29 13:30:56 +08:00
gap: 8px;
min-width: 0;
2026-04-03 11:44:32 +08:00
}
.title {
2026-05-29 13:30:56 +08:00
flex: 1;
min-width: 0;
display: -webkit-box;
overflow: hidden;
padding: 0;
border: 0;
color: var(--text-primary);
background: transparent;
2026-04-03 11:44:32 +08:00
font-size: 15px;
2026-05-29 13:30:56 +08:00
font-weight: 800;
line-height: 1.38;
2026-05-29 13:30:56 +08:00
text-align: left;
overflow-wrap: break-word;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
2026-04-03 11:44:32 +08:00
cursor: pointer;
}
2026-05-29 13:30:56 +08:00
.status-pill {
flex: 0 0 auto;
max-width: 88px;
overflow: hidden;
padding: 4px 8px;
border-radius: 999px;
color: var(--text-secondary);
background: var(--theme-primary-soft);
font-size: 11px;
font-weight: 800;
text-overflow: ellipsis;
white-space: nowrap;
}
.status-pill.ready {
color: var(--theme-secondary);
background: color-mix(in srgb, var(--theme-secondary) 14%, var(--theme-card-bg));
}
.status-pill.issue {
color: var(--theme-accent);
background: color-mix(in srgb, var(--theme-primary) 30%, var(--theme-card-bg));
}
.item-subtitle {
display: flex;
flex-wrap: wrap;
2026-05-29 13:30:56 +08:00
gap: 5px 8px;
margin-top: 6px;
font-size: 12px;
}
.appointment-panel {
width: 100%;
2026-04-03 11:44:32 +08:00
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
2026-05-29 13:30:56 +08:00
margin-top: 10px;
padding: 10px 12px;
border: 1px solid color-mix(in srgb, var(--theme-border) 88%, transparent);
border-radius: 16px;
background: var(--theme-primary-soft);
color: inherit;
text-align: left;
2026-04-03 11:44:32 +08:00
cursor: pointer;
}
.appointment-panel.issue {
2026-05-29 13:30:56 +08:00
border-color: var(--theme-secondary);
background: color-mix(in srgb, var(--theme-secondary) 10%, var(--theme-primary-soft));
2026-04-03 11:44:32 +08:00
}
.appointment-panel.ready {
2026-05-29 13:30:56 +08:00
border-color: color-mix(in srgb, var(--theme-secondary) 40%, var(--theme-border));
background: color-mix(in srgb, var(--theme-card-bg) 78%, var(--theme-primary-soft));
2026-04-03 11:44:32 +08:00
}
.appointment-content {
2026-04-03 11:44:32 +08:00
flex: 1;
min-width: 0;
}
.appointment-head {
display: flex;
justify-content: space-between;
gap: 8px;
2026-05-29 13:30:56 +08:00
margin-bottom: 7px;
}
.appointment-head strong {
2026-05-29 13:30:56 +08:00
color: var(--theme-accent);
white-space: nowrap;
}
.appointment-panel.issue .appointment-head strong {
2026-05-29 13:30:56 +08:00
color: var(--theme-secondary);
}
.appointment-grid {
display: grid;
2026-05-29 13:30:56 +08:00
gap: 5px;
}
.appointment-grid div {
min-width: 0;
}
.appointment-grid span,
.appointment-grid strong {
display: block;
2026-04-03 11:44:32 +08:00
font-size: 12px;
}
.actions,
.qty,
.summary-row {
2026-04-03 11:44:32 +08:00
display: flex;
align-items: center;
justify-content: space-between;
}
.actions {
2026-05-29 13:30:56 +08:00
display: grid;
grid-template-columns: auto minmax(0, 1fr) auto;
gap: 8px;
margin-top: 10px;
}
2026-04-03 11:44:32 +08:00
.qty {
2026-05-29 13:30:56 +08:00
gap: 0;
min-width: 88px;
overflow: hidden;
border: 1px solid var(--theme-border);
border-radius: 999px;
background: color-mix(in srgb, var(--theme-card-bg) 92%, transparent);
2026-04-03 11:44:32 +08:00
}
2026-05-29 13:30:56 +08:00
.qty span {
min-width: 30px;
color: var(--text-primary);
font-size: 13px;
font-weight: 800;
text-align: center;
}
.qty-btn {
width: 28px;
height: 28px;
display: inline-grid;
place-items: center;
border: 0;
color: var(--theme-accent);
background: transparent;
font-size: 15px;
font-weight: 900;
cursor: pointer;
}
.qty-btn:disabled {
color: color-mix(in srgb, var(--text-secondary) 48%, transparent);
cursor: not-allowed;
}
.item-total {
min-width: 0;
text-align: right;
}
.item-total span,
.item-total strong {
display: block;
}
.item-total span {
font-size: 11px;
}
.item-total strong {
overflow: hidden;
color: var(--theme-accent);
font-size: 14px;
text-overflow: ellipsis;
white-space: nowrap;
}
.remove-button {
width: 30px;
height: 30px;
display: inline-grid;
place-items: center;
border: 1px solid var(--theme-border);
2026-05-29 13:30:56 +08:00
border-radius: 999px;
color: var(--text-secondary);
background: color-mix(in srgb, var(--theme-card-bg) 86%, transparent);
cursor: pointer;
}
.coupon-panel {
width: 100%;
display: grid;
grid-template-columns: minmax(0, 1fr) auto auto;
gap: 10px;
align-items: center;
2026-05-29 13:30:56 +08:00
padding: 14px;
border-radius: 18px;
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);
2026-05-29 13:30:56 +08:00
font-size: 14px;
text-overflow: ellipsis;
white-space: nowrap;
}
.coupon-panel em {
2026-05-29 13:30:56 +08:00
color: var(--theme-secondary);
font-style: normal;
font-weight: 700;
white-space: nowrap;
}
.preview-panel {
display: grid;
gap: 6px;
2026-05-29 13:30:56 +08:00
padding: 14px;
border-radius: 18px;
}
.preview-line {
color: var(--text-secondary);
font-size: 12px;
line-height: 1.5;
}
.preview-line.vip {
2026-05-29 13:30:56 +08:00
color: var(--theme-secondary);
font-weight: 700;
}
.summary-panel {
2026-05-29 13:30:56 +08:00
padding: 16px;
}
.summary-title {
margin-bottom: 6px;
color: var(--text-primary);
font-size: 15px;
font-weight: 900;
2026-04-03 11:44:32 +08:00
}
.summary-row {
gap: 12px;
padding: 8px 0;
2026-05-29 13:30:56 +08:00
border-bottom: 1px solid color-mix(in srgb, var(--theme-border) 82%, transparent);
font-size: 13px;
}
.summary-row strong {
color: var(--text-primary);
white-space: nowrap;
}
2026-06-04 16:39:06 +08:00
.quote-remark-field {
display: grid;
gap: 8px;
margin-bottom: 14px;
color: var(--text-secondary);
font-size: 13px;
}
.summary-row.discount strong,
.summary-row.total strong {
color: var(--theme-accent);
2026-04-03 11:44:32 +08:00
}
.summary-row.total {
border-bottom: 0;
2026-04-03 11:44:32 +08:00
font-weight: 700;
}
2026-05-29 13:30:56 +08:00
.summary-row.total strong {
font-size: 20px;
}
2026-04-03 11:44:32 +08:00
.footer {
position: fixed;
2026-05-29 13:30:56 +08:00
left: 50%;
bottom: var(--cart-bottom-offset);
z-index: 20;
2026-05-30 18:31:35 +08:00
width: min(100%, var(--cart-shell-width));
display: flex;
align-items: center;
gap: 12px;
padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
2026-05-29 13:30:56 +08:00
border: 1px solid color-mix(in srgb, var(--theme-border) 86%, transparent);
border-bottom: 0;
border-radius: 24px 24px 0 0;
background: color-mix(in srgb, var(--theme-card-bg) 94%, transparent);
border-top: 1px solid var(--theme-border);
2026-05-29 13:30:56 +08:00
box-shadow: 0 -18px 44px color-mix(in srgb, var(--theme-neutral) 10%, transparent);
backdrop-filter: blur(16px);
2026-05-29 13:30:56 +08:00
transform: translateX(-50%);
}
.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);
2026-05-31 18:36:52 +08:00
font-size: 20px;
}
.checkout-button {
2026-05-29 13:30:56 +08:00
min-width: 136px;
height: 46px;
border: 0;
2026-05-29 13:30:56 +08:00
border-radius: 999px;
color: var(--theme-accent);
font-weight: 900;
background: var(--theme-primary);
box-shadow: var(--theme-button-shadow);
2026-04-03 11:44:32 +08:00
}
2026-05-29 13:30:56 +08:00
.checkout-button:not(:disabled):hover,
.checkout-button:not(:disabled):focus {
color: var(--theme-accent);
background: color-mix(in srgb, var(--theme-primary) 86%, var(--theme-card-bg));
}
.checkout-button:disabled {
color: var(--text-secondary);
background: var(--theme-primary-soft);
box-shadow: none;
}
2026-04-03 11:44:32 +08:00
.coupon-options {
display: flex;
flex-direction: column;
gap: 8px;
}
.coupon-option-copy {
display: grid;
gap: 2px;
min-width: 0;
}
.coupon-option-copy strong,
.coupon-option-copy em {
2026-05-29 13:30:56 +08:00
overflow-wrap: break-word;
}
.coupon-option-copy strong {
color: var(--text-primary);
}
.coupon-option-copy em {
2026-05-29 13:30:56 +08:00
color: var(--theme-secondary);
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);
2026-05-29 13:30:56 +08:00
overflow-wrap: break-word;
}
.coupon-unavailable-item em {
max-width: 180px;
color: var(--text-secondary);
font-style: normal;
text-align: right;
}
: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);
2026-05-29 13:30:56 +08:00
border-radius: 24px;
background: var(--theme-card-bg);
2026-05-29 13:30:56 +08:00
box-shadow: 0 24px 64px color-mix(in srgb, var(--theme-neutral) 22%, transparent);
}
: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;
2026-05-29 13:30:56 +08:00
border-radius: 999px;
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) {
2026-05-29 13:30:56 +08:00
color: var(--theme-accent);
border: 0;
2026-05-29 13:30:56 +08:00
background: var(--theme-primary);
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) {
2026-05-29 13:30:56 +08:00
color: var(--theme-accent);
background: color-mix(in srgb, var(--theme-primary) 86%, var(--theme-card-bg));
}
: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-05-31 18:36:52 +08:00
.cart-appbar {
position: sticky;
top: 0;
z-index: 30;
width: min(100%, var(--cart-shell-width));
margin: 0 auto;
padding: 12px 18px 9px;
border-bottom: 1px solid color-mix(in srgb, var(--theme-border) 78%, transparent);
background: color-mix(in srgb, var(--theme-card-bg) 88%, transparent);
backdrop-filter: blur(18px);
}
.cart-appbar-inner {
display: grid;
grid-template-columns: 42px minmax(0, 1fr) 42px;
align-items: center;
gap: 0;
min-height: 32px;
}
.cart-topbar-spacer {
width: 42px;
height: 32px;
}
.cart-brand {
min-width: 0;
overflow: hidden;
color: var(--text-primary);
font-size: 16px;
font-weight: 800;
letter-spacing: 0;
line-height: 1.25;
text-align: center;
text-overflow: ellipsis;
white-space: nowrap;
}
.cart-content {
display: grid;
gap: 28px;
padding-top: 18px;
padding-bottom: calc(144px + var(--cart-bottom-offset) + env(safe-area-inset-bottom));
}
.cart-section {
display: grid;
gap: 14px;
}
.cart-section-head {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 12px;
padding: 0 2px;
}
.cart-section-head h2 {
margin: 0;
color: var(--text-primary);
font-family: "Playfair Display", "Noto Serif SC", serif;
font-size: 23px;
font-weight: 800;
line-height: 1.15;
letter-spacing: 0;
}
.cart-section-head span {
flex: 0 0 auto;
color: var(--text-secondary);
font-size: 12px;
font-weight: 700;
line-height: 1.4;
}
.cart-item-list,
.service-card-list {
display: grid;
gap: 14px;
}
.cart-product-card {
display: grid;
grid-template-columns: auto 96px minmax(0, 1fr);
gap: 12px;
align-items: center;
min-width: 0;
padding: 14px;
border: 1px solid color-mix(in srgb, var(--theme-border) 76%, transparent);
border-radius: 22px;
background:
linear-gradient(145deg, color-mix(in srgb, var(--theme-card-bg) 90%, transparent), color-mix(in srgb, var(--theme-primary-soft) 42%, var(--theme-card-bg))),
color-mix(in srgb, var(--theme-card-bg) 86%, transparent);
box-shadow: 0 18px 42px color-mix(in srgb, var(--theme-neutral) 9%, transparent);
backdrop-filter: blur(18px);
transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.cart-product-card.selected {
border-color: color-mix(in srgb, var(--theme-primary) 52%, var(--theme-border));
box-shadow: 0 18px 46px color-mix(in srgb, var(--theme-primary) 13%, transparent);
}
.cart-product-card.warning {
border-color: color-mix(in srgb, var(--theme-secondary) 74%, var(--theme-border));
}
.product-check {
align-self: start;
margin-top: 38px;
}
.product-check :deep(.ant-checkbox-inner) {
width: 18px;
height: 18px;
border-radius: 6px;
border-color: color-mix(in srgb, var(--theme-primary) 40%, var(--theme-border));
background: color-mix(in srgb, var(--theme-card-bg) 72%, transparent);
}
.product-check :deep(.ant-checkbox-checked .ant-checkbox-inner) {
border-color: var(--theme-primary);
background: var(--theme-primary);
}
.product-thumb {
width: 96px;
height: 96px;
display: grid;
place-items: center;
overflow: hidden;
padding: 0;
border: 0;
border-radius: 20px;
color: var(--theme-accent);
background: linear-gradient(135deg, var(--theme-primary-soft), color-mix(in srgb, var(--theme-card-bg) 78%, var(--theme-primary)));
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--theme-border) 72%, transparent);
cursor: pointer;
}
.product-thumb img {
width: 100%;
height: 100%;
display: block;
object-fit: cover;
object-position: center;
}
.product-thumb span {
font-size: 26px;
font-weight: 900;
}
.product-info {
min-width: 0;
display: grid;
align-self: stretch;
align-content: space-between;
gap: 8px;
}
.product-title-row {
display: grid;
grid-template-columns: minmax(0, 1fr) 32px;
gap: 8px;
align-items: start;
}
.product-title {
min-width: 0;
display: -webkit-box;
overflow: hidden;
padding: 0;
border: 0;
color: var(--text-primary);
background: transparent;
font-size: 15px;
font-weight: 800;
line-height: 1.35;
letter-spacing: 0;
text-align: left;
overflow-wrap: break-word;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
cursor: pointer;
}
.product-delete {
width: 32px;
height: 32px;
display: inline-grid;
place-items: center;
border: 1px solid color-mix(in srgb, var(--theme-border) 82%, transparent);
border-radius: 50%;
color: var(--text-secondary);
background: color-mix(in srgb, var(--theme-card-bg) 70%, transparent);
cursor: pointer;
}
.product-delete:hover,
.product-delete:focus {
color: var(--theme-secondary);
border-color: color-mix(in srgb, var(--theme-secondary) 48%, var(--theme-border));
}
.product-meta {
display: flex;
flex-wrap: wrap;
gap: 5px 8px;
min-width: 0;
margin: 0;
color: var(--text-secondary);
font-size: 12px;
line-height: 1.45;
}
.product-meta span {
min-width: 0;
max-width: 100%;
overflow: hidden;
padding: 3px 8px;
border-radius: 999px;
background: color-mix(in srgb, var(--theme-primary-soft) 70%, transparent);
text-overflow: ellipsis;
white-space: nowrap;
}
.product-bottom {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
min-width: 0;
}
.product-price {
min-width: 0;
overflow: hidden;
color: var(--theme-accent);
font-size: 17px;
line-height: 1.1;
text-overflow: ellipsis;
white-space: nowrap;
}
.product-qty {
flex: 0 0 auto;
display: inline-grid;
grid-template-columns: 30px minmax(28px, auto) 30px;
align-items: center;
min-height: 32px;
overflow: hidden;
border: 1px solid color-mix(in srgb, var(--theme-border) 78%, transparent);
border-radius: 999px;
background: color-mix(in srgb, var(--theme-card-bg) 72%, transparent);
}
.product-qty button {
width: 30px;
height: 30px;
border: 0;
color: var(--theme-accent);
background: transparent;
font-size: 15px;
font-weight: 900;
line-height: 1;
cursor: pointer;
}
.product-qty button:disabled {
color: color-mix(in srgb, var(--text-secondary) 46%, transparent);
cursor: not-allowed;
}
.product-qty span {
min-width: 28px;
color: var(--text-primary);
font-size: 13px;
font-weight: 800;
text-align: center;
}
.stitch-issue {
margin: 0;
}
.service-detail-card,
.offer-card {
width: 100%;
display: grid;
gap: 12px;
min-width: 0;
border: 1px solid color-mix(in srgb, var(--theme-border) 76%, transparent);
border-radius: 22px;
color: inherit;
background: color-mix(in srgb, var(--theme-card-bg) 86%, transparent);
box-shadow: 0 18px 42px color-mix(in srgb, var(--theme-neutral) 8%, transparent);
backdrop-filter: blur(18px);
}
.service-detail-card {
padding: 14px;
text-align: left;
}
.service-detail-main {
width: 100%;
display: grid;
grid-template-columns: 46px minmax(0, 1fr) auto 14px;
align-items: center;
gap: 12px;
min-width: 0;
padding: 0;
border: 0;
color: inherit;
background: transparent;
text-align: left;
cursor: pointer;
}
.service-detail-card.ready {
border-color: color-mix(in srgb, var(--theme-primary) 42%, var(--theme-border));
}
.service-detail-card.warning {
border-color: color-mix(in srgb, var(--theme-secondary) 62%, var(--theme-border));
}
.service-icon,
.offer-icon {
display: grid;
place-items: center;
overflow: hidden;
border-radius: 16px;
color: var(--theme-accent);
background: color-mix(in srgb, var(--theme-primary) 40%, var(--theme-card-bg));
}
.service-icon {
width: 46px;
height: 46px;
}
.service-icon img {
width: 100%;
height: 100%;
display: block;
object-fit: cover;
object-position: center;
}
.service-icon span {
font-size: 16px;
font-weight: 900;
line-height: 1;
}
.service-copy,
.offer-copy {
min-width: 0;
display: grid;
gap: 3px;
}
.service-copy span,
.service-copy strong,
.service-copy em,
.offer-copy strong,
.offer-copy em {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.service-copy span {
color: var(--text-secondary);
font-size: 12px;
font-weight: 700;
}
.service-copy strong,
.offer-copy strong {
color: var(--text-primary);
font-size: 15px;
font-weight: 850;
}
.service-copy em,
.offer-copy em {
color: var(--text-secondary);
font-size: 12px;
font-style: normal;
line-height: 1.35;
}
.service-state {
max-width: 88px;
overflow: hidden;
padding: 5px 9px;
border-radius: 999px;
color: var(--theme-secondary);
background: color-mix(in srgb, var(--theme-secondary) 14%, var(--theme-card-bg));
font-size: 11px;
font-weight: 800;
text-overflow: ellipsis;
white-space: nowrap;
}
.service-detail-card.warning .service-state {
color: var(--theme-accent);
background: color-mix(in srgb, var(--theme-primary) 28%, var(--theme-card-bg));
}
.service-label {
color: var(--text-secondary);
font-size: 11px;
font-weight: 900;
line-height: 1.2;
}
.service-artist-strip,
.service-time-panel {
display: grid;
gap: 10px;
padding-top: 10px;
border-top: 1px solid color-mix(in srgb, var(--theme-border) 70%, transparent);
}
.service-artist-list {
display: flex;
gap: 12px;
overflow-x: auto;
padding: 2px 1px 4px;
scrollbar-width: none;
}
.service-artist-list::-webkit-scrollbar {
display: none;
}
.service-artist-option {
flex: 0 0 auto;
width: 64px;
display: grid;
justify-items: center;
gap: 6px;
padding: 0;
border: 0;
color: var(--text-secondary);
background: transparent;
cursor: pointer;
opacity: .62;
transition: opacity .18s ease, transform .18s ease;
}
.service-artist-option:hover,
.service-artist-option.active {
color: var(--theme-accent);
opacity: 1;
transform: translateY(-1px);
}
.service-artist-option img,
.service-artist-option > span {
width: 56px;
height: 56px;
display: grid;
place-items: center;
overflow: hidden;
border: 2px solid color-mix(in srgb, var(--theme-border) 86%, transparent);
border-radius: 50%;
color: var(--theme-accent);
background: color-mix(in srgb, var(--theme-primary-soft) 70%, var(--theme-card-bg));
object-fit: cover;
}
.service-artist-option.active img,
.service-artist-option.active > span {
border-color: var(--theme-primary);
box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary) 14%, transparent);
}
.service-artist-option em {
width: 100%;
overflow: hidden;
font-size: 11px;
font-style: normal;
font-weight: 800;
line-height: 1.2;
text-align: center;
text-overflow: ellipsis;
white-space: nowrap;
}
.service-time-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.service-time-head button {
border: 0;
color: var(--theme-accent);
background: transparent;
font-size: 12px;
font-weight: 800;
cursor: pointer;
}
.service-time-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 8px;
}
.service-time-option {
min-width: 0;
display: grid;
gap: 2px;
padding: 9px 8px;
border: 1px solid color-mix(in srgb, var(--theme-border) 76%, transparent);
border-radius: 999px;
color: var(--text-primary);
background: color-mix(in srgb, var(--theme-card-bg) 68%, transparent);
text-align: center;
cursor: pointer;
transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.service-time-option:hover,
.service-time-option.active {
border-color: var(--theme-primary);
background: color-mix(in srgb, var(--theme-primary) 18%, var(--theme-card-bg));
transform: translateY(-1px);
}
.service-time-option span,
.service-time-option strong {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.service-time-option span {
color: var(--text-secondary);
font-size: 10px;
font-weight: 700;
}
.service-time-option strong {
color: var(--theme-accent);
font-size: 13px;
}
.service-empty {
padding: 28px 12px;
border: 1px solid color-mix(in srgb, var(--theme-border) 76%, transparent);
border-radius: 22px;
background: color-mix(in srgb, var(--theme-card-bg) 78%, transparent);
}
.offer-card {
grid-template-columns: 48px minmax(0, 1fr) auto 14px;
padding: 16px;
text-align: left;
}
.offer-card:disabled {
cursor: not-allowed;
opacity: .62;
}
.offer-icon {
width: 48px;
height: 48px;
}
.offer-save {
color: var(--theme-accent);
font-size: 13px;
font-weight: 900;
white-space: nowrap;
}
.stitch-preview {
margin-top: -2px;
border-color: color-mix(in srgb, var(--theme-primary) 28%, var(--theme-border));
background: color-mix(in srgb, var(--theme-primary-soft) 66%, var(--theme-card-bg));
}
.stitch-summary {
padding: 18px;
border-radius: 24px;
background:
linear-gradient(145deg, color-mix(in srgb, var(--theme-card-bg) 92%, transparent), color-mix(in srgb, var(--theme-primary-soft) 42%, var(--theme-card-bg))),
color-mix(in srgb, var(--theme-card-bg) 88%, transparent);
backdrop-filter: blur(18px);
}
.stitch-summary h3 {
margin: 0 0 10px;
color: var(--text-primary);
font-size: 13px;
font-weight: 900;
line-height: 1.2;
letter-spacing: 0;
text-align: center;
}
.stitch-summary .summary-row {
padding: 10px 0;
font-size: 13px;
}
.stitch-summary .summary-row.total {
padding-top: 13px;
}
.stitch-summary .summary-row.total strong {
color: var(--theme-accent);
font-size: 23px;
}
.cart-footer {
justify-content: center;
gap: 0;
padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
background: color-mix(in srgb, var(--theme-card-bg) 88%, transparent);
backdrop-filter: blur(22px);
}
.cart-footer .checkout-button {
width: 100%;
max-width: 100%;
height: 50px;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
font-size: 15px;
}
.cart-footer .checkout-button :deep(.anticon) {
font-size: 17px;
}
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;
border: 1px solid var(--theme-border);
2026-04-03 11:44:32 +08:00
border-radius: 999px;
background: var(--theme-card-bg);
2026-04-03 11:44:32 +08:00
cursor: pointer;
}
.artist-option.active {
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;
}
.artist-option em {
2026-05-29 13:30:56 +08:00
color: var(--theme-secondary);
font-size: 12px;
font-style: normal;
}
2026-05-29 13:30:56 +08:00
.coupon-tip,
.helper {
color: var(--text-secondary);
font-size: 12px;
}
2026-05-29 13:30:56 +08:00
.quick-time-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
gap: 8px;
margin: 10px 0;
}
2026-05-29 13:30:56 +08:00
.quick-time {
display: grid;
gap: 2px;
padding: 10px 12px;
border: 1px solid var(--theme-border);
border-radius: 14px;
background: var(--theme-card-bg);
color: var(--text-primary);
text-align: left;
cursor: pointer;
transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.quick-time:hover,
.quick-time.active {
border-color: var(--theme-primary);
background: var(--theme-primary-soft);
transform: translateY(-1px);
}
.quick-time span {
color: var(--text-secondary);
font-size: 12px;
}
.quick-time strong {
font-size: 16px;
}
@media (max-width: 420px) {
2026-05-29 13:30:56 +08:00
.content {
padding-inline: 12px;
}
2026-05-29 13:30:56 +08:00
.cart-header {
margin-inline: -12px;
padding-inline: 12px;
}
.status-metrics {
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 6px;
}
.status-metric {
padding: 9px 7px;
}
.cart-group-card {
padding: 12px;
}
.item-card {
grid-template-columns: auto 70px minmax(0, 1fr);
padding: 10px;
}
.thumb {
width: 70px;
height: 70px;
}
.footer {
padding-inline: 14px;
}
.checkout-button {
2026-05-29 13:30:56 +08:00
min-width: 124px;
2026-04-03 11:44:32 +08:00
}
2026-05-31 18:36:52 +08:00
.cart-appbar {
padding-inline: 12px;
}
.cart-content {
gap: 24px;
padding-top: 16px;
}
.cart-section-head h2 {
font-size: 21px;
}
.cart-product-card {
grid-template-columns: auto 82px minmax(0, 1fr);
gap: 10px;
padding: 12px;
border-radius: 20px;
}
.product-check {
margin-top: 32px;
}
.product-thumb {
width: 82px;
height: 82px;
border-radius: 18px;
}
.product-title {
font-size: 14px;
}
.product-meta {
font-size: 11px;
}
.service-detail-card {
padding: 12px;
border-radius: 20px;
}
.service-detail-main {
grid-template-columns: 42px minmax(0, 1fr) auto 12px;
gap: 10px;
}
.service-icon {
width: 42px;
height: 42px;
border-radius: 14px;
}
.service-state {
max-width: 76px;
padding-inline: 8px;
}
.service-artist-list {
gap: 10px;
}
.service-artist-option {
width: 58px;
}
.service-artist-option img,
.service-artist-option > span {
width: 50px;
height: 50px;
}
.service-time-grid {
gap: 6px;
}
.service-time-option {
padding-inline: 6px;
}
.offer-card {
grid-template-columns: 44px minmax(0, 1fr) auto 12px;
padding: 14px;
border-radius: 20px;
}
.offer-icon {
width: 44px;
height: 44px;
border-radius: 14px;
}
2026-04-03 11:44:32 +08:00
}
</style>