<template>
  <div class="wrap">
    <InOut v-if="inOutVal==='1'" :toFlag="0"/>
    <div v-else-if="inOutVal==='2'&&_getPayFlag">pay</div>
    <InOut v-else :toFlag="1"/>
    <Loading v-show="_getshowflag"/>
  </div>
</template>

<script>
import Loading from './Loading'
import InOut from './InOut'
import { mapGetters, mapActions } from 'vuex'

export default {
  name: 'HelloWorld',
  components: {
    Loading, InOut
  },
  data() {
    return {
      payFlag: false,
      inOutVal: this.$route.query.id
      // isShow: ''
    }
  },
  computed: {
    ...mapGetters([
      '_getshowflag', '_getPayFlag'
    ])
  },
  created() {
    setTimeout(() => {
      this.handleHide()
      // 模拟请求
      // this.$fetch('/api/v2/movie/top250').then((response) => {
      //   console.log(response)
      // })
      // },
      // this.handlePayFlag()
      console.log(this._getPayFlag)
    }, 2000)
  },
  methods: {
    ...mapActions([
      'handleHide',
      'handleShow',
      'handlePayFlag'
    ])
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .wrap {
    width: 100%;
    height: 100%;
    position: relative;
  }
</style>
