hejianhao
2025-04-16 dab2d210ca06c1faa514c6388fbd5de1ab355360
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<template>
  <div class="cor-bus">
    <v-header
      title="积分明细"
      search
      :bar="bar"
      @on-search="onSearch"
    ></v-header>
    <div>
      <v-tool-table
        :trs="trs"
        :tds="tds"
      >
        <template v-slot:times="{scope}">
          <span v-if="scope.identityType == '1'">居民</span>
          <span v-if="scope.identityType == '2'">党员</span>
          <span v-if="scope.identityType == '3'">志愿者</span>
        </template>
      </v-tool-table>
    </div>
    <v-tool-page
      :item="paged"
      @on-page="onPage"
    ></v-tool-page>
  </div>
</template>
<script>
export default {
  name: "index",
  props: [],
  components: {},
  data() {
    return {
      bar: [
        { title: "姓名", name: "name", value: "" },       
        { title: "手机号", name: "phone"},       
        { title: "用户身份", name: "userIdentity", type: "select",
          list: [
            { label: "居民", value: 1 },
            { label: "党员", value: 2 },
            { label: "志愿者", value: 3 },
          ],
        },
        { title: "积分账户类型", name: "identityType", type: "select",
          list: [
            { label: "居民", value: 1 },
            { label: "党员", value: 2 },
            { label: "志愿者", value: 3 },
          ],
        },
        ],
      trs: [
        { text: "昵称", val: "nickName"},
        { text: "姓名", val: "name", width: "" },
        { text: "用户账号", val: "phone"},
        { text: "用户身份", val: "identity" },
        { text: "积分", val: "amount" },
        { text: "积分账户类型", val: "btn", slot: "times" },
        { text: "原因", val: "remark" },
        { text: "时间", val: "createAt" },
      ],
      search:{},
      tds: [],
      paged: { page: 0, total: 10, r: 0, limit: 10 },
    };
  },
 
  created() {},
 
  mounted() {},
 
  methods: {
    onSearch(v) {
      console.log(v)
      this.search = v;
      this.init();
    },
 
    onPage(v) {
      //分页
      if (v.page === this.paged.page && v.page && !v.reset) {
        return 0;
      }
      this.paged.page = v.page;
      this.paged.limit = v.limit;
      this.init();
    },
 
    init() {
      let os = demo.copy(this.search,
        Object.assign({
          pageNum: this.paged.page,
          pageSize: this.paged.limit,
        })
      );
      this.$api.post("integral/user/trade/page", os, (e) => {
        this.tds = e.records;
        this.paged.total = e.total;
      });
    },
 
  },
};
</script>
<style scoped>
  .cor-bus{
    overflow: scroll;
  }
.but {
  padding-bottom: 20px;
  display: flex;
}
</style>