<style lang="scss" scoped>

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