<template>
  <div class="order-confirm-info-con common">
    <div class="item flex-default">
      <span class="left">商品金额</span>
      <span class="right">￥{{ total.originalPrice }}</span>
    </div>
    <!-- <div class="item flex-default">
      <span class="left">运费（总重：{{ total.weight }}KG）</span>
      <span class="right">￥{{ total.express }}</span>
    </div> -->
    <!-- <div
      class="item flex-default coupon"
      @click="$emit('couponSelect')"
      v-if="showCoupon"
    >
      <span class="left">优惠券</span>
      <div :class="couponClass">
        <template v-if="couponValValid">-￥{{ total.coupon }}</template>
        <div class="text" v-else>{{ couponSelectLabel }}</div>
        <m-icon icon="icon-more-light" className="more" :size="10" />
      </div>
    </div> -->
    <!-- <div
      class="item flex-default"
      @click="$emit('couponSelect')"
      v-if="showPromotion"
    >
      <span class="left">促销</span>
      <span class="right"> -￥{{ total.promotion }} </span>
    </div> -->
    <!-- <div class="item flex-default" v-if="showIntegral">
      <span class="left">积分</span>
      <div class="right disable">
        <span class="text">共0，可抵0</span>
        <van-checkbox
          checked-color="#DD2E41"
          shape="square"
          v-model="pointCheck"
          size="small"
          :icon-size="15"
        />
      </div>
    </div> -->
  </div>
</template>

<script>
export default {
  props: [
    "total",
    "couponList",
    "promotionList",
    "orderTypeMap",
    "orderTypeObj",
  ],
  data() {
    return {
      pointCheck: false,
    };
  },
  computed: {
    noCoupon() {
      return !this.couponList || this.couponList.length == 0;
    },
    couponValValid() {
      return this.total.coupon > 0;
    },
    couponSelectLabel() {
      return this.noCoupon ? "无可用" : `${this.couponList.length} 张可用`;
    },
    showCoupon() {
      return this.orderTypeObj.comm.coupon;
    },
    couponClass() {
      return this.couponValValid ? ["right"] : ["right", "disable"];
    },
    showPromotion() {
      if (this.orderTypeObj.comm.promotion) {
        return this.promotionList && this.promotionList.length > 0;
      } else {
        return false;
      }
    },
    showIntegral() {
      return this.orderTypeObj.comm.integral;
    },
  },
  methods: {},
};
</script>

<style lang="less">
.order-confirm-info-con {
  > .item {
    padding-right: 10px;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;

    &:nth-of-type(1) {
      margin-top: 0;
    }
  }

  > .coupon {
    padding-right: 0;
  }

  > .item .left {
    color: #140603;
    font-size: 12px;
    font-weight: bold;
  }

  > .item .right {
    color: #fa9f37;
    font-size: 12px;
    display: flex;
    align-items: center;
    font-weight: bold;

    .text {
      font-size: 12px;
      font-weight: 400;
      line-height: 14px;
    }

    .more {
      margin-left: 3px;
    }
  }

  > .item .van-checkbox {
    margin-right: 0;
    margin-left: 5px;
    border-color: #aeaeae;
  }

  > .item .disable {
    color: #aeaeae;
  }
}
</style>