index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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. <van-dialog
  11. v-model="visible"
  12. confirmButtonText="下载云机,尽享新人优惠"
  13. confirmButtonColor="#169bd5"
  14. close-on-click-overlay
  15. @confirm="confirm"
  16. >
  17. <div style="text-align: center; padding: 10px; color: #999">
  18. 感谢您对我们应用的支持和参与。<br />
  19. 我们的活动已经结束了,<br />
  20. 但是我们会不断努力,<br />
  21. 为您带来更多精彩的活动和内容。<br />
  22. </div>
  23. </van-dialog>
  24. </div>
  25. </template>
  26. <script>
  27. import common from './mixins/common.js';
  28. export default {
  29. name: 'claimCloudPhone',
  30. auth: false,
  31. head: {
  32. title: '0元购机,尽情享受',
  33. },
  34. mixins: [common],
  35. data() {
  36. return {
  37. visible: false,
  38. };
  39. },
  40. mounted() {
  41. if (this.$userAgent.isWx && !this.$userAgent.isMiniProgram) {
  42. return;
  43. }
  44. const {
  45. invitationUserName,
  46. operateActivityId,
  47. userLaunchId,
  48. bool = 0,
  49. } = this.$route.query;
  50. if (invitationUserName && operateActivityId && userLaunchId) {
  51. // 删除旧的token
  52. localStorage.removeItem('auth._token.password');
  53. // 如果有这个说明被邀请人
  54. localStorage.setItem('auth.inviteeNum', 1);
  55. // 活动Id
  56. localStorage.setItem(
  57. 'auth.operateActivityId',
  58. window.atob(operateActivityId),
  59. );
  60. this.$router.replace({
  61. path: '/claimCloudPhone/0',
  62. query: this.$route.query,
  63. });
  64. return;
  65. }
  66. if (!+bool) {
  67. localStorage.removeItem('auth.inviteeNum');
  68. localStorage.setItem('auth.operateActivityId', operateActivityId);
  69. }
  70. setTimeout(() => {
  71. this.bargainingStatus();
  72. });
  73. },
  74. methods: {
  75. bargainingStatus() {
  76. const { operateActivityId, bool = 0 } = this.$route.query;
  77. let params = {};
  78. if (+bool || (!+bool && operateActivityId)) {
  79. params.operateActivityId = localStorage.getItem(
  80. 'auth.operateActivityId',
  81. );
  82. }
  83. this.$axios
  84. .$get('activity/v5/assist/bargaining/current/bargainingStatus', {
  85. headers: this.headers,
  86. params,
  87. })
  88. .then((res) => {
  89. if (res.success) {
  90. localStorage.setItem(
  91. 'bargainingStatusInfo',
  92. JSON.stringify(res.data),
  93. );
  94. // bargainingStatus 0 :选择云机界面 1:砍一刀界面 2;邀请好友页面 3:成功,领取下一台云机界面 4:失败,领取下一台云机界面 5:跳官网 6:活动结束选择云手机 7 是到活动页,活动结束
  95. switch (res.data.bargainingStatus) {
  96. case 0:
  97. case 6:
  98. sessionStorage.setItem(
  99. 'activityEmd',
  100. res.data.bargainingStatus,
  101. );
  102. this.$router.replace('/claimCloudPhone/chooseCloudPhone');
  103. break;
  104. case 5:
  105. this.visible = true;
  106. break;
  107. default:
  108. this.$router.replace(
  109. '/claimCloudPhone/' + res.data.bargainingStatus,
  110. );
  111. break;
  112. }
  113. }
  114. });
  115. },
  116. confirm() {
  117. location.href = 'https://www.androidscloud.com';
  118. },
  119. },
  120. };
  121. </script>
  122. <style lang="less" scoped>
  123. .loader-container {
  124. background: rgba(237, 228, 228, 1);
  125. height: 100%;
  126. width: 100%;
  127. }
  128. .point {
  129. position: absolute;
  130. top: 5%;
  131. right: 5%;
  132. width: 250px;
  133. height: 250px;
  134. }
  135. .loader {
  136. position: relative;
  137. width: 2.5em;
  138. height: 2.5em;
  139. transform: rotate(165deg);
  140. }
  141. .loader:before,
  142. .loader:after {
  143. content: '';
  144. position: absolute;
  145. top: 50%;
  146. left: 50%;
  147. display: block;
  148. width: 0.5em;
  149. height: 0.5em;
  150. border-radius: 0.25em;
  151. transform: translate(-50%, -50%);
  152. }
  153. .loader:before {
  154. animation: before8 2s infinite;
  155. }
  156. .loader:after {
  157. animation: after6 2s infinite;
  158. }
  159. @keyframes before8 {
  160. 0% {
  161. width: 0.5em;
  162. box-shadow: 1em -0.5em rgba(225, 20, 98, 0.75),
  163. -1em 0.5em rgba(111, 202, 220, 0.75);
  164. }
  165. 35% {
  166. width: 2.5em;
  167. box-shadow: 0 -0.5em rgba(225, 20, 98, 0.75),
  168. 0 0.5em rgba(111, 202, 220, 0.75);
  169. }
  170. 70% {
  171. width: 0.5em;
  172. box-shadow: -1em -0.5em rgba(225, 20, 98, 0.75),
  173. 1em 0.5em rgba(111, 202, 220, 0.75);
  174. }
  175. 100% {
  176. box-shadow: 1em -0.5em rgba(225, 20, 98, 0.75),
  177. -1em 0.5em rgba(111, 202, 220, 0.75);
  178. }
  179. }
  180. @keyframes after6 {
  181. 0% {
  182. height: 0.5em;
  183. box-shadow: 0.5em 1em rgba(61, 184, 143, 0.75),
  184. -0.5em -1em rgba(233, 169, 32, 0.75);
  185. }
  186. 35% {
  187. height: 2.5em;
  188. box-shadow: 0.5em 0 rgba(61, 184, 143, 0.75),
  189. -0.5em 0 rgba(233, 169, 32, 0.75);
  190. }
  191. 70% {
  192. height: 0.5em;
  193. box-shadow: 0.5em -1em rgba(61, 184, 143, 0.75),
  194. -0.5em 1em rgba(233, 169, 32, 0.75);
  195. }
  196. 100% {
  197. box-shadow: 0.5em 1em rgba(61, 184, 143, 0.75),
  198. -0.5em -1em rgba(233, 169, 32, 0.75);
  199. }
  200. }
  201. .loader {
  202. position: absolute;
  203. top: calc(50% - 1.25em);
  204. left: calc(50% - 1.25em);
  205. }
  206. </style>