user_cards_list.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <div>
  3. <div class="count-list">
  4. <div class="count-item">全部:{{total || 0}}</div>
  5. </div>
  6. <div>
  7. <el-table :data="cardsData" border style="width: 100%">
  8. <el-table-column
  9. prop=""
  10. label="购买方">
  11. <template slot-scope="scope">
  12. <span class="lblue point">
  13. <a target="_blank" :href="scope.row.host+'/wo/'+scope.row.uid">{{scope.row.uid_name}}</a>
  14. </span>
  15. </template>
  16. </el-table-column>
  17. <el-table-column
  18. prop=""
  19. label="被查询方">
  20. <template slot-scope="scope">
  21. <span class="lblue point">
  22. <a target="_blank" :href="scope.row.host+'/wo/'+scope.row.target_uid">{{scope.row.target_uid_name}}</a>
  23. </span>
  24. </template>
  25. </el-table-column>
  26. <el-table-column prop="pay_time" label="付款时间">
  27. <template slot-scope="scope">
  28. <span>{{formatDate(scope.row.pay_time,'Y-m-d H:i')}}</span>
  29. </template>
  30. </el-table-column>
  31. <el-table-column label="购买来源">
  32. <template slot-scope="scope">
  33. <span>{{(scope.row.source_type || '') +'-'+ (scope.row.version || '')}}</span>
  34. </template>
  35. </el-table-column>
  36. </el-table>
  37. </div>
  38. <div>
  39. <el-pagination
  40. class="order-footer"
  41. background
  42. layout="total, prev, pager, next"
  43. :page-size="20"
  44. :total="total"
  45. @current-change="handleCurrentChange"
  46. />
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. export default {
  52. name: "user_cards_list",
  53. data() {
  54. return {
  55. page: 1,
  56. total: 0,
  57. cardsData: [],
  58. }
  59. },
  60. mounted() {
  61. this.getAuditList();
  62. },
  63. methods: {
  64. async getAuditList() {
  65. const page = this.page;
  66. const data = {
  67. page
  68. };
  69. let res = await this.$post("/api/admin/UserCards/getCardsList", data);
  70. if (res && res.status === 1) {
  71. this.cardsData = res.data.list || [];
  72. this.total = res.data.total * 1;
  73. }
  74. },
  75. handleCurrentChange(val) {
  76. this.page = val;
  77. this.getAuditList();
  78. },
  79. formatDate(time, format = '') {
  80. if (time === "0") {
  81. return "--";
  82. }
  83. let now = new Date(time * 1000);
  84. let year = now.getFullYear();
  85. let month = now.getMonth() + 1;
  86. let date = now.getDate();
  87. let hour = now.getHours();
  88. let minute = now.getMinutes();
  89. let second = now.getSeconds();
  90. if (hour < 10) {
  91. hour = "0" + hour;
  92. }
  93. if (minute < 10) {
  94. minute = "0" + minute;
  95. }
  96. if (second < 10) {
  97. second = "0" + second;
  98. }
  99. return (format == '' ?
  100. year +
  101. "-" +
  102. month +
  103. "-" +
  104. date +
  105. " " +
  106. hour +
  107. ":" +
  108. minute +
  109. ":" +
  110. second
  111. :
  112. year +
  113. "-" +
  114. month +
  115. "-" +
  116. date +
  117. " " +
  118. hour +
  119. ":" +
  120. minute
  121. );
  122. },
  123. }
  124. }
  125. </script>
  126. <style scoped>
  127. .count-list {
  128. padding-bottom: 10px;
  129. display: flex;
  130. align-items: center;
  131. }
  132. </style>