From afa92f097732a5881fabfc3641bffc17f1038493 Mon Sep 17 00:00:00 2001 From: callmeyan Date: Sat, 22 Jun 2019 22:04:08 +0800 Subject: [PATCH] todo user index --- src/pages/user/Index.vue | 94 ++++++++++++++++++++++++++-------------- src/service/api.js | 3 ++ 2 files changed, 65 insertions(+), 32 deletions(-) diff --git a/src/pages/user/Index.vue b/src/pages/user/Index.vue index c445127..dd8e382 100644 --- a/src/pages/user/Index.vue +++ b/src/pages/user/Index.vue @@ -3,23 +3,23 @@
- + @@ -68,16 +66,21 @@ - - - + + + + + + + + -
@@ -94,13 +97,14 @@ height: 176, weight: 106, address: '北京', - smoke: '北京', - drink: '北京', + smoke: '不抽烟', + drink: '是', is_first_to_tibet: 1, medical_history: 1, medical_history_data: '反流性食道炎、、结肠炎', } import cities from '../../utils/distpicker'; + import {userSearch} from './../../service/api'; export default { name: "Index", @@ -109,17 +113,24 @@ provinces: cities, cities: [], searchModel: { - first_to_tibet: '', - province: '', - city: '' + is_first: '-1', + province: '-1', + city: '-1', + gender: '-1', + page: 1, + pageSize: 20, + name: '' }, - userList: Array(5).fill(userObj), - currentPage: 1, + userList: [], totalCount: 401 } }, filters: { - firstToTibet(v) { + formatMedical(v) { + if (!!v && Array.isArray(v)) return v.join('、'); + return '无'; + }, + formatYesNo(v) { return v == 1 ? "是" : "否"; }, formatGender(v) { @@ -132,6 +143,9 @@ return v + 'kg'; } }, + mounted() { + this.onSearch(); + }, methods: { handleProvinceChange(provinceId) { for (var i = 0; i < cities.length; i++) { @@ -141,8 +155,10 @@ } } }, - onSearch() { - + async onSearch() { + let data = await userSearch(this.searchModel); + this.userList = data.list; + this.totalCount = data.totalCount; }, handleSizeChange() { @@ -178,13 +194,27 @@ border-radius: 50%; } .info { - float: left; vertical-align: middle; padding-left: 10px; + position: relative; + height: 80px; + padding-top: 10px; + margin-left: 80px; p { height: 30px; line-height: 30px; } + .open-id { + position: absolute; + top: 40px; + left: 10px; + overflow: hidden; + } + } + &:hover { + .open-id { + overflow: visible; + } } } \ No newline at end of file diff --git a/src/service/api.js b/src/service/api.js index 9255e46..38e2c28 100644 --- a/src/service/api.js +++ b/src/service/api.js @@ -17,6 +17,9 @@ export async function adminLogin(params = {}) { export async function evaluationSearch(params = {}) { return get(`/admin/searchEvaluation?${stringify(params)}`); } +export async function userSearch(params = {}) { + return get(`/admin/searchUser?${stringify(params)}`); +} export async function queryNews(params = {}) { return get(`/news/index?${stringify(params)}`);