Commit 348ec318 authored by liwei's avatar liwei

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

parent 2ec109b5
<template>
<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 ref="paging" empty-view-text="迈出第一步才有更多故事发生哦"
:empty-view-title-style="{
......@@ -22,7 +13,16 @@
'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="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="recommendation-card" v-for="item in dataList" @click="gotoDetail(item)">
<view class="card-image">
......@@ -66,29 +66,10 @@ export default {
userList:[],
//是否有数据
isdata: false,
//距离表头高度
navHeight:'',
menuButtonInfo: '',
};
},
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: {
//获取用户信息列表
......@@ -157,9 +138,7 @@ export default {
min-height: 100vh;
background-color: #F4F5F9;
.recommendation {
min-height: 100vh;
background-color: #F4F5F9;
position: absolute;
padding: 0 34rpx;
.nodatacard{
height: 100vh;
......
<template>
<view style="background-color: #F4F5F9;min-height: 100vh;">
<!-- 页头-->
<u-navbar @leftClick="backbar" bgColor="#F4F5F9" :title="title"></u-navbar>
<view class="content">
<z-paging ref="paging" empty-view-text="迈出第一步才有更多故事发生哦"
:empty-view-title-style="{
'font-size': '32rpx',
......@@ -14,7 +12,14 @@
'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="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="recommendation-card" v-for="item in userList">
<view class="card-image">
......@@ -34,7 +39,7 @@
</view>
<view class="bottom-address">{{item.city}}</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>
......@@ -66,38 +71,13 @@ export default {
type:'',
//页面数据的数量
num:'',
//距离表头
navHeight:'',
menuButtonInfo: '',
//查询类型 1:我喜欢的 2:喜欢我的 3:互相喜欢的
queryType:'',
//分页查询参数
queryParam:{
page:1,
rows:10
}
};
},
onLoad(options) {
//设置页头
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()
},
methods: {
......@@ -137,6 +117,7 @@ export default {
item.city = getCity(item.memResidenceProvince,item.memResidenceCity)
}
});
this.$refs.paging.completeByTotal(this.userList,res.data.total);
}).catch(e => {
console.log(e)
})
......@@ -207,9 +188,11 @@ export default {
</script>
<style lang="scss" scoped>
.recommendation {
.content {
min-height: 100vh;
background-color: #F4F5F9;
.recommendation {
background-color: #F4F5F9;
position: absolute;
padding: 0 34rpx;
.nodatacard{
height: 100vh;
......@@ -262,12 +245,31 @@ export default {
}
}
.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 {
display: grid;
grid-template-columns: 330rpx 330rpx;
grid-column-gap: 22rpx;
.recommendation-card {
width: 330rpx;
margin-bottom: 25rpx;
......@@ -322,7 +324,6 @@ export default {
}
}
}
}
.cnacleLike{
height: 40rpx;
......
......@@ -42,70 +42,70 @@ export default {
],
options4: [
{
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg',
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '杨涛',
read: 1,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg',
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '雨中漫步',
read: 1,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg',
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '糖果梦境',
read: 1,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg',
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '海上日落',
read: 1,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg',
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '男朋友',
read: 1,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg',
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '女朋友',
read: 1,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg',
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '静谧之夜',
read: 1,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg',
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '风吹麦浪',
read: 0,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg',
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '路过岁月',
read: 0,
time: '23:59',
msg: '没有消息就是最好的消息'
},
{
avatar: 'http://192.168.69.154/upload/opmArticle/20250205/D55F11DEB8C2410CB899978572F82981.jpg',
avatar: 'http://192.168.1.23/upload/CmsNotice/20250210/00429923A8CE495ABA38CC2F527EADF5.jpg',
name: '繁星点点',
read: 0,
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