Commit f3b8fbae authored by liwei's avatar liwei

liwei

parent 94e93dd6
This diff is collapsed.
This diff is collapsed.
<template> <template>
<div class="integral-page"> <div class="integral-page">
<el-form ref="searchFrom" :model="searchFrom" style="padding-top:20px;" label-width="80px" inline> <el-form
ref="searchFrom"
:model="searchFrom"
style="padding-top:20px;"
label-width="80px"
inline
>
<el-form-item label="主账户ID"> <el-form-item label="主账户ID">
<el-input v-model="searchFrom.user_id"></el-input> <el-input v-model="searchFrom.user_id"></el-input>
</el-form-item> </el-form-item>
...@@ -11,126 +17,119 @@ ...@@ -11,126 +17,119 @@
<el-button type="primary" plain @click="getUser">搜索</el-button> <el-button type="primary" plain @click="getUser">搜索</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="userList" :style="{width: width+'px'}">
:data="userList" <el-table-column class="f-c" label="主账户">
style="width: 100%">
<el-table-column
className="f-c"
label="主账户">
<template slot-scope="scope"> <template slot-scope="scope">
<img class="avatar" :src="scope.row.user_avatar">{{scope.row.user_nickname}}(ID:{{scope.row.user_id}}) <img class="avatar" :src="scope.row.user_avatar" />
{{scope.row.user_nickname}}(ID:{{scope.row.user_id}})
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column class="f-c" label="子账户">
className="f-c"
label="子账户">
<template slot-scope="scope"> <template slot-scope="scope">
<img class="avatar" :src="scope.row.sub_user_avatar">{{scope.row.sub_user_nickname}}(ID:{{scope.row.sub_user_id}}) <img class="avatar" :src="scope.row.sub_user_avatar" />
{{scope.row.sub_user_nickname}}(ID:{{scope.row.sub_user_id}})
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="created_at" label="绑定时间"></el-table-column>
prop="created_at" <el-table-column prop="unbind_at" label="解绑时间">
label="绑定时间"> <template
</el-table-column> slot-scope="scope"
<el-table-column >{{scope.row.unbind_at=='0000-00-00 00:00:00'?'未解绑':scope.row.unbind_at}}</template>
prop="unbind_at"
label="解绑时间">
<template slot-scope="scope">
{{scope.row.unbind_at=='0000-00-00 00:00:00'?'未解绑':scope.row.unbind_at}}
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<page :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange"/> <page :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange" />
</div> </div>
</template> </template>
<script> <script>
import {getSubAccountListApi,getOldListApi} from "../../service/api"; import { getSubAccountListApi, getOldListApi } from "../../service/api";
import {INTEGRALTYPE,INTEGRALFUN} from "../../util/wordbook"; import { INTEGRALTYPE, INTEGRALFUN } from "../../util/wordbook";
import page from '../framework/page' import page from "../framework/page";
export default { export default {
name: "index", name: "index",
components: { components: {
page page
}, },
data(){ data() {
let is_addOption = []; let is_addOption = [];
for(let k in INTEGRALTYPE){ for (let k in INTEGRALTYPE) {
is_addOption.push({id:k,value:INTEGRALTYPE[k]}) is_addOption.push({ id: k, value: INTEGRALTYPE[k] });
} }
let sourceOption = []; let sourceOption = [];
for(let j in INTEGRALFUN){ for (let j in INTEGRALFUN) {
sourceOption.push({id:j,value:INTEGRALFUN[j]}) sourceOption.push({ id: j, value: INTEGRALFUN[j] });
} }
return { return {
searchFrom:{ width: 0,
user_id:'', searchFrom: {
sub_user_id:"" user_id: "",
sub_user_id: ""
}, },
userList:[], userList: [],
total:0, total: 0,
nowPage:1, nowPage: 1,
limit: 10, limit: 10,
showDetail:false showDetail: false
} };
}, },
mounted(){ mounted() {
this.getUser() this.getUser();
this.width = window.innerWidth - 200;
}, },
filters:{ filters: {
INTEGRALTYPE(value){ INTEGRALTYPE(value) {
return INTEGRALTYPE[value] return INTEGRALTYPE[value];
}, },
INTEGRALFUN(value){ INTEGRALFUN(value) {
return INTEGRALFUN[value] return INTEGRALFUN[value];
} }
}, },
methods:{ methods: {
onPageChange(val){ onPageChange(val) {
this.nowPage = val this.nowPage = val;
this.getUser() this.getUser();
}, },
onSizeChange(val){ onSizeChange(val) {
this.limit = val; this.limit = val;
this.nowPage = 1; this.nowPage = 1;
this.getUser() this.getUser();
}, },
getUser(){ getUser() {
let json = { let json = {
page: this.nowPage, page: this.nowPage,
limit: this.limit limit: this.limit
} };
if (this.searchFrom.user_id) { if (this.searchFrom.user_id) {
json.user_id = this.searchFrom.user_id json.user_id = this.searchFrom.user_id;
} }
if (this.searchFrom.sub_user_id) { if (this.searchFrom.sub_user_id) {
json.sub_user_id = this.searchFrom.sub_user_id json.sub_user_id = this.searchFrom.sub_user_id;
} }
getSubAccountListApi(json).then(res=>{ getSubAccountListApi(json).then(res => {
this.userList = res.list; this.userList = res.list;
this.total = res.total this.total = res.total;
}) });
}
} }
} }
};
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
@import "../../util/public"; @import "../../util/public";
.avatar{ .avatar {
width: 50px; width: 50px;
min-width: 50px; min-width: 50px;
height: 50px; height: 50px;
margin-right: 5px; margin-right: 5px;
border-radius: 50%; border-radius: 50%;
} }
</style> </style>
<style> <style>
.f-c > .cell { .f-c > .cell {
display: flex !important; display: flex !important;
flex-flow: row; flex-flow: row;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment