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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<template>
  <!--
        作者:
        时间:2025-11-18
        描述:插件中心-VIP专区-VIP用户
      -->
  <div class="table-wrap">
    <div class="table-search">
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
        <el-form-item label="用户昵称">
          <el-input v-model="formInline.nick_name" placeholder="用户昵称"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">查询</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div class="table-content">
      <el-table :data="list.data" style="width: 100%">
        <el-table-column prop="user.nickName" label="用户信息">
          <template slot-scope="scope">
            <div class="d-s-c">
              <div class="head-img mr10">
                <img :src="scope.row.user.avatarUrl"  width="30" height="30" />
              </div>
              <div>
                <p>{{ scope.row.user.nickName }}</p>
                <p class="gray9">ID: {{ scope.row.user_id }}</p>
              </div>
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="grade.name" label="会员等级"> </el-table-column>
        <el-table-column prop="money" label="可提现金额">
          <template slot-scope="scope">
            <span class="orange">¥{{ scope.row.money }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="freeze_money" label="提现冻结金额">
          <template slot-scope="scope">
            <span class="orange">¥{{ scope.row.freeze_money }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="total_money" label="已提现金额">
          <template slot-scope="scope">
            <span class="orange">¥{{ scope.row.total_money }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="referee.nickName" label="推荐人"> </el-table-column>
        <el-table-column prop="create_time" label="成为时间" width="140"> </el-table-column>
        <el-table-column fixed="right" label="操作" width="120">
          <template slot-scope="scope">
            <el-button @click="openSubUser(scope.row)" type="text" size="small" >下级用户</el-button>
            <el-button @click="detailedClick(scope.row)" type="text" size="small">提现明细</el-button>
            <el-button @click="editClick(scope.row)" type="text" size="small">修改</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <!--分页-->
    <div class="pagination">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="curPage"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="list.total"
      >
      </el-pagination>
    </div>
 
    <!--编辑用户-->
    <Edit :open_edit="open_edit" :userModel="userModel" @close="closeEditFunc"></Edit>
    <!--查看下级用户-->
    <SubUser :open_dialog="open_dialog" :userModel="userModel" @close="closeFunc"></SubUser>
  </div>
</template>
 
<script>
import vipApi from '@/api/plus/vip.js';
import Edit from './dialog/Edit';
import SubUser from './dialog/SubUser.vue';
 
export default {
  data() {
    return {
      formInline: {
        nick_name: ''
      },
      /*列表*/
      list: [],
      /*分页*/
      curPage: 1,
      pageSize: 10,
      /*是否打开编辑*/
      open_edit: false,
      open_dialog: false,
      /*当前编辑的用户模型*/
      userModel: {}
    };
  },
  components: {
    SubUser,
    Edit
  },
  created() {
    this.getData();
  },
  methods: {
    /*获取数据*/
    getData() {
      let self = this;
      let params = {
        list_rows: self.pageSize,
        page: self.curPage,
        nick_name: self.formInline.nick_name
      };
      vipApi.user(params, true)
        .then(data => {
          self.list = data.data.list;
        })
        .catch(() => {});
    },
 
    /*查询*/
    onSubmit() {
      this.curPage = 1;
      this.getData();
    },
 
    /*分页*/
    handleSizeChange(val) {
      this.pageSize = val;
      this.getData();
    },
    handleCurrentChange(val) {
      this.curPage = val;
      this.getData();
    },
 
    /*提现明细*/
    detailedClick(item) {
      this.$router.push({
        path: '/plus/vip/cash/index',
        query: {
          user_id: item.user_id
        }
      });
    },
    /*打开下级用户弹窗*/
    openSubUser(e){
      this.userModel=e;
      this.open_dialog=true;
    },
 
    /*关闭下级用户弹窗*/
    closeFunc(){
      this.open_dialog=false;
    },
 
    /*修改点击*/
    editClick(item) {
      this.userModel = item;
      this.open_edit = true;
    },
 
    /*关闭弹窗*/
    closeEditFunc(e) {
      this.open_edit = false;
      if (e && e.type == 'success') {
        this.getData();
      }
    }
  }
};
</script>
 
<style>
</style>