hookehuyr

✨ feat: 微信支付成功后,回调页面获取金额和ID

1 +<!--
2 + * @Date: 2022-04-27 10:08:22
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-06-17 13:50:54
5 + * @FilePath: /tswj/src/views/client/wechatpayCallback.vue
6 + * @Description: 微信支付成功后回调
7 +-->
1 <template> 8 <template>
2 <div class="wechatpay-callback-page"> 9 <div class="wechatpay-callback-page">
3 <div class="pay-success"> 10 <div class="pay-success">
...@@ -20,21 +27,18 @@ ...@@ -20,21 +27,18 @@
20 <script setup> 27 <script setup>
21 import MyButton from '@/components/MyButton/index.vue' 28 import MyButton from '@/components/MyButton/index.vue'
22 import icon_wechatpay from '@images/zhifu@2x.png' 29 import icon_wechatpay from '@images/zhifu@2x.png'
23 -import { ref, reactive, onMounted } from 'vue' 30 +import { ref, onMounted } from 'vue'
24 import { useRoute, useRouter } from 'vue-router' 31 import { useRoute, useRouter } from 'vue-router'
25 -import axios from '@/utils/axios';
26 -import $ from 'jquery'
27 -import { Toast } from 'vant';
28 const $route = useRoute(); 32 const $route = useRoute();
29 const $router = useRouter(); 33 const $router = useRouter();
30 34
31 -// TODO: 微信支付成功后回调 35 +const amount = ref(0)
32 -const amount = ref(50)
33 onMounted(() => { 36 onMounted(() => {
34 - 37 + // 捐赠金额
38 + amount.value = $route.query.amount
35 }) 39 })
36 40
37 -// TODO: 需要获取 donate_id 41 +// 需要获取 donate_id
38 // 跳转到捐赠证书页面,替换掉当前页面,不能返回这个页面 42 // 跳转到捐赠证书页面,替换掉当前页面,不能返回这个页面
39 const getCert = () => { 43 const getCert = () => {
40 $router.replace({ 44 $router.replace({
......