Commit 23c26165 authored by June's avatar June

fix:分组商品上下拉

parent b828866c
...@@ -60,44 +60,50 @@ ...@@ -60,44 +60,50 @@
<view class="cates_title">{{cate_name}}</view> <view class="cates_title">{{cate_name}}</view>
<pull-list <pull-list
ref="pullList" ref="pullList"
:refresherEnabled="false" @refresh="refresh"
@tolower="tolower"
> >
<view <block
class="goods-item flex j-start a-center" v-for="(goods, goodsidx) in goods_list"
v-for="good in goods_list" :key="goodsidx"
:key="good.goods_id"
@click="navDetail(good)"
> >
<image <view
class="goods-cover mr-2" class="goods-item flex j-start a-center"
lazy-load v-for="good in goods"
:src="baseUrl + '/' + good.goods_thumb" :key="good.goods_id"
mode="aspectFit" @click="navDetail(good)"
/> >
<view class="goods-price flex-1 flex flex-column j-between font-28"> <image
<view class="title">{{good.goods_name}}</view> class="goods-cover mr-2"
<view class="descColor desc font-24 w-100 flex j-between a-center"> lazy-load
<text class="flex-1">{{good.specification}}</text> :src="baseUrl + '/' + good.goods_thumb"
<text class="sale-count text-right">销量:{{good.virtual_quantity_sold}}</text> mode="aspectFit"
</view> />
<view class="w-100 flex j-between a-center"> <view class="goods-price flex-1 flex flex-column j-between font-28">
<view class="flex j-start a-center"> <view class="title">{{good.goods_name}}</view>
<price <view class="descColor desc font-24 w-100 flex j-between a-center">
:is_inquiry="good.is_inquiry" <text class="flex-1">{{good.specification}}</text>
:price="good.shop_price" <text class="sale-count text-right">销量:{{good.virtual_quantity_sold}}</text>
</view>
<view class="w-100 flex j-between a-center">
<view class="flex j-start a-center">
<price
:is_inquiry="good.is_inquiry"
:price="good.shop_price"
/>
<text class="primaryColor font-28">{{good.least_str}}</text>
</view>
<image
class="cart-icon"
src="/static/images/common/icon-cart.png"
mode="aspectFit"
@click.stop="handlePop(good)"
/> />
<text class="primaryColor font-28">{{good.least_str}}</text>
</view> </view>
<image
class="cart-icon"
src="/static/images/common/icon-cart.png"
mode="aspectFit"
@click.stop="handlePop(good)"
/>
</view> </view>
</view> </view>
</view> </block>
<view class="empty-text text-center mt-4 p-2">到底了,看看别的分类吧~</view> <view class="empty-text text-center mt-4 p-2">到底了,看看别的分类吧~</view>
...@@ -192,6 +198,7 @@ export default { ...@@ -192,6 +198,7 @@ export default {
cat_id = cate_list[index].id cat_id = cate_list[index].id
this.cate_name = cate_list[index].cat_name this.cate_name = cate_list[index].cat_name
this.loadMore.resetParams() this.loadMore.resetParams()
this.goods_list = []
this.getCateGoods() this.getCateGoods()
}, },
...@@ -201,10 +208,7 @@ export default { ...@@ -201,10 +208,7 @@ export default {
const { status, data } = await this.loadMore.getList({cat_id}, cateGoodsList) const { status, data } = await this.loadMore.getList({cat_id}, cateGoodsList)
if(status) { if(status) {
this.goods_list = data this.$set(this.goods_list, this.goods_list.length, data)
this.cate
} else {
this.goods_list = []
} }
}catch(e){ }catch(e){
console.log(e) console.log(e)
...@@ -212,6 +216,18 @@ export default { ...@@ -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 分类一的下表 // 切换分类 type === 1 分类1 type === 2 分类2, cate1_idx 分类一的下表
cateChange(type, cate_id, cate1_idx, cate2_idx) { cateChange(type, cate_id, cate1_idx, cate2_idx) {
if(cat_id === cate_id) return 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