<template>
  <div class="home-layout">
    <div class="banner">
      {{ $t('conduct.coreTech.bannerTitle') }}
    </div>
    <div class="plate1" id="plate1">
      <h1 class="common-title">{{ $t('conduct.coreTech.itemTitle1') }}</h1>
      <p class="desc">{{ $t('conduct.coreTech.itemText1') }}</p>
      <div class="video">
        <video autoplay controls src="@/assets/images/refactor/location/AI AR SLAM 01(剪辑版2).mp4"></video>
      </div>
    </div>
    <div class="plate2" id="plate2">
      <h1 class="common-title">{{ $t('conduct.coreTech.itemTitle2') }}</h1>
      <p class="desc">{{ $t('conduct.coreTech.itemText2') }}</p>
      <ul>
        <li v-for="(item, index) in plate2List" :key="item.name" :class="{'is-active': plate2ActiveIndex === index}" @click="plate2ActiveIndex=index">
          {{ item.name }}
        </li>
      </ul>
      <iframe allowfullscreen :src="plate2List[plate2ActiveIndex].iframeLink" />
    </div>
    <div class="plate3"  id="plate3">
      <h1 class="common-title">{{ $t('conduct.coreTech.itemTitle3') }}</h1>
      <p class="desc">{{ $t('conduct.coreTech.itemText3') }}</p>
      <ul>
        <li v-for="item in plate3List" :key="item.name">
          <div class="item-img" :style="{'background-image': `url(${item.img})`}"></div>
          <h4>{{ item.name }}</h4>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import {mapState} from 'vuex'
import wave from '@/components/wave'

export default {
  computed: {
    ...mapState({
      langCoreTech: state => state.language.home.coreTech,
      language: state => state.language.current

    })
  },
  components: {wave},
  data () {
    return {
      plate2ActiveIndex: 0,
      plate2List: [
        {
          name: this.$t('conduct.coreTech.item2Name1'),
          iframeLink: 'https://www.4dkankan.com/showProPC.html?m=nSjwSohIY'
        },
        {
          name: this.$t('conduct.coreTech.item2Name2'),
          iframeLink: 'https://www.4dkankan.com/spc.html?m=B4T8r0kk6'
        },
        {
          name: this.$t('conduct.coreTech.item2Name3'),
          iframeLink: 'https://www.4dkankan.com/showProPC.html?m=t-0Q99SHE'
        }
      ],
      plate3List: [
        {
          name: this.$t('conduct.coreTech.item3Name1'),
          img: require('@/assets/images/refactor/location/show-1.png')
        },
        {
          name: this.$t('conduct.coreTech.item3Name2'),
          img: require('@/assets/images/refactor/location/show-2.png')
        },
        {
          name: this.$t('conduct.coreTech.item3Name3'),
          img: require('@/assets/images/refactor/location/show-3.png')
        }
      ]
    }
  },
  methods: {
    goto (url) {
      window.open(url, '_blank')
    }
  },
  mounted () {
  },
  beforeDestroy () {
  }
}
</script>

<style lang="scss" scoped>
.banner {
  width: 100%;
  height: 140px;
  background: url(~@/assets/images/refactor/location/banner.png) no-repeat center center;
  background-size: cover;
  font-size: 22px;
  color: #202020;
  line-height: 33px;
  padding: 55px 0 0 42px;
  font-weight: bold;
}
.desc {
  color: #909090;
  font-size: 12px;
  line-height: 18px;
}
.plate1 {
  padding: 26px 20px 60px;
  .desc {
    margin: 27px 0 18px;
  }
}
.plate2 {
  padding: 56px 20px 60px;
  background: #F7F7F7;
  .desc {
    margin: 27px 0 18px;
  }
  ul {
    display: flex;
    margin-bottom: 18px;
    li {
      padding-right: 19px;
      margin-right: 20px;
      font-size: 14px;
      line-height: 21px;
      color: #909090;
      font-weight: bold;
      position: relative;
      &.is-active {
        color: #202020;
      }
      &::after {
        content: '';
        display: block;
        width: 1px;
        height: 14px;
        background: #909090;
        position: absolute;
        top: 50%;
        right: 0;
        margin-top: -7px;
      }
      &:last-child {
        &::after {
          display: none;
        }
      }
    }
  }
  iframe {
    width: 100%;
    height: 500px;
  }
}
.plate3 {
  padding: 56px 20px 60px;
  .desc {
    margin: 27px 0 28px;
  }
  ul {
    display: flex;
    flex-wrap: wrap;
    text-align: center;
    padding: 0 0 0 30px;
    li {
      margin-bottom: 27px;
    }
    li:first-child {
      margin-right: 98px;
    }
  }
  .item-img {
    width: 90px;
    height: 90px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    margin-bottom: 17px;
  }
}
.video {

  video {
    width: 100%;
  }
}
</style>
