<template>
    <div class="block-item">
        <div class="one-block">
          <div>
            <table class="trip-title">
              <tr>
                <td class="day">
                  <h3>
                    第
                    <span v-if="dayNum<10">0</span>
                    {{dayNum}}天
                  </h3>
                  <p style="margin: 0;">{{day.dateTime}}</p>
                </td>
                <td class="desc" v-html="title"></td>
              </tr>
            </table>
            <div class="five-box day_table">
                            <div class="left">
                                <div class="image">
                                    <img  v-if="day.details[0].img!='' && day.details[0].scenicJson" :style="{'top':day.details[0].scenicJson.y+'px'}" :src="$commonUtils.replaceHttps(day.details[0].img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" />
                                    <img  v-else :src="$commonUtils.replaceHttps(day.details[0].img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" />
                                </div>
                                <table class="day_table">
                                    <tr>
                                        <td>
                                            <div class="item">
                                              <h4 v-html="day.details[0].title" @click.stop="goUrl(day.details[0].url)" style="cursor: pointer" ></h4>
                                                <div class="playInfo">
                                                    <span class="playInfo-item" v-if='day.details[0].ticketName!=""'>
                                                        <!--<i class="iconfont icon-menpiao"></i>-->
                                                        <!--{{day.details[0].ticketName}}-->
                                                    </span>
                                                    <span class="playInfo-item" v-if='day.details[0].playTimeHour || day.details[0].playTimeMinutes'>
                                                        <i class="iconfont icon-shijian1"></i>
                                                        约
                                                        <span v-if="day.details[0].playTimeHour">{{day.details[0].playTimeHour}} 小时</span>
                                                        <span v-if="day.details[0].playTimeMinutes">{{day.details[0].playTimeMinutes}} 分钟</span>
                                                    </span>
                                                </div>
                                                <div v-html="day.details[0].content" class="pp"></div>
                                            </div>
                                        </td>
                                    </tr>
                                </table>

                            </div>
                            <div class="right">
                                <div class="fiveday">
                                    <div v-for="(item,i) in day.details" v-if="i>0&&i<5" :key="i">

                                        <div class="item item5">
                                                <div class="upFour">
                                                    <!-- <img  :style="{'top':item.scenicJson.y+'px'}" :src="$commonUtils.replaceHttps(item.img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> -->
                                                    <img v-if="item.img!=''&& item.scenicJson" :style="{'top':item.scenicJson.y+'px'}" :src="$commonUtils.replaceHttps(item.img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" />
                                                    <img  v-else :src="$commonUtils.replaceHttps(item.img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" />

                                                </div>
                                                <div class="down">
                                                  <h4 v-html="item.title" @click.stop="goUrl(item.url)" style="cursor: pointer" ></h4>
                                                    <div class="playInfo">
                                                    <span class="playInfo-item" v-if='item.ticketName!=""'>
                                                        <!--<i class="iconfont icon-menpiao"></i>-->
                                                        <!--{{item.ticketName}}-->
                                                    </span>
                                                    <span class="playInfo-item" v-if='item.playTimeHour || item.playTimeMinutes'>
                                                        <i class="iconfont icon-shijian1"></i>
                                                            约
                                                        <span v-if="item.playTimeHour">{{item.playTimeHour}}小时 </span>
                                                        <span v-if="item.playTimeMinutes">{{item.playTimeMinutes}}分钟</span>
                                                    </span>
                                                </div>
                                                <div v-html="item.content" class="pp" style="height:120px;overflow:hidden;"></div>
                                                </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
          </div>
            <div class="item day_tips" v-if='day.tips.length>0'>
                <h4>温馨提示</h4>
                <div>
                    <div v-for="(t,k) in day.tips" :key="k" v-html="t.content"></div>
                </div>
            </div>
            <table>
                <tr class="restaurant">
                    <td width="95" valign="middle" class="key">
                        <img crossOrigin="Anonymous" src='../../assets/img/daily_breakfast.png' />
                    </td>
                    <td width="211" valign="middle" class="val">{{day.can.breakfirst}}</td>
                    <td width="110" align="center" valign="middle" class="key">
                        <img crossOrigin="Anonymous" src='../../assets/img/daily_lunch.png' />
                    </td>
                    <td width="211" valign="middle" class="val">{{day.can.lanuch}}</td>
                    <td width="110" align="center" valign="middle" class="key">
                        <img crossOrigin="Anonymous" src='../../assets/img/daily_dinner.png' />
                    </td>
                    <td valign="middle" class="val">{{day.can.dinner}}</td>
                </tr>
                <tr class="restaurant">
                    <td colspan="6" height="15"></td>
                </tr>
                <tr class="restaurant">
                    <td valign="top" class="key">
                        <img crossOrigin="Anonymous" src='../../assets/img/daily_hotel-1.png' />
                    </td>
                    <td valign="middle" colspan="5" class="val" v-if='day.jiu2.length>0'>
                         <span v-for="(t,k) in day.jiu2" @click.stop="goUrl(t.url)" style="cursor: pointer" :key="k">
                                  {{k==day.jiu2.length-1?t.name:t.name+' / '}}
                            </span>
                      {{getHotelSuffix()}}
                    </td>
                    <td valign="middle" colspan="5" class="val" v-else>本日无酒店安排</td>
                </tr>
            </table>
        </div>
    </div>
</template>
<script>
export default {
  props: {
    day:{},
    isDirect:{},
    title:{},
    dayNum:{}
  },
  methods:{
    getHotelSuffix(){
      let suffix ="";
      if(this.day.jiu2.length>1){
        if(this.isDirect===1){
          suffix = "或同級"
        }
      }else{
        if(this.day.jiu2.length==1 && this.day.jiu2[0].name!='温馨的家'){
          if(this.isDirect===1){
            suffix = "【保证入住】"
          }
        }
      }
      return suffix;
    },
    goUrl(url) {
      if(url!=null&&url.length>0){
        window.open(url, "_blank");
      }
    }
  }
};
</script>
