wechatpayCallback.vue
1.69 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
<template>
<div class="wechatpay-callback-page">
<div class="pay-success">
<van-image width="50" height="50" :src="icon_wechatpay" />
<div class="text">支付成功</div>
</div>
<div class="pay-main">
<p class="title">上海市儿童基金会</p>
<div class="amount">
<p>¥</p>
<p>{{ amount }}</p>
</div>
</div>
<div class="button-wrapper">
<my-button type="primary" @on-click="getCert">查看证书</my-button>
</div>
</div>
</template>
<script setup>
import MyButton from '@/components/MyButton/index.vue'
import icon_wechatpay from '@images/zhifu@2x.png'
import { ref, reactive, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import axios from '@/utils/axios';
import $ from 'jquery'
import { Toast } from 'vant';
const $route = useRoute();
const $router = useRouter();
// TODO: 微信支付成功后回调
const amount = ref(50)
onMounted(() => {
})
// TODO: 需要获取 donate_id
// 跳转到捐赠证书页面,替换掉当前页面,不能返回这个页面
const getCert = () => {
$router.replace({
path: '/client/donateCertificate',
query: {
donate_id: $route.query.donate_id
}
});
}
</script>
<style lang="less" scoped>
.wechatpay-callback-page {
.pay-success {
text-align: center;
padding: 20%;
.text {
color: #52ab38;
}
}
.pay-main {
color: #222222;
text-align: center;
.title {
font-size: 1.15rem;
margin-bottom: 1rem;
}
.amount {
p {
font-size: 1.5rem;
display: inline-block;
vertical-align: middle;
}
}
}
.button-wrapper {
padding: 30% 4rem;
}
}
</style>