Files
xiaomai a5ac00baa1 feat(pricing): introduce real-time budget estimator
This commit introduces a real-time budget estimator for event services. A new summary sidebar now displays a live,
itemized breakdown of costs as the user selects options in the order form.

Key changes include:
- A new `OrderSummary` component to display the price breakdown and total.
- Comprehensive pricing logic implemented in the `useEventOrder` composable.
- A responsive two-column layout on the main page to accommodate the summary.
- UI/UX improvements across the form, including clearer labels and subtle transition animations for conditional fields.
2025-10-16 21:14:44 +08:00

69 lines
2.1 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<UCard>
<template #header>
<h2 class="text-xl font-bold">{{ secIdx }}. 基本信息</h2>
<p class="text-muted text-sm">
请留下联系方式与活动基础信息便于预算估算
</p>
</template>
<div class="grid gap-4">
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<UFormField name="contactName" label="联系人" required>
<UInput v-model="orderState.contactName" class="w-full" />
</UFormField>
<UFormField name="contactNumber" label="联系电话(或 WhatsApp">
<div class="flex items-center gap-2">
<UCheckbox
v-model="orderState.isSameContact"
label="同活动联系人"
class="whitespace-nowrap"
/>
<UInput
v-model="orderState.contactNumber"
:disabled="orderState.isSameContact"
:class="[
'w-full transition-opacity duration-300',
orderState.isSameContact ? 'opacity-0 pointer-events-none' : '',
]"
/>
</div>
</UFormField>
</div>
<!-- 活动信息 -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
<UFormField name="eventName" label="活动名称" required>
<UInput
v-model="orderState.eventName"
class="w-full"
placeholder="例: ACME 集团 2025 年终晚会暨 50 周年庆典"
/>
</UFormField>
<UFormField name="eventDate" label="活动日期" required>
<UInput type="date" v-model="orderState.eventDate" class="w-full" />
</UFormField>
<UFormField name="eventLocation" label="地点" required>
<USelect
v-model="orderState.eventLocation"
:items="eventLocationItems"
placeholder="请选择地点"
class="w-full"
/>
</UFormField>
</div>
</div>
</UCard>
</template>
<script lang="ts" setup>
const { sectionIndex, orderState, eventLocationItems } = useEventOrder();
const secIdx = ref(++sectionIndex.value);
</script>
<style></style>