list.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <cl-crud class="liu-crud-wrap" @load="onLoad">
  3. <template #slot-tabs="{ scope }">
  4. <el-tabs class="liu-tabs" type="border-card">
  5. <el-tab-pane label="全部 (152)"></el-tab-pane>
  6. <el-tab-pane label="粉丝 (112)"></el-tab-pane>
  7. <el-tab-pane label="会员(82)"></el-tab-pane>
  8. </el-tabs>
  9. </template>
  10. <template #table-column-avatarUrl="{scope}">
  11. <cl-avatar
  12. shape="square"
  13. :size="40"
  14. :src="scope.row.avatarUrl | default_avatar"
  15. :style="{ margin: 'auto' }"
  16. ></cl-avatar>
  17. </template>
  18. <template #table-column-balance="{scope}">
  19. <span>{{ scope.row.userAsset.balance }}</span>
  20. </template>
  21. <template #table-column-growth="{scope}">
  22. <span>{{ scope.row.userAsset.growth }}</span>
  23. </template>
  24. <!-- 充值 -->
  25. <template #slot-recharge="{scope}">
  26. <el-button type="text">充值</el-button>
  27. </template>
  28. <!-- 升级 -->
  29. <template #slot-upgrade="{scope}">
  30. <el-button type="text">升级</el-button>
  31. </template>
  32. <!-- 发货 -->
  33. <template #slot-ship="{scope}">
  34. <el-button type="text">发货</el-button>
  35. </template>
  36. </cl-crud>
  37. </template>
  38. <script>
  39. export default {
  40. methods: {
  41. onLoad({ ctx, app }) {
  42. ctx.service(this.$service.member)
  43. .set('table', {
  44. columns: [
  45. {
  46. prop: 'id',
  47. label: 'ID',
  48. align: 'center'
  49. },
  50. {
  51. prop: 'avatarUrl',
  52. label: '头像',
  53. align: 'center'
  54. },
  55. {
  56. prop: 'userName',
  57. label: '来源 昵称',
  58. align: 'center'
  59. },
  60. {
  61. prop: 'mobile',
  62. label: '手机号',
  63. align: 'center'
  64. },
  65. {
  66. prop: 'actPrice',
  67. label: '会员级别',
  68. align: 'center',
  69. emptyText: '无',
  70. 'min-width': 150
  71. },
  72. {
  73. prop: 'balance',
  74. label: '余额',
  75. align: 'center'
  76. },
  77. {
  78. prop: 'growth',
  79. label: '成长值',
  80. align: 'center'
  81. },
  82. {
  83. prop: 'subscribe',
  84. label: '关注公众号',
  85. align: 'center',
  86. sortable: true,
  87. width: 150
  88. },
  89. {
  90. prop: 'visitTimeFormat',
  91. label: '最近访问',
  92. align: 'center'
  93. }
  94. ],
  95. // 操作列
  96. op: {
  97. visible: true, // 是否显示
  98. // 同 element-ui Table-column Attributes
  99. props: {
  100. width: 150,
  101. align: 'center',
  102. fixed: 'right',
  103. label: '操作'
  104. },
  105. // 布局,请移步 `layout`
  106. layout: ['slot-recharge', 'slot-upgrade', 'slot-ship']
  107. }
  108. })
  109. .set('layout', [
  110. ['slot-tabs'],
  111. ['search-key', 'flex1', 'refresh-btn', 'add-btn'],
  112. ['data-table'],
  113. ['flex1', 'pagination']
  114. ])
  115. .done();
  116. app.refresh({ status: 0 });
  117. }
  118. }
  119. };
  120. </script>