video.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <div style="min-width:1200px;height: 100vh;background: #000000;" :style="{'--color': `${basicSet.set ? basicSet.set.theme_color: '#44be95'}` }">
  3. <v-header :showTab="showTab" :showPublish="showPublish" v-if="!isCourse && !isMicro"></v-header>
  4. <m-header :showPublish="showPublish" v-if="!isCourse && isMicro"></m-header>
  5. <!--l-header为了改变主题色-->
  6. <l-header v-show="false"></l-header>
  7. <main class="content-container" ref="container">
  8. <nuxt/>
  9. </main>
  10. </div>
  11. </template>
  12. <script>
  13. import {mapState} from 'vuex';
  14. import LHeader from "~/components/default/header";
  15. import VHeader from "~/components/default/video-header";
  16. import MHeader from "~/components/default/micro-header";
  17. export default {
  18. components: {
  19. LHeader,
  20. VHeader,
  21. MHeader
  22. },
  23. data (){
  24. return {
  25. isCourse: true,
  26. showTab: false,
  27. showPublish: false,
  28. isMicro: false,
  29. showRoute: ['videoDetail'],
  30. microRoute: ['microhomepage','microRelease','member-sign'],
  31. }
  32. },
  33. computed: {
  34. ...mapState(['basicSet'])
  35. },
  36. watch: {
  37. '$route'(res) {
  38. console.log(this.$route.name)
  39. this.url = this.fun.redirectH5(this.$route.path, this.$route.fullPath);
  40. this.microRoute.indexOf(this.$route.name)> -1 ? this.isMicro = true : this.isMicro = false;
  41. this.showRoute.indexOf(this.$route.name)> -1 ? this.showTab = true : this.showTab = false;
  42. (location.href.indexOf('releaseVideo')>-1 || this.$route.name.indexOf('microRelease')>-1) ? this.showPublish = false : this.showPublish = true;
  43. location.href.indexOf('coursedetail')>-1 ? this.isCourse = true : this.isCourse = false;
  44. }
  45. },
  46. mounted () {
  47. // console.log(this.$route.name)
  48. this.fun.redirectH5(this.$route.path, this.$route.fullPath);
  49. //判断是否微社区
  50. this.microRoute.indexOf(this.$route.name)> -1 ? this.isMicro = true : this.isMicro = false;
  51. // 判断是否发现视频详情
  52. this.showRoute.indexOf(this.$route.name)> -1 ? this.showTab = true : this.showTab = false;
  53. // 判断是否发布页面
  54. (location.href.indexOf('releaseVideo')>-1 || this.$route.name.indexOf('microRelease')>-1) ? this.showPublish = false : this.showPublish = true;
  55. // 判断课程详情
  56. location.href.indexOf('coursedetail')>-1 ? this.isCourse = true : this.isCourse = false;
  57. },
  58. methods: {
  59. },
  60. }
  61. </script>