<template>
  <div class="text-[24px] text-[#171717] leading-[32px] font-medium pt-[12px] pb-[12px]">
    {{ currentStatusspan }}
  </div>
</template>

<script setup>
import { defineProps, computed } from "vue";
import { useI18n } from "vue-i18n";

const { t } = useI18n();

// 订单状态配置映射
const ORDER_STATUS_CONFIG = {
  0: "order.card.orderStatusPendingPay",
  1: "order.card.orderStatusPendingConfirm",
  2: "order.card.orderStatusPendingUse",
  3: "order.card.orderStatusCanceled",
  4: "order.card.orderStatusRefunding",
  5: "order.card.orderStatusRefunded",
  6: "order.card.orderStatusCompleted",
};

const props = defineProps({
  orderData: {
    type: Object,
    required: true,
    default: () => ({
      orderId: "",
      paySerialNumber: "",
      payWay: "", // 支付方式 0-微信 1-支付宝 2-云闪付
      payAmt: "",
      orderStatus: "0", // 订单状态 0-待支付 1-待确认 2-待使用 3-已取消 4-退款中 5-已退款 6-已完成
      orderType: "0", // 0-酒店订单, 1-门票订单, 2-餐饮
    }),
  },
});

// 当前状态
const currentStatusspan = computed(() => {
  return t(ORDER_STATUS_CONFIG[props.orderData.orderStatus] || ORDER_STATUS_CONFIG["0"]);
});
</script>
