index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <div class="schedule" @touchmove="touchmove">
  3. <!-- 播放键 -->
  4. <svg
  5. class="imgbtn rotating"
  6. @click="play"
  7. :style="{
  8. 'animation-play-state': play_stats ? 'running' : 'paused',
  9. }"
  10. viewBox="0 0 1024 1024"
  11. version="1.1"
  12. xmlns="http://www.w3.org/2000/svg"
  13. p-id="899"
  14. width="32"
  15. height="32"
  16. >
  17. <path
  18. d="M512 17.066667c273.339733 0 494.933333 221.5936 494.933333 494.933333S785.339733 1006.933333 512 1006.933333 17.066667 785.339733 17.066667 512 238.660267 17.066667 512 17.066667z"
  19. opacity=".502"
  20. p-id="900"
  21. ></path>
  22. <path
  23. d="M512 1024C229.2224 1024 0 794.7776 0 512 0 229.2224 229.2224 0 512 0c282.7776 0 512 229.2224 512 512 0 282.7776-229.2224 512-512 512z m0-972.8C257.501867 51.2 51.2 257.501867 51.2 512s206.301867 460.8 460.8 460.8 460.8-206.301867 460.8-460.8S766.498133 51.2 512 51.2z"
  24. fill="#FFFFFF"
  25. p-id="901"
  26. ></path>
  27. <path
  28. d="M530.568533 170.666667c4.8128 34.1504 5.495467 77.2096 41.2672 120.2688 27.4944 32.802133 58.453333 62.173867 79.7696 88.832C679.799467 414.6176 699.733333 458.359467 699.733333 502.784c0 71.0656-34.372267 141.431467-57.770666 180.394667h-10.990934c16.503467-36.898133 49.5104-97.723733 46.7456-162.628267-1.365333-36.232533-15.121067-75.178667-38.485333-103.867733-26.146133-33.501867-70.161067-60.142933-108.663467-62.8736v387.447466c0 30.754133-18.568533 58.7776-45.380266 79.274667C459.0592 841.028267 424.669867 853.333333 394.410667 853.333333c-19.2512 0-37.137067-6.144-49.5104-16.401066-13.073067-10.257067-20.6336-25.275733-20.6336-43.042134 0-28.023467 19.2512-56.046933 45.380266-76.544 26.146133-21.179733 59.136-34.850133 86.647467-34.850133 24.081067 0 44.6976 3.413333 57.088 15.035733V170.666667h17.186133z"
  29. fill="#FFFFFF"
  30. p-id="902"
  31. ></path>
  32. </svg>
  33. <!-- 上划图标 -->
  34. <div class="up_icon">
  35. <div class="center0">
  36. <div class="up_left"></div>
  37. <div class="up_right"></div>
  38. </div>
  39. </div>
  40. <change v-if="page === -1" />
  41. <div class="page" @touchstart="touchstart" @touchend="touchend">
  42. <pageFirst v-if="page === 0" />
  43. <pageSecond v-if="page === 1" />
  44. <pageThird v-if="page === 2" />
  45. <pageFourth v-if="page === 3" />
  46. <pageFifth v-if="page === 4" />
  47. <pageSexth v-if="page === 5" />
  48. <pageSeventh v-if="page === 6" />
  49. <pageEighth v-if="page === 7" />
  50. </div>
  51. </div>
  52. </template>
  53. <script setup>
  54. import { ref, nextTick } from 'vue';
  55. import change from './change.vue';
  56. import pageFirst from './page1.vue';
  57. import pageSecond from './page2.vue';
  58. import pageThird from './page3.vue';
  59. import pageFourth from './page4.vue';
  60. import pageFifth from './page5.vue';
  61. import pageSexth from './page6.vue';
  62. import pageSeventh from './page7.vue';
  63. import pageEighth from './page8.vue';
  64. // import { onMounted, reactive } from "vue";
  65. // import { isIpad, isIpod, isIphone } from "../../utils/isTerminal";
  66. /**
  67. * window.$originData.orginParames.title 页面标题
  68. * window.$originData.orginParames.parameters 固定参数值
  69. * window.$originData.urlParames url参数
  70. */
  71. console.log(window.$originData);
  72. const play_stats = ref(false);
  73. const page = ref(0);
  74. let startY = 0;
  75. const audio = new Audio('https://cxzx.smcic.net/topic/tool/media/bgm.mp3');
  76. audio.loop = true; // 循环播放
  77. audio.autoplay = 'autoplay';
  78. audio.oncanplay = () => {
  79. window.WeixinJSBridge &&
  80. window.WeixinJSBridge.invoke(
  81. 'getNetworkType',
  82. {},
  83. () => {
  84. audio.play();
  85. play_stats.value = true;
  86. },
  87. false
  88. );
  89. };
  90. audio.onplaying = () => (play_stats.value = !audio.paused);
  91. audio.onpause = () => (play_stats.value = !audio.paused);
  92. const play = () => {
  93. if (audio.paused) {
  94. // 播放
  95. audio.play();
  96. } else {
  97. // 暂停
  98. audio.pause();
  99. }
  100. };
  101. const touchstart = e => {
  102. startY = e.changedTouches[0].clientY;
  103. };
  104. const touchend = e => {
  105. const cha = startY - e.changedTouches[0].clientY;
  106. // cha > 0 向上滑动手指
  107. // cha < 0 向下滑动手指
  108. if(cha <= 0 && cha >= -50) return
  109. if(cha > 0 && cha < 100) return
  110. // 距离足够则滑动到下一页;
  111. let n = cha > 0 ? 1 : -1;
  112. let dn = n + page.value;
  113. if (dn < 0) return (dn = 7);
  114. if (dn > 7) return (dn = 0);
  115. page.value = -1;
  116. nextTick(() => {
  117. let t = setTimeout(() => {
  118. clearTimeout(t);
  119. page.value = dn;
  120. console.log(n)
  121. }, 1200);
  122. });
  123. };
  124. const touchmove = e=> {
  125. e.preventDefault();
  126. }
  127. </script>
  128. <style lang="scss">
  129. // 动画库
  130. @import url(./sass/animation.scss);
  131. // 字体库
  132. @import url(./sass/base.scss);
  133. // @import url(https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css);
  134. .schedule {
  135. width: 100vw;
  136. height: 100vh;
  137. overflow: hidden;
  138. position: fixed;
  139. background-image: url(./img/background.webp);
  140. background-size: 100% 100%;
  141. max-width: 750px;
  142. min-width: 330px;
  143. margin: 0 auto;
  144. .imgbtn {
  145. position: absolute;
  146. top: 16px;
  147. right: 16px;
  148. z-index: 10;
  149. }
  150. .rotating {
  151. -webkit-animation: rotating 1.2s linear infinite;
  152. -moz-animation: rotating 1.2s linear infinite;
  153. -o-animation: rotating 1.2s linear infinite;
  154. animation: rotating 1.2s linear infinite;
  155. }
  156. .up_icon {
  157. width: 24px;
  158. height: 14px;
  159. position: absolute;
  160. z-index: 10;
  161. bottom: 30px;
  162. left: 50%;
  163. transform: translateX(-50%);
  164. font-size: 0;
  165. .center0 {
  166. position: relative;
  167. display: flex;
  168. -webkit-animation: start 1.5s ease-in-out infinite;
  169. -moz-animation: start 1.5s infinite ease-in-out;
  170. animation: start 1.5s ease-in-out infinite;
  171. .up_left,
  172. .up_right {
  173. overflow: hidden;
  174. height: 14px;
  175. width: 12px;
  176. flex: 1;
  177. padding-top: 5px;
  178. }
  179. .up_left::after,
  180. .up_right::after {
  181. background-color: #fff;
  182. width: 14px;
  183. height: 5px;
  184. border-radius: 2px;
  185. position: absolute;
  186. display: block;
  187. content: ' ';
  188. }
  189. .up_left::after {
  190. transform: rotate(-40deg);
  191. box-shadow: 1px 1px 1px #646464;
  192. -webkit-transform: rotate(-40deg);
  193. }
  194. .up_right::after {
  195. -webkit-transform: rotate(40deg);
  196. transform: rotate(40deg);
  197. box-shadow: 1px -1px 1px #646464;
  198. margin-left: -5px;
  199. }
  200. }
  201. }
  202. .page {
  203. width: 100%;
  204. height: 100vh;
  205. & > div {
  206. width: 100%;
  207. height: 100%;
  208. }
  209. }
  210. .excess-enter-active,
  211. .excess-leave-active {
  212. transition: opacity 0.1s ease;
  213. }
  214. .excess-enter-from,
  215. .excess-leave-to {
  216. opacity: 0;
  217. }
  218. }
  219. </style>