Commit 1e04794d authored by liwei's avatar liwei

新增了会员列表搜索功能和页面

parent 57b7cf25
...@@ -92,6 +92,20 @@ export const options = { ...@@ -92,6 +92,20 @@ export const options = {
{ label: '拉祜族', value: 54 }, { label: '拉祜族', value: 54 },
{ label: '仫佬', value: 55 } { label: '仫佬', value: 55 }
], ],
height: [
{ label: '不限', value: '不限' },
{ label: '150-160', value: '150-160' },
{ label: '160-170', value: '160-170' },
{ label: '170-180', value: '170-180' },
{ label: '180以上', value: '180以上' }
],
weight: [
{ label: '不限', value: '不限' },
{ label: '30-40', value: '30-40' },
{ label: '50-60', value: '50-60' },
{ label: '70-80', value: '70-80' },
{ label: '80以上', value: '80以上' }
],
residence: [ residence: [
{ {
label: '北京', label: '北京',
...@@ -1852,7 +1866,7 @@ export const options = { ...@@ -1852,7 +1866,7 @@ export const options = {
] ]
} }
// 获取整个options [{label: a,value: b }] // 获取整个options [{label: a,value: b }]
const opList = ['sex', 'education', 'marriage', 'constellation', 'nation', 'residence','realAuthen'] const opList = ['sex', 'education', 'marriage', 'constellation', 'nation', 'residence','realAuthen','height','weight']
export function getOptions(optionName) { export function getOptions(optionName) {
if (!opList.includes(optionName)) { if (!opList.includes(optionName)) {
return [] return []
......
...@@ -298,7 +298,7 @@ ...@@ -298,7 +298,7 @@
"pages": [{ "pages": [{
"path": "preference/preference", "path": "preference/preference",
"style": { "style": {
"navigationBarTitleText": "推荐设置", "navigationBarTitleText": "筛选设置",
"backgroundColor": "#ffffff", "backgroundColor": "#ffffff",
"backgroundColorTop": "#ffffff", "backgroundColorTop": "#ffffff",
"navigationBarBackgroundColor": "#ffffff" "navigationBarBackgroundColor": "#ffffff"
......
...@@ -4,10 +4,7 @@ ...@@ -4,10 +4,7 @@
<view class="content"> <view class="content">
<!-- 左上角搜索--> <!-- 左上角搜索-->
<u-navbar bgColor="white" :placeholder="true"> <u-navbar bgColor="white" :placeholder="true">
<view class="u-nav-slot" slot="left" @click="screen"> <view class="u-nav-slot" slot="left"></view>
<!-- <image :src="baseUrl+'/index/screen.png'" class="img" mode="aspectFill"></image>-->
<!-- <view class="text">搜索</view>-->
</view>
</u-navbar> </u-navbar>
<view> <view>
...@@ -179,13 +176,6 @@ ...@@ -179,13 +176,6 @@
url: '/pagesUser/userInfo?memberId='+item.businessId url: '/pagesUser/userInfo?memberId='+item.businessId
}) })
}, },
//左上角的搜索
async screen() {
//判断当前是否已登录
uni.navigateTo({
url: '/pagespreference/preference/preference'
});
},
}, },
}; };
</script> </script>
......
<template> <template>
<view style="background-color: #F4F5F9;min-height: 100vh;"> <view style="background-color: #F4F5F9;min-height: 100vh;">
<!-- 页头--> <!-- 页头-->
<u-navbar @leftClick="backbar" bgColor="#F4F5F9" title="会员信息"></u-navbar> <u-navbar bgColor="white" :placeholder="true" title="会员信息">
<view class="u-nav-slot" slot="left">
<u-icon name="arrow-left" color="black" size="20" @click="backbar"/>
<view @click="search" style="display: flex;align-items: center;justify-content: center">
<image :src="baseUrl+'/index/screen.png'" class="img" mode="aspectFill"></image>
<view class="text">筛选</view>
</view>
</view>
</u-navbar>
<view class="recommendation" :style="{'top':navHeight+'px'}"> <view class="recommendation" :style="{'top':navHeight+'px'}">
<view v-if="isdata" class="nodatacard"> <view v-if="isdata" class="nodatacard">
<view class="text">暂无数据</view> <view class="text">暂无数据</view>
...@@ -36,6 +44,7 @@ ...@@ -36,6 +44,7 @@
import {userList} from "../api/user"; import {userList} from "../api/user";
import {getCity, getValue} from "../common/options"; import {getCity, getValue} from "../common/options";
import {calculateAge, parseDate} from "../common"; import {calculateAge, parseDate} from "../common";
import {getOssUrl} from "../api/article";
export default { export default {
data() { data() {
return { return {
...@@ -52,9 +61,8 @@ export default { ...@@ -52,9 +61,8 @@ export default {
isdata: false, isdata: false,
//页面数据的数量 //页面数据的数量
num:'', num:'',
//距离表头 //距离表头高度
navHeight:'', navHeight:'',
share: false,
menuButtonInfo: '', menuButtonInfo: '',
}; };
}, },
...@@ -73,44 +81,86 @@ export default { ...@@ -73,44 +81,86 @@ export default {
statusBarHeight statusBarHeight
} = res; } = res;
const margin = top - statusBarHeight const margin = top - statusBarHeight
this.navHeight = (height + statusBarHeight + (margin * 3)) //导航栏总高 this.navHeight = (height + statusBarHeight + (margin * 5)) //导航栏总高
} }
}) })
//获取用户信息 //获取用户信息
this.getUserList() this.getUserList()
}, },
methods: { methods: {
filterSearch(value) {
let minHeight = ''
let maxHeight = ''
let minWeight = ''
let maxWeight = ''
if (value.memHeight != ''){
minHeight = value.memHeight.split('-')[0]
maxHeight = value.memHeight.split('-')[1]
}
if (value.memWeight != ''){
minWeight = value.memWeight.split('-')[0]
maxWeight = value.memWeight.split('-')[1]
}
console.log('======params======', value)
this.queryParam = {
page: 1,
rows: 10,
memCareer:value.memCareer,
memCollege:value.memCollege,
memSex: value.memSex,
minHeight: minHeight,
maxHeight: maxHeight,
minWeight: minWeight,
maxWeight: maxWeight,
memResidenceProvince: value.memResidenceProvince,
memResidenceCity: value.memResidenceCity
}
this.getUserList()
},
//左上角的搜索
search() {
//判断当前是否已登录
uni.navigateTo({
url: '/pagespreference/preference/preference'
});
},
//跳转用户详情 //跳转用户详情
gotoDetail(item){ gotoDetail(item){
uni.navigateTo({ uni.navigateTo({
url: '/pagesUser/userInfo?id='+item.userId url: '/pagesUser/userInfo?id='+item.userId
}) })
}, },
//获取用户列表数据
getUserList() { getUserList() {
const query = { userList(this.queryParam).then(res =>{
page: this.queryParam.page,
rows: this.queryParam.rows
}
userList(query).then(res =>{
this.userList = res.data.data this.userList = res.data.data
//遍历this.userList //遍历this.userList
this.userList.forEach(item => { this.userList.forEach(item => {
//处理头像 //处理头像
item.avatarUrl = item.avatarUrl.replace(/\\/g, '/') // 替换 avatarUrl 中的所有 \ 为 / if (item.avatar != null && item.avatar != ''){
getOssUrl(item.avatar).then(res => {
item.avatarUrl = res.data.data
})
}
//处理性别 //处理性别
item.memSex = getValue('sex',item.memSex) if (item.memSex != null && item.memSex != ''){
item.memSex = getValue('sex',item.memSex)
}
//处理年龄 //处理年龄
const birthdayItem = parseDate(item.memBirthday) if (item.memBirthday != null && item.memBirthday != ''){
item.memAge = calculateAge(birthdayItem.year,birthdayItem.month,birthdayItem.day) const birthdayItem = parseDate(item.memBirthday)
item.memAge = calculateAge(birthdayItem.year,birthdayItem.month,birthdayItem.day)
}
//处理地址 //处理地址
item.city = getCity(item.memResidenceProvince,item.memResidenceCity) if (item.memResidenceProvince != null && item.memResidenceProvince != '' && item.memResidenceCity != null && item.memResidenceCity != ''){
item.city = getCity(item.memResidenceProvince,item.memResidenceCity)
}
}); });
}).catch(e => { }).catch(e => {
console.log(e) console.log(e)
}) })
}, },
//返回按钮
backbar() { backbar() {
uni.navigateBack({ uni.navigateBack({
delta: 1, //返回层数,2则上上页 delta: 1, //返回层数,2则上上页
...@@ -121,9 +171,29 @@ export default { ...@@ -121,9 +171,29 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.u-nav-slot {
display: flex;
align-items: center;
.text {
height: 44rpx;
font-size: 32rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #000000;
margin-left: 14rpx;
line-height: 44rpx;
}
.img {
width: 22rpx;
height: 28rpx;
margin-left: 32rpx;
}
}
.recommendation { .recommendation {
background-color: #F4F5F9; background-color: #F4F5F9;
position: relative; position: absolute;
padding: 0 34rpx; padding: 0 34rpx;
.nodatacard{ .nodatacard{
height: 100vh; height: 100vh;
......
This diff is collapsed.
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