|
不知道怎么回事只能往下滑加载下一页的内容,滑过去的几页内容无法查看!
<list class="search-pro-result" if="{{ moreData && moreData[0] && showData }}" onscrollbottom="loadMoreData">
<list-item type="productLeft" class="search-pro-item" onclick="routerProductdetail($item.id)" for="{{ moreData }}">
<div class="product-item-inner">
<div class="product-item-left">
<image src="{{ $item.pic }}" class="product-item-img">image>
div>
<div class="product-item-right">
<text class="product-item-top">{{ $item.name }}text>
<div class="product-item-bto"><text class="product-item-price-num">{{ $item.price }}text>div>
div>
div>
list-item>
<list-item type="loadStatus" class="load-status">
<progress type="circular" show="{{hasMoreData}}">progress>
<text show="{{hasMoreData}}">加载更多text>
<text show="{{!hasMoreData}}">没有更多了~text>
list-item>
list>
loadMoreData () {
//展示搜索产品列表
const self = this
fetch.fetch({
url:'',
data: { keyword: self.inputValue, page: self.page, a: 'Search' },
success: function (res) {
self.data = JSON.parse(res.data)
self.productData = self.data.data
self.moreData = self.productData.list
self.showWho = true
self.showSearchNone = false
if(self.moreData){
setTimeout(function () {
self.moreData = self.moreData.concat(self.productData.list)
self.page = self.page+1
}, 1000)
}else{
self.hasMoreData = false
}
}
})
},
|
|