RegistrationDetails.vue
2.2 KB
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
104
105
106
107
108
109
110
111
112
113
114
<template>
<view class="content">
<view style="padding-top: 16px;">
<view class="bo">
<view class="title"><text class="left">培训名称:</text><text class="right">{{postData.work_name}}</text>
</view>
<view class="money"><text class="left">培训金额(元):</text><text class="right">{{postData.price}}元</text>
</view>
<view class="time"><text class="left">报名时间:</text><text
class="right">{{postData.create_time_text}}</text></view>
<view class="zhiBox" @click="payment" v-if="postData.is_pay==0">
<text class="zhifu">支付</text>
</view>
<view class="zhiBox"v-if="postData.is_pay==1">
<text class="zhifu">已支付</text>
</view>
</view>
</view>
</view>
</template>
<script>
import request from '../../utils/request.js'
import wexinPay from '../../utils/jws.js'
export default {
data() {
return {
postData: ""
}
},
onLoad(options) {
this.id = options.id
this.getData()
},
methods: {
getData() {
request.post('/api/index/sign_up_detail', {
id: this.id
}).then(res => {
this.postData = res.data
}).catch(err => {
})
},
payment() {
let url='/pages/index/Information'
request.post('/api/index/pay', {
id:this.id
}).then(res => {
console.log(res,'res')
wexinPay(res.data,url)
}).catch(err => {
})
// let authURL = 'http://ranqi-admin.t.brotop.cn/api/index/auth?token=' + uni
// .getStorageSync('Authorization') + '&url=/pages/index/index'
// window.location.href = authURL;
}
}
}
</script>
<style>
.time {
margin-bottom: 52px;
}
.money {
margin-bottom: 49px;
}
.title {
margin-bottom: 72px;
}
.bo {
background-color: #FFFFFF;
margin: 16px 16px 0 16px;
padding: 16px;
}
.content {
background-color: #F2F3F5;
height: 100vh;
}
.right {
color: #323233;
font-size: 30rpx;
font-weight: bold;
margin-left: 15px;
}
.left {
color: #646566;
font-size: 32rpx;
}
.zhiBox {
display: flex;
align-items: center;
justify-content: center;
height: 100rpx;
background: #67d96a;
border-radius: 16rpx;
margin: 0 72px;
}
.zhifu {
color: #FFFFFF;
font-size: 36rpx;
}
</style>