<template>
  <view class="index-box">
    <index-nav @setTabNum="setTabNum"></index-nav>
    <view class="list-box">
      <view class="box-one" v-if="tabNum===0">
        <slide-item></slide-item>
      </view>
      <view class="box-two" v-else-if="tabNum===1">
        <attachment-list></attachment-list>
      </view>
      <view class="box-three" v-else>
        <attachment-list></attachment-list>
      </view>
    </view>
  </view>
</template>

<script>
import IndexNav from "@/pages/index/model/index-nav";
import AttachmentList from "@/pages/index/model/attachment-list";
import SlideItem from "@/pages/index/model/slide-item";
import inobounce from 'inobounce'
export default {
  components: {SlideItem, AttachmentList, IndexNav},
  data() {
    return {
      tabNum:0
    }
  },
  created() {
    let u = navigator.userAgent
    if (u.indexOf('iPhone') > -1) {
      inobounce.enable()
    }
  },
  beforeDestroy() {
    inobounce.disable()
  },
  methods: {
    setTabNum(tabNum){
      this.tabNum=tabNum
    }
  }
}
</script>

<style scoped lang="scss">
.index-box{
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
  height: calc(100vh - 50px - env(safe-area-inset-bottom));
  width: 100vw;
  .box-one{

  }

}

</style>
