<template>
  <div class="index-box">
    <img src="../../public/fourBoxes-image/1.jpg" class="bg-image" />
    <div class="index-FourBoxes">
      <div class="index-FourBoxes-yushi test" @click="goPagess('yushi')">
        <img src="../../public/fourBoxes-image/浴室.png" :style="styleImage" class="Four-image" />
        <div style=" width: 80px; position: absolute; left: 13vw; top: 36vh;">
          <img style=" width:100%;" src="../assets/fourBoxes-2/浴室-2.png" />
        </div>
      </div>
      <div class="index-FourBoxes-yimao test" @click="goPagess('yimao')">
        <img src="../../public/fourBoxes-image/衣帽间.png" :style="styleImage" class="Four-image" />
        <div style=" width: 80px;; position: absolute; left: 62vw; top: 36vh;">
          <img style=" width:100%;" src="../assets/fourBoxes-2/衣帽间-2.png" />
        </div>
      </div>
      <div class="index-FourBoxes-keting test" @click="goPagess('keting')">
        <img src="../../public/fourBoxes-image/客厅.png" :style="styleImage" class="Four-image" />
        <div style=" width: 80px;; position: absolute; left: 13vw; top: 77vh;">
          <img style=" width:100%;" src="../assets/fourBoxes-2/客厅-2.png" />
        </div>
      </div>
      <div class="index-FourBoxes-yangtai test" @click="goPagess('yangtai')">
        <img src="../../public/fourBoxes-image/阳台.png" :style="styleImage" class="Four-image" />
        <div style=" width: 80px;; position: absolute; left: 62vw; top: 77vh;">
          <img style=" width:100%;" src="../assets/fourBoxes-2/阳台-2.png" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      styleImage: 'opacity: 0.3;',
      typeYushi: {
        bgImage: require('../../public/yushi-image/1.jpg'),
        swiper: {
          swiper1: require('../../public/yushi-image/2.png'),
          swiper2: require('../../public/yushi-image/3.png'),
          swiper3: require('../../public/yushi-image/4.png')
        }
      },
      typeYimao: {
        bgImage: require('../../public/yimao-image/1.jpg'),
        swiper: {
          swiper1: require('../../public/yimao-image/2.png'),
          swiper2: require('../../public/yimao-image/3.png'),
          swiper3: require('../../public/yimao-image/4.png')
        }
      },
      typeKeting: {
        bgImage: require('../../public/keting-image/1.jpg'),
        swiper: {
          swiper1: require('../../public/keting-image/2.png'),
          swiper2: require('../../public/keting-image/3.png'),
          swiper3: require('../../public/keting-image/4.png'),
          swiper4: require('../../public/keting-image/5.png')
        }
      },
      typeYangtai: {
        bgImage: require('../../public/yangtai-image/1.jpg'),
        swiper: {
          swiper1: require('../../public/yangtai-image/2.png'),
          swiper2: require('../../public/yangtai-image/3.png'),
          swiper3: require('../../public/yangtai-image/4.png'),
          swiper4: require('../../public/yangtai-image/5.png')
        }
      }
    }
  },
  methods: {
    goPagess(e, res) {
      this.styleImage = ''

      switch (e) {
        case 'yushi':
          console.log('yushi')
          var arr = JSON.stringify(this.typeYushi)
          this.$router.push({
            name: 'Test',
            params: { types: encodeURIComponent(arr) }
          })

          break
        case 'keting':
          console.log('keting')
          var arr = JSON.stringify(this.typeKeting)
          this.$router.push({
            name: 'Test',
            params: { types: encodeURIComponent(arr) }
          })
          break
        case 'yimao':
          console.log('yimao')
          var arr = JSON.stringify(this.typeYimao)
          this.$router.push({
            name: 'Test',
            params: { types: encodeURIComponent(arr) }
          })
          break
        case 'yangtai':
          console.log('yangtai')
          var arr = JSON.stringify(this.typeYangtai)
          this.$router.push({
            name: 'Test',
            params: { types: encodeURIComponent(arr) }
          })
          break
        default:
          return
      }
    },
    goYimao() {},
    goKeting() {},
    goYangtai() {}
  }
}
</script>

<style lang="scss" scoped>
.index-box {
  width: 100vw;
  height: 100vh;
  display: flex;
  // justify-content: center;
  .bg-image {
    width: 100%;
    position: absolute;
  }
  .index-FourBoxes {
    position: relative;
    top: 16vh;
    // border: 1px solid #fff;
    width: 98%;
    height: 84%;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    .test {
      float: left;
      width: 48%;
      height: 49%;
      // border: 1px solid red;
      .Four-image {
        width: 100%;
        height: 100%;
      }
    }
    &-yushi,
    &-keting {
      margin-right: 4px;
    }
    &-yimao,
    &-yangtai {
      margin-left: 4px;
    }
  }
}
</style>

