pay_succeed.vue 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. <div class="w-[1200px] mx-[auto] bg-[#fff] rounded-[var(--rounded-big)]">
  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] mb-[30px] rounded-[var(--rounded-big)]">
  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]">
  29. <el-button plain round class="!border-[#ccc] !text-[#333] oppoSans-M" @click="toOderList">{{ t('lookOrders') }}</el-button>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </template>
  36. <script lang="ts" setup>
  37. import { computed, reactive, ref, watch } from 'vue'
  38. import { Select } from '@element-plus/icons-vue'
  39. import { useRouter, useRoute } from 'vue-router'
  40. import { getPayInfo } from '@/app/api/pay'
  41. // 需要登录
  42. definePageMeta({
  43. middleware: "auth"
  44. });
  45. const route = useRoute();
  46. const router = useRouter();
  47. const tradeId = route.query.trade_id
  48. const tradeType = route.query.trade_type
  49. let loading = ref(true);
  50. let payInfo = ref({});
  51. // 支付信息
  52. const getPayInfoFn = (trade_id,trade_type)=>{
  53. loading.value = true;
  54. getPayInfo(trade_type, trade_id).then((res) => {
  55. payInfo.value = res.data;
  56. loading.value = false;
  57. }).catch((res) => {
  58. loading.value = false;
  59. })
  60. }
  61. getPayInfoFn(tradeId,tradeType);
  62. const toOderList = ()=>{
  63. router.push('/order/list')
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. .box-card {
  68. border: none !important;
  69. }
  70. .text-color {
  71. color: var(--jjext-color-brand);
  72. }
  73. .page-height {
  74. min-height: calc(100vh - 170px);
  75. background-color: var(--el-bg-color-page);
  76. }
  77. </style>