<template>
  <div class="baseinfo">
    <el-descriptions
      class="margin-top"
      title=""
      :column="4"
      direction="horizontal"
    >
      <el-descriptions-item :label="$t('orderCode')">{{
        orderInfo.ordersId
      }}</el-descriptions-item>
      <el-descriptions-item :label="$t('orderStatus')">{{
        orderInfo.status | statusFilter
      }}</el-descriptions-item>
      <el-descriptions-item :label="$t('netShopOC')">{{
        orderInfo.ormorder
      }}</el-descriptions-item>
      <el-descriptions-item :label="$t('orderType')">{{
        orderInfo.orderType | orderTypeFilter
      }}</el-descriptions-item>
    </el-descriptions>
    <el-descriptions
      class="margin-top"
      title=""
      :column="4"
      direction="horizontal"
    >
      <el-descriptions-item :label="$t('takeOrderTime')">{{
        orderInfo.timeplaced
      }}</el-descriptions-item>
      <el-descriptions-item :label="$t('payTime')">{{
        orderInfo.payTime
      }}</el-descriptions-item>
      <el-descriptions-item :label="$t('currency')">{{
        orderInfo.currency
      }}</el-descriptions-item>
      <el-descriptions-item :label="$t('payways')">{{
        orderInfo.paytype
      }}</el-descriptions-item>
    </el-descriptions>
    <el-descriptions
      class="margin-top"
      title=""
      :column="4"
      direction="horizontal"
    >
      <el-descriptions-item :label="$t('goodsAmount')">{{
        orderInfo.discountTotal + orderInfo.payment
      }}</el-descriptions-item>
      <el-descriptions-item :label="$t('shipMoney')">
        {{ orderInfo.totalShipping }}</el-descriptions-item
      >
      <el-descriptions-item :label="$t('shouldPay')">{{
        orderInfo.payment
      }}</el-descriptions-item>
      <el-descriptions-item :label="$t('offerAmount')">{{
        orderInfo.discountTotal
      }}</el-descriptions-item>
    </el-descriptions>
    <el-descriptions
      class="margin-top"
      title=""
      :column="4"
      direction="horizontal"
    >
      <el-descriptions-item :label="$t('sellerDiscount')">{{
        orderInfo.sellerDiscount
      }}</el-descriptions-item>
      <el-descriptions-item :label="$t('platformDiscount')">
        {{ orderInfo.platformDiscount }}</el-descriptions-item
      >
      <el-descriptions-item :label="$t('loanAmount')">{{
        orderInfo.loanAmount
      }}</el-descriptions-item>
    </el-descriptions>
    <el-descriptions
      class="margin-top"
      title=""
      :column="4"
      direction="horizontal"
    >
      <el-descriptions-item :label="$t('buyerRemark')">{{
        orderInfo.buyerNote
      }}</el-descriptions-item>
      <el-descriptions-item :label="$t('sellerRemark')">{{
        orderInfo.sellerNote
      }}</el-descriptions-item>
      <el-descriptions-item :label="$t('inRemark')">{{
        orderInfo.note
      }}</el-descriptions-item>
    </el-descriptions>
  </div>
</template>

<script>
import { orderTypeKeyValue, statusKeyValue } from "@/api/oms/order/order";
import i18n from "@/lang"; // 国际化

export default {
  name: "baseInfoTab",
  props: ["orderInfo"],
  filters: {
    orderTypeFilter(key) {
      return i18n.t(orderTypeKeyValue[key]);
    },
    statusFilter(key) {
      return i18n.t(statusKeyValue[key]);
    }
  },
  data() {
    return {};
  },
  methods: {}
};
</script>

<style lang="scss" scoped>
.ptitle {
  display: flex;
  justify-content: space-between;
  margin: 0px 20px 0px 20px;
  color: #1f2d3d;
  text-align: left;
  font-weight: bold;
}
</style>
