|
@@ -5,19 +5,19 @@
|
|
<view class="list" @tap="goDetails(item.id)" v-for="(item, index1) in dataSource" :key="index1">
|
|
<view class="list" @tap="goDetails(item.id)" v-for="(item, index1) in dataSource" :key="index1">
|
|
<span class="listTitle">{{ item.titleName }}</span>
|
|
<span class="listTitle">{{ item.titleName }}</span>
|
|
|
|
|
|
- <view class="onePic" v-if="item.pictureList.length == 1">
|
|
|
|
|
|
+ <view class="onePic" v-if="item.pictureList != null && item.pictureList.length == 1">
|
|
<image :src="loadImgSrcLocalhost(item2)" v-for="(item2, index2) in item.pictureList" :key="index2">
|
|
<image :src="loadImgSrcLocalhost(item2)" v-for="(item2, index2) in item.pictureList" :key="index2">
|
|
</image>
|
|
</image>
|
|
</view>
|
|
</view>
|
|
- <view class="twoPic" v-if="item.pictureList.length == 2">
|
|
|
|
|
|
+ <view class="twoPic" v-if="item.pictureList != null && item.pictureList.length == 2">
|
|
<image :src="loadImgSrcLocalhost(item2)" v-for="(item2, index2) in item.pictureList" :key="index2">
|
|
<image :src="loadImgSrcLocalhost(item2)" v-for="(item2, index2) in item.pictureList" :key="index2">
|
|
</image>
|
|
</image>
|
|
</view>
|
|
</view>
|
|
- <view class="threePic" v-if="item.pictureList.length == 3">
|
|
|
|
|
|
+ <view class="threePic" v-if="item.pictureList != null && item.pictureList.length == 3">
|
|
<image :src="loadImgSrcLocalhost(item2)" v-for="(item2, index2) in item.pictureList" :key="index2">
|
|
<image :src="loadImgSrcLocalhost(item2)" v-for="(item2, index2) in item.pictureList" :key="index2">
|
|
</image>
|
|
</image>
|
|
</view>
|
|
</view>
|
|
- <view class="threePic" v-if="item.pictureList.length > 3">
|
|
|
|
|
|
+ <view class="threePic" v-if="item.pictureList != null && item.pictureList.length > 3">
|
|
<image :src="loadImgSrcLocalhost(item2)" v-for="(item2, index2) in item.pictureList"
|
|
<image :src="loadImgSrcLocalhost(item2)" v-for="(item2, index2) in item.pictureList"
|
|
v-if="index2 < 3" :key="index2"></image>
|
|
v-if="index2 < 3" :key="index2"></image>
|
|
</view>
|
|
</view>
|
|
@@ -64,6 +64,20 @@
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
this.getList(1)
|
|
this.getList(1)
|
|
},
|
|
},
|
|
|
|
+ onReachBottom(){
|
|
|
|
+ let pageNum = this.queryParams.pageNum
|
|
|
|
+ let pageSize = this.queryParams.pageSize
|
|
|
|
+ let total = this.total
|
|
|
|
+ if(pageNum * pageSize >= total){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title:'暂无更多数据'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ } else {
|
|
|
|
+ this.queryParams.pageNum += 1;
|
|
|
|
+ this.getList()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
goDetails(id) {
|
|
goDetails(id) {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
@@ -82,7 +96,7 @@
|
|
}
|
|
}
|
|
list(params).then(res => {
|
|
list(params).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
- this.dataSource = res.rows
|
|
|
|
|
|
+ this.dataSource = [...this.dataSource,...res.rows]
|
|
this.total = res.total
|
|
this.total = res.total
|
|
}
|
|
}
|
|
})
|
|
})
|