quanwei
18 hours ago c441dea81bd86bdfb12dff35821fed51f4cc91c2
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<template>
  <!--
          作者:luoyiming
          时间:2020-06-01
          描述:插件中心-分销-队长用户-查看下级用户
      -->
  <div>
    <el-dialog title="队员" :visible.sync="dialogVisible" @close="dialogFormVisible" :close-on-click-modal="true" :close-on-press-escape="false">
      <!--table-->
      <div class="mt16">
        <el-table size="small" :data="tableData" border style="width: 100%" v-loading="loading">
          <el-table-column prop="user_id" label="用户ID"></el-table-column>
          <el-table-column prop="nickName" label="微信头像">
            <template slot-scope="scope">
              <img class="radius" v-img-url="scope.row.user.avatarUrl" width="30" height="30" />
            </template>
          </el-table-column>
          <el-table-column prop="user.nickName" label="    微信昵称"></el-table-column>
          <el-table-column prop="user.mobile" label="手机号"></el-table-column>
          <el-table-column prop="create_time" label="加入时间"></el-table-column>
        </el-table>
      </div>
 
      <!--分页-->
      <div class="pagination">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          background
          :current-page="curPage"
          :page-size="pageSize"
          layout="total, prev, pager, next, jumper"
          :total="totalDataNumber"
        ></el-pagination>
      </div>
 
    </el-dialog>
  </div>
</template>
 
<script>
import PlusApi from '@/api/plus/team.js';
export default {
  data() {
    return {
      /*是否显示*/
      dialogVisible: false,
      /*是否正在加载*/
      loading:true,
      /*当前第几级*/
      level: '1',
      /*列表数据*/
      tableData: [],
      /*一页多少条*/
      pageSize: 20,
      /*一共多少条数据*/
      totalDataNumber: 0,
      /*当前是第几页*/
      curPage: 1
    };
  },
  props: {
    open_dialog: Boolean,
    userModel:Object
  },
  watch: {
    open_dialog: function(n, o) {
      if (n != o) {
        this.dialogVisible = this.open_dialog;
        if(n){
          this.getData();
        }
      }
    }
  },
  created() {
 
  },
  methods: {
 
    /*切换等级*/
    changFunc(e){
      this.getData();
    },
 
    /*选择第几页*/
    handleCurrentChange(val) {
      let self = this;
      self.curPage = val;
      self.loading = true;
      self.getData();
    },
 
    /*获取数据*/
    getData() {
      let self = this;
      let Params = {};
      Params.page = self.curPage;
      Params.list_rows = self.pageSize;
      Params.user_id=self.userModel.user_id;
      Params.level=self.level;
      PlusApi.teamUserFans(Params, true)
        .then(data => {
          self.loading = false;
          self.tableData = data.data.list.data;
        })
        .catch(error => {});
    },
 
    /*每页多少条*/
    handleSizeChange(val) {
      this.curPage = 1;
      this.pageSize = val;
      this.getData();
    },
 
    /*关闭弹窗*/
    dialogFormVisible(e) {
      this.$emit('close', {});
    }
  }
};
</script>
 
<style scoped>
.el-dialog__body {
  padding: 10px 20px;
}
</style>