index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <div class="">
  3. <div class="m-10 bg-w p-20 br-10">
  4. <div class="f-sa-s">
  5. <div class="f-fs-c f-col">
  6. <div style="font-size: 16px;">总下载量</div>
  7. <div class="mt-4" style="font-weight: bold; font-size: 18px;">
  8. {{ statistics.all }}
  9. </div>
  10. </div>
  11. <div class="f-fs-c f-col">
  12. <div style="font-size: 16px;">月下载量</div>
  13. <div class="mt-4" style="font-weight: bold; font-size: 18px;">
  14. {{ statistics.month }}
  15. </div>
  16. </div>
  17. <div class="f-fs-c f-col">
  18. <div style="font-size: 16px;">周下载量</div>
  19. <div class="mt-4" style="font-weight: bold; font-size: 18px;">
  20. {{ statistics.week }}
  21. </div>
  22. </div>
  23. </div>
  24. <div class="f-sa-s mt-20">
  25. <div class="f-fs-c f-col">
  26. <div style="font-size: 16px;">总下载金额</div>
  27. <div class="mt-4" style="font-weight: bold; font-size: 18px;">
  28. {{ statistics.sumPaidPrice }}
  29. </div>
  30. </div>
  31. <div class="f-fs-c f-col">
  32. <div style="font-size: 16px;">总下载积分</div>
  33. <div class="mt-4" style="font-weight: bold; font-size: 18px;">
  34. {{ statistics.sumPoints }}
  35. </div>
  36. </div>
  37. <div class="f-fs-c f-col">
  38. <div style="font-size: 16px;">&nbsp;</div>
  39. <div class="mt-4" style="font-weight: bold; font-size: 18px;">
  40. &nbsp;
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <toolbar @on-filter="filterData" @on-reset="filterData" />
  46. <base-table
  47. class="m-10 bg-w p-20 br-10"
  48. :columns="columns"
  49. :items="items"
  50. :pagination="pagination"
  51. :page-change="pageChange"
  52. />
  53. </div>
  54. </template>
  55. <script>
  56. import toolbar from './toolbar';
  57. import mxFilterList from '@/mixins/filterList';
  58. import { getDownloadPage, getDownloadCount } from '@/api/statistics';
  59. export default {
  60. name: 'DownloadImage',
  61. components: { toolbar },
  62. mixins: [
  63. mxFilterList({
  64. fetchList: getDownloadPage // 在下方data再声明一个 fetchList: iGetList 同等效果
  65. })
  66. ],
  67. data() {
  68. return {
  69. columns: [
  70. {
  71. key: 'orderId',
  72. name: '订单编号',
  73. width: '160'
  74. },
  75. {
  76. key: 'kindergartenName',
  77. name: '幼儿园',
  78. },
  79. {
  80. key: 'activityName',
  81. name: '活动',
  82. },
  83. {
  84. key: 'listPreview',
  85. name: '图片',
  86. width: '180',
  87. render: (h, { row }) =>
  88. h('img', {
  89. style: {
  90. width: '160px',
  91. height: '90px'
  92. },
  93. class: 'pre-img',
  94. attrs: {
  95. src: row.listPreview
  96. },
  97. on: {
  98. click: () =>
  99. this.$AdvanceViewImageModal({
  100. items: [{ src: row.listPreview }]
  101. })
  102. }
  103. })
  104. },
  105. {
  106. key: 'tempType',
  107. name: '照片类型',
  108. render: (h, { row }) => {
  109. if (row.isHdLogoPhoto) {
  110. return h('span', '高清图');
  111. }
  112. if (row.isOriginPhoto) {
  113. return h('span', '原图');
  114. }
  115. }
  116. },
  117. {
  118. key: 'nickname',
  119. name: '下载用户',
  120. },
  121. {
  122. key: 'payChannels',
  123. name: '支付渠道',
  124. width: this.$col.m
  125. },
  126. {
  127. key: 'payablePrice',
  128. name: '花费金额/积分(还没折算)',
  129. width: this.$col.b,
  130. render: (h,{row}) => h('span',`¥${row.payablePrice}`)
  131. },
  132. {
  133. key: 'photoTime',
  134. name: '拍摄时间',
  135. width: this.$col.b
  136. },
  137. {
  138. key: 'createAt',
  139. name: '下载时间',
  140. width: this.$col.b
  141. }
  142. ],
  143. statistics: {}
  144. };
  145. },
  146. methods:{
  147. async pageChange(page) {
  148. this.pagination.page = page;
  149. const inParams = {
  150. ...this.filter,
  151. ...this.internalFilterObj,
  152. page: this.pagination.page,
  153. size: this.pagination.pageSize
  154. };
  155. const { data, msg } = await this.apiList(inParams, {
  156. limit: this.pagination.pageSize,
  157. start: this.pagination.page
  158. });
  159. const res2 = await getDownloadCount(inParams)
  160. this.statistics = res2.data
  161. if ('data' in data) {
  162. const items = data.data;
  163. if (items.length === 0 && this.pagination.page > 1) {
  164. this.pageChange(1);
  165. } else {
  166. this.items = items;
  167. this.pagination.total = data.total;
  168. }
  169. this.loadCallBack(data);
  170. }
  171. }
  172. }
  173. };
  174. </script>
  175. <style type="scss" scoped></style>