index.vue 4.1 KB

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