start.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. <template>
  2. <view class="app-page bg-gradient-blue-lighten-b" :class="calcPageClass" :style="[calcPageStyle]">
  3. <view v-if="calcBackgroundType!=='video'" class="tn-satr">
  4. <view class="sky"></view>
  5. <view class="stars">
  6. <view class="falling-stars">
  7. <view class="star-fall"></view>
  8. <view class="star-fall"></view>
  9. <view class="star-fall"></view>
  10. <view class="star-fall"></view>
  11. </view>
  12. <view class="small-stars">
  13. <view class="star"></view>
  14. <view class="star"></view>
  15. <view class="star"></view>
  16. <view class="star"></view>
  17. <view class="star"></view>
  18. <view class="star"></view>
  19. <view class="star"></view>
  20. <view class="star"></view>
  21. <view class="star"></view>
  22. <view class="star"></view>
  23. <view class="star"></view>
  24. <view class="star"></view>
  25. </view>
  26. <view class="medium-stars">
  27. <view class="star"></view>
  28. <view class="star"></view>
  29. <view class="star"></view>
  30. <view class="star"></view>
  31. <view class="star"></view>
  32. <view class="star"></view>
  33. <view class="star"></view>
  34. <view class="star"></view>
  35. <view class="star"></view>
  36. <view class="star"></view>
  37. <view class="star"></view>
  38. <view class="star"></view>
  39. </view>
  40. </view>
  41. </view>
  42. <video v-else class="video-bg" :object-fit="startConfig.bgVideoFit" :src="startConfig.bgVideo" :loop="true" :autoplay="true"
  43. :muted="true" :controls="false" :show-fullscreen-btn="false" :show-play-btn="false"
  44. :show-center-play-btn="false" :show-loading="false" :enable-progress-gesture="false"
  45. :show-progress="false"></video>
  46. <cover-view v-if="startConfig.title || startConfig.logo" class="title-container">
  47. <cover-view v-if="startConfig.logo" class="app-logo">
  48. <cover-view class="app-logo-border">
  49. <cover-image class="app-logo-image" :src="$utils.checkImageUrl(startConfig.logo)"
  50. mode="aspectFill"></cover-image>
  51. </cover-view>
  52. </cover-view>
  53. <cover-view v-if="startConfig.title" class="app-title" :style="startConfig.titleStyle">
  54. 「 {{ startConfig.title }} 」
  55. </cover-view>
  56. </cover-view>
  57. <cover-view v-if="startConfig.desc1 || startConfig.desc2" class="bottom-container">
  58. <cover-view class="text-align-center" :style="startConfig.descStyle"
  59. style="color:white;padding: 60vh 0 0 0;">
  60. <cover-view class="" style="font-size: 44rpx;" v-if="startConfig.desc1">{{ startConfig.desc1 }}
  61. </cover-view>
  62. <cover-view class="mt-30 text-size-m" v-if="startConfig.desc2">{{ startConfig.desc2 }}</cover-view>
  63. </cover-view>
  64. <cover-view class="" style="padding: 120rpx 200rpx;z-index: 999;position: relative;">
  65. <cover-view class="start-btn" :class="[startConfig.btnClass]" @click="fnStart()"
  66. :style="startConfig.btnStyle">{{ startConfig.btnText || '开始体验' }}
  67. </cover-view>
  68. </cover-view>
  69. </cover-view>
  70. <!-- 波浪效果 -->
  71. <wave v-if="startConfig.useWave"></wave>
  72. </view>
  73. </template>
  74. <script>
  75. import wave from '@/components/wave/wave.vue';
  76. export default {
  77. components: {
  78. wave
  79. },
  80. computed: {
  81. startConfig() {
  82. return this.$tm.vx.getters().getConfigs.appConfig.startConfig;
  83. },
  84. calcBackgroundType() {
  85. return this.startConfig.backgroundType;
  86. },
  87. calcPageClass() {
  88. if (this.calcBackgroundType === 'color') {
  89. return [this.startConfig.bg]
  90. }
  91. return []
  92. },
  93. calcPageStyle() {
  94. if (this.calcBackgroundType === 'color') {
  95. return {}
  96. }
  97. if (this.calcBackgroundType === 'image') {
  98. return {
  99. backgroundImage: `url(${this.$utils.checkImageUrl(this.startConfig.bgImage)})!important`,
  100. backgroundSize: this.startConfig.bgImageFit
  101. }
  102. }
  103. if (this.calcBackgroundType === 'video') {
  104. return {
  105. background: '#ffffff'
  106. }
  107. }
  108. return {};
  109. }
  110. },
  111. methods: {
  112. fnStart() {
  113. uni.switchTab({
  114. url: '/pages/tabbar/home/home',
  115. success: () => {
  116. uni.setStorageSync('APP_HAS_STARTED', true);
  117. }
  118. });
  119. }
  120. }
  121. };
  122. </script>
  123. <style lang="scss" scoped>
  124. .app-page {
  125. position: relative;
  126. width: 100vw;
  127. height: 100vh;
  128. background-size: cover;
  129. background-repeat: no-repeat;
  130. }
  131. .start-btn {
  132. box-sizing: border-box;
  133. background-color: transparent;
  134. padding: 16rpx 50rpx;
  135. border-radius: 50rpx;
  136. border: 2rpx solid #ffffff;
  137. color: #ffffff;
  138. text-align: center;
  139. font-size: 28rpx;
  140. }
  141. .bottom-container {
  142. position: absolute;
  143. bottom: 50rpx;
  144. left: 50%;
  145. transform: translateX(-50%);
  146. z-index: 999;
  147. }
  148. .video-bg {
  149. position: absolute;
  150. left: 0;
  151. top: 0;
  152. width: 100vw;
  153. height: 100vh;
  154. z-index: 0;
  155. }
  156. .title-container {
  157. width: 100vw;
  158. position: absolute;
  159. top: 20vh;
  160. left: 0;
  161. z-index: 999;
  162. display: flex;
  163. flex-direction: column;
  164. align-items: center;
  165. justify-content: center;
  166. }
  167. .app-logo {
  168. width: 200rpx;
  169. height: 200rpx;
  170. &-border {
  171. width: 100%;
  172. height: 100%;
  173. box-sizing: border-box;
  174. border: 8rpx solid rgba(255, 255, 255, 0.35);
  175. border-radius: 50%;
  176. overflow: hidden;
  177. }
  178. &-image {
  179. width: 100%;
  180. height: 100%;
  181. border-radius: 50%;
  182. }
  183. }
  184. .app-title {
  185. color: #ffffff;
  186. margin-top: 26rpx;
  187. font-size: 36rpx;
  188. font-weight: 600;
  189. text-align: center;
  190. }
  191. .tn-satr {
  192. position: fixed;
  193. width: 100%;
  194. height: 600px;
  195. overflow: hidden;
  196. flex-shrink: 0;
  197. z-index: 998;
  198. }
  199. .stars {
  200. position: absolute;
  201. z-index: 1;
  202. width: 100%;
  203. height: 400px;
  204. }
  205. .star {
  206. border-radius: 50%;
  207. background: #ffffff;
  208. box-shadow: 0 0 6px 0 rgba(255, 255, 255, 0.8);
  209. }
  210. .small-stars .star {
  211. position: absolute;
  212. width: 3px;
  213. height: 3px;
  214. }
  215. .small-stars .star:nth-child(2n) {
  216. opacity: 0;
  217. -webkit-animation: star-blink 1.2s linear infinite alternate;
  218. animation: star-blink 1.2s linear infinite alternate;
  219. }
  220. .small-stars .star:nth-child(1) {
  221. left: 40px;
  222. bottom: 50px;
  223. }
  224. .small-stars .star:nth-child(2) {
  225. left: 200px;
  226. bottom: 40px;
  227. }
  228. .small-stars .star:nth-child(3) {
  229. left: 60px;
  230. bottom: 120px;
  231. }
  232. .small-stars .star:nth-child(4) {
  233. left: 140px;
  234. bottom: 250px;
  235. }
  236. .small-stars .star:nth-child(5) {
  237. left: 400px;
  238. bottom: 300px;
  239. }
  240. .small-stars .star:nth-child(6) {
  241. left: 170px;
  242. bottom: 80px;
  243. }
  244. .small-stars .star:nth-child(7) {
  245. left: 200px;
  246. bottom: 360px;
  247. -webkit-animation-delay: 0.2s;
  248. animation-delay: 0.2s;
  249. }
  250. .small-stars .star:nth-child(8) {
  251. left: 250px;
  252. bottom: 320px;
  253. }
  254. .small-stars .star:nth-child(9) {
  255. left: 300px;
  256. bottom: 340px;
  257. }
  258. .small-stars .star:nth-child(10) {
  259. left: 130px;
  260. bottom: 320px;
  261. -webkit-animation-delay: 0.5s;
  262. animation-delay: 0.5s;
  263. }
  264. .small-stars .star:nth-child(11) {
  265. left: 230px;
  266. bottom: 330px;
  267. -webkit-animation-delay: 7s;
  268. animation-delay: 7s;
  269. }
  270. .small-stars .star:nth-child(12) {
  271. left: 300px;
  272. bottom: 360px;
  273. -webkit-animation-delay: 0.3s;
  274. animation-delay: 0.3s;
  275. }
  276. @-webkit-keyframes star-blink {
  277. 50% {
  278. width: 3px;
  279. height: 3px;
  280. opacity: 1;
  281. }
  282. }
  283. @keyframes star-blink {
  284. 50% {
  285. width: 3px;
  286. height: 3px;
  287. opacity: 1;
  288. }
  289. }
  290. .medium-stars .star {
  291. position: absolute;
  292. width: 3px;
  293. height: 3px;
  294. opacity: 0;
  295. -webkit-animation: star-blink 1.2s ease-in infinite alternate;
  296. animation: star-blink 1.2s ease-in infinite alternate;
  297. }
  298. .medium-stars .star:nth-child(1) {
  299. left: 300px;
  300. bottom: 50px;
  301. }
  302. .medium-stars .star:nth-child(2) {
  303. left: 400px;
  304. bottom: 40px;
  305. -webkit-animation-delay: 0.4s;
  306. animation-delay: 0.4s;
  307. }
  308. .medium-stars .star:nth-child(3) {
  309. left: 330px;
  310. bottom: 300px;
  311. -webkit-animation-delay: 0.2s;
  312. animation-delay: 0.2s;
  313. }
  314. .medium-stars .star:nth-child(4) {
  315. left: 460px;
  316. bottom: 300px;
  317. -webkit-animation-delay: 0.9s;
  318. animation-delay: 0.9s;
  319. }
  320. .medium-stars .star:nth-child(5) {
  321. left: 300px;
  322. bottom: 150px;
  323. -webkit-animation-delay: 1.2s;
  324. animation-delay: 1.2s;
  325. }
  326. .medium-stars .star:nth-child(6) {
  327. left: 440px;
  328. bottom: 120px;
  329. -webkit-animation-delay: 1s;
  330. animation-delay: 1s;
  331. }
  332. .medium-stars .star:nth-child(7) {
  333. left: 200px;
  334. bottom: 140px;
  335. -webkit-animation-delay: 0.8s;
  336. animation-delay: 0.8s;
  337. }
  338. .medium-stars .star:nth-child(8) {
  339. left: 30px;
  340. bottom: 480px;
  341. -webkit-animation-delay: 0.3s;
  342. animation-delay: 0.3s;
  343. }
  344. .medium-stars .star:nth-child(9) {
  345. left: 460px;
  346. bottom: 400px;
  347. -webkit-animation-delay: 1.2s;
  348. animation-delay: 1.2s;
  349. }
  350. .medium-stars .star:nth-child(10) {
  351. left: 150px;
  352. bottom: 10px;
  353. -webkit-animation-delay: 1s;
  354. animation-delay: 1s;
  355. }
  356. .medium-stars .star:nth-child(11) {
  357. left: 420px;
  358. bottom: 450px;
  359. -webkit-animation-delay: 1.2s;
  360. animation-delay: 1.2s;
  361. }
  362. .medium-stars .star:nth-child(12) {
  363. left: 340px;
  364. bottom: 180px;
  365. -webkit-animation-delay: 1.1s;
  366. animation-delay: 1.1s;
  367. }
  368. @keyframes star-blink {
  369. 50% {
  370. width: 4px;
  371. height: 4px;
  372. opacity: 1;
  373. }
  374. }
  375. .star-fall {
  376. position: relative;
  377. border-radius: 2px;
  378. width: 80px;
  379. height: 2px;
  380. overflow: hidden;
  381. -webkit-transform: rotate(-20deg);
  382. transform: rotate(-20deg);
  383. }
  384. .star-fall:after {
  385. content: '';
  386. position: absolute;
  387. width: 50px;
  388. height: 2px;
  389. background: -webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0)), to(rgba(255, 255, 255, 0.4)));
  390. background: linear-gradient(to left, rgba(0, 0, 0, 0) 0%, rgba(255, 255, 255, 0.4) 100%);
  391. left: 100%;
  392. -webkit-animation: star-fall 3.6s linear infinite;
  393. animation: star-fall 3.6s linear infinite;
  394. }
  395. .star-fall:nth-child(1) {
  396. left: 80px;
  397. bottom: -100px;
  398. }
  399. .star-fall:nth-child(1):after {
  400. -webkit-animation-delay: 2.4s;
  401. animation-delay: 2.4s;
  402. }
  403. .star-fall:nth-child(2) {
  404. left: 200px;
  405. bottom: -200px;
  406. }
  407. .star-fall:nth-child(2):after {
  408. -webkit-animation-delay: 2s;
  409. animation-delay: 2s;
  410. }
  411. .star-fall:nth-child(3) {
  412. left: 430px;
  413. bottom: -50px;
  414. }
  415. .star-fall:nth-child(3):after {
  416. -webkit-animation-delay: 3.6s;
  417. animation-delay: 3.6s;
  418. }
  419. .star-fall:nth-child(4) {
  420. left: 400px;
  421. bottom: 100px;
  422. }
  423. .star-fall:nth-child(4):after {
  424. -webkit-animation-delay: 0.2s;
  425. animation-delay: 0.2s;
  426. }
  427. @-webkit-keyframes star-fall {
  428. 20% {
  429. left: -100%;
  430. }
  431. 100% {
  432. left: -100%;
  433. }
  434. }
  435. @keyframes star-fall {
  436. 20% {
  437. left: -100%;
  438. }
  439. 100% {
  440. left: -100%;
  441. }
  442. }
  443. </style>