confirmation.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <div class="confirmation">
  3. <div class="confirmation-bg">
  4. <div class="confirmation-tips">
  5. <template v-if="status[currentStatus]">
  6. <van-icon
  7. :name="status[currentStatus].key"
  8. v-if="status[currentStatus].key"
  9. />
  10. {{ status[currentStatus].name }}
  11. </template>
  12. </div>
  13. <div class="confirmation-obtain" v-if="currentStatus !== 2">
  14. 3大权益已开通&nbsp;&nbsp;云机已到账
  15. </div>
  16. </div>
  17. <div class="confirmation-container">
  18. <div class="jump">
  19. <img src="@/assets/image/claimCloudPhone/confirmation-btn.png" style="height: 46px">
  20. <div @click="toH5">暂不下载,使用网页版</div>
  21. </div>
  22. <div class="confirmation-guide">
  23. <div class="confirmation-guide-title">
  24. 您可在云应用/浏览器直接下载安装应用
  25. </div>
  26. <img
  27. src="@/assets/image/claimCloudPhone/confirmation-guide.png"
  28. alt=""
  29. />
  30. </div>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. export default {
  36. auth: false,
  37. name: 'confirmation',
  38. head: {
  39. title: '0元购机,尽情享受',
  40. },
  41. components: {},
  42. data() {
  43. return {
  44. bargainingStatusInfo: {},
  45. status: {
  46. 1: {
  47. name: '支付成功',
  48. key: 'passed',
  49. },
  50. 2: {
  51. name: '支付中...',
  52. key: 0,
  53. },
  54. 3: {
  55. name: '支付失败',
  56. key: 'close',
  57. },
  58. },
  59. currentStatus: '',
  60. index: 1,
  61. };
  62. },
  63. mounted() {
  64. this.getPayStatus();
  65. this.bargainingStatusInfo = JSON.parse(
  66. localStorage.getItem('bargainingStatusInfo'),
  67. );
  68. },
  69. methods: {
  70. getPayStatus(bool = true) {
  71. if (bool) {
  72. this.$toast.loading({
  73. message: '加载中...',
  74. forbidClick: true,
  75. duration: 0,
  76. });
  77. }
  78. this.$axios
  79. .$get('pay/v1/alipay/h5/spend/getPayStatus', {
  80. params: {
  81. myOrderNum: localStorage.getItem('activityPurchaseMyOrderNum'),
  82. },
  83. })
  84. .then((res) => {
  85. if (res.success) {
  86. this.currentStatus = res.data;
  87. if (+res.data === 2) {
  88. if (this.index === 2) {
  89. this.currentStatus = 3;
  90. this.$set(
  91. this.status[this.currentStatus],
  92. 'name',
  93. '去app查看结果',
  94. );
  95. this.index = 1;
  96. return;
  97. }
  98. this.index++;
  99. setTimeout(() => {
  100. this.getPayStatus(false);
  101. }, 2000);
  102. }
  103. }
  104. })
  105. .finally(() => {
  106. this.$toast.clear();
  107. });
  108. },
  109. download() {
  110. location.href = this.$userAgent.isAndroid
  111. ? this.bargainingStatusInfo.downloadAndroidUrl
  112. : 'https://www.androidscloud.com';
  113. },
  114. toH5() {
  115. location.href =
  116. 'http://gntest.phone.androidscloud.com:1280/cloud/phone/web/#/';
  117. },
  118. },
  119. };
  120. </script>
  121. <style lang="less" scoped>
  122. .confirmation {
  123. height: 100%;
  124. background: #f4f6f8;
  125. .confirmation-bg {
  126. height: 215px;
  127. background: #ff707d;
  128. padding-top: 38px;
  129. border-radius: 0px 0px 46px 46px;
  130. .confirmation-tips {
  131. font-family: PingFangSC, PingFang SC;
  132. font-weight: 400;
  133. font-size: 22px;
  134. color: #ffffff;
  135. line-height: 30px;
  136. text-align: center;
  137. font-style: normal;
  138. .van-icon-passed {
  139. margin-right: 5px;
  140. }
  141. }
  142. .confirmation-obtain {
  143. font-family: PingFangSC, PingFang SC;
  144. font-weight: 400;
  145. font-size: 14px;
  146. color: #fff5dc;
  147. line-height: 20px;
  148. text-align: center;
  149. font-style: normal;
  150. margin-top: 12px;
  151. }
  152. }
  153. .confirmation-container {
  154. padding: 0 26px;
  155. .jump {
  156. height: 146px;
  157. padding: 41px 45px 0;
  158. box-sizing: border-box;
  159. background: #ffffff;
  160. border-radius: 8px;
  161. margin-top: -100px;
  162. margin-bottom: 16px;
  163. overflow: hidden;
  164. & > div:last-of-type {
  165. margin-top: 12px;
  166. font-family: PingFangSC, PingFang SC;
  167. font-weight: 400;
  168. font-size: 12px;
  169. color: #666666;
  170. line-height: 17px;
  171. text-align: center;
  172. font-style: normal;
  173. }
  174. }
  175. .confirmation-guide {
  176. background: #ffffff;
  177. border-radius: 8px;
  178. padding: 16px 10px;
  179. .confirmation-guide-title {
  180. font-family: PingFangSC, PingFang SC;
  181. font-weight: bold;
  182. font-size: 16px;
  183. color: #0a132b;
  184. text-align: center;
  185. font-style: normal;
  186. }
  187. & > img {
  188. width: 100%;
  189. margin: 22px 0;
  190. }
  191. }
  192. }
  193. }
  194. </style>