ActivityTable.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <div>
  3. <el-dialog
  4. :title="marketingData.title"
  5. width="1000px"
  6. :visible.sync="dialogVisible"
  7. :before-close="close"
  8. >
  9. <div class="dialog-search">
  10. <div>参与用户数量:{{marketingData.realNum}}</div>
  11. <div class="ge"></div>
  12. <div>新用户数(助力用户数):{{marketingData.newUserCount}}</div>
  13. <div class="ge"></div>
  14. <div>抽奖码数量:{{marketingData.codeCount}}</div>
  15. </div>
  16. <el-table
  17. v-loading="loading"
  18. :data="marketingList"
  19. class="el-table"
  20. >
  21. <el-table-column label="用户编号" prop="userId" min-width="80" />
  22. <el-table-column label="用户昵称" prop="nickName" min-width="80" />
  23. <el-table-column label="抽奖码" prop="code" min-width="80" />
  24. <el-table-column label="抽奖码获取时间" prop="createdTime" min-width="85">
  25. <template slot-scope="scope">
  26. <div>{{ parseTime(scope.row.createdTime) }}</div>
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="奖级" prop="awardsName" min-width="50" >
  30. <template slot-scope="scope">
  31. <div v-if="scope.row.prizeName != ''">{{ scope.row.awardsName }}</div>
  32. <div v-else> -- </div>
  33. </template>
  34. </el-table-column>
  35. <el-table-column label="奖品名称" prop="prizeName" min-width="85" >
  36. <template slot-scope="scope">
  37. <div v-if="scope.row.prizeType == 'COIN'">盲豆 x{{scope.row.value}}</div>
  38. <div v-else-if="scope.row.prizeName != ''">{{ scope.row.prizeName }}</div>
  39. <div v-else> -- </div>
  40. </template>
  41. </el-table-column>
  42. </el-table>
  43. <pagination
  44. v-show="marketingTotal > 0"
  45. :total="marketingTotal"
  46. :page.sync="pageParams.pageNum"
  47. :limit.sync="pageParams.pageSize"
  48. @pagination="getMarketingData"
  49. />
  50. <div class="dialog-btn">
  51. <el-button size="small" @click="close"> 关 闭 </el-button>
  52. </div>
  53. </el-dialog>
  54. </div>
  55. </template>
  56. <script>
  57. import { getMarketingData, getMarketingDataCodeList } from '@/api/business/marketing'
  58. export default {
  59. name: "CouponAdd",
  60. props: {
  61. dialogVisible: {
  62. type: Boolean,
  63. default: false,
  64. },
  65. ids: {
  66. type: Object,
  67. default: () => []
  68. }
  69. },
  70. data() {
  71. return {
  72. loading: false,
  73. marketingList: [], // 列表
  74. marketingTotal: 0, // 总数
  75. pageParams: {
  76. pageNum: 1,
  77. pageSize: 10,
  78. },
  79. marketingData: {},//
  80. };
  81. },
  82. created() {
  83. this.getMarketingData();
  84. },
  85. methods: {
  86. // 列表
  87. getMarketingData() {
  88. this.loading = true;
  89. getMarketingDataCodeList('pageNum='+this.pageParams.pageNum + '&pageSize='+this.pageParams.pageSize+'&',this.ids.id ).then((res) => {
  90. this.marketingList = res.rows
  91. this.marketingTotal = res.total;
  92. this.loading = false;
  93. });
  94. getMarketingData(this.ids.id ).then((res) => {
  95. if(res.code == 0){
  96. this.marketingData = res.data
  97. }
  98. });
  99. },
  100. close() {
  101. this.$emit("close");
  102. },
  103. },
  104. };
  105. </script>
  106. <style lang="scss" scoped>
  107. .dialog-search {
  108. display: flex;
  109. line-height: 32px;
  110. margin-bottom: 20px;
  111. .ge {
  112. width: 40px;
  113. }
  114. }
  115. .dialog-btn {
  116. display: flex;
  117. align-content: center;
  118. justify-content: flex-end;
  119. padding: 40px 0 0;
  120. .ge {
  121. width: 40px;
  122. }
  123. }
  124. </style>