/
Payment.vue
103 lines (91 loc) · 2.3 KB
/
Payment.vue
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<template>
<!--支付页面,展示支付宝二维码-->
<div class="wrapper">
<el-row class="qr">
<el-col>
<el-card :body-style="{ padding: '50px', margin: '0px auto'}">
<div style="padding: 14px;">
<span>请打开支付宝进行扫描或者先 </span>
<span><a v-bind:href="'#/order-detail/orderNo/'+ orderNo" >查看订单</a></span>
<div class="bottom clearfix">
</div>
</div>
<!--<img src="http://image.vuespringdemo.com/qr-1506955845058.png" class="image">-->
<img v-bind:src="qrUrl" class="image" v-loading.body="loading">
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
// 请求服务器数据
import orderApi from './../../api/portal/orderapi.js'
export default {
data () {
return {
orderNo: '',
qrUrl: '',
loading: true
}
},
created () {
this.$store.dispatch('updateBreadcrumbs', this)
var orderNo = this.$route.params['orderNo']
// 获取支付二维码
console.log('----orderNo----', orderNo)
this.getQRUrl(orderNo)
},
methods: {
getQRUrl (orderNo) {
let self = this
orderApi.pay(self, orderNo).then(function (response) {
console.log('----getQRUrl----', response.data)
if (response.data.status === 0) {
self.orderNo = response.data.data.orderNo
self.qrUrl = response.data.data.qrUrl
self.loading = false
} else if (response.data.status === 3) {
self.$router.push('/login')
} else {
self.$message({
message: response.data.msg,
type: 'error'
})
// window.history.back()
self.$router.push({name: 'Recommend'})
}
})
}
}
}
</script>
<style scoped>
.wrapper {
margin: 0px auto;
text-align: center;
width: 1080px;
height: 500px;
}
h3 {
font-size: 16px;
font-weight: 700;
line-height: 35px;
height: 35px;
color: #333;
border-bottom: 1px solid #ddd;
}
h2:hover {
color: #c60023;
}
a {
text-decoration: none;
}
a:hover {
cursor: pointer;
color: #c60023;
}
.image {
width: 300px;
height: 300px;
}
</style>