<!-- 首页 -->
<template>
    <div class="home">
      <miniProgramPlayback v-if="pageType == 'miniProgramPlayback'"></miniProgramPlayback>
      <miniProgramVideo v-if="pageType == 'miniProgramVideo'"></miniProgramVideo>
    </div>
</template>
<script>
    import miniProgramPlayback from '@/views/miniProgramPlayback/index.vue';
    import miniProgramVideo from '@/views/miniProgramVideo/index.vue';
    export default {
        name: 'home',
        components: {
          miniProgramPlayback,
          miniProgramVideo,
        },
        data() {
            return {
              pageType:null,
            }
        },
        created() {

        },
        mounted() {
          let text = decodeURIComponent(window.location.href);
          text = text.split("?")[1]
          if(text.indexOf('touken') != -1){
            // this.$router.push({
            //   path: '/miniProgramVideo'+'?'+text,
            // });
            this.$set(this,'pageType','miniProgramVideo');
          }else if(text.indexOf('cameraIndexCode') != -1){
            // this.$router.push({
            //   path: '/miniProgramPlayback'+'?'+text,
            // });
            this.$set(this,'pageType','miniProgramPlayback');
          }
        },
        methods: {},
    }
</script>
<style scoped lang="scss">
    .home{
      flex:1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
</style>
