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
<template>
<div class="user" v-loading="loading">
<el-form ref="searchFrom" :model="searchFrom" label-width="80px" inline>
<el-form-item label="ID">
<el-input v-model="searchFrom.user_id"></el-input>
</el-form-item>
<el-form-item>
<div class="flexRow">
<el-button type="primary" plain @click="getUser">搜索</el-button>
<!--<el-button type="success" plain @click="syncUser">同步最新数据</el-button>-->
</div>
</el-form-item>
</el-form>
<el-table
:data="userList"
style="width: 100%">
<el-table-column
className="f-c"
label="用户">
<template slot-scope="scope">
<img class="avatar" :src="scope.row.user_avatar">{{scope.row.user_nickname}}(ID:{{scope.row.user_id}})
</template>
</el-table-column>
<el-table-column
prop="user_mobile"
label="手机号">
</el-table-column>
<el-table-column
prop="created_at"
label="注册时间" sortable>
</el-table-column>
<el-table-column
prop="last_login_at"
label="最后登录时间" sortable>
</el-table-column>
<el-table-column
prop="course_title"
label="课程标题" >
</el-table-column>
<el-table-column
prop="goods_name"
label="优惠券" >
</el-table-column>
<el-table-column
prop="order_id"
label="订单Id" >
</el-table-column>
<!-- <el-table-column
label="操作">
<template slot-scope="scope">
<el-button size="mini" plain type="primary" @click="goToDetail(scope.row.user_id)">
查看详情
</el-button>
</template>
</el-table-column> -->
</el-table>
<page :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange"/>
</div>
</template>
<script>
import {getAutomationListApi,getSyncUserApi} from "../../service/api";
import page from '../framework/page'
export default {
name: "index",
data(){
return {
searchFrom:{
nickName:'',
mobile:'',
level:'',
userId: ''
},
dialogDetail:{
show:false,
id:''
},
userList:[],
total:0,
nowPage:1,
limit: 10,
showDetail:false,
showId:'',
dialogObj:{
show:false,
title:'绑定老师',
id:0,
teacher_id: 0
},
dialogDetailObj: {
show: false,
id: ''
},
loading: false
}
},
components:{
page,
},
mounted(){
this.getUser()
},
methods:{
sexFormatter(item){
if(item.sex==0){
return '保密'
}
if(item.sex==1){
return '男'
}
if(item.sex==2){
return '女'
}
},
onPageChange(val){
this.nowPage = val
this.getUser()
},
onSizeChange(val){
this.limit = val;
this.nowPage = 1;
this.getUser()
},
getUser(){
let json = {
page: this.nowPage,
limit: this.limit
}
if(this.searchFrom.user_id){
json.user_id = this.searchFrom.user_id
}
getAutomationListApi(json).then(res =>{
console.log(res)
this.userList = res.result.list
this.total = res.result.total
})
}
}
}
</script>
<style scoped lang="less">
@import "../../util/public";
.avatar {
width: 50px;
margin-right: 5px;
border-radius: 50%;
height: 50px;
}
.user{
height: 100%;
overflow: auto;
padding: 20px 0;
.btn-content{
text-align: center;
}
}
.flexRow {
display: flex;
flex-flow: row;
justify-content: flex-start;
align-items: center;
}
</style>
<style>
.f-c > div {
display: flex !important;
flex-flow: row;
justify-content: flex-start;
align-items: center;
}
</style>