<!--  -->
<template>
  <div class="exhibition-detail">
    <div class="wrapper">
      <div class="top">
        <img
          class="bg"
          :src="require('@/assets/images/exhibition-type-top-bg.png')"
          alt=""
        />
        <div class="btn" @click="jumpTo()">
          线上展览<img
            :src="require('@/assets/images/exhibition-right-arrow.png')"
            alt=""
          />
        </div>
      </div>
      <div class="bottom">
        <img
          class="bg"
          :src="require('@/assets/images/survey-type-bottom-bg.png')"
          alt=""
        />

        <div class="content">
          <div class="nav">
            <img
              class="bg"
              :src="require('@/assets/images/survey-type-nav-bg.png')"
              alt=""
            />
            <div class="nav-con">
              <div class="nav-con-title">展览</div>
              <div class="nav-con-type">
                <ul>
                  <li
                    :class="{ cur: exhibitionType === 'hot' }"
                    @click="switchType('hot')"
                  >
                    <a>正在热展</a>
                    <div class="arrow" v-if="exhibitionType === 'hot'">
                      <img :src="require('@/assets/images/arrow.png')" alt="" />
                    </div>
                  </li>
                  <li
                    :class="{ cur: exhibitionType === 'preview' }"
                    @click="switchType('preview')"
                  >
                    <a>固定展览</a>
                    <div class="arrow" v-if="exhibitionType === 'preview'">
                      <img :src="require('@/assets/images/arrow.png')" alt="" />
                    </div>
                  </li>
                  <li
                    :class="{ cur: exhibitionType === 'review' }"
                    @click="switchType('review')"
                  >
                    <a>展览回顾</a>
                    <div class="arrow" v-if="exhibitionType === 'review'">
                      <img :src="require('@/assets/images/arrow.png')" alt="" />
                    </div>
                  </li>
                </ul>
              </div>
            </div>
          </div>
          <div class="con">
            <div class="back" @click="back">
              <img :src="require('@/assets/images/back.png')" alt="" />
            </div>
            <img
              class="bg"
              :src="require('@/assets/images/survey-type-con-bg.png')"
              alt=""
            />
            <div class="detail">
              <div class="detail-wrapper">
                <div class="detail-title">{{ detail.name }}</div>
                <div class="detail-desc" v-if="exhibitionType!=='preview'">
                  展览日期:
                  {{ detail.startTime | dateFormat1("yyyy-MM-yy") }}-{{
                    detail.endTime | dateFormat1("yyyy-MM-yy")
                  }}
                </div>
                <div class="detail-con" v-html="detail.content"></div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
// 这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
// 例如：import 《组件名称》 from '《组件路径》';
export default {
  name: 'exhibition-detail',
  // import引入的组件需要注入到对象中才能使用
  components: {},
  data () {
    // 这里存放数据
    return {
      exhibitionType: 'hot',
      detail: {}
    }
  },
  // 监听属性 类似于data概念
  computed: {},
  // 监控data中的数据变化
  watch: {},
  // 方法集合
  methods: {
    switchType (type) {
      this.$router.push({ path: '/exhibition-type', query: { type } })
    },
    back () {
      this.$router.push({
        path: '/exhibition-type',
        query: { type: this.detail.navType || '' }
      })
    },
    jumpTo () {
      window.open('http://www.4dmodel.com/SuperTwo/index.html?m=1025')
    }
  },
  // 生命周期 - 创建完成（可以访问当前this实例）
  created () {
    this.detail = this.$route.query
    this.exhibitionType = this.detail.navType
  },
  // 生命周期 - 挂载完成（可以访问DOM元素）
  mounted () {},
  beforeCreate () {}, // 生命周期 - 创建之前
  beforeMount () {}, // 生命周期 - 挂载之前
  beforeUpdate () {}, // 生命周期 - 更新之前
  updated () {}, // 生命周期 - 更新之后
  beforeDestroy () {}, // 生命周期 - 销毁之前
  destroyed () {}, // 生命周期 - 销毁完成
  activated () {} // 如果页面有keep-alive缓存功能，这个函数会触发
}
</script>
<style lang='less' scoped>
.bg {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
}
.exhibition-detail {
  width: 100%;
  margin-bottom: 98px;
  .wrapper {
    width: 100%;
    .top {
      width: 100%;
      height: 278px;
      position: relative;
      .btn {
        position: absolute;
        background: #945335;
        box-shadow: 0 0 6px rgba(255, 255, 255, 1);
        text-align: center;
        line-height: 55px;
        width: 200px;
        height: 55px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 20px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #ffffff;
        cursor: pointer;
        > img {
          position: absolute;
          right: 20px;
          top: 14px;
          width: 29px;
          height: 29px;
        }
      }
    }
    .bottom {
      width: 100%;
      position: relative;
      .content {
        min-width: 1090px;
        margin: 0 auto;
        width: 57%;
        display: flex;
        justify-content: center;
        .nav {
          flex: 1;
          margin-right: 1%;
          margin-top: -68px;
          position: relative;
          .nav-con {
            width: 85%;
            margin: 94px auto 0;
            .nav-con-title {
              background: #945335;
              padding: 14.5px 0 14.5px 46px;
              font-size: 20px;
              font-family: Microsoft YaHei;
              font-weight: bold;
              color: #ffffff;
              opacity: 1;
            }
            .nav-con-type {
              margin-top: 3px;
              background: rgba(148, 83, 53, .6);
              overflow: hidden;
              > ul {
                width: 100%;
                margin-top: 21px;
                margin-bottom: 105px;
                > li {
                  width: 100%;
                  padding: 8px 0 8px 51px;
                  font-size: 16px;
                  font-family: Microsoft YaHei;
                  font-weight: 400;
                  color: #000000;
                  position: relative;
                  cursor: pointer;
                  .arrow {
                    position: absolute;
                    top: 10px;
                    right: 11.5px;
                    width: 10.5px;
                    height: 18px;
                    > img {
                      width: 100%;
                      height: 100%;
                    }
                  }
                }
                .cur {
                  background: linear-gradient(180deg, #585a5a 0%, #949198 100%);
                  color: #ffffff;
                }
              }
            }
          }
        }
        .con {
          flex: 3;
          margin-top: -68px;
          position: relative;
          .back {
            width: 19px;
            position: absolute;
            left: 26px;
            top: 97px;
            cursor: pointer;
            > img {
              width: 100%;
            }
          }
          .detail {
            width: 100%;
            .detail-wrapper {
              width: 86%;
              margin: 152px auto 80px;
              max-width: 708px;
              overflow-x: scroll;
              .detail-title {
                font-size: 40px;
                font-family: Microsoft YaHei;
                font-weight: 400;
                line-height: 58px;
                color: #000000;
              }
              .detail-desc {
                margin-top: 36px;
                margin-top: 8px;
                font-size: 12px;
                font-weight: 400;
                font-size: 16px;
                font-family: Microsoft YaHei;
                color: #000000;
              }
              .detail-con {
                margin-top: 62px;
                /deep/ img {
                  display: block;
                  margin: 10px auto;
                  max-height: 400px;
                }
              }
            }
          }
        }
      }
    }
  }
}
</style>
