完善商品搜索,商品分页,调整聊聊栏目提示开发提示,新增检查版本更新

This commit is contained in:
唐明明
2022-01-14 10:19:17 +08:00
parent e46e35cfbd
commit 1c4393bb6a
9 changed files with 419 additions and 162 deletions

View File

@@ -11,6 +11,10 @@
color="#e6576b"
@onGoods="$Router.push({ name: 'StoreGoods', params: {id: $event.goods_id}})"
/>
<!-- 加载更多 -->
<view class="pages-load">
<u-loadmore :status="status" />
</view>
</block>
<block v-else>
<view class="vertical pages-empty">
@@ -34,7 +38,8 @@
classify: [
{ name: "全部", category_id: "" }
],
cid : ""
cid : "",
page : 1
};
},
mounted(){
@@ -46,12 +51,17 @@
},
methods:{
// 商品列表
getLists(cid) {
getLists() {
lists({
category_id : this.$Route.query.id,
category_cid: this.cid
category_cid: this.cid,
page : this.page
}).then(res => {
this.goodsArr = res.data
if(res.page.current === 1){
this.goodsArr = []
}
this.goodsArr = this.goodsArr.concat(res.data)
this.status = res.page.has_more ? 'loadmore' : 'nomore'
uni.stopPullDownRefresh()
})
},
@@ -66,10 +76,22 @@
this.goodsArr = []
this.cid = e.category_id
this.getLists()
}
},
},
onPullDownRefresh() {
this.page = 1
this.getLists()
},
onReachBottom() {
if(this.status === 'loadmore'){
this.page += 1
this.status = 'loading'
this.getLists()
}
},
onNavigationBarButtonTap() {
this.$Router.push({name: 'StoreSearch'})
}
}
</script>
@@ -83,4 +105,9 @@
.pages-empty{
height: 70vh;
}
// 加载分页
.pages-load{
padding-bottom: $padding;
}
</style>