official.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view class="wrapper" :class="[animation ? 'animation' : 'animation2']" :style="{top: (statusBarHeight * 2 + 72) + 'rpx'}">
  3. <view class="content">
  4. <image :src="resource.award_bg_detail_official" class="image-1" />
  5. <image :src="resource.award_bg_detail_official" class="image-2" />
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import resource from '@/utils/resource'
  11. export default {
  12. data() {
  13. return {
  14. resource,
  15. animation: true
  16. }
  17. },
  18. computed: {
  19. statusBarHeight() {
  20. if (this.$store.state.systemInfo) {
  21. return this.$store.state.systemInfo.statusBarHeight
  22. }
  23. return 20
  24. }
  25. }
  26. }
  27. </script>
  28. <style lang="scss" scoped>
  29. .wrapper {
  30. position: fixed;
  31. left: 0;
  32. width: 100%;
  33. height: 374rpx;
  34. z-index: -1;
  35. .content {
  36. width: 100%;
  37. height: 100%;
  38. position: relative;
  39. .image-1 {
  40. position: absolute;
  41. top: 0;
  42. left: 0;
  43. width: 840rpx;
  44. height: 100rpx;
  45. }
  46. .image-2 {
  47. position: absolute;
  48. bottom: 0;
  49. left: 100%;
  50. width: 840rpx;
  51. height: 100rpx;
  52. }
  53. }
  54. }
  55. @keyframes moveLeft {
  56. 0% {
  57. left: 0;
  58. }
  59. 50% {
  60. left: -100%;
  61. }
  62. 100% {
  63. left: 0;
  64. }
  65. }
  66. @keyframes moveLeft2 {
  67. 0% {
  68. left: 100%;
  69. }
  70. 50% {
  71. left: 0;
  72. }
  73. 100% {
  74. left: 100%;
  75. }
  76. }
  77. .animation {
  78. animation: moveLeft 15s linear infinite;
  79. }
  80. .animation2 {
  81. animation: moveLeft2 15s linear infinite;
  82. }
  83. </style>