main
fanfan 7 months ago
parent 07acb3c36b
commit 205f0d9d60
  1. 43
      pages/goods/list.vue

@ -13,7 +13,8 @@
<template v-if="options.categoryId">
<view class="goodsban" v-if="tabbar && tabbar.length > 0">
<scroll-view class="typeList" scroll-x="true">
<view v-for="(item,index) in tabbar" :key="index" class="bandsImg" @click="onChage(item,1,index)"
<view v-for="(item,index) in tabbar" :key="index" class="bandsImg"
@click="onChage(item,1,index)"
:style="{'color':item.category_id==isBanrdActive?'#F43B21':'#5A5A5A','border':item.category_id==isBanrdActive?'1rpx solid #F22029':'1rpx solid #E7E7E7'}">
<image :src="item.image?item.image.external_url:''" mode="aspectFill"></image>
<view class="typeItem">{{item.name}}</view>
@ -35,7 +36,8 @@
<view class="sort-item" :class="{ active: sortType === 'all' }" @click="handleSortType('all')">
<text>综合</text>
</view>
<view class="sort-item" :class="{ active: sortType === 'sales' }" @click="handleSortType('sales')">
<view class="sort-item" :class="{ active: sortType === 'sales' }"
@click="handleSortType('sales')">
<text>销量</text>
</view>
<view class="sort-item sort-item-price" :class="{ active: sortType === 'price' }"
@ -44,7 +46,8 @@
<view class="price-arrow">
<view class="icon up" :class="{ active: sortType === 'price' && !sortPrice }">
<u-icon name="arrow-up-fill"
:color="!sortPrice&&sortType === 'price'?'#F43B21':'#3C3C3C'" size="17"></u-icon>
:color="!sortPrice&&sortType === 'price'?'#F43B21':'#3C3C3C'" size="17">
</u-icon>
</view>
<view class="icon down" :class="{ active: sortType === 'price' && sortPrice }">
<u-icon name="arrow-down-fill"
@ -53,7 +56,8 @@
</view>
</view>
<view class="sort-item" :class="{ active: sortType === 'city' }" @click="handleSortType('city')">
<view class="sort-item" :class="{ active: sortType === 'city' }"
@click="handleSortType('city')">
<picker mode="selector" @change="multiChange" value="{{multiIndex}}" :range="multiArray"
range-key="name">
<text>类型</text>
@ -336,25 +340,32 @@
if (res.data.list.length > 0) {
that.tabbar = res.data.list;
that.isBanrdActive = 0
that.list= [];
that.onChage(that.tabbar[0], 1,0)
that.list = [];
if (this.options.categoryId) {
that.onChage(that.tabbar[0], 1, 0)
}else{
this.$refs.uWaterfall1.clear();
this.list.data = []
this.list = []
this.mescroll.resetUpScroll()
}
// res.data.list.forEach(item => {
// item.children.forEach(item_1 => {
// that.goodsType.push(item_1)
// })
// });
// console.log(that.goodsType, that.tabbar)
}else{
} else {
that.upCallback(1)
}
})
.catch(reject)
})
},
onChage(item, type,index) {
onChage(item, type, index) {
if (type == 1) {
if(this.tabbar && this.tabbar[index].children && this.tabbar[index].children.length > 0){
this.goodsType= this.tabbar[index].children;
if (this.tabbar && this.tabbar[index].children && this.tabbar[index].children.length > 0) {
this.goodsType = this.tabbar[index].children;
}
this.isActive = '';
this.keyName2 = ''
@ -366,7 +377,6 @@
this.keyName1 = item.name
}
}
if (type == 2) {
if (item.category_id == this.isActive) {
this.isActive = '';
@ -548,7 +558,8 @@
::v-deep .u-empty {
padding: 100rpx 0;
}
.head{
.head {
width: 100%;
overflow: hidden;
background-color: #fff;
@ -557,9 +568,11 @@
width: 100%;
left: 0;
}
.blank{
.blank {
height: 416rpx;
}
//
.header {
background-color: #fff;
@ -591,6 +604,7 @@
.store-sort {
color: #000;
width: 100%;
.store-box {
display: flex;
padding: 20rpx 0;
@ -732,7 +746,7 @@
background: #FFFFFF;
box-sizing: border-box;
margin: 20rpx 14rpx 0rpx 0;
border-radius:8rpx;
border-radius: 8rpx;
.goods-image {
@ -789,6 +803,7 @@
justify-content: space-between;
align-items: center;
margin-bottom: 16rpx;
image {
width: 28rpx;
height: 28rpx;

Loading…
Cancel
Save