Commit 348ec318 authored by liwei's avatar liwei

修改了三个页面的分页的bug

parent 2ec109b5
<template> <template>
<view class="content"> <view class="content">
<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>
<!-- z-paging是一个分页组件--> <!-- z-paging是一个分页组件-->
<z-paging ref="paging" empty-view-text="迈出第一步才有更多故事发生哦" <z-paging ref="paging" empty-view-text="迈出第一步才有更多故事发生哦"
:empty-view-title-style="{ :empty-view-title-style="{
...@@ -22,7 +13,16 @@ ...@@ -22,7 +13,16 @@
'width': '447rpx', 'width': '447rpx',
'height': '375rpx' 'height': '375rpx'
}" v-model="dataList" @query="queryList" :fixed="true" :auto-show-back-to-top="true" :back-to-top-with-animate="false"> }" v-model="dataList" @query="queryList" :fixed="true" :auto-show-back-to-top="true" :back-to-top-with-animate="false">
<view class="recommendation" :style="{'top':navHeight+'px'}"> <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">
<view class="card"> <view class="card">
<view class="recommendation-card" v-for="item in dataList" @click="gotoDetail(item)"> <view class="recommendation-card" v-for="item in dataList" @click="gotoDetail(item)">
<view class="card-image"> <view class="card-image">
...@@ -66,29 +66,10 @@ export default { ...@@ -66,29 +66,10 @@ export default {
userList:[], userList:[],
//是否有数据 //是否有数据
isdata: false, isdata: false,
//距离表头高度
navHeight:'',
menuButtonInfo: '',
}; };
}, },
onLoad(options) { onLoad(options) {
//获取当前页面的页头高度
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
const {
top,
width,
height,
right
} = this.menuButtonInfo
uni.getSystemInfo({
success: (res) => {
const {
statusBarHeight
} = res;
const margin = top - statusBarHeight
this.navHeight = (height + statusBarHeight + (margin * 5)) //导航栏总高
}
})
}, },
methods: { methods: {
//获取用户信息列表 //获取用户信息列表
...@@ -157,9 +138,7 @@ export default { ...@@ -157,9 +138,7 @@ export default {
min-height: 100vh; min-height: 100vh;
background-color: #F4F5F9; background-color: #F4F5F9;
.recommendation { .recommendation {
min-height: 100vh;
background-color: #F4F5F9; background-color: #F4F5F9;
position: absolute;
padding: 0 34rpx; padding: 0 34rpx;
.nodatacard{ .nodatacard{
height: 100vh; height: 100vh;
......
<template> <template>
<view style="background-color: #F4F5F9;min-height: 100vh;"> <view class="content">
<!-- 页头-->
<u-navbar @leftClick="backbar" bgColor="#F4F5F9" :title="title"></u-navbar>
<z-paging ref="paging" empty-view-text="迈出第一步才有更多故事发生哦" <z-paging ref="paging" empty-view-text="迈出第一步才有更多故事发生哦"
:empty-view-title-style="{ :empty-view-title-style="{
'font-size': '32rpx', 'font-size': '32rpx',
...@@ -14,7 +12,14 @@ ...@@ -14,7 +12,14 @@
'width': '447rpx', 'width': '447rpx',
'height': '375rpx' 'height': '375rpx'
}" v-model="dataList" @query="queryList" :fixed="true" :auto-show-back-to-top="true" :back-to-top-with-animate="false"> }" v-model="dataList" @query="queryList" :fixed="true" :auto-show-back-to-top="true" :back-to-top-with-animate="false">
<view class="recommendation" :style="{'top':navHeight+'px'}"> <!-- 页头-->
<u-navbar bgColor="white" :placeholder="true" :title="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"></view>-->
</view>
</u-navbar>
<view class="recommendation">
<view class="card"> <view class="card">
<view class="recommendation-card" v-for="item in userList"> <view class="recommendation-card" v-for="item in userList">
<view class="card-image"> <view class="card-image">
...@@ -34,7 +39,7 @@ ...@@ -34,7 +39,7 @@
</view> </view>
<view class="bottom-address">{{item.city}}</view> <view class="bottom-address">{{item.city}}</view>
</view> </view>
<image v-if="type == '1' || type == '3'" class="cnacleLike" :src="baseUrl+'/user/cancelLike.png'" @click="deleteLike(item.userId)"/> <!-- <image v-if="type == '1' || type == '3'" class="cnacleLike" :src="baseUrl+'/user/cancelLike.png'" @click="deleteLike(item.userId)"/>-->
</view> </view>
</view> </view>
</view> </view>
...@@ -66,38 +71,13 @@ export default { ...@@ -66,38 +71,13 @@ export default {
type:'', type:'',
//页面数据的数量 //页面数据的数量
num:'', num:'',
//距离表头
navHeight:'',
menuButtonInfo: '',
//查询类型 1:我喜欢的 2:喜欢我的 3:互相喜欢的 //查询类型 1:我喜欢的 2:喜欢我的 3:互相喜欢的
queryType:'', queryType:'',
//分页查询参数
queryParam:{
page:1,
rows:10
}
}; };
}, },
onLoad(options) { onLoad(options) {
//设置页头 //设置页头
this.type = options.type; this.type = options.type;
//获取当前页面的页头高度
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
const {
top,
width,
height,
right
} = this.menuButtonInfo
uni.getSystemInfo({
success: (res) => {
const {
statusBarHeight
} = res;
const margin = top - statusBarHeight
this.navHeight = (height + statusBarHeight + (margin * 3)) //导航栏总高
}
})
this.getUserList() this.getUserList()
}, },
methods: { methods: {
...@@ -137,6 +117,7 @@ export default { ...@@ -137,6 +117,7 @@ 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)
}) })
...@@ -207,67 +188,88 @@ export default { ...@@ -207,67 +188,88 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.recommendation { .content {
min-height: 100vh;
background-color: #F4F5F9; background-color: #F4F5F9;
position: absolute; .recommendation {
padding: 0 34rpx; background-color: #F4F5F9;
.nodatacard{ padding: 0 34rpx;
height: 100vh; .nodatacard{
display: flex; height: 100vh;
justify-content: center;
align-items: center;
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;
...@@ -322,7 +324,6 @@ export default { ...@@ -322,7 +324,6 @@ export default {
} }
} }
} }
} }
.cnacleLike{ .cnacleLike{
height: 40rpx; height: 40rpx;
......
...@@ -42,70 +42,70 @@ export default { ...@@ -42,70 +42,70 @@ export default {
], ],
options4: [ options4: [
{ {
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg', avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '杨涛', name: '杨涛',
read: 1, read: 1,
time: '23:59', time: '23:59',
msg: '没有消息就是最好的消息' msg: '没有消息就是最好的消息'
}, },
{ {
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg', avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '雨中漫步', name: '雨中漫步',
read: 1, read: 1,
time: '23:59', time: '23:59',
msg: '没有消息就是最好的消息' msg: '没有消息就是最好的消息'
}, },
{ {
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg', avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '糖果梦境', name: '糖果梦境',
read: 1, read: 1,
time: '23:59', time: '23:59',
msg: '没有消息就是最好的消息' msg: '没有消息就是最好的消息'
}, },
{ {
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg', avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '海上日落', name: '海上日落',
read: 1, read: 1,
time: '23:59', time: '23:59',
msg: '没有消息就是最好的消息' msg: '没有消息就是最好的消息'
}, },
{ {
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg', avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '男朋友', name: '男朋友',
read: 1, read: 1,
time: '23:59', time: '23:59',
msg: '没有消息就是最好的消息' msg: '没有消息就是最好的消息'
}, },
{ {
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg', avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '女朋友', name: '女朋友',
read: 1, read: 1,
time: '23:59', time: '23:59',
msg: '没有消息就是最好的消息' msg: '没有消息就是最好的消息'
}, },
{ {
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg', avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '静谧之夜', name: '静谧之夜',
read: 1, read: 1,
time: '23:59', time: '23:59',
msg: '没有消息就是最好的消息' msg: '没有消息就是最好的消息'
}, },
{ {
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg', avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '风吹麦浪', name: '风吹麦浪',
read: 0, read: 0,
time: '23:59', time: '23:59',
msg: '没有消息就是最好的消息' msg: '没有消息就是最好的消息'
}, },
{ {
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg', avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '路过岁月', name: '路过岁月',
read: 0, read: 0,
time: '23:59', time: '23:59',
msg: '没有消息就是最好的消息' msg: '没有消息就是最好的消息'
}, },
{ {
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg', avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '繁星点点', name: '繁星点点',
read: 0, read: 0,
time: '23:59', time: '23:59',
......
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