请选择 进入手机版 | 继续访问电脑版
 找回密码
 立即注册
搜索

互动交流 滚动加载只能往下加载,无法向上一页回滚,无法查看上...

1
回复
1696
查看
[复制链接]

3

主题

4

帖子

35

积分

 楼主| 2018-8-13 18:11:38 显示全部楼层 |阅读模式
不知道怎么回事只能往下滑加载下一页的内容,滑过去的几页内容无法查看! <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 } } }) },
回复

使用道具 举报

8

主题

226

帖子

700

积分

2018-8-13 19:47:10 显示全部楼层
self.moreData = self.productData.list 之后又 self.moreData = self.moreData.concat(self.productData.list) 这个操作的作用是?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册