Commit c4338955 authored by liwei's avatar liwei

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

parent 736a59cb
......@@ -44,25 +44,25 @@
<text v-else>0</text>
</view>
<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">
<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 class="tab-1-text">
我喜欢的
</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">
<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 class="tab-2-text">
喜欢我的
</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">
<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 class="tab-3-text">
互相喜欢
......
......@@ -14,16 +14,16 @@
<view class="card-bottom">
<view class="bottom-left">
<view class="bottom-info">
{{item.nickName}}
<image v-if="item.gender == 'MALE'" class="gender" :src="baseUrl+'/user/male.png'" mode=""/>
{{item.memNickName}}
<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=""/>
</view>
<view class="bottom-info">
{{item.age}}
{{item.memAge}}
<text style="margin-left: 10rpx;margin-right: 10rpx;color: #BBB9B9FF;">|</text>
{{item.height}}cm
{{item.memHeight}}cm
</view>
<view class="bottom-address">{{item.address}}</view>
<view class="bottom-address">{{item.city}}</view>
</view>
</view>
</view>
......@@ -33,56 +33,18 @@
</template>
<script>
import {userList} from "../../api/user";
import {getOssUrl} from "../../api/article";
import {getCity, getValue} from "../../common/options";
import {calculateAge, parseDate} from "../../common";
export default {
data() {
return {
//图片路径
baseUrl: this.$IMG_URL,
//用户列表
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:'重庆市'
},
],
userList:[],
//是否有数据
isdata: false,
//页头
......@@ -95,6 +57,11 @@ export default {
navHeight:'',
share: false,
menuButtonInfo: '',
//分页查询参数
queryParam:{
page:1,
rows:10
}
};
},
onLoad(options) {
......@@ -132,169 +99,62 @@ export default {
this.getUserList()
},
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(){
if (this.type == '1'){
//我喜欢的
const list = [
{
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:'重庆市'
},
]
this.userList = list
const params = {
page:this.queryParam.page,
rows:this.queryParam.rows,
queryType: '1'
}
this.getList(params)
} else if(this.type == '2') {
//喜欢我的
const list = [
{
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:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
]
this.userList = list
const params = {
page:this.queryParam.page,
rows:this.queryParam.rows,
queryType: '2'
}
this.getList(params)
} else if(this.type == '3') {
//互相喜欢的
const list = [
{
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:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
},
{
nickName:'暖洋洋',
gender:'FEMALE',
age:'21',
height:'165',
address:'重庆市'
}
]
this.userList = list
const params = {
page:this.queryParam.page,
rows:this.queryParam.rows,
queryType: '3'
}
this.getList(params)
}
},
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