index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <div class="schedule">
  3. <!-- 上划图标 -->
  4. <div class="up_icon">
  5. <div class="center0">
  6. <div class="up_left"></div>
  7. <div class="up_right"></div>
  8. </div>
  9. </div>
  10. <div class="page" @touchstart="touchstart" @touchend="touchend">
  11. <pageFirst :class="{ animate__animated: true, animate__fadeInUp: isUp,animate__fadeInDown: !isUp}" v-if="page === 0" />
  12. <pageThird :class="{ animate__animated: true, animate__fadeInUp: isUp,animate__fadeInDown: !isUp}" v-if="page === 1" />
  13. <pageFifth @isNext="isNext" :class="{ animate__animated: true, animate__fadeInUp: isUp,animate__fadeInDown: !isUp}" v-if="page === 2" />
  14. <page4 @isNext="isNext" :class="{ animate__animated: true, animate__fadeInUp: isUp,animate__fadeInDown: !isUp}" v-if="page === 3" />
  15. <page7 @isNext="isNext" :class="{ animate__animated: true, animate__fadeInUp: isUp,animate__fadeInDown: !isUp}" v-if="page === 4" />
  16. <page8 @isNext="isNext" :class="{ animate__animated: true, animate__fadeInUp: isUp,animate__fadeInDown: !isUp}" v-if="page === 5" />
  17. <page9 @isNext="isNext" :class="{ animate__animated: true, animate__fadeInUp: isUp,animate__fadeInDown: !isUp}" v-if="page === 6" />
  18. <page10 @isNext="isNext" :class="{ animate__animated: true, animate__fadeInUp: isUp,animate__fadeInDown: !isUp}" v-if="page === 7" />
  19. <page11 @isNext="isNext" :class="{ animate__animated: true, animate__fadeInUp: isUp,animate__fadeInDown: !isUp}" v-if="page === 8" />
  20. <page12 @isNext="isNext" :class="{ animate__animated: true, animate__fadeInUp: isUp,animate__fadeInDown: !isUp}" v-if="page === 9" />
  21. <pageSexth @isNext="isNext" :class="{ animate__animated: true, animate__fadeInUp: isUp,animate__fadeInDown: !isUp}" v-if="page === 10" />
  22. </div>
  23. </div>
  24. </template>
  25. <script setup>
  26. import { ref } from 'vue';
  27. import pageFirst from './page1.vue';
  28. import pageThird from './page3.vue';
  29. import page4 from './page4.vue';
  30. import pageFifth from './page5.vue';
  31. import pageSexth from './page6.vue';
  32. import page7 from './page7.vue';
  33. import page8 from './page8.vue';
  34. import page9 from './page9.vue';
  35. import page10 from './page10.vue';
  36. import page11 from './page11.vue';
  37. import page12 from './page12.vue';
  38. // import { onMounted, reactive } from "vue";
  39. // import { isIpad, isIpod, isIphone } from "../../utils/isTerminal";
  40. /**
  41. * window.$originData.orginParames.title 页面标题
  42. * window.$originData.orginParames.parameters 固定参数值
  43. * window.$originData.urlParames url参数
  44. */
  45. // console.log(window.$originData);
  46. // const play_stats = ref(false);
  47. const page = ref(0);
  48. const isUp = ref(true);
  49. let startY = 0;
  50. let t= 0;
  51. const touchstart = e => {
  52. startY = e.changedTouches[0].clientY;
  53. t = Date.now()
  54. };
  55. const touchend = e => {
  56. const cha = startY - e.changedTouches[0].clientY;
  57. // cha > 0 向上滑动手指
  58. // cha < 0 向下滑动手指
  59. if(cha <= 0 && cha >= -50) return
  60. if(cha > 0 && cha < 100) return
  61. if (Date.now() - t > 500) return e.preventDefault();
  62. // 距离足够则滑动到下一页;
  63. let n = cha > 0 ? 1 : -1;
  64. let dn = n + page.value;
  65. let len = 10;
  66. isUp.value = n === 1;
  67. if (dn < 0) return (dn = len);
  68. if (dn > len) return (dn = 0);
  69. page.value = dn;
  70. };
  71. const isNext = B => {
  72. console.log(B)
  73. }
  74. </script>
  75. <style lang="scss">
  76. // 动画库
  77. @import url(./sass/animation.scss);
  78. // 字体库
  79. @import url(./sass/base.scss);
  80. // @import url(https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css);
  81. .schedule {
  82. width: 100vw;
  83. height: 100vh;
  84. overflow: hidden;
  85. position: fixed;
  86. background-image: url(./img/background.jpg);
  87. background-size: 100% 100%;
  88. max-width: 750px;
  89. min-width: 330px;
  90. margin: 0 auto;
  91. display: block;
  92. .imgbtn {
  93. position: absolute;
  94. top: 16px;
  95. right: 16px;
  96. z-index: 10;
  97. }
  98. .rotating {
  99. -webkit-animation: rotating 1.2s linear infinite;
  100. -moz-animation: rotating 1.2s linear infinite;
  101. -o-animation: rotating 1.2s linear infinite;
  102. animation: rotating 1.2s linear infinite;
  103. }
  104. .up_icon {
  105. width: 24px;
  106. height: 14px;
  107. position: absolute;
  108. z-index: 10;
  109. bottom: 30px;
  110. left: 50%;
  111. transform: translateX(-50%);
  112. font-size: 0;
  113. .center0 {
  114. position: relative;
  115. display: flex;
  116. -webkit-animation: start 1.5s ease-in-out infinite;
  117. -moz-animation: start 1.5s infinite ease-in-out;
  118. animation: start 1.5s ease-in-out infinite;
  119. .up_left,
  120. .up_right {
  121. overflow: hidden;
  122. height: 14px;
  123. width: 12px;
  124. flex: 1;
  125. padding-top: 5px;
  126. }
  127. .up_left::after,
  128. .up_right::after {
  129. background-color: #fff;
  130. width: 14px;
  131. height: 5px;
  132. border-radius: 2px;
  133. position: absolute;
  134. display: block;
  135. content: ' ';
  136. }
  137. .up_left::after {
  138. transform: rotate(-40deg);
  139. box-shadow: 1px 1px 1px #646464;
  140. -webkit-transform: rotate(-40deg);
  141. }
  142. .up_right::after {
  143. -webkit-transform: rotate(40deg);
  144. transform: rotate(40deg);
  145. box-shadow: 1px -1px 1px #646464;
  146. margin-left: -5px;
  147. }
  148. }
  149. }
  150. .page {
  151. width: 100%;
  152. height: 100vh;
  153. margin: 0 auto;
  154. & > div {
  155. width: 100%;
  156. height: 100%;
  157. }
  158. }
  159. .excess-enter-active,
  160. .excess-leave-active {
  161. transition: opacity 0.1s ease;
  162. }
  163. .excess-enter-from,
  164. .excess-leave-to {
  165. opacity: 0;
  166. }
  167. }
  168. </style>