quanwei
2 days ago 04102f7237efefa744090ed7c25f7b5d0807b679
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
<template>
  <div>
    <div class="table-wrap">
      <el-table :data="tableData" style="width: 100%" v-loading="loading">
        <el-table-column prop="user.nickName" label="昵称"></el-table-column>
        <el-table-column label="微信头像">
          <template slot-scope="scope">
            <img :src="scope.row.user.avatarUrl" width="30px" height="30px" />
          </template>
        </el-table-column>
        <el-table-column prop="gender" label="性别">
          <template slot-scope="scope">
            {{ scope.row.user.gender | convertSex }}
          </template>
        </el-table-column>
        <el-table-column prop="user.country" label="国家"></el-table-column>
        <el-table-column prop="user.province" label="省份"></el-table-column>
        <el-table-column prop="user.city" label="城市"></el-table-column>
        <el-table-column prop="create_time" label="关注时间" width="140"></el-table-column>
      </el-table>
 
      <!--分页-->
      <div class="pagination">
        <el-pagination background :current-page="curPage" :page-size="pageSize" layout="total, prev, pager, next, jumper" :total="totalDataNumber"></el-pagination>
      </div>
    </div>
  </div>
</template>
 
<script>
import FansApi from '@/api/fans.js';
export default {
  components: {},
  data() {
    return {
      /*表单数据*/
      tableData: [],
      loading: true,
      /*一页多少条*/
      pageSize: 20,
      /*一共多少条数据*/
      totalDataNumber: 0,
      /*当前是第几页*/
      curPage: 1
    };
  },
  created() {
    /*获取列表*/
    this.getData();
  },
  methods: {
    /*获取列表*/
    getData() {
      let self = this;
      let Params = {};
      Params.page = self.curPage;
      FansApi.fansList(Params, true)
        .then(data => {
          self.loading = false;
          self.tableData = data.data.list.data;
          self.totalDataNumber = data.data.list.total;
        })
        .catch(error => {
          self.loading = false;
        });
    },
    /*选择第几页*/
    handleCurrentChange(val) {
      let self = this;
      self.curPage = val;
      self.loading = true;
      self.getData();
    },
  }
};
</script>
 
<style></style>