App.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <iframe class="ifr" id="ifr" @load="onLoadIfr" :src="`program/index.html?token=${token}`" frameborder="0"></iframe>
  3. <router-view class="fix-root" :userInfo="userInfo" />
  4. <template v-if="!$route.meta.outoflist">
  5. <Vmenu @clickIntro="isShowIntro = true" />
  6. <div @click="isShowIntegralDetail = true" class="integral-area">
  7. <img :src="`${config.cdn_url}images/icon_integral.png`" alt="">
  8. <span>积分:{{ point }}</span>
  9. </div>
  10. </template>
  11. <teleport to='#app'>
  12. <Transition>
  13. <Introduce v-if="isShowIntro" @close="isShowIntro = false" />
  14. </Transition>
  15. <Transition>
  16. <IntegralDetail v-if="isShowIntegralDetail" @close="isShowIntegralDetail = false" />
  17. </Transition>
  18. </teleport>
  19. </template>
  20. <script setup>
  21. import Vmenu from "@/components/Vmenu.vue";
  22. import Introduce from "@/components/Introduce.vue";
  23. import IntegralDetail from '@/components/Integral-detail.vue'
  24. import { ref, onMounted, reactive } from 'vue'
  25. import http from '@/api/http.js'
  26. import utils from '@/utils/index.js'
  27. let token = utils.getQueryByName('token')
  28. const isShowIntro = ref(false)
  29. const isShowIntegralDetail = ref(false)
  30. const point = ref(0)
  31. let userInfo = reactive({})
  32. const root = document.documentElement;
  33. root.style.setProperty('--bgImage', `url(${config.cdn_url}images/background.jpg)`);
  34. const onLoadIfr = () => {
  35. window.onmessage = (e) => {
  36. if (e.data.source === 'shareImg') {
  37. e.data.data && wx.miniProgram.navigateTo({
  38. url: '/pages/share/index?img='+ encodeURIComponent(e.data.data)
  39. })
  40. }
  41. };
  42. }
  43. onMounted(async () => {
  44. let result = (await http.get('cms/wxUser/getUserInfo')).data;
  45. let info = result.data
  46. userInfo = info
  47. point.value = info.point
  48. })
  49. </script>
  50. <style lang="scss">
  51. @import "@/assets/style/reset.css";
  52. @import "@/assets/style/my-reset.css";
  53. html,
  54. body {
  55. height: 100%;
  56. overscroll-behavior: none;
  57. overflow: hidden;
  58. }
  59. #app {
  60. font-family: Avenir, Helvetica, Arial, sans-serif;
  61. -webkit-font-smoothing: antialiased;
  62. -moz-osx-font-smoothing: grayscale;
  63. width: 100%;
  64. height: 100%;
  65. position: relative;
  66. background-image: var(--bgImage);
  67. background-size: cover;
  68. background-repeat: no-repeat;
  69. background-position: center bottom;
  70. .integral-area {
  71. position: absolute;
  72. right: 0;
  73. bottom: 40px;
  74. background: linear-gradient(270deg, #C1A97A 0%, rgba(193, 169, 122, 0) 100%);
  75. display: flex;
  76. align-items: center;
  77. padding: 0 20px 0 50px;
  78. z-index: 9;
  79. >span {
  80. color: #fff;
  81. margin-left: 10px;
  82. font-size: 14px;
  83. }
  84. }
  85. .ifr {
  86. width: 100%;
  87. height: 100%;
  88. position: fixed;
  89. left: 0%;
  90. top: 0;
  91. }
  92. .fix-root {
  93. pointer-events: none;
  94. * {
  95. pointer-events: auto;
  96. }
  97. }
  98. }
  99. * {
  100. user-select: none;
  101. -webkit-touch-callout: none;
  102. }
  103. /* 垃圾360浏览器不支持not() */
  104. input,
  105. textarea {
  106. user-select: initial;
  107. }
  108. ::-webkit-scrollbar {
  109. background: rgba(193, 169, 122, 0.5);
  110. width: 0.3rem;
  111. height: 0.3rem;
  112. }
  113. /*宽度是对垂直滚动条而言,高度是对水平滚动条而言*/
  114. ::-webkit-scrollbar-thumb {
  115. background: #fff;
  116. border-radius: 0.15rem;
  117. }
  118. ::-webkit-scrollbar-corner {
  119. background: rgba(193, 169, 122, 0.5);
  120. }
  121. .fade-out-leave-active {
  122. transition: opacity 1s;
  123. }
  124. .fade-out-leave-to {
  125. opacity: 0;
  126. }
  127. .animation-show-hide {
  128. animation: show-hide 1.8s infinite;
  129. }
  130. @keyframes show-hide {
  131. 0% {
  132. opacity: 0;
  133. }
  134. 50% {
  135. opacity: 1;
  136. }
  137. 100% {
  138. opacity: 0;
  139. }
  140. }
  141. i {
  142. font-style: italic;
  143. }
  144. .viewer-container {
  145. background-color: rgba(0, 0, 0, 80%) !important;
  146. }
  147. .v-enter-active,
  148. .v-leave-active {
  149. transition: opacity 0.5s ease;
  150. }
  151. .v-enter-from,
  152. .v-leave-to {
  153. opacity: 0;
  154. }
  155. </style>