Commit c4338955 authored by liwei's avatar liwei

修改了我的页面的,三种类型的会员列表查询

parent 736a59cb
...@@ -44,25 +44,25 @@ ...@@ -44,25 +44,25 @@
<text v-else>0</text> <text v-else>0</text>
</view> </view>
<view class="top-tabs"> <view class="top-tabs">
<view class="tab-1" @click="gotolike(1,info.ilike)"> <view class="tab-1" @click="gotolike(1,info.meFollowCount)">
<view class="tab-1-num"> <view class="tab-1-num">
<text v-if="info.ilike">{{info.ilike}}</text><text v-else>0</text> <text v-if="info.meFollowCount">{{info.meFollowCount}}</text><text v-else>0</text>
</view> </view>
<view class="tab-1-text"> <view class="tab-1-text">
我喜欢的 我喜欢的
</view> </view>
</view> </view>
<view class="tab-2" style="margin: 0 136rpx;" @click="gotolike(2,info.likeMe)"> <view class="tab-2" style="margin: 0 136rpx;" @click="gotolike(2,info.followMeCount)">
<view class="tab-2-num"> <view class="tab-2-num">
<text v-if="info.likeMe">{{info.likeMe}}</text><text v-else>0</text> <text v-if="info.followMeCount">{{info.followMeCount}}</text><text v-else>0</text>
</view> </view>
<view class="tab-2-text"> <view class="tab-2-text">
喜欢我的 喜欢我的
</view> </view>
</view> </view>
<view class="tab-3" @click="gotolike(3,info.lovers)"> <view class="tab-3" @click="gotolike(3,info.eachFollowCount)">
<view class="tab-3-num"> <view class="tab-3-num">
<text v-if="info.lovers">{{info.lovers}}</text><text v-else>0</text> <text v-if="info.eachFollowCount">{{info.eachFollowCount}}</text><text v-else>0</text>
</view> </view>
<view class="tab-3-text"> <view class="tab-3-text">
互相喜欢 互相喜欢
......
...@@ -14,16 +14,16 @@ ...@@ -14,16 +14,16 @@
<view class="card-bottom"> <view class="card-bottom">
<view class="bottom-left"> <view class="bottom-left">
<view class="bottom-info"> <view class="bottom-info">
{{item.nickName}} {{item.memNickName}}
<image v-if="item.gender == 'MALE'" class="gender" :src="baseUrl+'/user/male.png'" mode=""/> <image v-if="item.memSex === '0'" class="gender" :src="baseUrl+'/user/male.png'" mode=""/>
<image v-else class="gender" :src="baseUrl+'/user/famale.png'" mode=""/> <image v-else class="gender" :src="baseUrl+'/user/famale.png'" mode=""/>
</view> </view>
<view class="bottom-info"> <view class="bottom-info">
{{item.age}} {{item.memAge}}
<text style="margin-left: 10rpx;margin-right: 10rpx;color: #BBB9B9FF;">|</text> <text style="margin-left: 10rpx;margin-right: 10rpx;color: #BBB9B9FF;">|</text>
{{item.height}}cm {{item.memHeight}}cm
</view> </view>
<view class="bottom-address">{{item.address}}</view> <view class="bottom-address">{{item.city}}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -33,56 +33,18 @@ ...@@ -33,56 +33,18 @@
</template> </template>
<script> <script>
import {userList} from "../../api/user";
import {getOssUrl} from "../../api/article";
import {getCity, getValue} from "../../common/options";
import {calculateAge, parseDate} from "../../common";
export default { export default {
data() { data() {
return { return {
//图片路径 //图片路径
baseUrl: this.$IMG_URL, baseUrl: this.$IMG_URL,
//用户列表 //用户列表
userList:[ userList:[],
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'MALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'MALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
],
//是否有数据 //是否有数据
isdata: false, isdata: false,
//页头 //页头
...@@ -95,6 +57,11 @@ export default { ...@@ -95,6 +57,11 @@ export default {
navHeight:'', navHeight:'',
share: false, share: false,
menuButtonInfo: '', menuButtonInfo: '',
//分页查询参数
queryParam:{
page:1,
rows:10
}
}; };
}, },
onLoad(options) { onLoad(options) {
...@@ -132,169 +99,62 @@ export default { ...@@ -132,169 +99,62 @@ export default {
this.getUserList() this.getUserList()
}, },
methods: { methods: {
getList(params){
//我喜欢的
userList(params).then(res =>{
this.userList = res.data.data
//遍历this.userList
this.userList.forEach(item => {
//处理头像
if (item.avatar != null && item.avatar != ''){
getOssUrl(item.avatar).then(res => {
item.avatarUrl = res.data.data
})
}
//处理性别
if (item.memSex != null && item.memSex != ''){
item.memSex = getValue('sex',item.memSex)
}
//处理年龄
if (item.memBirthday != null && item.memBirthday != ''){
const birthdayItem = parseDate(item.memBirthday)
item.memAge = calculateAge(birthdayItem.year,birthdayItem.month,birthdayItem.day)
}
//处理地址
if (item.memResidenceProvince != null && item.memResidenceProvince != '' && item.memResidenceCity != null && item.memResidenceCity != ''){
item.city = getCity(item.memResidenceProvince,item.memResidenceCity)
}
});
}).catch(e => {
console.log(e)
})
},
//获取用户列表数据
getUserList(){ getUserList(){
if (this.type == '1'){ if (this.type == '1'){
//我喜欢的 //我喜欢的
const list = [ const params = {
{ page:this.queryParam.page,
nickName:'暖洋洋', rows:this.queryParam.rows,
gender:'FEMALE', queryType: '1'
age:'21', }
height:'165', this.getList(params)
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'MALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'MALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
]
this.userList = list
} else if(this.type == '2') { } else if(this.type == '2') {
//喜欢我的 //喜欢我的
const list = [ const params = {
{ page:this.queryParam.page,
nickName:'暖洋洋', rows:this.queryParam.rows,
gender:'FEMALE', queryType: '2'
age:'21', }
height:'165', this.getList(params)
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'MALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'MALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
]
this.userList = list
} else if(this.type == '3') { } else if(this.type == '3') {
//互相喜欢的 //互相喜欢的
const list = [ const params = {
{ page:this.queryParam.page,
nickName:'暖洋洋', rows:this.queryParam.rows,
gender:'MALE', queryType: '3'
age:'21', }
height:'165', this.getList(params)
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'MALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
}
]
this.userList = list
} }
}, },
backbar() { backbar() {
......
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