index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <div class="loader-container">
  3. <div class="loader"></div>
  4. </div>
  5. </template>
  6. <script>
  7. import common from './mixins/common.js';
  8. export default {
  9. name: 'claimCloudPhone',
  10. auth: false,
  11. head: {
  12. title: '0元购机,尽情享受',
  13. },
  14. mixins: [common],
  15. data() {
  16. return {};
  17. },
  18. mounted() {
  19. const {
  20. invitationUserName,
  21. operateActivityId,
  22. userLaunchId,
  23. bool = 0,
  24. } = this.$route.query;
  25. if (invitationUserName && operateActivityId && userLaunchId) {
  26. // 删除旧的token
  27. localStorage.removeItem('auth._token.password');
  28. // 如果有这个说明被邀请人
  29. localStorage.setItem('auth.inviteeNum', 1);
  30. // 活动Id
  31. localStorage.setItem(
  32. 'auth.operateActivityId',
  33. window.atob(operateActivityId),
  34. );
  35. this.$router.replace({
  36. path: '/claimCloudPhone/0',
  37. query: this.$route.query,
  38. });
  39. return;
  40. }
  41. if (!+bool) {
  42. localStorage.removeItem('auth.inviteeNum');
  43. localStorage.setItem('auth.operateActivityId', operateActivityId);
  44. }
  45. setTimeout(() => {
  46. this.bargainingStatus();
  47. });
  48. },
  49. methods: {
  50. bargainingStatus() {
  51. this.$axios
  52. .$get('activity/v5/assist/bargaining/current/bargainingStatus', {
  53. headers: this.headers,
  54. })
  55. .then((res) => {
  56. if (res.success) {
  57. localStorage.setItem(
  58. 'bargainingStatusInfo',
  59. JSON.stringify(res.data),
  60. );
  61. // bargainingStatus 0 :选择云机界面 1:砍一刀界面 2;邀请好友页面 3:成功,领取下一台云机界面 4:失败,领取下一台云机界面
  62. switch (res.data.bargainingStatus) {
  63. case 0:
  64. this.$router.replace('/claimCloudPhone/chooseCloudPhone');
  65. break;
  66. default:
  67. this.$router.replace(
  68. '/claimCloudPhone/' + res.data.bargainingStatus,
  69. );
  70. break;
  71. }
  72. }
  73. });
  74. },
  75. },
  76. };
  77. </script>
  78. <style lang="less" scoped>
  79. .loader-container {
  80. background: rgba(237, 228, 228, 1);
  81. height: 100%;
  82. width: 100%;
  83. }
  84. .loader {
  85. position: relative;
  86. width: 2.5em;
  87. height: 2.5em;
  88. transform: rotate(165deg);
  89. }
  90. .loader:before,
  91. .loader:after {
  92. content: '';
  93. position: absolute;
  94. top: 50%;
  95. left: 50%;
  96. display: block;
  97. width: 0.5em;
  98. height: 0.5em;
  99. border-radius: 0.25em;
  100. transform: translate(-50%, -50%);
  101. }
  102. .loader:before {
  103. animation: before8 2s infinite;
  104. }
  105. .loader:after {
  106. animation: after6 2s infinite;
  107. }
  108. @keyframes before8 {
  109. 0% {
  110. width: 0.5em;
  111. box-shadow: 1em -0.5em rgba(225, 20, 98, 0.75),
  112. -1em 0.5em rgba(111, 202, 220, 0.75);
  113. }
  114. 35% {
  115. width: 2.5em;
  116. box-shadow: 0 -0.5em rgba(225, 20, 98, 0.75),
  117. 0 0.5em rgba(111, 202, 220, 0.75);
  118. }
  119. 70% {
  120. width: 0.5em;
  121. box-shadow: -1em -0.5em rgba(225, 20, 98, 0.75),
  122. 1em 0.5em rgba(111, 202, 220, 0.75);
  123. }
  124. 100% {
  125. box-shadow: 1em -0.5em rgba(225, 20, 98, 0.75),
  126. -1em 0.5em rgba(111, 202, 220, 0.75);
  127. }
  128. }
  129. @keyframes after6 {
  130. 0% {
  131. height: 0.5em;
  132. box-shadow: 0.5em 1em rgba(61, 184, 143, 0.75),
  133. -0.5em -1em rgba(233, 169, 32, 0.75);
  134. }
  135. 35% {
  136. height: 2.5em;
  137. box-shadow: 0.5em 0 rgba(61, 184, 143, 0.75),
  138. -0.5em 0 rgba(233, 169, 32, 0.75);
  139. }
  140. 70% {
  141. height: 0.5em;
  142. box-shadow: 0.5em -1em rgba(61, 184, 143, 0.75),
  143. -0.5em 1em rgba(233, 169, 32, 0.75);
  144. }
  145. 100% {
  146. box-shadow: 0.5em 1em rgba(61, 184, 143, 0.75),
  147. -0.5em -1em rgba(233, 169, 32, 0.75);
  148. }
  149. }
  150. .loader {
  151. position: absolute;
  152. top: calc(50% - 1.25em);
  153. left: calc(50% - 1.25em);
  154. }
  155. </style>