123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- <template>
- <div class="confirmation">
- <div class="confirmation-bg">
- <div class="confirmation-tips">
- <template v-if="status[currentStatus]">
- <van-icon
- :name="status[currentStatus].key"
- v-if="status[currentStatus].key"
- />
- {{ status[currentStatus].name }}
- </template>
- </div>
- <div class="confirmation-obtain" v-if="currentStatus !== 2">
- 3大权益已开通 云机已到账
- </div>
- </div>
- <div class="confirmation-container">
- <div class="jump">
- <img
- src="@/assets/image/claimCloudPhone/confirmation-btn.png"
- class="jump-btn"
- @click="download"
- />
- <div @click="toH5">暂不下载,使用网页版</div>
- </div>
- <div class="confirmation-guide">
- <div class="confirmation-guide-title">
- 您可在云应用/浏览器直接下载安装应用
- </div>
- <img
- src="@/assets/image/claimCloudPhone/confirmation-guide.png"
- alt=""
- />
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- auth: false,
- name: 'confirmation',
- head: {
- title: '0元购机,尽情享受',
- },
- components: {},
- data() {
- return {
- bargainingStatusInfo: {},
- status: {
- 1: {
- name: '支付成功',
- key: 'passed',
- },
- 2: {
- name: '支付中...',
- key: 0,
- },
- 3: {
- name: '支付失败',
- key: 'close',
- },
- },
- currentStatus: '',
- index: 1,
- H5_URL: process.env.H5_URL,
- };
- },
- mounted() {
- this.getPayStatus();
- this.bargainingStatusInfo = JSON.parse(
- localStorage.getItem('bargainingStatusInfo'),
- );
- },
- methods: {
- getPayStatus(bool = true) {
- if (bool) {
- this.$toast.loading({
- message: '加载中...',
- forbidClick: true,
- duration: 0,
- });
- }
- this.$axios
- .$get('pay/v1/alipay/h5/spend/getPayStatus', {
- params: {
- myOrderNum: localStorage.getItem('activityPurchaseMyOrderNum'),
- },
- })
- .then((res) => {
- if (res.success) {
- this.currentStatus = res.data;
- if (+res.data === 2) {
- if (this.index === 2) {
- this.currentStatus = 3;
- this.$set(
- this.status[this.currentStatus],
- 'name',
- '去app查看结果',
- );
- this.index = 1;
- return;
- }
- this.index++;
- setTimeout(() => {
- this.getPayStatus(false);
- }, 2000);
- }
- }
- })
- .finally(() => {
- this.$toast.clear();
- });
- },
- download() {
- location.href = this.$userAgent.isAndroid
- ? this.bargainingStatusInfo.downloadAndroidUrl
- : 'https://www.androidscloud.com';
- },
- toH5() {
- location.href = this.H5_URL + '/cloud/phone/web/#/';
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .confirmation {
- height: 100%;
- background: #f4f6f8;
- .confirmation-bg {
- height: 215px;
- background: #ff707d;
- padding-top: 38px;
- border-radius: 0px 0px 46px 46px;
- .confirmation-tips {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 22px;
- color: #ffffff;
- line-height: 30px;
- text-align: center;
- font-style: normal;
- .van-icon-passed {
- margin-right: 5px;
- }
- }
- .confirmation-obtain {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- color: #fff5dc;
- line-height: 20px;
- text-align: center;
- font-style: normal;
- margin-top: 12px;
- }
- }
- .confirmation-container {
- padding: 0 26px;
- .jump {
- height: 146px;
- padding: 41px 45px 0;
- box-sizing: border-box;
- background: #ffffff;
- border-radius: 8px;
- margin-top: -100px;
- margin-bottom: 16px;
- overflow: hidden;
- & > div:last-of-type {
- margin-top: 12px;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 12px;
- color: #666666;
- line-height: 17px;
- text-align: center;
- font-style: normal;
- }
- .jump-btn {
- height: 46px;
- width: 100%;
- }
- }
- .confirmation-guide {
- background: #ffffff;
- border-radius: 8px;
- padding: 16px 10px;
- .confirmation-guide-title {
- font-family: PingFangSC, PingFang SC;
- font-weight: bold;
- font-size: 16px;
- color: #0a132b;
- text-align: center;
- font-style: normal;
- }
- & > img {
- width: 100%;
- margin: 22px 0;
- }
- }
- }
- }
- </style>
|