代码贴上,waterfall +吸顶+swiper
<template>
<view v-bind:style="{'height':windowHeight +'px'}">
<waterfall ref="fall" column-count="2" column-width="auto" @loadmore="loadMore()">
<header>
<!-- <view style="width: 750rpx;height: 400rpx; background-color: red;"> -->
<swiper :indicator-dots="indicator_dots" :autoplay="autoplay" :circular="circular" :vertical="vertical">
<swiper-item v-for="(item,index) in list" :key="item.id">
<view>
<!-- <image :src="item.url" style="width: 100%;height: 280rpx;"></image> -->
<image :src="item.url" style="width: 750;"></image>
</view>
</swiper-item>
</swiper>
<!-- </view> -->
</header>
<header style="position:sticky; top: 0px;">
<view>
<text style="background-color: aquamarine;">这里是自定义导航 还带吸顶~~~~~~~~~~~</text>
</view>
</header>
<cell v-for="(item, index) in dataList" >
<image :src="item.mainPic"></image>
</cell>
<loading>
<text>下拉刷新</text>
</loading>
</waterfall>
</view>
</template>
<script>
import request from "../../utils/http.js"
export default {
data() {
return {
// 是否显示指示器
indicator_dots: true,
// 自动播放
autoplay: true,
// 采用衔接动画
circular: true,
// 否为横向
vertical: false,
dataList:[],
windowHeight: 0,
pageNo: 0,
pageSize: 30,
list2: [{
image: 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
title: '昨夜星辰昨夜风,画楼西畔桂堂东',
},{
image: 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
title: '身无彩凤双飞翼,心有灵犀一点通'
},{
image: 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}],
list: [{
id: 1,
url: 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
// title: '昨夜星辰昨夜风,画楼西畔桂堂东',
},{
id: 2,
url: 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
// title: '身无彩凤双飞翼,心有灵犀一点通'
},{
id: 3,
url: 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
// title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}],
}
},
onPullDownRefresh() {
console.log("下拉刷新了?");
this.loadMore();
},
onLoad() {
this.windowHeight = uni.getSystemInfoSync().windowHeight;
this.queryList(this.pageNo,this.pageSize);
},
methods: {
queryList(pageNo,pageSize){
request.post('tb/getGoodThing', {
deviceType: getApp().globalData.platform == 'android' ? (getApp().globalData.systemLevel < 10 ? 'IMEI' : 'OAID') :
'IDFA',
deviceValue: '',//getApp().globalData.equipmentNumber,
pageId: pageNo,
pageSize: pageSize,
type: 1
}, 'application/json').then((res) => {
if (res.length < 10) {
this.loadingState = false
this.loadstatus = 'normal'
} else {
this.loadstatus = 'loading'
this.loadingState = true
}
// console.log(JSON.stringify(res))
this.dataList = this.dataList.concat(res);
uni.stopPullDownRefresh();
})
},
loadMore(){
this.pageNo += 1;
this.queryList(this.pageNo,this.pageSize);
this.$refs["fall"].resetLoadmore();
}
}
}
</script>
<style>
.item-image {
width: 750rpx;
height: 300rpx;
}
</style>