1. 下拉刷新

2. 翻页到底部提示
This commit is contained in:
jqtmviyu@gmail.com 2021-02-25 22:41:50 +08:00
parent fa45fef42e
commit e377702b4a
2 changed files with 17 additions and 2 deletions

View File

@ -18,7 +18,8 @@
{ {
"path": "pages/goods_list/goods_list", "path": "pages/goods_list/goods_list",
"style": { "style": {
"navigationBarTitleText": "商品列表" "navigationBarTitleText": "商品列表",
"enablePullDownRefresh":true
} }
}, },
{ {

View File

@ -38,6 +38,8 @@
<block v-else-if="tabsCurrent===2"> <block v-else-if="tabsCurrent===2">
<view class="price">价格</view> <view class="price">价格</view>
</block> </block>
<!-- 没有更多数数据提示 -->
<view v-if="!hasMore">没有更多数据</view>
</view> </view>
</template> </template>
@ -72,7 +74,9 @@ export default {
], ],
tabsCurrent: 0, tabsCurrent: 0,
// //
goods: [] goods: [],
//
hasMore: true,
} }
}, },
@ -86,6 +90,7 @@ export default {
// //
if(Params.pagenum >= TotalPage){ if(Params.pagenum >= TotalPage){
console.log("没有下一页数据了") console.log("没有下一页数据了")
this.hasMore = false
uni.showToast({ uni.showToast({
title: "没有更多数据了", title: "没有更多数据了",
icon:"none", icon:"none",
@ -97,6 +102,15 @@ export default {
this.getGoods() this.getGoods()
} }
}, },
//
async onPullDownRefresh(){
this.goods = []
this.hasMore = false
Params.pagenum = 1
await this.getGoods()
//
uni.stopPullDownRefresh()
},
methods: { methods: {
// //