index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <div class="information" :class="{ mobile: mobile, disabled: isPlay }">
  3. <!-- <component :is="page"></component> -->
  4. <ViewMobile v-if="mobile" />
  5. <ViewPc v-else />
  6. </div>
  7. </template>
  8. <script setup>
  9. import ViewPc from './View.Pc.vue'
  10. import ViewMobile from './View.Mobile.vue'
  11. import { ref, markRaw, onMounted, computed, watch } from 'vue'
  12. import { useApp } from '@/app'
  13. import { useStore } from 'vuex'
  14. const store = useStore()
  15. const mobile = ref(false)
  16. // const page = ref(ViewMobile)
  17. const isPlay = computed(() => store.getters['tour/isPlay'])
  18. useApp().then(app => {
  19. mobile.value = app.config.mobile
  20. // console.log(app.config)
  21. // page.value = mobile.value ? ViewMobile : ViewPc
  22. })
  23. </script>
  24. <style lang="scss" scoped>
  25. .information {
  26. position: absolute;
  27. left: 50%;
  28. transform: translateX(-50%);
  29. top: 30px;
  30. height: 34px;
  31. border-radius: 0 34px 34px 0;
  32. pointer-events: all;
  33. color: rgba(255, 255, 255, 0.88);
  34. z-index: 100;
  35. &.mobile {
  36. position: absolute;
  37. top: 0;
  38. left: 0;
  39. // left: 50%;
  40. transform: none;
  41. width: 100%;
  42. background: none;
  43. min-height: calc(var(--vh) * 100);
  44. pointer-events: none;
  45. &.disabled {
  46. // position: absolute;
  47. }
  48. }
  49. :deep(.icon) {
  50. cursor: pointer;
  51. display: flex;
  52. position: absolute;
  53. right: 0;
  54. top: 0;
  55. bottom: 0;
  56. width: 24px;
  57. align-items: center;
  58. justify-content: flex-start;
  59. color: inherit;
  60. i {
  61. font-size: 14px;
  62. }
  63. }
  64. }
  65. </style>