<template>
  <div class="detaObj" style="min-height: 80vh" ref="detaObj">
    <div
      style="
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        border-top: 1px solid #eee;
        box-shadow: 0 2px 8px rgb(0 0 0 / 20%);
        z-index: 999;
      "
      class="bg-white"
      :style="{ transform: stickyHeight }"
    >
    
      <div
        style="max-width: 1200px; margin-left: auto; margin-right: auto"
        :class="{ 'q-px-md': $q.screen.width < 1220 }"
        class="q-py-sm"
      > <div class="row items-center">
        <span
          class="col product-price text-subtitle1 text-weight-bold f30"
          style="text-align: left"
        >
          <span>CNY {{ moneyFormat(MinPrice, 0) }}</span>
          <span class="q-ml-sm f16 text-grey-7">起</span>
        </span>
        <q-btn
          color="primary"
          unelevated
          class="q-px-xl"
          label="選擇方案"
          @click="goScrollHandler(priceListHeight)"
        />
      </div>
      <q-separator v-if="isShowNav" color="grey-2" class="q-my-sm" />
      <div class="row no-wrap items-center justify-between" 
      :class="{'q-pt-md q-mb-xs':!isShowNav,' q-pb-xs':isShowNav,}">
      
          <div
        :class="{'row no-wrap': $q.platform.is.desktop,'col row justify-between': $q.platform.is.mobile,}">
        <q-field stack-label label="入住 / 退房日期" standout 
        style="min-width: 190px" dense>
          <div class="self-center full-width no-outline row no-wrap items-center" tabindex="0">
            <span>{{dateRangeFormat}} </span>
            <q-chip size="9px" clickable 
            text-color="white" 
            color="dark" square>{{liveNvm}} 晚</q-chip>
          </div>
          <q-popup-proxy :offset="[0, 10]" ref="qDateProxy">
              <q-date 
              v-model="dateRange" 
              :options="optionsFn" 
              range mask="YYYY/MM/DD"
              @range-end="dateRangeHandler"></q-date>
          </q-popup-proxy>
        </q-field>
        <q-field v-if="$q.platform.is.desktop" stack-label label="人数及客房" standout
        class="q-ml-lg"
        style="min-width:190px" dense>
          <div class="self-center full-width no-outline" tabindex="0">
             {{numberOfAdults}}成人 
            <template v-if="numberOfChildren>0"> {{numberOfChildren}}儿童</template> 
             {{roomGroup}}房
          </div>
          <q-popup-proxy :offset="[0, 10]">
            <div class="q-pa-lg q-py-lg bg-white">
              <div class="items-center"
              :class="{'row':$q.platform.is.desktop,'column':$q.platform.is.mobile}">
                <span class="text-grey-7 product-price fz14 q-mr-lg">客房</span>
                <div>
                  <q-input
                  :style="{'width': $q.platform.is.desktop?'150px':'auto'}"
                  v-model="roomGroup"
                  mask="#"
                  reverse-fill-mask
                  dense
                  standout
                  readonly
                >
              <template v-slot:prepend>
                <q-btn
                  color="primary"
                  :size="$q.platform.is.desktop?'sm':'xs'"
                  class="q-px-none"
                  flat
                  icon="remove"
                  @click="addPeople('room', -1)"
                />
              </template>
              <template v-slot:append>
                <q-btn
                  color="primary"
                  :size="$q.platform.is.desktop?'sm':'xs'"
                  class="q-px-none"
                  flat
                  icon="add"
                  @click="addPeople('room', 1)"
                />
              </template>
              </q-input>
                </div>
              </div>
              <q-separator color="grey-2" class="q-my-md" />
              <div class="column" v-for="(x,index) in msg.searchroomGroup" :key="index">
                <div class="row no-wrap">
                  <div class="row items-center">
                    <span class="text-grey-7 product-price fz14 q-mr-lg">成人</span>
                    <q-input
                    :style="{'width': $q.platform.is.desktop?'150px':'auto'}"
                      v-model="x.numberOfAdults"
                      class="col"
                      mask="#"
                      reverse-fill-mask
                      dense
                      standout
                      readonly
                    >
                  <template v-slot:prepend>
                    <q-btn
                      color="primary"
                      :size="$q.platform.is.desktop?'sm':'xs'"
                      class="q-px-none"
                      flat
                      icon="remove"
                      @click="addPeople('numberOfAdults', -1,x)"
                    />
                  </template>
                  <template v-slot:append>
                    <q-btn
                      color="primary"
                      :size="$q.platform.is.desktop?'sm':'xs'"
                      class="q-px-none"
                      flat
                      icon="add"
                      @click="addPeople('numberOfAdults', 1,x)"
                    />
                  </template>
                    </q-input>
                    </div>
                    <div class="items-center"
                    :class="{'row q-ml-lg':$q.platform.is.desktop,'q-ml-sm':$q.platform.is.mobile}">
                      <span class="text-grey-7 product-price fz14 q-mr-lg">儿童</span>
                      <q-input
                        :style="{'width': $q.platform.is.desktop?'150px':'auto'}"
                        v-model="x.numberOfChildren"
                        class="col"
                        mask="#"
                        reverse-fill-mask
                        dense
                        standout
                        readonly
                      >
                    <template v-slot:prepend>
                      <q-btn
                        color="primary"
                        :size="$q.platform.is.desktop?'sm':'xs'"
                        class="q-px-none"
                        flat
                        icon="remove"
                        @click="addPeople('numberOfChildren', -1,x)"
                      />
                    </template>
                    <template v-slot:append>
                      <q-btn
                        color="primary"
                        :size="$q.platform.is.desktop?'sm':'xs'"
                        class="q-px-none"
                        flat
                        icon="add"
                        @click="addPeople('numberOfChildren', 1,x)"
                      />
                    </template>
                      </q-input>
                      </div>
                </div>
                <q-separator v-if="index!=(msg.searchroomGroup.length-1)" color="grey-2" class="q-my-md" />
              </div>
            </div>
          </q-popup-proxy>
        </q-field>
       </div>
       <q-btn v-if="$q.platform.is.mobile" unelevated round class="bg-grey-3 hover" icon="search" title="更多筛选">
        <q-badge rounded class="din bg-red-2 text-red-14 text-weight-bold" floating label="1"/>
        <q-tooltip>更多</q-tooltip>
        <q-popup-proxy class="no-shadow" style="box-shadow: 0 0 50px #ddd !important" 
        :offset="[0, 20]" ref="qDateProxy2"
        @before-hide="getRoom(),$refs.qDateProxy2.hide()">
          <q-card class="q-pa-md rounded-borders" style="width: 300px">
            <div class="q-mb-md text-subtitle2">更多</div>
            <div class="q-my-md">
              <q-field stack-label label="人数及客房" standout dense>
          <div class="self-center full-width no-outline" tabindex="0">
             {{numberOfAdults}}成人 
            <template v-if="numberOfChildren>0"> {{numberOfChildren}}儿童</template> 
             {{roomGroup}}房
          </div>
          <q-popup-proxy :offset="[0, 10]">
            <div class="q-pa-lg q-py-lg bg-white">
              <div class="column">
                <span class="text-grey-7 fz14 q-mr-lg">客房</span>
                <div>
                  <q-input
                  v-model="roomGroup"
                  mask="#"
                  reverse-fill-mask
                  dense
                  standout
                  readonly
                >
              <template v-slot:prepend>
                <q-btn
                  color="primary"
                  :size="$q.platform.is.desktop?'sm':'xs'"
                  class="q-px-none"
                  flat
                  icon="remove"
                  @click="addPeople('room', -1)"
                />
              </template>
              <template v-slot:append>
                <q-btn
                  color="primary"
                  :size="$q.platform.is.desktop?'sm':'xs'"
                  class="q-px-none"
                  flat
                  icon="add"
                  @click="addPeople('room', 1)"
                />
              </template>
              </q-input>
                </div>
              </div>
              <q-separator color="grey-2" class="q-my-md" />
              <div class="column" v-for="(x,index) in msg.searchroomGroup" :key="index">
                <div class="row no-wrap">
                  <div class="column">
                    <span class="text-grey-7 fz14 q-mr-lg">成人</span>
                    <q-input
                    :style="{'width': $q.platform.is.desktop?'150px':'auto'}"
                      v-model="x.numberOfAdults"
                      class="col"
                      mask="#"
                      reverse-fill-mask
                      dense
                      standout
                      readonly
                    >
                  <template v-slot:prepend>
                    <q-btn
                      color="primary"
                      :size="$q.platform.is.desktop?'sm':'xs'"
                      class="q-px-none"
                      flat
                      icon="remove"
                      @click="addPeople('numberOfAdults', -1,x)"
                    />
                  </template>
                  <template v-slot:append>
                    <q-btn
                      color="primary"
                      :size="$q.platform.is.desktop?'sm':'xs'"
                      class="q-px-none"
                      flat
                      icon="add"
                      @click="addPeople('numberOfAdults', 1,x)"
                    />
                  </template>
                    </q-input>
                    </div>
                    <div class="items-center"
                    :class="{'row q-ml-lg':$q.platform.is.desktop,'q-ml-sm':$q.platform.is.mobile}">
                      <span class="text-grey-7 fz14 q-mr-lg">儿童</span>
                      <q-input
                        :style="{'width': $q.platform.is.desktop?'150px':'auto'}"
                        v-model="x.numberOfChildren"
                        class="col"
                        mask="#"
                        reverse-fill-mask
                        dense
                        standout
                        readonly
                      >
                    <template v-slot:prepend>
                      <q-btn
                        color="primary"
                        :size="$q.platform.is.desktop?'sm':'xs'"
                        class="q-px-none"
                        flat
                        icon="remove"
                        @click="addPeople('numberOfChildren', -1,x)"
                      />
                    </template>
                    <template v-slot:append>
                      <q-btn
                        color="primary"
                        :size="$q.platform.is.desktop?'sm':'xs'"
                        class="q-px-none"
                        flat
                        icon="add"
                        @click="addPeople('numberOfChildren', 1,x)"
                      />
                    </template>
                      </q-input>
                      </div>
                </div>
                <q-separator v-if="index!=(msg.searchroomGroup.length-1)" color="grey-2" class="q-my-md" />
              </div>
              
            </div>
          </q-popup-proxy>
        </q-field>
            </div>
            <!-- <div class="q-my-md row">
              <q-btn
                  color="primary"
                  unelevated
                  class="q-px-xl col"
                  label="确定搜索"
                  @click="getRoom(),$refs.qDateProxy2.hide()"
                />
            </div> -->
          </q-card>
        </q-popup-proxy>
       </q-btn>
       <div v-if="$q.platform.is.desktop">
        <q-btn
          color="primary"
          unelevated
          class="q-px-xl"
          label="搜索"
          @click="getRoom"
        />
       </div>
      </div>
      </div>
    </div>
    <div
      v-if="hotelSummary"
      style="max-width: 1200px; margin-left: auto; margin-right: auto"
      :class="{ 'q-px-md': $q.screen.width < 1220 }"
    >
      <div class="row items-center q-mt-md q-mb-lg" style="padding-top: 73px;">
        <q-breadcrumbs
          class="col f12 no-wrap q-mr-md"
          style="font-size: 13px"
        >
          <q-breadcrumbs-el
            icon="home"
            label="首頁"
            class="cursor-pointer"
            @click="CommonJump('/index', {})"
          />
          <q-breadcrumbs-el label="日本" class="cursor-pointer" />
          <!-- <q-breadcrumbs-el>
            <span>
              <span class="cursor-pointer">{{ hotelSummary.hotelStateProvince }} </span>
              <span class="q-mr-sm"></span>
            </span>
          </q-breadcrumbs-el> -->
          <q-breadcrumbs-el
            v-if="$q.platform.is.desktop"
            :label="hotelSummary.hotelName"
            class="text-grey-6 ellipsis"
          />
        </q-breadcrumbs>
        <div class="text-grey-6 f12">Product No. # {{dataList.hotelId}}</div>
      </div>
      <div class="row rounded-borders bg-white overflow-hidden relative">
        <q-img class="col-5 cursor-pointer" :src="hotelDetails.hotelImageUrl1" :ratio="16/9" @click="showImageHandler(hotelDetails.hotelImageUrl1)"/>
        <div class="col column q-ml-xs">
          <q-img class="cursor-pointer" :src="hotelDetails.hotelImageUrl2" :ratio="16/9" @click="showImageHandler(hotelDetails.hotelImageUrl2)"/>
          <q-img class="q-mt-xs cursor-pointer" :src="hotelDetails.hotelImageUrl3" :ratio="16/9" @click="showImageHandler(hotelDetails.hotelImageUrl3)"/>
        </div>
        <div class="col column q-ml-xs">
          <q-img class="cursor-pointer" :src="hotelDetails.hotelImageUrl4" :ratio="16/9" @click="showImageHandler(hotelDetails.hotelImageUrl4)"/>
          <q-img class="q-mt-xs cursor-pointer" :src="hotelDetails.hotelImageUrl5" :ratio="16/9" @click="showImageHandler(hotelDetails.hotelImageUrl5)"/>
          
        </div>
        <div class="absolute" style="right: 10px;bottom: 10px;">
          <span class="text-white f12 q-pa-xs q-px-md row items-center cursor-pointer" 
          style="background: rgba(23,23,23,.5);border-radius: 30px;"
          @click="showImageHandler(hotelDetails.hotelImageUrl1)">
          <q-icon name="images"></q-icon>
          <span>{{images.length}}</span>
          </span>
        </div>
        
      </div>
      <div
        class="q-py-lg"
        :class="{ row: $q.platform.is.desktop, column: $q.platform.is.mobile }"
      >
        <div class="col q-mr-lg">
          <div class="f30 bold row items-center">
            <span class="ellipsis-2-lines q-pr-lg">{{ hotelSummary.hotelName }}</span>
            <q-rating v-model="roomReviewRating" size="1em" 
            color="orange" :max="roomReviewRating" readonly />
          </div>
          <div class="q-mt-md f12 text-grey-6">
            <q-icon
              name="iconfont icondingweixiao"
              size="16px"
              class="q-mr-sm"
            />
            <!-- <span
              >日本 -

              <span v-for="(x, i) in citys" :key="i">
                <span class="cursor-pointer">{{ x }} </span>
                <span v-if="i + 1 != citys.length" class="q-mr-sm">,</span>
              </span>
            </span> -->
            <span>{{ hotelSummary.address }}</span>
          </div>
          <div class="q-mt-md row">
            <q-chip
              class="transparent q-mr-xl no-padding"
              square
              icon="iconfont iconOwner-1"
              label=" 直營產品"
            />
            <q-chip 
              class="transparent q-mr-xl no-padding" 
              square
              icon="iconfont icontime" 
              :label="`住宿時間 ${liveNvm} 晚`" />
          </div>
        </div>
        <div
          :style="{ width: $q.platform.is.mobile ? '100%' : '293px' }"
          class="bg-grey-3 rounded-borders q-px-md"
          :class="{
            'q-py-lg': $q.platform.is.desktop,
            'row justify-between items-center q-mt-sm q-py-sm':
              $q.platform.is.mobile,
          }"
        >
          <div class="product-price f30 bold" v-if="MinPrice > 0">
            CNY：{{ moneyFormat(MinPrice, 0) }}
            <span class="f16 text-grey-6 normal">起</span>
          </div>
          <div v-else class="product-price text-subtitle1 f30 bold text-grey-6">暫無報價</div>
          <q-btn
            color="primary"
            label="選擇方案"
            unelevated
            @click="goScrollHandler(priceListHeight)"
            :class="{ 'q-mt-md full-width': $q.platform.is.desktop }"
          />
        </div>
      </div>
    </div>
    <!-- <div
      class="bg-white"
      style="
        position: fixed;
        left: 0;
        right: 0;
        top: -1px;
        border-top: 1px solid #eee;
        box-shadow: 0 2px 8px rgb(0 0 0 / 20%);
        z-index: 999;
      "
      v-if="currentHeight > priceListHeight + 100 && $q.platform.is.mobile"
      :style="{ transform: stickyHeight }"
    >
      <q-tabs
        v-model="tab"
        dense
        class="text-grey"
        active-color="primary"
        indicator-color="primary"
        align="left"
        narrow-indicator
      >
        <q-tab
          v-for="(x, i) in navs"
          :key="i"
          @click="goScrollHandler(x.top + 20)"
          :name="x.display"
          :label="x.display"
        ></q-tab>
      </q-tabs>
    </div> -->
    <!-- <div class="flex justify-between q-mx-auto" style="max-width: 1200px">
      <hotel-star></hotel-star>
      <hotel-des></hotel-des>
      <hotel-map></hotel-map>
    </div> -->
    <div
      class="q-pa-lg bg-grey-3 text-grey-9"
      ref="pricelist"
    >
      <div
        id="scheme"
        style="max-width: 1200px; margin-left: auto; margin-right: auto"
      >
        <div class="text-h6">選擇方案</div>
        <div
        class="rounded-borders bg-white q-pa-md q-mt-md">
        <div v-if="$q.platform.is.mobile">
          <div class="row items-center justify-end">
            <span class="product-price text-h6 q-mr-md"
              >CNY
              {{
                moneyFormat(MinPrice, 0)
              }}</span
            >
            <q-btn
              color="primary"
              outline
              :label="showOrderPreview ? '取消選擇' : '選擇'"
              @click="changeShowOrderPreviewHandler"
              class="q-px-lg"
            />
          </div>
          <div class="text-info q-mt-md text-right">
            最早可預訂日期：{{ StartDate }}
          </div>
        </div>
            <div
            class="rounded-borders bg-white q-pa-md q-mt-md"
            v-if="$q.platform.is.mobile&&showOrderPreview"
          >
            <RoomCard
            :priceList="SimilarList"
            :SimilarObj="SimilarObj"
            :msg="msg"
            @change="changeChosenDateHandler"
            ref="RoomCard"
          ></RoomCard>
                
              </div>
          <!-- <div class="text-h6 q-pt-lg" v-if="$q.platform.is.mobile">
            所選方案詳情
          </div> -->
          <div
            class="bg-white rounded-borders q-mt-md" v-if="$q.platform.is.desktop"
          >
            <div class="q-pa-md row">
              <div class="col">
                <div
                  class="text-subtitle1 text-weight-bold row items-center"
                  
                >
                  <span class="q-mr-md">行程標準出行方案</span>
                  <!-- <q-chip
                    square
                    color="orange"
                    size="sm"
                    text-color="grey-2"
                    class="text-light"
                    label="取消需二次確認"
                  /> -->
                </div>
                <!-- <div class="text-grey f12">
                  <ul class="q-pl-md no-margin">
                    <li v-for="(x, i) in warnBuy" class="q-mt-md" :key="i">
                      {{ x }}
                    </li>
                  </ul>
                </div> -->
              </div>
              <div class="" v-if="$q.platform.is.desktop">
                <div class="row items-center">
                  <span class="product-price text-h6 q-mr-md"
                    >CNY
                    {{
                      moneyFormat(MinPrice, 0)
                    }}</span
                  >
                  <q-btn
                    color="primary"
                    outline
                    :label="showOrderPreview ? '取消選擇' : '選擇'"
                    @click="changeShowOrderPreviewHandler"
                    class="q-px-lg"
                  />
                </div>
                <div class="text-info q-mt-md text-right">
                  最早可預訂日期：{{ StartDate }}
                </div>
              </div>
            </div>
            <div
              class="q-pa-md"
              style="border-top: 1px solid #eee"
              v-if="showOrderPreview"
            >
              <div class="q-mt-lg" v-if="$q.platform.is.desktop">
                <RoomCard
                    :priceList="SimilarList"
                    :SimilarObj="SimilarObj"
                    :msg="msg"
                    @change="changeChosenDateHandler"
                    ref="RoomCard"
                  ></RoomCard>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div
      style="max-width: 1200px; margin-left: auto; margin-right: auto"
      class="q-mt-xl row"
      :class="{ 'q-px-md': $q.screen.width < 1220 && $q.screen.width > 760 }"
    >
      <div
        :class="{ 'col-8': $q.platform.is.desktop, col: $q.platform.is.mobile }"
      >
        <div
          class="text-h5 text-weight-bold text-left q-mt-xl"
          :class="{
            'q-px-md': $q.screen.width < 1220 && $q.platform.is.mobile,
          }" ref="product">產品介紹</div>
        <div
          class="q-mt-md"
          ref="diyContext"
          :class="{
            'q-px-md': $q.screen.width < 1220 && $q.platform.is.mobile,
          }"
        >
        <div class="q-pb-md">{{hotelDetails.hotelDescription}}</div>
        <div class="q-pb-md">{{hotelDetails.bathUsage}}</div>
        <div>{{hotelDetails.hotelRooms}}</div>
      </div>
        <div ref="server"
          class="text-h5 text-weight-bold text-left q-mt-xl"
          :class="{
            'q-px-md': $q.screen.width < 1220 && $q.platform.is.mobile,
          }">服务设施</div>
        <div class="q-mt-sm column":class="{
          'q-px-md': $q.screen.width < 1220 && $q.platform.is.mobile,
        }">
            <div class="q-pb-md"><span class="text-weight-bold q-pr-lg">接送服务</span> {{hotelDetails.pickupService}}</div>
            <div class="q-pb-md row no-wrap">
              <span class="text-weight-bold q-mt-xs">客房网络连接</span> 
              <span class="q-pl-md row wrap col">
                <q-chip size="9px" clickable 
            text-color="white" 
            color="dark" square v-for="(x,i) in InterArr" :key="i">{{x}}</q-chip>
              </span>
          </div>
          <div class="row no-wrap overflow-hidden">
            <span class="text-weight-bold">水疗</span> 
            <div class="column col q-pl-md overflow-hidden">
              <div class="scroll q-pb-xs" :style="{'max-width': $q.platform.is.mobile?'85vw':'auto'}">
                <table class="hotel-details-table q-pb-md q-mr-md">
                  <tr>
                      <td colspan="3" class="td01">室外</td>
                      <td colspan="3" class="td01">屋内</td>
                      <td colspan="3" class="td01">蒸气浴</td>
                  </tr>
                  <tr>
                      <td class="td02">男</td>
                      <td class="td02">女</td>
                      <td class="td02">混浴</td>
                      <td class="td02">男</td>
                      <td class="td02">女</td>
                      <td class="td02">混浴</td>
                      <td class="td02">男</td>
                      <td class="td02">女</td>
                      <td class="td02">混浴</td>
                  </tr>
                  <tr>
                      <td>{{bathRoom[0]}}</td>
                      <td>{{bathRoom[1]}}</td>
                      <td>{{bathRoom[2]}}</td>
                      <td>{{bathRoom[3]}}</td>
                      <td>{{bathRoom[4]}}</td>
                      <td>{{bathRoom[5]}}</td>
                      <td>{{bathRoom[6]}}</td>
                      <td>{{bathRoom[7]}}</td>
                      <td>{{bathRoom[8]}}</td>
                  </tr>
              </table>
              </div>
              
            <div class="q-pt-sm row wrap">
                <q-chip size="9px" clickable 
            text-color="white" 
            color="dark" square v-for="(x,i) in HotSpring" :key="i">{{x}}</q-chip>
            </div>
            </div>
            
        </div>
        </div>
        
        <div
          class="text-h5 text-weight-bold text-left q-mt-xl"
          ref="warning"
          :class="{
            'q-px-md': $q.screen.width < 1220 && $q.platform.is.mobile,
          }"
        >
          購買須知
        </div>
        <div
          class="q-mt-lg trip-text bg-orange-1 q-pa-md rounded-borders q-mb-xl"
          style="border: 1px dashed var(--q-color-warning)"
          :class="{
            'q-mx-md': $q.screen.width < 1220 && $q.platform.is.mobile,
          }"
        >超過13歲視為成人處理</div>
        <div
          class="text-h5 text-weight-bold text-left q-mt-xl"
          ref="assemblypoint"
          :class="{
            'q-px-md': $q.screen.width < 1220 && $q.platform.is.mobile,
          }"
        >
          酒店地址
        </div>
        <div
          class="q-mt-lg trip-text rounded-borders q-mb-xl"
          style="border: 1px dashed var(--q-color-warning)"
          :class="{
            'q-mx-md': $q.screen.width < 1220 && $q.platform.is.mobile,
          }">
          <div class="q-pa-md" style="border-bottom: 1px dashed var(--q-color-warning)">
            <div class="text-weight-bold text-h6">酒店名稱：{{hotelSummary.hotelName}}</div>
            <div class="text-grey-9">地址：{{`${hotelSummary.address}`}}</div>
          </div>
          <div class="q-pa-md" v-for="(x,index) in travelLngLat" :key="index">
            <!-- <componentsMap v-if="x.Lng&&x.Lat" :AddressObj="x"/>
            <div v-else class="card text-center">经纬度未知</div> -->
          </div>
        </div>
        <div
          class="text-h5 text-weight-bold text-left q-mt-xl"
          ref="tips"
          :class="{
            'q-px-md': $q.screen.width < 1220 && $q.platform.is.mobile,
          }"
        >
          溫馨提示
        </div>
        <div
          class="q-mt-lg trip-text bg-white q-pa-md rounded-borders q-mb-xl"
          style="border: 1px dashed var(--q-color-info)"
          :class="{
            'q-mx-md': $q.screen.width < 1220 && $q.platform.is.mobile,
          }"
        >
        預定成功後房間將為您整晚保留</div>
        <div
          class="text-h5 text-weight-bold text-left q-mt-xl"
          ref="cancelTips"
          :class="{
            'q-px-md': $q.screen.width < 1220 && $q.platform.is.mobile,
          }"
        >
          取消政策
        </div>
        <div
          class="q-mt-lg trip-text q-mb-xl"
          :class="{
            'q-mx-md': $q.screen.width < 1220 && $q.platform.is.mobile,
          }"
        >
          <ul class="no-padding text-grey-9 q-ml-md">
            <li>所选日期 15 天（含）之前取消，收取手续费 0%</li>
            <li class="q-mt-sm">所选日期 8 ~ 14 天之间取消，收取手续费 30%</li>
            <li class="q-mt-sm">所选日期 4 ~ 7 天之间取消，收取手续费 50%</li>
            <li class="q-mt-sm">所选日期 1 ~ 3 天之间取消，收取手续费 80%</li>
            <li class="q-mt-sm">所选日期 0 ~ 0 天之间取消，收取手续费 100%</li>
          </ul>
          <div class="q-mt-lg f12 text-grey-6">
            <q-icon name="iconfont icontishi" class="q-mr-sm" />
            <span
              >注意：由于站内商品来自全球各地，订单取消时间将依该供应商所在时区判定。供应商需
              2-5
              个工作天进行取消流程，依照您购买的商品取消政策收取手续费，并于取消流程完成后14
              个工作天内退款。</span
            >
          </div>
        </div>
      </div>

      <template v-if="$q.platform.is.desktop">
        <div class="col-1"></div>
        <div class="col q-ml-xl position-relative">
          <div style="position: sticky; top: 200px">
            <div
              class="text-subtitle2 text-grey-6 cursor-pointer q-mb-md"
              v-for="(x, i) in navs"
              :key="i"
              @click="goScrollHandler(x.top + 20)"
              :class="{
                'active-trip-module':
                  currentHeight >= x.top &&
                  (i == navs.length - 1 || currentHeight < navs[i + 1].top),
              }"
            >
              {{ x.display }}
            </div>
          </div>
        </div>
      </template>
    </div>
    <q-dialog class="no-padding" v-model="showImagePriview" 
    v-if="images && images.length > 0">
      <image-preview :current="currentImage" :images="images"></image-preview>
    </q-dialog>
  </div>
</template>

<script>
import { date } from 'quasar'
import smaple from "src/components/trip/smaple.vue";
import block from "src/components/trip/block/index";
import hotelStar from "./hotel/hotelStar.vue";
import hotelMap from "./hotel/hotelMap.vue";
import hotelDes from "./hotel/hotelDes.vue";
import comments from "./hotel/comments.vue";
import selectRoom from './hotel/selectRoom.vue';
import componentsMap from 'src/components/car/Map.vue';
import ImagePreview from 'src/components/common/ImagePreview.vue'
import RoomCard from '../components/hotal/RoomCard.vue'
import OrderPreview from "src/components/hotal/orderPreview.vue";
export default {
  props: [],
  components: {
    smaple,
    block,
    hotelStar,
    hotelMap,
    hotelDes,
    comments,
    selectRoom,
    componentsMap,
    ImagePreview,
    RoomCard,
    OrderPreview,
  },
  data() {
    return {
      MinPrice: 0,
      selectedCar: "",
      tab: "",
      searchDate: "",
      clickDate: "",
      slide: 1,

      StartDate: '',
      roomReviewRating: 0,
      currentImage: '',
      showImagePriview: false,
      travelLngLat: [],//经纬度
      ServeArr: [],//酒店服务与设施
      InterArr: [],//网络连接
      bathRoom: [],//温泉
      HotSpring: [],
      images: [],
      hotelSummary: {},
      hotelDetails: {},
      roomGroup: 1,
      numberOfAdults: 1,
      numberOfChildren: 0,
      liveNvm: 1,
      dateRange:{},
      dateRangeFormat: '',//入住、离店时间
      roomGroupObj:{
        childAges:null,
        roomNum:null,numberOfAdults:1,numberOfChildren:0
      },
      msg: {
        hotelId:'',
        sort:1,
        displayFrom:1,
        arrivalDate:'',//开始时间
        departureDate:'',//结束时间
        roomOptionCd:'',
        searchroomGroup:[{ 
          childAges:null,
          roomNum:1,numberOfAdults:1,numberOfChildren:0
        }],
      },
      detaMsg:{
        groupBookingFlg: "0",
        hotelId: 0,
        hotelImageSize: 5,//图片大小
        photoGalleryGetFlg: 1 //画廊取得标志
      },
      currentPrice: [],
      isShow: false,
      dataList: {
        roomGroup: null,
      },
      JapanIncrease: '',
      SimilarList: [],
      SimilarObj: null,
      isDirect: 1,
      TripConfig: {},
      isShowNav: false,
      clickIndex: 1,
      isLoading: false,
      isShowDialog: false,
      citys: [],
      //Slider configuration [obj]
      options: {
        currentPage: 0,
        speed: 300,
        itemAnimation: true,
        centeredSlides: true,
        thresholdDistance: 100,
        thresholdTime: 300,
        loopedSlides: 2,
        slidesToScroll: 1,
        loop: true,
      },
      warnBuy: [
        "超过13岁视为成人处理",
        "预定成功后房间将为您整晚保留"
      ],
      showOrderPreview: false,
      videoPosition: 0,
      currentHeight: 0,
      isPictureInPicture: false,
      days: [
        {
          val: "",
          top: 0,
          isActive: false,
          display: "",
        },
      ],
      navs: [
        {
          val: "product",
          top: 0,
          isActive: false,
          display: "產品介紹",
        },
        {
          val: "server",
          top: 0,
          isActive: false,
          display: "服务设施",
        },
        {
          val: "warning",
          top: 0,
          isActive: false,
          display: "購買須知",
        },
        {
          val: "assemblypoint",
          top: 0,
          isActive: false,
          display: "酒店地址",
        },
        {
          val: "tips",
          top: 0,
          isActive: false,
          display: "溫馨提示",
        },
        {
          val: "cancelTips",
          top: 0,
          isActive: false,
          display: "取消政策",
        },
      ],
      priceListHeight: 0,
      stickyHeight: 0,
      zoomDiyContext: 1,
    };
  },
  watch: {
    SimilarList: {
      handler: function (val, oldval) {
        this.SimilarList = val;
      },
      immediate: true,
      deep: true,
    },
  },
  created() {
    if (this.$route.params.id) {
      this.detaMsg.hotelId = decodeURIComponent(this.$route.params.id)
      this.msg.hotelId = decodeURIComponent(this.$route.params.id)
    }
   
    
  },
  mounted() {
    window.addEventListener("scroll", this.handleScroll);
    
    this.dateRange.to = date.formatDate(date.addToDate(new Date(), { days: 9 }), 'YYYY/MM/DD')
    this.dateRange.from = date.formatDate(date.addToDate(new Date(), { days: 8 }), 'YYYY/MM/DD')
    this.msg.arrivalDate = date.formatDate(date.addToDate(new Date(), { days: 8 }), 'YYYY/MM/DD')
    this.msg.departureDate = date.formatDate(date.addToDate(new Date(), { days: 9 }), 'YYYY/MM/DD')
    this.dateRangeFormat = `${this.msg.arrivalDate} - ${this.msg.departureDate} `
    this.StartDate = this.msg.arrivalDate
    

    window.addEventListener("scroll", this.menu);
    this.getData();
    this.getRoom()
  },
  beforeDestroy() {
    document.getElementsByTagName("body")[0].style = "";
  },
  methods: {
    changeShowOrderPreviewHandler(){
      this.SimilarObj = {
        JapanIncrease: this.JapanIncrease,
        numberOfAdults: this.numberOfAdults,
        numberOfChildren: this.numberOfChildren,
        arrivalDate: this.msg.arrivalDate,
        departureDate: this.msg.departureDate,
        liveNvm: this.liveNvm
      }
      this.showOrderPreview = !this.showOrderPreview
    },
    showImageHandler(url) {
      let index = 0
      let images = this.images
      this.$viewerApi({
        options: {
          initialViewIndex: index,
        },
        images,
      });
      return
      this.currentImage = url
      this.showImagePriview = true
    },
    addPeople(m, i, x) {
      if(m=='room'){
        if(i==1){
          this.roomGroup++
          this.msg.searchroomGroup.push(this.roomGroupObj)
        }else{
          if(this.roomGroup>1){
            this.roomGroup--
            this.msg.searchroomGroup.pop()
          }
        }
      }else{
        x[m] = parseInt(x[m]) + i;
        if(m!='numberOfChildren'){
          x[m] = x[m] < 1 ? 1 : x[m]++;
        }else{
          x[m] = x[m] < 0 ? 0 : x[m]++;
        }
      }
      this.CountPeople()
    },
    CountPeople(){
      this.numberOfAdults = 0
      this.numberOfChildren = 0
      this.msg.searchroomGroup.forEach((x,index)=>{
        x.roomNum = index+1
        this.numberOfAdults += x.numberOfAdults
        this.numberOfChildren += x.numberOfChildren
      })
    },
    optionsFn(cd) {
      return cd >= date.formatDate(date.addToDate(new Date(), { days: 8 }), 'YYYY/MM/DD')
    },
    // 日期筛选
    dateRangeHandler(e) {
      let arrivalDate = `${e.from.year}/${e.from.month}/${e.from.day}`
      let departureDate = `${e.to.year}/${e.to.month}/${e.to.day} `
      let liveNvm = this.dateDiffer(arrivalDate,departureDate)
      if(liveNvm>9||liveNvm==0) return this.$message.error(`住宿时间最多九晚,至少一晚`)
      this.liveNvm = liveNvm
      this.msg.arrivalDate = arrivalDate
      this.msg.departureDate = departureDate
      this.dateRangeFormat = `${this.msg.arrivalDate} - ${this.msg.departureDate} `
      if (this.$refs.qDateProxy) this.$refs.qDateProxy.hide()
      if(this.$q.platform.is.mobile){
        this.getRoom()
      }
    },
    dateDiffer(DateStart,DateEnd) {
        //date1结束时间
      let date1 = new Date(DateEnd);
      //date2当前时间
      let date2 = new Date(DateStart);
      date1 = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate());
      date2 = new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());
      const diff = date1.getTime() - date2.getTime(); //目标时间减去当前时间
      const diffDate = diff / (24 * 60 * 60 * 1000);  //计算当前时间与结束时间之间相差天数
      return diffDate
    },
    handleSelect(id) {
      if (this.selectedCar === id) {
        this.selectedCar = "";
      } else {
        this.selectedCar = id;
      }
    },
    getTopNum(x) {
      this.days = JSON.parse(x);
    },
    handleScroll(e) {
      let temp = this.getScroll().top;
      this.stickyHeight = document.querySelector(".q-header--hidden")
        ? "translateY(0px)"
        : "translateY(0px)";
      this.currentHeight = temp;
      if (
        this.videoPosition > 0 &&
        this.videoPosition < this.currentHeight &&
        this.options.currentPage == 0 &&
        !this.isPictureInPicture
      ) {
        this.isPictureInPicture = true;
        let t = document.querySelectorAll("video")[0];
        try {
          t.requestPictureInPicture();
        } catch (error) {}
      } else if (
        this.videoPosition > 0 &&
        this.videoPosition > this.currentHeight &&
        this.options.currentPage == 0 &&
        this.isPictureInPicture
      ) {
        this.isPictureInPicture = false;
        document.exitPictureInPicture();
      }
      let h = document.location.hash;
      if (h.indexOf("#/detailHotal/") == -1) {
        window.removeEventListener("scroll", this.handleScroll);
      }
    },
    
    getScroll() {
      return {
        left:
          window.pageXOffset ||
          document.documentElement.scrollLeft ||
          document.body.scrollLeft ||
          0,
        top:
          window.pageYOffset ||
          document.documentElement.scrollTop ||
          document.body.scrollTop ||
          0,
      };
    },
    goScrollHandler(top) {
      window.scrollTo(0, top);
    },
    slideHandler(e) {
      this.options.currentPage = e.currentPage;
      if (
        e.currentPage != 0 &&
        this.$refs.video &&
        this.$refs.video.isPlaying
      ) {
        this.$refs.video.pause();
      }
    },
    playHandler(e) {},
    pauseHandler(e) {},
    timeChangeHandler(e) {

    },
    //
    seekedChangeHandler(e) {
      
    },
    resetHandler() {
      this.currentPrice = [];
      this.$refs.RoomCard.reset();
    },
    changeChosenDateHandler(val) {
      let arrList = function(arr){
        arr.forEach(x=>{
          x.id=null
        })
      }
      arrList(val.roomOptions)
      val.roomOptions.forEach((x,index)=>{
        x.id=(index+1)
      })
      this.currentPrice = JSON.parse(JSON.stringify(val));
      this.$refs.qDateProxy.hide();
    },
    showDialog() {
      this.isShowDialog = true;
    },
    //关闭弹窗
    closeDialog() {
      this.isShowDialog = false;
    },
    //  获取详情
    getData() {
      this.$q.loading.show();
      this.apipost(
        "dmc_post_Get_GetJAPAN_HotelDetail",
        this.detaMsg,
        (res) => {
          this.$q.loading.hide();
          if (res.data.resultCode == 1) {
            this.dataList = res.data.data
            this.hotelDetails = res.data.data.hotelDetails;
            this.hotelSummary = res.data.data.hotelSummary;
            this.roomReviewRating = Number(this.hotelDetails.roomReviewRating);
            this.travelLngLat.push({
              Lat: this.hotelSummary.latitudeW,
              Lng: this.hotelSummary.longitudeW,
              Address: this.hotelSummary.hotelName
            });
            //拆分酒店服务与设施
            if (this.hotelDetails.roomEquipments != "") {
              let ServeArr = this.hotelDetails.roomEquipments.split(",");
              this.Services = [];
              if (ServeArr[0] == 1) {
                this.Services.push("浴室和厕所");
              }
              if (ServeArr[1] == 0) {
                this.Services.push("公共汽车厕所CD（有全室巴士）");
              }
              if (ServeArr[1] == 1) {
                this.Services.push("公共汽车厕所CD（有一部分巴士）");
              }
              if (ServeArr[1] == 2) {
                this.Services.push("公共汽车厕所CD（有全室厕所）");
              }
              if (ServeArr[1] == 3) {
                this.Services.push("公共汽车厕所CD（有一部分厕所）");
              }
              if (ServeArr[1] == 4) {
                this.Services.push("公共汽车厕所CD（所有厕所都没有）");
              }
              if (ServeArr[2] == 1) {
                this.Services.push("淋浴-免费(全室)");
              }
              if (ServeArr[2] == 2) {
                this.Services.push("淋浴-收费(全室)");
              }
              if (ServeArr[2] == 3) {
                this.Services.push("淋浴-免费(部分)");
              }
              if (ServeArr[2] == 4) {
                this.Services.push("淋浴-收费(部分)");
              }
              if (ServeArr[3] == 1) {
                this.Services.push("冷暖气-免费(全室)");
              }
              if (ServeArr[3] == 2) {
                this.Services.push("冷暖气-收费(全室)");
              }
              if (ServeArr[3] == 3) {
                this.Services.push("冷暖气-免费(部分)");
              }
              if (ServeArr[3] == 4) {
                this.Services.push("冷暖气-收费(部分)");
              }
              if (ServeArr[4] == 1) {
                this.Services.push("全室有空调(收费)");
              }
              if (ServeArr[4] == 2) {
                this.Services.push("部分客房有空调(免费)");
              }
              if (ServeArr[4] == 3) {
                this.Services.push("部分客房有空调(收费)");
              }
              if (ServeArr[4] == 4) {
                this.Services.push("没有空调");
              }
              if (ServeArr[5] == 0) {
                this.Services.push("全房间有暖气设备(免费)");
              }
              if (ServeArr[5] == 1) {
                this.Services.push("全部房间都有暖气(收费)");
              }
              if (ServeArr[5] == 2) {
                this.Services.push("部分客房供暖(免费)");
              }
              if (ServeArr[5] == 3) {
                this.Services.push("部分客房供暖(收费)");
              }
              if (ServeArr[5] == 4) {
                this.Services.push("没有暖气设备");
              }
              if (ServeArr[6] == 1) {
                this.Services.push("电视（免费）");
              }
              if (ServeArr[6] == 2) {
                this.Services.push("电视（收费）");
              }
              if (ServeArr[7] == 1) {
                this.Services.push("录像机（免费）");
              }
              if (ServeArr[7] == 2) {
                this.Services.push("录像机（收费）");
              }
              if (ServeArr[8] == 1) {
                this.Services.push("卫星广播（免费）");
              }
              if (ServeArr[8] == 2) {
                this.Services.push("卫星广播（收费）");
              }
              if (ServeArr[9] == 1) {
                this.Services.push("冰箱-有(带饮料的)");
              }
              if (ServeArr[9] == 2) {
                this.Services.push("空冰箱");
              }
              if (ServeArr[10] == 1) {
                this.Services.push("迷你酒吧");
              }
              if (ServeArr[11] == 1) {
                this.Services.push("祖邦煎锅（免费）");
              }
              if (ServeArr[11] == 2) {
                this.Services.push("祖邦煎锅（收费）");
              }
            }
            //拆分网络连接
            if (this.hotelDetails.internetAccessibilityOfTheRoom != "") {
              this.InterArr = [];
              let InternetArr = this.hotelDetails.internetAccessibilityOfTheRoom.split(
                ","
              );
              if (InternetArr[0] == 1) {
                this.InterArr.push("客房网络连接");
              }
              if (InternetArr[1] == 1) {
                this.InterArr.push("拨号连线");
              }
              if (InternetArr[2] == 1) {
                this.InterArr.push("可连接LAN");
              }
              if (InternetArr[3] == 1) {
                this.InterArr.push("无线局域网");
              }
              if (InternetArr[4] == 1) {
                this.InterArr.push("PC贷款");
              }
              if (InternetArr[5] == 1) {
                this.InterArr.push("免费接入网络");
              }
            }
            //拆分温泉
            if (this.hotelDetails.bathAndBathAmenities != "") {
              this.HotSpring = [];
              this.bathRoom = [];
              let HotSpring = this.hotelDetails.bathAndBathAmenities.split(",");
              this.bathRoom = HotSpring.slice(2, 11);
              if (HotSpring[0] == 1) {
                this.HotSpring.push("露天温泉(也有男女(包括时间交替)·可借贷");
              } else if (HotSpring[0] == 2) {
                this.HotSpring.push(
                  "露天温泉(有男女也有(包括时间交替)·不能借贷"
                );
              } else if (HotSpring[0] == 3) {
                this.HotSpring.push(
                  "露天温泉(男女中只有1个(包括混浴)、可以包租)"
                );
              } else if (HotSpring[0] == 4) {
                this.HotSpring.push(
                  "露天温泉(男女中只有一个(包括混浴)，不能包租"
                );
              }

              if (HotSpring[1] == 1) {
                this.HotSpring.push("有包租浴室(没有条件)");
              } else if (HotSpring[1] == 2) {
                this.HotSpring.push("有包租浴室(有条件)");
              }

              if (HotSpring[11] == 1) {
                this.HotSpring.push("阿米尼蒂:脸·手巾(免费)");
              } else if (HotSpring[11] == 2) {
                this.HotSpring.push("阿米尼蒂:脸·手巾(收费)");
              }
              if (HotSpring[12] == 1) {
                this.HotSpring.push("阿米尼蒂:牙刷、牙膏(免费)");
              } else if (HotSpring[12] == 2) {
                this.HotSpring.push("阿米尼蒂:牙刷、牙膏(收费)");
              }
              if (HotSpring[13] == 1) {
                this.HotSpring.push("阿米蒂奇:浴巾(免费)");
              } else if (HotSpring[13] == 2) {
                this.HotSpring.push("阿米蒂奇:浴巾(收费)");
              }

              if (HotSpring[14] == 1) {
                this.HotSpring.push("水芹菜:洗发水(免费)");
              } else if (HotSpring[14] == 2) {
                this.HotSpring.push("水芹菜:洗发水(收费)");
              }

              if (HotSpring[15] == 1) {
                this.HotSpring.push("阿姆尼蒂:林斯(免费)");
              } else if (HotSpring[15] == 2) {
                this.HotSpring.push("阿姆尼蒂:林斯(收费)");
              }
              if (HotSpring[16] == 1) {
                this.HotSpring.push("阿米尼蒂:沐浴露(免费)");
              } else if (HotSpring[16] == 2) {
                this.HotSpring.push("阿米尼蒂:沐浴露(收费)");
              }

              if (HotSpring[17] == 1) {
                this.HotSpring.push("水黾:肥皂(免费)");
              } else if (HotSpring[17] == 2) {
                this.HotSpring.push("水黾:肥皂(收费)");
              }

              if (HotSpring[18] == 1) {
                this.HotSpring.push("亚健康:浴衣(免费)");
              } else if (HotSpring[18] == 2) {
                this.HotSpring.push("亚健康:浴衣(收费)");
              }

              if (HotSpring[19] == 1) {
                this.HotSpring.push("艾尼蒂:睡衣(免费)");
              } else if (HotSpring[19] == 2) {
                this.HotSpring.push("艾尼蒂:睡衣(收费)");
              }
              if (HotSpring[20] == 1) {
                this.HotSpring.push("阿姆尼蒂:浴衣(免费)");
              } else if (HotSpring[20] == 2) {
                this.HotSpring.push("阿姆尼蒂:浴衣(收费)");
              }

              if (HotSpring[21] == 1) {
                this.HotSpring.push("足球运动员:吹风机(免费)");
              } else if (HotSpring[21] == 2) {
                this.HotSpring.push("足球运动员:吹风机(收费)");
              }

              if (HotSpring[22] == 1) {
                this.HotSpring.push("艾尼蒂:羽毛被褥(免费)");
              } else if (HotSpring[22] == 2) {
                this.HotSpring.push("艾尼蒂:羽毛被褥(收费)");
              }
              if (HotSpring[23] == 1) {
                this.HotSpring.push("艾尼蒂:刮胡子(免费)");
              } else if (HotSpring[23] == 2) {
                this.HotSpring.push("艾尼蒂:刮胡子(收费)");
              }
              if (HotSpring[24] == 1) {
                this.HotSpring.push("水黾:淋浴帽(免费)");
              } else if (HotSpring[24] == 2) {
                this.HotSpring.push("水黾:淋浴帽(收费)");
              }
              if (HotSpring[25] == 1) {
                this.HotSpring.push("阿米尼蒂:棉签(免费)");
              } else if (HotSpring[25] == 2) {
                this.HotSpring.push("阿米尼蒂:棉签(收费)");
              }
              if (HotSpring[26] == 1) {
                this.HotSpring.push("水黾:冲澡(免费)");
              } else if (HotSpring[26] == 2) {
                this.HotSpring.push("水黾:冲澡(收费)");
              }

              if (HotSpring[27] == 1) {
                this.HotSpring.push("石梳:梳子刷(有)");
              }
              if (HotSpring[28] == 1) {
                this.HotSpring.push("其他温泉浴:展望浴(没有条件)");
              } else if (HotSpring[28] == 2) {
                this.HotSpring.push("其他温泉浴:展望浴(有条件)");
              }
              if (HotSpring[29] == 1) {
                this.HotSpring.push("其他:桑拿浴(免费)");
              } else if (HotSpring[29] == 2) {
                this.HotSpring.push("其他:桑拿浴(收费)");
              }
              if (HotSpring[30] == 1) {
                this.HotSpring.push("其他:jazza(没有条件)");
              } else if (HotSpring[29] == 2) {
                this.HotSpring.push("其他:jazza(有条件)");
              }
            }
            let dataImgArray=[]
            for (let i = 0; i < 5; i++) {
                if(this.hotelDetails[`hotelImageUrl${(i+1)}`] && this.hotelDetails[`hotelImageUrl${(i+1)}`].length>0){
                    dataImgArray.push(this.hotelDetails[`hotelImageUrl${(i+1)}`])
                }
            }
            if(res.data.data.photoGalleries&&res.data.data.photoGalleries.photoGalleryInfo){
                for (let i = 0; i < res.data.data.photoGalleries.photoGalleryInfo.length; i++) {
                dataImgArray.push(res.data.data.photoGalleries.photoGalleryInfo[i].photoGalleryImageURL)
                }
            }
            this.images=dataImgArray;
            
            this.$nextTick(() => {
              setTimeout(() => {
                this.navs.forEach((x) => {
                  x.top =
                    this.$refs[x.val].getBoundingClientRect().top + this.currentHeight - 140;
                });
                this.priceListHeight =
                  this.$refs.pricelist.getBoundingClientRect().top +
                  this.currentHeight -
                  60;
              }, 1000);

              
            });

          } else {
            this.$message.error(res.data.message);
          }
          
        },
        null
      );
    },
    // 获取酒店房间
    getRoom() {
      this.$q.loading.show();
      this.apipost(
        "dmc_post_Get_GetJAPAN_RoomsList",
        this.msg,
        (res) => {
          this.$q.loading.hide();
          if (res.data.resultCode == 1) {
            if (Object.prototype.toString.call(res.data.data.roomRateDetails) =="[object Object]"
            ) {
              this.SimilarList.push(res.data.data.roomRateDetails);
            } else {
              this.SimilarList = res.data.data.roomRateDetails;
            }
                        
            let arrList = function(arr){
              arr.forEach(item=>{
                item.images=[]
                item.id=null
              })
            }
            arrList(this.SimilarList)
            this.SimilarList.forEach((x,index) => {
              x.id = (index+1)
              x.images.push(x.roomImageURL)
              if(x.roomOptions.length>0){
                for (let f = 0; f < x.roomOptions.length; f++) {
                  for (let i = 0; i < 4; i++) {
                    if(x.roomOptions[f][`planPictureURL${(i+1)}`]){
                      x.images.push(x.roomOptions[f][`planPictureURL${(i+1)}`])
                    }
                  }
                }
              }
              if (
                Object.prototype.toString.call(x.roomOptions) ==
                "[object Object]"
              ) {
                let arr = [];
                arr.push(x.roomOptions);
                x.roomOptions = arr;
              }
              
            });
            this.JapanIncrease = res.data.data.JapanIncrease;
            if(this.SimilarList.length>0&&this.SimilarList[0].roomOptions.length>0){
                this.MinPrice = this.getPrice2(this.SimilarList[0].roomOptions[0].chargeableRateInfoPerPersonForANightBySetCurrency)
            }else{
              if(this.$route.params.b2CPrice){
                this.MinPrice = this.$route.params.b2CPrice
              }
            }
          } else {
            this.SimilarList = []
            //this.$message.error(res.data.message=='No results match your search.'?'當前入住日期未報價,請選擇其他日期看看吧':res.data.message)
            
          }
          
        },
        null
      );
    },
    getPrice2(price){
      if(this.JapanIncrease)
        return Math.ceil(price / this.JapanIncrease)
    },
    
    menu() {
      this.scroll =
        document.documentElement.scrollTop || document.body.scrollTop;
      if (this.scroll > 300) {
        this.isShowNav = true;
      } else {
        this.isShowNav = false;
      }
    },
  },
};
</script>

<style>
  .hotel-details-table {
        border: 1px solid #DCDCDC;
        border-collapse: collapse;
        width:680px;
    }
    .hotel-details-table .td01 {
        padding: 3px 15px;
        background: #F7F7F7;
        width: 226px;
        height: 19px;
        text-align: center;
    }
    .hotel-details-table .td02 {
        padding: 3px 15px;
        background: #FAFAFA;
        width: 69px;
        height: 19px;
        text-align: center;
    }
    .hotel-details-table td {
        width: 439px;
        padding: 10px 20px;
        vertical-align: middle;
        text-align: center;
        border: 1px solid #DCDCDC;
        font-size: 14px;
        box-sizing: border-box;
    }
    .hotel-details-tableMoblie {
        border: 1px solid #DCDCDC;
        border-collapse: collapse;
        width:100%;
        margin-top: 5px;
    }
    .hotel-details-tableMoblie .td01 {
        padding: 3px 10px;
        background: #F7F7F7;
        width: 33.33%;
        height: 19px;
        text-align: center;
    }
    .hotel-details-tableMoblie .td02 {
        padding: 3px 5px;
        background: #FAFAFA;
        width: 33.33%;
        height: 19px;
        text-align: center;
    }
    .hotel-details-tableMoblie td {
        width: 100%;
        padding: 10px 20px;
        vertical-align: middle;
        text-align: center;
        border: 1px solid #DCDCDC;
        font-size: 14px;
        box-sizing: border-box;
    }
.slider-item {
  transform: scale(1);
  transition-timing-function: ease;
  transition-duration: 300ms;
}
.slider-item.slider-active {
  transform: scale(1);
  z-index: 999;
}
.trip-text img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}
.trip-text {
  line-height: 1.6;
}
.slider-item.slider-active-copy {
  transform: scale(1);
  z-index: 999;
}
.active-trip-module {
  color: var(--q-color-primary);
  font-weight: 800;
  position: relative;
}
.active-trip-module::before {
  position: absolute;
  content: " ";
  top: 0;
  bottom: 0;
  left: -25px;
  width: 5px;
  border-radius: 5px;
  background: var(--q-color-primary);
}
.trip-module {
  color: #9e9e9e;
  transition: all 0.3s;
  font-weight: 100;
  text-align: center;
  line-height: 38px;
  font-size: 18px;
  width: 38px;
  height: 38px;
  border: 1px solid #ccc;
  border-radius: 50%;
  font-family: lettergothicstd;
}
#setZoom > div {
  zoom: calc(100 / 1000);
}
</style>
<style scoped>
.car-select {
  background: #ef7a70;
  color: #fff;
}
.gray {
  color: #999;
}
.cancel {
  background-color: #ef7a70;
  margin-left: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
}
.about {
  background-color: #f6f6f6;
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: 10px;
}
.tag {
  height: 28px;
  border-radius: 4px;
  line-height: 28px;
  padding: 0 14px;
}
.tag-blue {
  background: #eff7fe;
  color: #36a1fa;
}
.tag-red {
  background: var(--q-color-primary);
  color: #ee4454;
}
.room-item {
  padding: 25px;
  border-radius: 8px;
  background: #ffffff;
}
.room-img {
  width: 303px;
  height: 176px;
  border-radius: 8px;
}
.canuse {
  color: #2d90ff;
}
.select-btn {
  width: 100px;
  height: 42px;
  background: #ffffff;
  border: 1px solid #ee4454;
  border-radius: 8px;
  color: #ee4454;
}
</style>