<template>
    <div class="block-item">
        <div class="one-block">
            <div class="five-box">
                <div class="left">
                    <div class="image">
                        <img crossOrigin="Anonymous" :src='day.details[0].img+"?x-oss-process=image/resize,h_497,image/crop,g_north,w_311,h_497"'/>
                    </div>
                    <div class="item">
                        <h3 v-html="day.details[0].title"></h3>
                        <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>
                        <span v-html="day.details[0].content"></span>
                    </div>
                </div>
                <div class="right">
                    <el-row :gutter="4">
                        <el-col :span="12" v-for="(item,i) in day.details" v-if="i>0&&i<5" :key="i">
                            <div class="item">
                                <div class="three-item">
                                    <div class="image">
                                        <img crossOrigin="Anonymous" :src='item.img' />
                                    </div>
                                    <h3 v-html="item.title"></h3>
                                    <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>
                                    <span v-html="item.content"></span>
                                </div>
                            </div>
                        </el-col>
                    </el-row>
                </div>
            </div>
            <div class="item flex" v-if='day.tips.length>0'>
                <h4>温馨提示</h4>
                <div class="remark">
                    <span v-for="(t,k) in day.tips" :key="k" v-html="t.content"></span>
                </div>
            </div>
            <div class="restaurant">
                <el-row :gutter="30">
                    <el-col :span="8" class="restaurant-item">
                        <div class="key">
                            <img crossOrigin="Anonymous" src='../../../assets/img/daily_breakfast.png' />
                        </div>
                        <div class="val">{{day.can.breakfirst}}</div>
                    </el-col>
                    <el-col :span="8" class="restaurant-item">
                        <div class="key">
                            <img crossOrigin="Anonymous" src='../../../assets/img/daily_lunch.png' />
                        </div>
                        <div class="val">{{day.can.lanuch}}</div>
                    </el-col>
                    <el-col :span="8" class="restaurant-item">
                        <div class="key">
                            <img crossOrigin="Anonymous" src='../../../assets/img/daily_dinner.png' />
                        </div>
                        <div class="val">{{day.can.dinner}}</div>
                    </el-col>
                </el-row>
            </div>
            <div class="restaurant">
                <el-row :gutter="30">
                    <el-col :span="24" class="restaurant-item">
                        <div class="key">
                            <img crossOrigin="Anonymous" src='../../../assets/img/daily_hotel-1.png' />
                        </div>
                        <div class="val" v-if='day.jiu2.length>0'>
                            <span v-for="(t,k) in day.jiu2" :key="k">
                               {{k==day.jiu2.length-1? (t.newTitle!=''&& t.newTitle!=t.name?t.newTitle:t.name) : (t.newTitle!=''&& t.newTitle!=t.name?t.newTitle:t.name)+' / ' }}
                            </span>
                              {{getHotelSuffix()}}
                        </div>
                        <div class="val" v-else>本日无酒店安排</div>
                    </el-col>
                </el-row>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    props:{
        day:{},
        isDirect: {},
    },
     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 != '温馨的家' && this.day.jiu2[0].name != '机场附近酒店') {
            if (this.day.jiu2[0].status == 1) {
              suffix = "【保证入住】"
            } else {
              if (this.isDirect === 1) {
                suffix = "或同級"
              }
            }
          }
        }
        return suffix;
      },
    }
}
</script>
