| | |
| | | </scroll-view> |
| | | |
| | | </view> |
| | | <view class="goodsInfos"> |
| | | <scroll-view :scroll-y="true" :show-scrollbar="false"> |
| | | <view class="goodsInfos" > |
| | | <scroll-view :scroll-y="true" :show-scrollbar="false" style="height: 100%;" @scrolltolower="loadMoreData()"> |
| | | |
| | | <view class="goodsItem" v-for="item in goodsList" :key="item.id" |
| | | @click.prevent="goToGoodsInfo(item.id)" |
| | |
| | | }, |
| | | //触底获取数据 |
| | | async loadMoreData() { |
| | | console.log("触底加载------------》",this.maxPages) |
| | | if (this.getGoodsParam.pageNumber < this.maxPages) { |
| | | this.getGoodsParam.pageNumber++; |
| | | await this.getgoodsData() |
| | |
| | | item.cardNum = cardItem.num; |
| | | } |
| | | }) |
| | | this.goodsList = goodsList.data.result.records; |
| | | console.log('this.goodsList----------------------->',JSON.stringify(this.goodsList)) |
| | | this.goodsList = [...this.goodsList,...goodsList.data.result.records]; |
| | | this.maxPages = goodsList.data.result.pages |
| | | console.log('this.goodsList----------------------->',JSON.stringify(goodsList.data.result)) |
| | | |
| | | }, |
| | | async chooseCategory(id) { |