payRecord.vue 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <div class="page">
  3. <el-table :data="dataList" border cell-class-name="vertical-top-cell" v-loading="loading" empty-text="暂无交易记录" max-height="578px" style="margin-top: 18px;">
  4. <el-table-column label="序号" width="50">
  5. <template #default="scope">
  6. {{ scope.$index + 1 }}
  7. </template>
  8. </el-table-column>
  9. <el-table-column label="订单编号" prop="orderNo"></el-table-column>
  10. <el-table-column label="交易时间" prop="payTime"></el-table-column>
  11. <el-table-column label="商品类型" prop="xx">
  12. <template #default="scope">{{ typeCfg[scope.row.type]||'' }}</template>
  13. </el-table-column>
  14. <el-table-column label="购买次数" prop="totalFrequency"></el-table-column>
  15. <el-table-column label="交易金额(元)" prop="totalAmount"></el-table-column>
  16. <el-table-column label="有效期至" prop="expirationTime"></el-table-column>
  17. </el-table>
  18. <el-row style="display: flex;justify-content: center;">
  19. <el-pagination
  20. @size-change="handleSizeChange"
  21. @current-change="handleCurrentChange"
  22. :current-page="queryParams.page"
  23. :page-sizes="[5, 10, 20, 50]"
  24. :page-size="10"
  25. layout="total, sizes, prev, pager, next, jumper"
  26. :total="total"
  27. v-show="total > 0">
  28. </el-pagination>
  29. </el-row>
  30. </div>
  31. </template>
  32. <script setup name="">
  33. const props = defineProps({
  34. userId:{
  35. typeof:'String',
  36. default:''
  37. }
  38. });
  39. import { ref, getCurrentInstance, onMounted } from 'vue'
  40. const { proxy } = getCurrentInstance();
  41. import {
  42. getPayRecoedList
  43. } from '@/api/agent/indexTwo.js'
  44. const queryParams = ref({
  45. page: 1,
  46. limit: 10,
  47. tradeRecord:1,
  48. userId:''
  49. })
  50. const typeCfg = ref({
  51. 1: '个人版',
  52. 2: '团队版',
  53. 0:'团队PRO版',
  54. 3:'高级',
  55. 4:'中级',
  56. 5:'初级',
  57. })
  58. const dataList = ref([])
  59. const total = ref(0)
  60. const loading = ref(false)
  61. const handleSizeChange = (val) => {
  62. queryParams.value.limit = val;
  63. getList();
  64. }
  65. const handleCurrentChange = (val) => {
  66. queryParams.value.page = val;
  67. getList();
  68. }
  69. const getList = async () => {
  70. let query = JSON.parse(JSON.stringify(queryParams.value));
  71. loading.value = true;
  72. const res = await getPayRecoedList(query);
  73. dataList.value = res.data.list;
  74. total.value = res.data.total;
  75. loading.value = false;
  76. }
  77. onMounted(() => {
  78. queryParams.value.userId = props.userId;
  79. getList();
  80. })
  81. </script>
  82. <style scoped lang="scss">
  83. </style>