<style lang="scss" scoped>

</style>
<template>
    <div>
            <div class="row q-mb-sm items-center">
              <div class="q-mr-lg">總金額</div>
              <div class="text-subtitle2 text-weight-bolder ">
                CNY {{ moneyFormat(sumPrice, 2) }}
              </div>
            </div>
            <div class="row q-mb-sm items-center">
              <div class="q-mr-lg">優惠金額</div>
              <div
                class="text-subtitle2 text-weight-bolder text-teal"
                v-if="DiscountMoney > 0"
              >
                CNY - {{ moneyFormat(DiscountMoney, 2) }}
              </div>
              <div class="text-grey-5" v-else>暫無優惠</div>
            </div>
            <!-- <div class="row q-mb-sm items-center">
              <div class="q-mr-lg">支付金額</div>
              <div class="text-h6 text-weight-bolder  product-price">
                CNY {{ moneyFormat(TotalPrice, 2) }}
              </div>
            </div> -->
    </div>
</template>
<script>
export default {
    props: {
        orderInfo: {
            type: Object,
            default: () => ({})
        }
    },
    data() {
      return {
        details: null,
      sumPrice: 0,//总金额
      DiscountMoney: 0,//优惠金额
      TotalPrice: 0, // 支付金額
      }
    },
    mounted() {
        this.getGroupData()
    },
    methods: {
    //  获取团的详情
    getGroupData() {
      // this.$q.loading.show();
      if(!this.orderInfo.ErpOrderId) return this.sumPrice = this.orderInfo.TotalPrice.toFixed(2)
      this.apipost(
        "dmc_post_GetThirdHotelOrder",
        { OrderID: this.orderInfo.ErpOrderId },
        (r) => {
          if (r.data.resultCode == 1) {
            this.dataList = r.data.data;
            const {DiscountMoney,TotalPrice} = r.data.data;
      // sumPrice: 0,//总金额
      // DiscountMoney: 0,//优惠金额
      // TotalPrice: 0, // 支付金額
      // MailingState: '',//邮寄状态 1自取 2邮寄
            this.TotalPrice = TotalPrice;
            this.DiscountMoney = DiscountMoney
            this.sumPrice = TotalPrice + DiscountMoney
            // this.sumPrice = this.moneyFormat(this.sumPrice, 2)
            // this.TotalPrice = this.moneyFormat(this.TotalPrice, 2)
            // this.DiscountMoney = this.moneyFormat(this.DiscountMoney, 2)
          } else {
            this.$q.notify({
              type: "negative",
              message: r.data.message,
              position: "top",
              timeout: 2000, // 以毫秒为单位; 0意味着没有超时
            });
          }
          // this.$q.loading.hide();
        },
        null
      );
    },
    }
}
</script>