hwb0 преди 3 години
родител
ревизия
ffe82445f7
променени са 2 файла, в които са добавени 13 реда и са изтрити 4 реда
  1. 1 1
      packageGoods/goods/list.vue
  2. 12 3
      pages/core/index.vue

+ 1 - 1
packageGoods/goods/list.vue

@@ -50,7 +50,7 @@
 				<view class="goods-list-item"></view>
 			</view>
 		</view>
-		<view class="flex empty" v-if="!list.length && !loading">
+		<view class="flex empty" v-if="!list.length">
 			<u-empty text="暂无商品" mode="order" />
 		</view>
 	</view>

+ 12 - 3
pages/core/index.vue

@@ -38,8 +38,8 @@
 		<view class="core-category">
 			<swiper class="core-category-swiper" :autoplay="false">
 				<swiper-item class="swiper-item" v-for="(item, index) in classifyIndex == 0 ? classifyListFilter : classifyList[classifyIndex].list" :key="index">
-					<view class="swiper-item__content" v-for="(items, indexs) in item" :key="indexs" @click="toTagGoods(items)">
-						<image :src="items.picUrl" mode="aspectFit"></image>
+					<view class="swiper-item__content" v-for="(items, indexs) in item" :key="indexs">
+						<image :src="items.picUrl" mode="aspectFit" @click="toCategoryGoods(index, indexs)"></image>
 						<view class="name">{{ items.name }}</view>
 					</view>
 				</swiper-item>
@@ -289,7 +289,16 @@
 			// 商品标签
 			toTagGoods(item) {
 				uni.navigateTo({
-					url: `/packageGoods/goods/list?name=${ item.name }&tagIds=${ item.tagId ? item.tagId : '' }&categoryId=${ item.categoryId ? item.categoryId : '' }`
+					url: `/packageGoods/goods/list?name=${ item.name }&tagIds=${ item.tagId ? item.tagId : '' }`
+				})
+			},
+			
+			// 商品分类
+			toCategoryGoods(index, indexs) {
+				let list = this.classifyIndex == 0 ? this.classifyListFilter : this.classifyList[this.classifyIndex].list
+				let item = list[index][indexs]
+				uni.navigateTo({
+					url: `/packageGoods/goods/list?name=${ item.name }&categoryId=${ item.categoryId ? item.categoryId : '' }`
 				})
 			},
 		},