index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <main class="redirect-page">
  3. <div class="glow glow-top" aria-hidden="true"></div>
  4. <div class="glow glow-bottom" aria-hidden="true"></div>
  5. <section class="redirect-card" aria-labelledby="redirect-title" aria-live="polite">
  6. <div class="icon-wrap" aria-hidden="true">
  7. <van-icon name="records-o" />
  8. </div>
  9. <h1 id="redirect-title">正在前往培训报名页面</h1>
  10. <p class="description">报名页面即将打开,请稍候</p>
  11. <div class="loading-status">
  12. <van-loading type="spinner" size="18px" color="#1677ff" />
  13. <span>正在安全跳转...</span>
  14. </div>
  15. <button type="button" class="redirect-button" @click="redirectToRegistration">
  16. 立即前往
  17. <van-icon name="arrow" />
  18. </button>
  19. <p class="fallback-tip">若未自动跳转,请点击上方按钮</p>
  20. </section>
  21. <footer class="page-footer">
  22. <van-icon name="shield-o" aria-hidden="true" />
  23. <span>安全跳转 · 请放心访问</span>
  24. </footer>
  25. </main>
  26. </template>
  27. <script setup lang="ts">
  28. import { onBeforeUnmount, onMounted } from 'vue'
  29. const REGISTRATION_URL = 'https://preapi.yaoyi.net/h5/#/pages/artile//training-registration'
  30. const REDIRECT_DELAY = 1000
  31. let redirectTimer: number | undefined
  32. const redirectToRegistration = (): void => {
  33. window.location.replace(REGISTRATION_URL)
  34. }
  35. onMounted(() => {
  36. redirectTimer = window.setTimeout(redirectToRegistration, REDIRECT_DELAY)
  37. })
  38. onBeforeUnmount(() => {
  39. if (redirectTimer !== undefined) {
  40. window.clearTimeout(redirectTimer)
  41. }
  42. })
  43. </script>
  44. <style scoped lang="scss">
  45. .redirect-page {
  46. position: relative;
  47. display: flex;
  48. min-height: 100vh;
  49. min-height: 100dvh;
  50. align-items: center;
  51. justify-content: center;
  52. overflow: hidden;
  53. padding: calc(28px + env(safe-area-inset-top, 0px)) 22px
  54. calc(68px + env(safe-area-inset-bottom, 0px));
  55. background: linear-gradient(160deg, #f7faff 0%, #edf5ff 54%, #f7fbff 100%);
  56. color: #1f2937;
  57. font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  58. box-sizing: border-box;
  59. }
  60. .glow {
  61. position: absolute;
  62. border-radius: 50%;
  63. pointer-events: none;
  64. }
  65. .glow-top {
  66. top: -92px;
  67. right: -76px;
  68. width: 238px;
  69. height: 238px;
  70. background: radial-gradient(circle, rgba(39, 133, 255, 0.18) 0%, transparent 70%);
  71. }
  72. .glow-bottom {
  73. bottom: -116px;
  74. left: -90px;
  75. width: 286px;
  76. height: 286px;
  77. background: radial-gradient(circle, rgba(80, 173, 255, 0.14) 0%, transparent 70%);
  78. }
  79. .redirect-card {
  80. position: relative;
  81. z-index: 1;
  82. width: 100%;
  83. max-width: 360px;
  84. padding: 38px 24px 26px;
  85. border: 1px solid rgba(255, 255, 255, 0.92);
  86. border-radius: 22px;
  87. background: rgba(255, 255, 255, 0.88);
  88. box-shadow: 0 18px 48px rgba(49, 98, 157, 0.12);
  89. text-align: center;
  90. box-sizing: border-box;
  91. backdrop-filter: blur(12px);
  92. h1,
  93. p {
  94. margin: 0;
  95. }
  96. h1 {
  97. margin-top: 22px;
  98. color: #172033;
  99. font-size: 21px;
  100. font-weight: 700;
  101. line-height: 1.4;
  102. }
  103. }
  104. .icon-wrap {
  105. position: relative;
  106. display: flex;
  107. width: 68px;
  108. height: 68px;
  109. align-items: center;
  110. justify-content: center;
  111. margin: 0 auto;
  112. border-radius: 22px;
  113. background: linear-gradient(145deg, #1677ff 0%, #39a5ff 100%);
  114. box-shadow: 0 12px 28px rgba(22, 119, 255, 0.26);
  115. color: #fff;
  116. font-size: 31px;
  117. &::after {
  118. position: absolute;
  119. inset: -7px;
  120. border: 1px solid rgba(22, 119, 255, 0.12);
  121. border-radius: 27px;
  122. content: '';
  123. }
  124. }
  125. .redirect-card .description {
  126. margin-top: 8px;
  127. color: #7a8495;
  128. font-size: 14px;
  129. line-height: 1.6;
  130. }
  131. .loading-status {
  132. display: flex;
  133. min-height: 46px;
  134. align-items: center;
  135. justify-content: center;
  136. gap: 9px;
  137. margin-top: 24px;
  138. border-radius: 12px;
  139. background: #f4f8fd;
  140. color: #526176;
  141. font-size: 13px;
  142. }
  143. .redirect-button {
  144. display: flex;
  145. width: 100%;
  146. height: 46px;
  147. align-items: center;
  148. justify-content: center;
  149. gap: 5px;
  150. margin-top: 18px;
  151. padding: 0;
  152. border: 0;
  153. border-radius: 23px;
  154. background: linear-gradient(90deg, #1677ff 0%, #2998ff 100%);
  155. box-shadow: 0 9px 20px rgba(22, 119, 255, 0.22);
  156. color: #fff;
  157. font-size: 15px;
  158. font-weight: 600;
  159. cursor: pointer;
  160. -webkit-tap-highlight-color: transparent;
  161. &:active {
  162. opacity: 0.86;
  163. transform: translateY(1px);
  164. }
  165. &:focus-visible {
  166. outline: 2px solid #1677ff;
  167. outline-offset: 3px;
  168. }
  169. }
  170. .redirect-card .fallback-tip {
  171. margin-top: 13px;
  172. color: #a0a8b4;
  173. font-size: 12px;
  174. line-height: 1.5;
  175. }
  176. .page-footer {
  177. position: absolute;
  178. right: 0;
  179. bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  180. left: 0;
  181. display: flex;
  182. align-items: center;
  183. justify-content: center;
  184. gap: 5px;
  185. color: #9ba8b8;
  186. font-size: 12px;
  187. }
  188. @media (max-width: 360px) {
  189. .redirect-page {
  190. padding-right: 16px;
  191. padding-left: 16px;
  192. }
  193. .redirect-card {
  194. padding: 32px 20px 23px;
  195. }
  196. }
  197. @media (prefers-reduced-motion: reduce) {
  198. .redirect-button:active {
  199. transform: none;
  200. }
  201. }
  202. </style>