pay.vue
765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<template>
<LayoutApp :show-back="true">
<div>{{count}} 秒</div>
<div>支付成功跳转成功页</div>
<div>支付失败返回上一层</div>
</LayoutApp>
</template>
<script>
import config from 'config';
export default {
name: 'PayPage',
props: ['orderCode', 'payParams', 'extra'],
data() {
return {
count: 60
};
},
mounted() {
if (this.payParams) {
const url = config.alipayUrl + '?' + this.payParams;
window.location.href = url;
}
this.setCount();
},
methods: {
setCount() {
if (this.count > 0) {
setTimeout(() => {
this.count = this.count - 1;
this.setCount();
}, 1000);
}
}
}
};
</script>
<style lang="scss" scoped>
</style>