Commit 23c26165 authored by June's avatar June

fix:分组商品上下拉

parent b828866c
......@@ -60,12 +60,17 @@
<view class="cates_title">{{cate_name}}</view>
<pull-list
ref="pullList"
:refresherEnabled="false"
@refresh="refresh"
@tolower="tolower"
>
<block
v-for="(goods, goodsidx) in goods_list"
:key="goodsidx"
>
<view
class="goods-item flex j-start a-center"
v-for="good in goods_list"
v-for="good in goods"
:key="good.goods_id"
@click="navDetail(good)"
>
......@@ -98,6 +103,7 @@
</view>
</view>
</view>
</block>
<view class="empty-text text-center mt-4 p-2">到底了,看看别的分类吧~</view>
......@@ -192,6 +198,7 @@ export default {
cat_id = cate_list[index].id
this.cate_name = cate_list[index].cat_name
this.loadMore.resetParams()
this.goods_list = []
this.getCateGoods()
},
......@@ -201,10 +208,7 @@ export default {
const { status, data } = await this.loadMore.getList({cat_id}, cateGoodsList)
if(status) {
this.goods_list = data
this.cate
} else {
this.goods_list = []
this.$set(this.goods_list, this.goods_list.length, data)
}
}catch(e){
console.log(e)
......@@ -212,6 +216,18 @@ export default {
}
},
tolower() {
console.log('tolower')
this.getCateGoods()
},
refresh() {
console.log('refresh')
this.loadMore.resetParams()
this.goods_list = []
this.getCateGoods()
},
// 切换分类 type === 1 分类1 type === 2 分类2, cate1_idx 分类一的下表
cateChange(type, cate_id, cate1_idx, cate2_idx) {
if(cat_id === cate_id) return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment