opacity_header.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div class="container">
  3. <proginn-header v-if="deviceType.pc" transparent="true"/>
  4. <wx-header v-if="deviceType.wx"></wx-header>
  5. <nuxt class="main"/>
  6. <proginn-footer v-if="deviceType.pc"/>
  7. </div>
  8. </template>
  9. <script>
  10. import ProginnHeader from '@/components/header'
  11. import ProginnFooter from '@/components/footer'
  12. import WxHeader from '@/components/wx_header'
  13. import { mapState, mapMutations } from 'vuex'
  14. export default {
  15. components: {
  16. ProginnHeader,
  17. ProginnFooter,
  18. WxHeader,
  19. },
  20. computed: {
  21. ...mapState(['isPC', 'isWeixin', 'deviceType']),
  22. },
  23. mounted() {
  24. this.checkTerminal()
  25. window.addEventListener('resize', this.checkInnerWidth)
  26. },
  27. methods: {
  28. ...mapMutations(['updateIsPC', 'updateIsWeixin']),
  29. checkTerminal() {
  30. this.updateIsPC({
  31. isPC: this.$deviceType.isPC()
  32. })
  33. this.updateIsWeixin({
  34. isWeixin: window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i)
  35. })
  36. },
  37. }
  38. }
  39. </script>
  40. <style>
  41. *,
  42. *:before,
  43. *:after {
  44. box-sizing: border-box;
  45. margin: 0;
  46. }
  47. .container {
  48. display: flex;
  49. flex-direction: column;
  50. align-items: center;
  51. }
  52. .main {
  53. min-width: 1000px;
  54. min-height: calc(100vh - 376px);
  55. margin: 20px 0 30px;
  56. }
  57. @media screen and (max-width: 960px) {
  58. .main {
  59. min-width: auto;
  60. }
  61. }
  62. </style>