Commit 2ec109b5 authored by liwei's avatar liwei

修改了三个页面的分页,目前还有小bug

parent cff0c728
<template> <template>
<view style="background: #F4F5F9;min-height: 100vh"> <view style="background: #F4F5F9;min-height: 100vh">
<!-- 轮播图 后面放banner里的图--> <!-- z-paging是一个分页组件-->
<view class="box"> <z-paging ref="paging" empty-view-text="迈出第一步才有更多故事发生哦"
:empty-view-title-style="{
'font-size': '32rpx',
'color': '#C9C9D0',
'position': 'absolute',
'width': '100vw',
}" :empty-view-img="baseUrl+'/common/empty.png'" :empty-view-img-style="{
'position': 'absolute',
'top': '210rpx',
'width': '447rpx',
'height': '375rpx'
}" v-model="dataList" @query="queryList" :fixed="true" :auto-show-back-to-top="true" :back-to-top-with-animate="false">
<view class="box">
<view class="swiper"> <view class="swiper">
<ls-swiper :list="bannerList" imgKey="" :loop="true" :dots="true" :autoplay="true" :height="200" /> <ls-swiper :list="bannerList" imgKey="" :loop="true" :dots="true" :autoplay="true" :height="200" />
</view> </view>
</view> </view>
<!-- 活动列表--> <view class="card" v-for="(item,index) in dataList" :key="index" @click="gotopage(item)">
<view class="card" v-for="(item,index) in activityList" :key="index" @click="gotopage(item)"> <view class="contentBody">
<view class="contentBody"> <view class="leftlist">
<view class="leftlist"> <image :src="item.url" class="leftlistimage"/>
<image :src="item.url" class="leftlistimage"/>
</view>
<view class="rightlist">
<view class="rightlist-title">{{item.title}}</view>
<view class="rightlist-time">
<view class="timeicon">
<u-icon name="clock" color="#666666;" size="15"></u-icon>
</view>
<view class="timetext">{{item.publishDate}}</view>
</view> </view>
<view class="rightlist-address"> <view class="rightlist">
<view class="addressicon"> <view class="rightlist-title">{{item.title}}</view>
<u-icon name="tags" color="#D84848;" size="15"></u-icon> <view class="rightlist-time">
<view class="timeicon">
<u-icon name="clock" color="#666666;" size="15"></u-icon>
</view>
<view class="timetext">{{item.publishDate}}</view>
</view>
<view class="rightlist-address">
<view class="addressicon">
<u-icon name="tags" color="#D84848;" size="15"></u-icon>
</view>
<view class="addresstext" v-if="item.summary">{{item.summary}}</view>
<view class="addresstext" v-else>-</view>
</view> </view>
<view class="addresstext" v-if="item.summary">{{item.summary}}</view>
<view class="addresstext" v-else>-</view>
</view> </view>
</view> </view>
</view> </view>
</view> </z-paging>
<view style="background: #F4F5F9;" class="bussiness-nomore">~ 没有更多啦 ~</view>
</view> </view>
</template> </template>
...@@ -45,6 +56,8 @@ export default { ...@@ -45,6 +56,8 @@ export default {
}, },
data() { data() {
return { return {
//分页插件存储数据的变量
dataList:[],
//图片路径 //图片路径
baseUrl: this.$IMG_URL, baseUrl: this.$IMG_URL,
//分页查询参数 //分页查询参数
...@@ -55,101 +68,51 @@ export default { ...@@ -55,101 +68,51 @@ export default {
//banner轮播图 //banner轮播图
bannerList:[], bannerList:[],
//活动列表 //活动列表
activityList: [ activityList: [],
{
name:'测试1',
createTime:'2024-10-12',
address:'天津'
},
{
name:'测试2',
createTime:'2024-10-12',
address:'天津'
},
{
name:'测试3',
createTime:'2024-10-12',
address:'天津'
},
{
name:'测试4',
createTime:'2024-10-12',
address:'天津'
},
{
name:'测试5',
createTime:'2024-10-12',
address:'天津'
},
{
name:'测试6',
createTime:'2024-10-12',
address:'天津'
},
{
name:'测试6',
createTime:'2024-10-12',
address:'天津'
},
{
name:'测试6',
createTime:'2024-10-12',
address:'天津'
},
{
name:'测试6',
createTime:'2024-10-12',
address:'天津'
}
],
showArrowDown: true,
showTabbar: true,
scrollTop: 0,
}; };
}, },
onShow() { onShow() {
this.getBannerList() this.getBannerList()
this.getActivityList()
}, },
methods: { methods: {
//获取Banner列表 queryList(pageNo, pageSize) {
getBannerList() {
const query = { const query = {
page: this.queryParam.page, page:pageNo,
rows: this.queryParam.rows rows:pageSize,
publishStatus:'1'
} }
bannerList(query).then(res =>{ activityList(query).then(res =>{
let imgList = [] this.activityList = res.data.data
res.data.data.forEach(item => { this.activityList.forEach(item => {
getOssUrl(item.pictureId).then(imgRes => { getOssUrl(item.pictureId).then(imgRes => {
if (imgRes.data.data != null) { if (imgRes.data.data != null) {
imgRes.data.data = imgRes.data.data.replace(/\\/g, "/"); imgRes.data.data = imgRes.data.data.replace(/\\/g, "/");
imgList.push(imgRes.data.data) item.url = imgRes.data.data
} }
}) })
}) })
this.bannerList = imgList this.$refs.paging.completeByTotal(this.activityList,res.data.total);
}).catch(e => { }).catch(e => {
console.log(e) console.log(e)
}) })
}, },
//获取活动列表 //获取Banner列表
getActivityList() { getBannerList() {
const query = { const query = {
page:this.queryParam.page, page: this.queryParam.page,
rows:this.queryParam.rows, rows: this.queryParam.rows
publishStatus:'1'
} }
activityList(query).then(res =>{ bannerList(query).then(res =>{
this.activityList = res.data.data let imgList = []
this.activityList.forEach(item => { res.data.data.forEach(item => {
getOssUrl(item.pictureId).then(imgRes => { getOssUrl(item.pictureId).then(imgRes => {
if (imgRes.data.data != null) { if (imgRes.data.data != null) {
imgRes.data.data = imgRes.data.data.replace(/\\/g, "/"); imgRes.data.data = imgRes.data.data.replace(/\\/g, "/");
item.url = imgRes.data.data imgList.push(imgRes.data.data)
} }
}) })
}) })
this.bannerList = imgList
}).catch(e => { }).catch(e => {
console.log(e) console.log(e)
}) })
...@@ -165,74 +128,6 @@ export default { ...@@ -165,74 +128,6 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.bussiness-nomore{
text-align: center;
padding: 42rpx 0;
font-size: 13px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #B9B9B9;
}
@keyframes leftMove {
0% {
left: -130rpx;
}
100% {
left: 0;
}
}
@keyframes rightMove {
0% {
right: -130rpx;
}
100% {
right: 0;
}
}
@keyframes topHide {
0% {
top: 50%;
width: 0;
height: 0;
}
70% {
top: 18%;
width: 100rpx;
height: 100rpx;
}
80% {
top: 18%;
width: 100rpx;
height: 100rpx;
}
90% {
top: 20%;
width: 80rpx;
height: 80rpx;
}
100% {
top: 20%;
wixdth: 0;
height: 0;
}
}
page {
width: 100%;
height: 100vh;
}
.card { .card {
background-color: white; background-color: white;
width: 680rpx; width: 680rpx;
...@@ -351,82 +246,7 @@ page { ...@@ -351,82 +246,7 @@ page {
.box { .box {
.swiper { .swiper {
position: relative; position: relative;
.hint {
position: absolute;
top: 46rpx;
right: 34rpx;
width: 202rpx;
height: 62rpx;
background: rgba(255, 255, 255, 0.2);
border-radius: 34rpx;
display: flex;
justify-content: center;
align-items: center;
image {
width: 24rpx;
height: 28rpx;
}
.t {
font-size: 28rpx;
font-weight: 400;
color: #333333;
margin-left: 14rpx;
}
}
} }
.lable {
display: flex;
align-items: center;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #434343;
margin-left: 50rpx;
margin-top: 48rpx;
.lable-div {
height: 54rpx;
background: #e5f4ff;
border-radius: 28rpx;
line-height: 54rpx;
padding: 0 38rpx;
}
}
.line {
width: 636rpx;
// height: 2rpx;
// background-color: #c8d3e2;
// border-bottom: 2rpx dashed #c8d3e2;
margin: 0 auto;
margin-top: 44rpx;
}
.circles {
background: #f5f6fa;
width: 44rpx;
height: 44rpx;
border-radius: 50%;
position: absolute;
right: -22rpx;
top: 1002rpx;
}
.circle {
background: #f5f6fa;
width: 44rpx;
height: 44rpx;
border-radius: 50%;
position: absolute;
left: -22rpx;
top: 1002rpx;
}
width: 686rpx; width: 686rpx;
margin: 0 auto; margin: 0 auto;
border-radius: 42rpx 42rpx 24rpx 24rpx; border-radius: 42rpx 42rpx 24rpx 24rpx;
...@@ -434,137 +254,8 @@ page { ...@@ -434,137 +254,8 @@ page {
z-index: 10; z-index: 10;
position: relative; position: relative;
background: #fff; background: #fff;
.ling {
height: 42rpx;
display: flex;
align-items: center;
margin-left: 58rpx;
margin-top: 24rpx;
.img {
height: 42rpx;
width: 42rpx;
margin-right: 8rpx;
}
.text {
height: 34rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 34rpx;
}
}
.box-bq {
height: 40rpx;
font-size: 28rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #333333;
margin-left: 58rpx;
margin-top: 24rpx;
line-height: 40rpx;
display: flex;
align-items: center;
.xian {
width: 2rpx;
height: 20rpx;
background: #e0e2e8;
margin: 0 32rpx;
}
}
.box-name {
.simg {
width: 48rpx;
height: 48rpx;
margin-left: 20rpx;
}
height: 56rpx;
font-size: 40rpx;
font-family: PingFang SC-Heavy,
PingFang SC;
font-weight: 800;
color: #4a4a4a;
line-height: 56rpx;
margin-left: 58rpx;
margin-top: 24rpx;
display: flex;
align-items: center;
image {
width: 48rpx;
height: 48rpx;
margin-left: 20rpx;
margin-top: 5rpx;
}
}
.box-jj {
.box-jj-ta {
width: 618rpx;
height: 58rpx;
background: #f5f6fa;
border-radius: 30rpx 30rpx 30rpx 30rpx;
margin: 0 auto;
margin-top: 32rpx;
display: flex;
align-items: center;
justify-content: space-between;
.text2 {
height: 34rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 34rpx;
margin-right: 28rpx;
}
.box-jj-ta-left {
display: flex;
align-items: center;
.xian {
width: 2rpx;
height: 20rpx;
background: #e0e2e8;
margin: 0 18rpx;
}
.te {
height: 34rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 34rpx;
}
.img {
width: 24rpx;
height: 24rpx;
margin: 0 18rpx 0 26rpx;
}
}
}
width: 100%;
height: auto;
background-color: #fff;
position: relative;
}
} }
.pageanima {
position: relative;
}
.pagePop { .pagePop {
animation-name: pagePop; // 动画名称 animation-name: pagePop; // 动画名称
...@@ -573,17 +264,4 @@ page { ...@@ -573,17 +264,4 @@ page {
animation-duration: 0.5s; // 动画完成时间 animation-duration: 0.5s; // 动画完成时间
} }
@keyframes pagePop {
0% {
top: 100rpx;
opacity: 0.5;
}
100% {
top: 0;
opacity: 1;
}
}
</style> </style>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<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.meFollowCount)"> <view class="tab-1" @click="gotolike(1)">
<view class="tab-1-num"> <view class="tab-1-num">
<text v-if="info.meFollowCount">{{info.meFollowCount}}</text><text v-else>0</text> <text v-if="info.meFollowCount">{{info.meFollowCount}}</text><text v-else>0</text>
</view> </view>
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
我喜欢的 我喜欢的
</view> </view>
</view> </view>
<view class="tab-2" style="margin: 0 136rpx;" @click="gotolike(2,info.followMeCount)"> <view class="tab-2" style="margin: 0 136rpx;" @click="gotolike(2)">
<view class="tab-2-num"> <view class="tab-2-num">
<text v-if="info.followMeCount">{{info.followMeCount}}</text><text v-else>0</text> <text v-if="info.followMeCount">{{info.followMeCount}}</text><text v-else>0</text>
</view> </view>
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
喜欢我的 喜欢我的
</view> </view>
</view> </view>
<view class="tab-3" @click="gotolike(3,info.eachFollowCount)"> <view class="tab-3" @click="gotolike(3)">
<view class="tab-3-num"> <view class="tab-3-num">
<text v-if="info.eachFollowCount">{{info.eachFollowCount}}</text><text v-else>0</text> <text v-if="info.eachFollowCount">{{info.eachFollowCount}}</text><text v-else>0</text>
</view> </view>
...@@ -385,11 +385,13 @@ import {articleList, getOssUrl} from "../../api/article"; ...@@ -385,11 +385,13 @@ import {articleList, getOssUrl} from "../../api/article";
url: "/pagesme/me/doubleauth" url: "/pagesme/me/doubleauth"
}) })
}, },
gotolike(type,num) { //喜欢三个列表页面 //跳转我喜欢的 喜欢我的 互相喜欢的三个列表页面
gotolike(type,num) {
uni.navigateTo({ uni.navigateTo({
url: "/pagesme/me/likeList?type="+type+'&num='+num url: "/pagesme/me/likeList?type="+type
}) })
}, },
//操作项跳转
whether(i) { whether(i) {
if (i == 0) { if (i == 0) {
uni.navigateTo({ uni.navigateTo({
......
<template> <template>
<view style="background-color: #F4F5F9;min-height: 100vh;"> <view class="content">
<!-- 页头-->
<u-navbar bgColor="white" :placeholder="true" title="会员信息"> <u-navbar bgColor="white" :placeholder="true" title="会员信息">
<view class="u-nav-slot" slot="left"> <view class="u-nav-slot" slot="left">
<u-icon name="arrow-left" color="black" size="20" @click="backbar"/> <u-icon name="arrow-left" color="black" size="20" @click="backbar"/>
...@@ -10,33 +9,44 @@ ...@@ -10,33 +9,44 @@
</view> </view>
</view> </view>
</u-navbar> </u-navbar>
<view class="recommendation" :style="{'top':navHeight+'px'}"> <!-- z-paging是一个分页组件-->
<view v-if="isdata" class="nodatacard"> <z-paging ref="paging" empty-view-text="迈出第一步才有更多故事发生哦"
<view class="text">暂无数据</view> :empty-view-title-style="{
</view> 'font-size': '32rpx',
<view class="card"> 'color': '#C9C9D0',
<view class="recommendation-card" v-for="item in userList" @click="gotoDetail(item)"> 'position': 'absolute',
<view class="card-image"> 'width': '100vw',
<image class="img" :src="item.avatarUrl"/> }" :empty-view-img="baseUrl+'/common/empty.png'" :empty-view-img-style="{
</view> 'position': 'absolute',
<view class="card-bottom"> 'top': '210rpx',
<view class="bottom-left"> 'width': '447rpx',
<view class="bottom-info"> 'height': '375rpx'
{{item.memNickName}} }" v-model="dataList" @query="queryList" :fixed="true" :auto-show-back-to-top="true" :back-to-top-with-animate="false">
<image v-if="item.memSex == '男'" class="gender" :src="baseUrl+'/user/male.png'" mode=""/> <view class="recommendation" :style="{'top':navHeight+'px'}">
<image v-else class="gender" :src="baseUrl+'/user/famale.png'" mode=""/> <view class="card">
</view> <view class="recommendation-card" v-for="item in dataList" @click="gotoDetail(item)">
<view class="bottom-info"> <view class="card-image">
{{ item.memAge }} <image class="img" :src="item.avatarUrl"/>
<text style="margin-left: 10rpx;margin-right: 10rpx;color: #BBB9B9FF;">|</text> </view>
{{item.memHeight}}cm <view class="card-bottom">
<view class="bottom-left">
<view class="bottom-info">
{{item.memNickName}}
<image v-if="item.memSex == '男'" 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.memAge }}
<text style="margin-left: 10rpx;margin-right: 10rpx;color: #BBB9B9FF;">|</text>
{{item.memHeight}}cm
</view>
<view class="bottom-address">{{item.city}}</view>
</view> </view>
<view class="bottom-address">{{item.city}}</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </z-paging>
</view> </view>
</template> </template>
...@@ -48,19 +58,14 @@ import {getOssUrl} from "../api/article"; ...@@ -48,19 +58,14 @@ import {getOssUrl} from "../api/article";
export default { export default {
data() { data() {
return { return {
//分页插件存储数据的变量
dataList:[],
//图片路径 //图片路径
baseUrl: this.$IMG_URL, baseUrl: this.$IMG_URL,
//分页查询参数
queryParam:{
page:1,
rows:10
},
//用户列表 //用户列表
userList:[], userList:[],
//是否有数据 //是否有数据
isdata: false, isdata: false,
//页面数据的数量
num:'',
//距离表头高度 //距离表头高度
navHeight:'', navHeight:'',
menuButtonInfo: '', menuButtonInfo: '',
...@@ -84,53 +89,15 @@ export default { ...@@ -84,53 +89,15 @@ export default {
this.navHeight = (height + statusBarHeight + (margin * 5)) //导航栏总高 this.navHeight = (height + statusBarHeight + (margin * 5)) //导航栏总高
} }
}) })
//获取用户信息
this.getUserList()
}, },
methods: { methods: {
filterSearch(value) { //获取用户信息列表
let minHeight = '' queryList(pageNo, pageSize) {
let maxHeight = '' const params = {
let minWeight = '' page: pageNo,
let maxWeight = '' rows: pageSize
if (value.memHeight != '' && value.memHeight != '不限'){
minHeight = value.memHeight.split('-')[0]
maxHeight = value.memHeight.split('-')[1]
}
if (value.memWeight != '' && value.memWeight != '不限'){
minWeight = value.memWeight.split('-')[0]
maxWeight = value.memWeight.split('-')[1]
} }
console.log('======params======', value) userList(params).then(res =>{
this.queryParam = {
page: 1,
rows: 10,
memSex: value.memSex,
minHeight: minHeight,
maxHeight: maxHeight,
minWeight: minWeight,
maxWeight: maxWeight,
memResidenceProvince: value.memResidenceProvince,
memResidenceCity: value.memResidenceCity
}
this.getUserList()
},
//左上角的搜索
search() {
//判断当前是否已登录
uni.navigateTo({
url: '/pagesUser/userFilterPage'
});
},
//跳转用户详情
gotoDetail(item){
uni.navigateTo({
url: '/pagesUser/userInfo?memberId='+item.businessId
})
},
//获取用户列表数据
getUserList() {
userList(this.queryParam).then(res =>{
this.userList = res.data.data this.userList = res.data.data
//遍历this.userList //遍历this.userList
this.userList.forEach(item => { this.userList.forEach(item => {
...@@ -157,10 +124,24 @@ export default { ...@@ -157,10 +124,24 @@ export default {
item.city = getCity(item.memResidenceProvince,item.memResidenceCity) item.city = getCity(item.memResidenceProvince,item.memResidenceCity)
} }
}); });
this.$refs.paging.completeByTotal(this.userList,res.data.total);
}).catch(e => { }).catch(e => {
console.log(e) console.log(e)
}) })
}, },
//左上角的搜索
search() {
//判断当前是否已登录
uni.navigateTo({
url: '/pagesUser/userFilterPage'
});
},
//跳转用户详情
gotoDetail(item){
uni.navigateTo({
url: '/pagesUser/userInfo?memberId='+item.businessId
})
},
//返回按钮 //返回按钮
backbar() { backbar() {
uni.navigateBack({ uni.navigateBack({
...@@ -172,87 +153,90 @@ export default { ...@@ -172,87 +153,90 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.u-nav-slot { .content {
display: flex; min-height: 100vh;
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 {
background-color: #F4F5F9; background-color: #F4F5F9;
position: absolute; .recommendation {
padding: 0 34rpx; min-height: 100vh;
.nodatacard{ background-color: #F4F5F9;
height: 100vh; position: absolute;
display: flex; padding: 0 34rpx;
justify-content: center; .nodatacard{
align-items: center; height: 100vh;
flex-direction: column;
.text{
text-align: center;
padding: 42rpx 0;
font-size: 13px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #B9B9B9;
}
}
.recommendation-top {
display: flex;
justify-content: space-between;
margin: 56rpx 0;
.top-title {
font-size: 19px;
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
font-weight: bold;
color: #222222;
}
.more {
display: flex; display: flex;
justify-content: center;
.more-title { align-items: center;
font-size: 17px; flex-direction: column;
.text{
text-align: center;
padding: 42rpx 0;
font-size: 13px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN; font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400; font-weight: 400;
color: #848484; color: #B9B9B9;
margin-right: 14rpx; }
}
.recommendation-top {
display: flex;
justify-content: space-between;
margin: 56rpx 0;
.top-title {
font-size: 19px;
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
font-weight: bold;
color: #222222;
} }
.more-image { .more {
display: flex; display: flex;
align-items: center;
.rightimage { .more-title {
width: 7px; font-size: 17px;
height: 12px; font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #848484;
margin-right: 14rpx;
}
.more-image {
display: flex;
align-items: center;
.rightimage {
width: 7px;
height: 12px;
}
} }
} }
} }
} }
.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;
}
}
.card { .card {
display: grid; display: grid;
grid-template-columns: 330rpx 330rpx; grid-template-columns: 330rpx 330rpx;
grid-column-gap: 22rpx; grid-column-gap: 22rpx;
.recommendation-card { .recommendation-card {
width: 330rpx; width: 330rpx;
margin-bottom: 25rpx; margin-bottom: 25rpx;
...@@ -307,6 +291,5 @@ export default { ...@@ -307,6 +291,5 @@ export default {
} }
} }
} }
} }
</style> </style>
...@@ -2,34 +2,44 @@ ...@@ -2,34 +2,44 @@
<view style="background-color: #F4F5F9;min-height: 100vh;"> <view style="background-color: #F4F5F9;min-height: 100vh;">
<!-- 页头--> <!-- 页头-->
<u-navbar @leftClick="backbar" bgColor="#F4F5F9" :title="title"></u-navbar> <u-navbar @leftClick="backbar" bgColor="#F4F5F9" :title="title"></u-navbar>
<view class="recommendation" :style="{'top':navHeight+'px'}"> <z-paging ref="paging" empty-view-text="迈出第一步才有更多故事发生哦"
<view v-if="isdata" class="nodatacard"> :empty-view-title-style="{
<view class="text">暂无数据</view> 'font-size': '32rpx',
</view> 'color': '#C9C9D0',
<view class="card"> 'position': 'absolute',
<view class="recommendation-card" v-for="item in userList"> 'width': '100vw',
<view class="card-image"> }" :empty-view-img="baseUrl+'/common/empty.png'" :empty-view-img-style="{
<image @click="gotoDetail(item)" class="img" :src="item.avatarUrl"/> 'position': 'absolute',
</view> 'top': '210rpx',
<view class="card-bottom"> 'width': '447rpx',
<view class="bottom-left"> 'height': '375rpx'
<view class="bottom-info"> }" v-model="dataList" @query="queryList" :fixed="true" :auto-show-back-to-top="true" :back-to-top-with-animate="false">
{{item.memNickName}} <view class="recommendation" :style="{'top':navHeight+'px'}">
<image v-if="item.memSex === '0'" class="gender" :src="baseUrl+'/user/male.png'" mode=""/> <view class="card">
<image v-else class="gender" :src="baseUrl+'/user/famale.png'" mode=""/> <view class="recommendation-card" v-for="item in userList">
</view> <view class="card-image">
<view class="bottom-info"> <image @click="gotoDetail(item)" class="img" :src="item.avatarUrl"/>
{{item.memAge}} </view>
<text style="margin-left: 10rpx;margin-right: 10rpx;color: #BBB9B9FF;">|</text> <view class="card-bottom">
{{item.memHeight}}cm <view class="bottom-left">
<view class="bottom-info">
{{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.memAge}}
<text style="margin-left: 10rpx;margin-right: 10rpx;color: #BBB9B9FF;">|</text>
{{item.memHeight}}cm
</view>
<view class="bottom-address">{{item.city}}</view>
</view> </view>
<view class="bottom-address">{{item.city}}</view> <image v-if="type == '1' || type == '3'" class="cnacleLike" :src="baseUrl+'/user/cancelLike.png'" @click="deleteLike(item.userId)"/>
</view> </view>
<image v-if="type == '1' || type == '3'" class="cnacleLike" :src="baseUrl+'/user/cancelLike.png'" @click="deleteLike(item.userId)"/>
</view> </view>
</view> </view>
</view> </view>
</view> </z-paging>
</view> </view>
</template> </template>
...@@ -42,6 +52,8 @@ import {calculateAge, parseDate} from "../../common"; ...@@ -42,6 +52,8 @@ import {calculateAge, parseDate} from "../../common";
export default { export default {
data() { data() {
return { return {
//分页插件存储数据的变量
dataList:[],
//图片路径 //图片路径
baseUrl: this.$IMG_URL, baseUrl: this.$IMG_URL,
//用户列表 //用户列表
...@@ -56,8 +68,9 @@ export default { ...@@ -56,8 +68,9 @@ export default {
num:'', num:'',
//距离表头 //距离表头
navHeight:'', navHeight:'',
share: false,
menuButtonInfo: '', menuButtonInfo: '',
//查询类型 1:我喜欢的 2:喜欢我的 3:互相喜欢的
queryType:'',
//分页查询参数 //分页查询参数
queryParam:{ queryParam:{
page:1, page:1,
...@@ -68,7 +81,6 @@ export default { ...@@ -68,7 +81,6 @@ export default {
onLoad(options) { onLoad(options) {
//设置页头 //设置页头
this.type = options.type; this.type = options.type;
this.num = options.num;
//获取当前页面的页头高度 //获取当前页面的页头高度
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
const { const {
...@@ -89,8 +101,13 @@ export default { ...@@ -89,8 +101,13 @@ export default {
this.getUserList() this.getUserList()
}, },
methods: { methods: {
getList(params){ //分页查询
//我喜欢的 queryList(pageNo, pageSize) {
const params = {
page: pageNo,
rows: pageSize,
queryType:this.queryType
}
likeList(params).then(res =>{ likeList(params).then(res =>{
this.userList = res.data.data this.userList = res.data.data
this.num = this.userList.length this.num = this.userList.length
...@@ -128,43 +145,29 @@ export default { ...@@ -128,43 +145,29 @@ export default {
getTitle(){ getTitle(){
if (this.type == '1'){ if (this.type == '1'){
//我喜欢的 //我喜欢的
this.title = '我喜欢的' + '('+ this.num +')'; this.title = '我喜欢的' + '('+this.num+')';
} else if (this.type == '2'){ } else if (this.type == '2'){
//喜欢我的 //喜欢我的
this.title = '喜欢我的' + '('+ this.num +')'; this.title = '喜欢我的'+ '('+this.num+')';
} else if (this.type == '3'){ } else if (this.type == '3'){
//互相喜欢 //互相喜欢
this.title = '互相喜欢' + '('+ this.num +')'; this.title = '互相喜欢'+ '('+this.num+')';
} }
}, },
//获取用户列表数据 //获取用户列表数据
getUserList(){ getUserList(){
if (this.type == '1'){ if (this.type == '1'){
//我喜欢的 //我喜欢的
const params = { this.queryType = '1'
page:this.queryParam.page,
rows:this.queryParam.rows,
queryType: '1'
}
this.getList(params)
} else if(this.type == '2') { } else if(this.type == '2') {
//喜欢我的 //喜欢我的
const params = { this.queryType = '2'
page:this.queryParam.page,
rows:this.queryParam.rows,
queryType: '2'
}
this.getList(params)
} else if(this.type == '3') { } else if(this.type == '3') {
//互相喜欢的 //互相喜欢的
const params = { this.queryType = '3'
page:this.queryParam.page,
rows:this.queryParam.rows,
queryType: '3'
}
this.getList(params)
} }
}, },
//取消关注
deleteLike(id){ deleteLike(id){
//是否确认 //是否确认
uni.showModal({ uni.showModal({
...@@ -193,6 +196,7 @@ export default { ...@@ -193,6 +196,7 @@ export default {
url: '/pagesUser/userInfo?memberId='+item.businessId url: '/pagesUser/userInfo?memberId='+item.businessId
}) })
}, },
//返回按钮
backbar() { backbar() {
uni.navigateBack({ uni.navigateBack({
delta: 1, //返回层数,2则上上页 delta: 1, //返回层数,2则上上页
...@@ -205,7 +209,7 @@ export default { ...@@ -205,7 +209,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.recommendation { .recommendation {
background-color: #F4F5F9; background-color: #F4F5F9;
position: relative; position: absolute;
padding: 0 34rpx; padding: 0 34rpx;
.nodatacard{ .nodatacard{
height: 100vh; height: 100vh;
......
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