pay_succeed.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <div class="w-full bg-[#F7F8FA] page-height" v-loading="loading">
  3. <div v-if="Object.values(payInfo).length">
  4. <div class="flex items-center justify-center py-[40px]">
  5. <div class="inline-block bg-[#00b42a] rounded-[50%] w-[35px] h-[35px] text-center leading-[40px]">
  6. <el-icon color="#fff"><Select /></el-icon>
  7. </div>
  8. <h3 class="text-[#00b42a] ml-[10px] text-[25px]">{{ t('payMente') }}</h3>
  9. </div>
  10. <el-card class="box-card w-[1200px] mx-[auto]" shadow="never">
  11. <div class="py-[20px] px-[20px] text-[14px]">
  12. <h3 class="text-center my-[30px] text-[40px] price-font" v-if="payInfo.type == 'balancepay'">¥{{payInfo.money}}</h3>
  13. <h3 class="text-center my-[30px] text-[40px] price-font" v-else>¥{{payInfo.money}}</h3>
  14. <div class="bg-[#f7f8fa] py-[20px] px-[30px] rounded-[2px] mb-[30px]">
  15. <div class="flex mb-[20px]">
  16. <span>{{ t('payNumber') }}</span>
  17. <span class="flex-1 text-right">{{payInfo.out_trade_no}}</span>
  18. </div>
  19. <div class="flex mb-[20px]">
  20. <span>{{ t('orderTime') }}</span>
  21. <span class="flex-1 text-right">{{payInfo.create_time}}</span>
  22. </div>
  23. <div class="flex">
  24. <span>{{ t('payType') }}</span>
  25. <span class="flex-1 text-right">{{payInfo.type_name}}</span>
  26. </div>
  27. </div>
  28. <div class="flex items-center justify-center mb-[40px]"><el-button plain @click="toOderList">{{ t('lookOrders') }}</el-button></div>
  29. </div>
  30. </el-card>
  31. </div>
  32. </div>
  33. </template>
  34. <script lang="ts" setup>
  35. import { computed, reactive, ref, watch } from 'vue'
  36. import { Select } from '@element-plus/icons-vue'
  37. import { useRouter, useRoute } from 'vue-router'
  38. import { getPayInfo } from '@/app/api/pay'
  39. // 需要登录
  40. definePageMeta({
  41. middleware: "auth"
  42. });
  43. const route = useRoute();
  44. const router = useRouter();
  45. const tradeId = route.query.trade_id
  46. const tradeType = route.query.trade_type
  47. let loading = ref(true);
  48. let payInfo = ref({});
  49. // 支付信息
  50. const getPayInfoFn = (trade_id,trade_type)=>{
  51. loading.value = true;
  52. getPayInfo(trade_type, trade_id).then((res) => {
  53. payInfo.value = res.data;
  54. loading.value = false;
  55. }).catch((res) => {
  56. loading.value = false;
  57. })
  58. }
  59. getPayInfoFn(tradeId,tradeType);
  60. const toOderList = ()=>{
  61. router.push('/order/list')
  62. }
  63. </script>
  64. <style lang="scss" scoped>
  65. .box-card {
  66. border: none !important;
  67. }
  68. .text-color {
  69. color: var(--jjext-color-brand);
  70. }
  71. .page-height {
  72. min-height: calc(100vh - 170px);
  73. background-color: var(--el-bg-color-page);
  74. }
  75. </style>