<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>
