<style lang="scss" scoped>

</style>
<template>
<div></div>
</template>
<script>
export default {
    props: {
        orderInfo: {
            type: Object,
            default: () => ({})
        }
    },
    data() {
      return {
        dataList: null,
        details: null,
      sumPrice: 0,//总金额
      DiscountsMoney: 0,//优惠金额
      Money: 0, // 支付金額
      }
    },
    mounted() {
        this.getGroupData()
    },
    methods: {
    getGroupData() {
      this.$q.loading.show();
      this.apipost(
        "b2b_get_GetB2BTravelInfoV1",{ProductId: this.orderInfo.GoodsId},
        (r) => {
          if (r.data.resultCode == 1) {
            this.dataList = r.data.data;
            if (this.dataList.dayList && this.dataList.dayList.length > 0) {
              this.dataList.dayList.forEach((item) => {
                item.slide = 0;
              });
              if (r.data.data.scenicList) {
                r.data.data.scenicList.forEach((x) => {
                  if (x.cityName) {
                    this.citys.push(x.cityName);
                  }
                });
              }
            }
            this.dataList.imgCover = JSON.parse(this.dataList.imgCover);
            this.dayList = this.dataList.dayList;

            this.isShow = true;
            this.isDirect = this.dataList.isDirect;
            if (this.dataList.videoStr && this.dataList.videoStr != "") {
              this.options.loop = false;
              this.options.currentPage = 1;
              this.$nextTick(() => {
                setTimeout(() => {
                  let t = document.querySelectorAll(".slider-wrapper");
                  if (t.length > 0) {
                    let d = t[0].getBoundingClientRect();
                    this.videoPosition = d.top + d.height;
                  }
                }, 1000);
              });
            }
            this.$nextTick(() => {
              if (this.dataList.feature.featureHtml != "") {
                let tw =
                  parseFloat(
                    this.$refs.diyContext.getBoundingClientRect().width
                  ) / 1123.0;

                let divArr = document.querySelectorAll("#setZoom>div");
                for (let i = 0; i < divArr.length; i++) {
                  let div = divArr[i];
                  if (this.$q.platform.is.mobile) {
                    div.style.zoom =
                      div.offsetWidth > 1000
                        ? 0.999
                        : document.documentElement.clientWidth / 1123.0;
                  } else {
                    div.style.zoom = 1;
                  }
                }

                this.zoomDiyContext = tw > 1 ? 1 : tw.toFixed(2);
              }
              setTimeout(() => {
                this.navs.forEach((x) => {
                  x.top =
                    this.$refs[x.val].getBoundingClientRect().top +
                    this.currentHeight -
                    60;
                });
                this.priceListHeight =
                  this.$refs.pricelist.getBoundingClientRect().top +
                  this.currentHeight -
                  60;
                this.days = [];
                this.dayList.forEach((x) => {
                  let dayListObj = {
                    val: "day" + x.dayNum,
                    top: 0,
                    isActive: false,
                    display: x.dayNum > 9 ? x.dayNum : "0" + x.dayNum,
                  };
                  this.days.push(dayListObj);
                });
              }, 1000);

              try {
                document
                  .querySelector("#scrollId .q-page-container")
                  .addEventListener("scroll", this.handleScrollDay);
              } catch (error) {
               
              }
            });
          } else {
            this.$q.notify({
              type: "negative",
              message: r.data.message,
              position: "top",
              timeout: 2000, // 以毫秒为单位; 0意味着没有超时
            });
          }
          this.$q.loading.hide();
        },
        null
      );
    },
    }
}
</script>