confirmation.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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. <div @click="download">打开APP,使用完整功能</div>
  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 class="confirmation-guide-step">
  31. <div>
  32. <div>1</div>
  33. 进入云手机
  34. </div>
  35. <div>
  36. <div>2</div>
  37. 点开云应用,浏览/搜索内容
  38. </div>
  39. <div>
  40. <div>3</div>
  41. 下载,打开游戏
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </template>
  48. <script>
  49. export default {
  50. auth: false,
  51. name: 'confirmation',
  52. head: {
  53. title: '0元购机,尽情享受',
  54. },
  55. components: {},
  56. data() {
  57. return {
  58. bargainingStatusInfo: {},
  59. status: {
  60. 1: {
  61. name: '支付成功',
  62. key: 'passed',
  63. },
  64. 2: {
  65. name: '支付中...',
  66. key: 0,
  67. },
  68. 3: {
  69. name: '支付失败',
  70. key: 'close',
  71. },
  72. },
  73. currentStatus: '',
  74. index: 1,
  75. };
  76. },
  77. mounted() {
  78. this.getPayStatus();
  79. this.bargainingStatusInfo = JSON.parse(
  80. localStorage.getItem('bargainingStatusInfo'),
  81. );
  82. },
  83. methods: {
  84. getPayStatus(bool = true) {
  85. if (bool) {
  86. this.$toast.loading({
  87. message: '加载中...',
  88. forbidClick: true,
  89. duration: 0,
  90. });
  91. }
  92. this.$axios
  93. .$get('pay/v1/alipay/h5/spend/getPayStatus', {
  94. params: {
  95. myOrderNum: localStorage.getItem('activityPurchaseMyOrderNum'),
  96. },
  97. })
  98. .then((res) => {
  99. if (res.success) {
  100. this.currentStatus = res.data;
  101. console.log(this.currentStatus, 123456)
  102. if (+res.data === 2) {
  103. if (this.index === 2) {
  104. this.currentStatus = 3;
  105. this.$set(
  106. this.status[this.currentStatus],
  107. 'name',
  108. '去app查看结果',
  109. );
  110. this.index = 1;
  111. return;
  112. }
  113. this.index++;
  114. setTimeout(() => {
  115. this.getPayStatus(false);
  116. }, 2000);
  117. }
  118. }
  119. })
  120. .finally(() => {
  121. this.$toast.clear();
  122. });
  123. },
  124. download() {
  125. location.href = this.$userAgent.isAndroid
  126. ? this.bargainingStatusInfo.downloadAndroidUrl
  127. : 'https://www.androidscloud.com';
  128. },
  129. toH5() {
  130. location.href =
  131. 'http://gntest.phone.androidscloud.com:1280/cloud/phone/web/#/';
  132. },
  133. },
  134. };
  135. </script>
  136. <style lang="less" scoped>
  137. .confirmation {
  138. height: 100%;
  139. background: #f4f6f8;
  140. .confirmation-bg {
  141. height: 215px;
  142. background: #1676fe;
  143. padding-top: 38px;
  144. border-radius: 0px 0px 46px 46px;
  145. .confirmation-tips {
  146. font-family: PingFangSC, PingFang SC;
  147. font-weight: 400;
  148. font-size: 22px;
  149. color: #ffffff;
  150. line-height: 30px;
  151. text-align: center;
  152. font-style: normal;
  153. .van-icon-passed {
  154. margin-right: 5px;
  155. }
  156. }
  157. .confirmation-obtain {
  158. font-family: PingFangSC, PingFang SC;
  159. font-weight: 400;
  160. font-size: 14px;
  161. color: #9ccffb;
  162. text-align: center;
  163. font-style: normal;
  164. margin-top: 12px;
  165. }
  166. }
  167. .confirmation-container {
  168. padding: 0 26px;
  169. .jump {
  170. height: 146px;
  171. padding: 0 45px;
  172. box-sizing: border-box;
  173. background: #ffffff;
  174. border-radius: 8px;
  175. margin-top: -100px;
  176. margin-bottom: 16px;
  177. overflow: hidden;
  178. & > div:first-of-type {
  179. margin-top: 41px;
  180. height: 46px;
  181. line-height: 46px;
  182. background: #3974f2;
  183. border-radius: 23px;
  184. font-family: PingFangSC, PingFang SC;
  185. font-weight: 600;
  186. font-size: 14px;
  187. color: #ffffff;
  188. text-align: center;
  189. font-style: normal;
  190. }
  191. & > div:last-of-type {
  192. margin-top: 12px;
  193. font-family: PingFangSC, PingFang SC;
  194. font-weight: 400;
  195. font-size: 12px;
  196. color: #bbbbbb;
  197. line-height: 17px;
  198. text-align: center;
  199. font-style: normal;
  200. }
  201. }
  202. .confirmation-guide {
  203. background: #ffffff;
  204. border-radius: 8px;
  205. padding: 16px 10px;
  206. .confirmation-guide-title {
  207. font-family: PingFangSC, PingFang SC;
  208. font-weight: bold;
  209. font-size: 16px;
  210. color: #0a132b;
  211. text-align: center;
  212. font-style: normal;
  213. }
  214. & > img {
  215. width: 100%;
  216. height: 156px;
  217. margin: 22px 0;
  218. }
  219. .confirmation-guide-step {
  220. font-family: PingFangSC, PingFang SC;
  221. font-weight: 400;
  222. font-size: 14px;
  223. color: #333333;
  224. line-height: 18px;
  225. text-align: left;
  226. font-style: normal;
  227. & > div {
  228. display: flex;
  229. align-items: center;
  230. }
  231. div > div {
  232. display: inline-block;
  233. width: 16px;
  234. height: 16px;
  235. border-radius: 50%;
  236. line-height: 20px;
  237. color: #fff;
  238. background: #3b7fff;
  239. display: flex;
  240. justify-content: center;
  241. align-items: center;
  242. margin-right: 8px;
  243. }
  244. }
  245. }
  246. }
  247. }
  248. </style>