meOperate.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view>
  3. <view class="uni-container">
  4. <uni-table ref="table" :loading="loading" border stripe type="selection" emptyText="暂无更多数据">
  5. <uni-tr>
  6. <uni-th align="center">姓名</uni-th>
  7. <uni-th align="center">积分变动</uni-th>
  8. <uni-th align="center">剩余积分</uni-th>
  9. <uni-th align="center">积分变动来源</uni-th>
  10. <uni-th align="center">时间</uni-th>
  11. </uni-tr>
  12. <uni-tr v-for="(item, index) in tableData" :key="index">
  13. <uni-td>{{item.name == null || item.name == '' ? item.wechatName : item.name}}</uni-td>
  14. <uni-td>{{ item.scoreOperate }}</uni-td>
  15. <uni-td align="center">{{ item.scoreNum }}</uni-td>
  16. <uni-td align="center">{{ item.relevance }}</uni-td>
  17. <uni-td align="center">{{ item.createTime }}</uni-td>
  18. </uni-tr>
  19. </uni-table>
  20. <view class="uni-pagination-box">
  21. <uni-pagination show-icon :page-size="queryParams.pageSize" :current="queryParams.pageNum" :total="total" @change="change" />
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import {listScoreInfo} from '@/api/me/meOperate.js';
  28. export default {
  29. data() {
  30. return {
  31. searchVal: '',
  32. tableData: [],
  33. // 数据总量
  34. total: 0,
  35. userId : null,
  36. queryParams:{
  37. // 当前页
  38. pageNum: 1,
  39. // 每页数据量
  40. pageSize: 10,
  41. //请求参数
  42. userId: getApp().globalData.userId
  43. },
  44. loading: false,
  45. };
  46. },
  47. onLoad() {
  48. this.selectedIndexs = [];
  49. this.getData(1);
  50. },
  51. methods: {
  52. // 分页触发
  53. change(e) {
  54. this.$refs.table.clearSelection();
  55. this.selectedIndexs.length = 0;
  56. this.getData(e.current);
  57. },
  58. // 获取数据
  59. getData(pageNum) {
  60. this.loading = true;
  61. this.queryParams.pageNum = pageNum;
  62. listScoreInfo(this.queryParams).then(res =>{
  63. this.tableData = res.rows
  64. this.total = res.total
  65. this.loading = false;
  66. });
  67. }
  68. }
  69. };
  70. </script>
  71. <style>
  72. @import './meOperate.css';
  73. </style>