Browse Source

分类商品列表筛选修复

zhengjinyi 3 years ago
parent
commit
3222a21373
4 changed files with 12 additions and 102 deletions
  1. 5 95
      pages/goods/goods-classify.vue
  2. 2 2
      pages/search/search.vue
  3. 3 3
      services/ajax.env.js
  4. 2 2
      services/config.env.js

+ 5 - 95
pages/goods/goods-classify.vue

@@ -287,52 +287,6 @@
 				:style="{ paddingTop: CustomBar + 'px', paddingBottom: isIphoneX ? '180rpx' : '146rpx' }"
 			>
 				<scroll-view class="tui-drawer-scroll" scroll-y :style="{ height: drawerH + 'px' }">
-					<view class="drawer-title">
-						<view class="drawer-title-h1">{{ classData.name }}</view>
-					</view>
-					<view class="drawer-main">
-						<view class="drawer-main-cell clearfix">
-							<template v-if="classData.smallTypeList">
-								<view
-									class="drawer-item-cell"
-									v-for="(item, index) in classData.smallTypeList"
-									:key="index"
-								>
-									<view class="drawer-item-title">{{ item.name }}</view>
-									<view class="drawer-item-main" v-if="item.tinyTypeList">
-										<text
-											class="drawer-item-text"
-											:class="tiny.isChecked ? 'checked' : ''"
-											v-for="(tiny, tinyIndex) in item.tinyTypeList"
-											:key="tinyIndex"
-											@click="SearchCondition(3, item, tiny)"
-											>{{ tiny.name }}</text
-										>
-									</view>
-									<view class="drawer-item-main" v-else>
-										<text
-											class="drawer-item-text"
-											:class="item.isChecked ? 'checked' : ''"
-											@click="SearchCondition(2, item)"
-											>全部商品</text
-										>
-									</view>
-								</view>
-							</template>
-							<template v-else>
-								<view class="drawer-item-cell">
-									<view class="drawer-item-main none">
-										<text
-											class="drawer-item-text"
-											:class="classData.isChecked ? 'checked' : ''"
-											@click="SearchCondition(1, classData)"
-											>全部商品</text
-										>
-									</view>
-								</view>
-							</template>
-						</view>
-					</view>
 					<view class="drawer-title">
 						<view class="drawer-title-h1">品牌</view>
 						<view class="drawer-title-p"
@@ -440,6 +394,7 @@ export default {
 			checkedBrandLength: 0,
 			windowHeight: '',
 			scrollHeight: '',
+			pathQueryId:0,
 			listQuery: {
 				id: 0,
 				identity: 0,
@@ -493,7 +448,7 @@ export default {
 	methods: {
 		async initGetStotage(option) {
 			const userInfo = await this.$api.getStorage()
-			this.listQuery.id = this.brandParam.id = option.id
+			this.listQuery.id = this.pathQueryId = this.brandParam.id = option.id
 			this.listQuery.identity = this.identity
 			this.listQuery.idType = this.classifyType = this.brandParam.idType = Number(option.classType)
 			uni.setNavigationBarTitle({ title: option.title })
@@ -535,12 +490,12 @@ export default {
 						el.isChecked = false
 						return el
 					})
-					if(this.defaultBrandLists.length>8){
+					if(this.defaultBrandLists.length>11){
 						this.isShowAllBrands = false
 					}else{
 						this.isShowAllBrands = true
 					}
-					this.brandLists = this.defaultBrandLists.slice(0, 8)
+					this.brandLists = this.defaultBrandLists.slice(0, 11)
 					console.log('品牌=============>', this.brandLists)
 				})
 				.catch(error => {
@@ -713,58 +668,13 @@ export default {
 		handSearchList() {
 			//确定筛选
 			if (this.searchCheckedId == null) {
-				this.listQuery.id = this.classData.bigTypeId
+				this.listQuery.id = this.pathQueryId
 			} else {
 				this.listQuery.id = this.searchCheckedId
 			}
 			this.rightDrawer = false
 			this.GetProductListInfo()
 		},
-		SearchCondition(type, item, tiny) {
-			//选择筛选分类
-			this.listQuery.idType = type
-			const {
-				classData,
-				classData: { smalltypeList }
-			} = this
-			classData.isChecked = false
-			if (smalltypeList && smalltypeList.length > 0) {
-				smalltypeList.forEach((item, index) => {
-					item.isChecked = false
-					const { tinytypeList } = item
-					if (tinytypeList && tinytypeList.length > 0) {
-						tinytypeList.forEach((tinyItem, tinyIndex) => {
-							tinyItem.isChecked = false
-						})
-					}
-				})
-			}
-			switch (type) {
-				case 1:
-					console.log('1级分类全部商品', item)
-					item.isChecked = !item.isChecked
-					this.searchCheckedId = item.bigTypeId
-					break
-				case 2:
-					console.log('2级分类全部商品', item)
-					item.isChecked = !item.isChecked
-					if (item.isChecked) {
-						this.searchCheckedId = item.smallTypeId
-					} else {
-						this.searchCheckedId = ''
-					}
-					break
-				case 3:
-					console.log('3级分类', tiny)
-					tiny.isChecked = !tiny.isChecked
-					if (tiny.isChecked) {
-						this.searchCheckedId = tiny.tinyTypeId
-					} else {
-						this.searchCheckedId = ''
-					}
-					break
-			}
-		},
 		navToDetailPage(id) {
 			this.isModallayer = true
 			this.$api.navigateTo(`/pages/goods/product?id=${id}`)

+ 2 - 2
pages/search/search.vue

@@ -580,12 +580,12 @@ export default {
 						el.isChecked = false
 						return el
 					})
-					if(this.defaultBrandLists.length>8){
+					if(this.defaultBrandLists.length>11){
 						this.isShowAllBrands = false
 					}else{
 						this.isShowAllBrands = true
 					}
-					this.brandLists = this.defaultBrandLists.slice(0,8)
+					this.brandLists = this.defaultBrandLists.slice(0,11)
 					console.log('品牌=============>', this.brandLists)
 				})
 				.catch(error => {

+ 3 - 3
services/ajax.env.js

@@ -4,11 +4,11 @@ if(process.env.NODE_ENV === 'development'){
     // URL_CONFIG = 'http://192.168.2.67:8008'	 //智捷联调地址
     // URL_CONFIG = 'http://192.168.2.68:8008'	 	 //涛涛联调地址
     // URL_CONFIG = 'http://192.168.2.75:8008'	 //超超联调地址
-    URL_CONFIG = 'https://spi-b.caimei365.com'//采美测试地址
-    // URL_CONFIG = 'https://spi.caimei365.com'
+    // URL_CONFIG = 'https://spi-b.caimei365.com'//采美测试地址
+    URL_CONFIG = 'https://spi.caimei365.com'
 }else{ 
     // 生产环境
     // URL_CONFIG = 'https://spi-b.caimei365.com'
-    URL_CONFIG = 'https://spi.caimei365.com'
+    URL_CONFIG = 'https://spi.caimei365.com' 
 }
 export default URL_CONFIG

+ 2 - 2
services/config.env.js

@@ -4,8 +4,8 @@ if(process.env.NODE_ENV === 'development'){
     // URL_CONFIG = 'http://192.168.2.67:18002'	 //智捷联调地址
     // URL_CONFIG = 'http://192.168.2.68:18002'	 //涛涛联调地址
     // URL_CONFIG = 'http://192.168.2.75:18002'	 //超超联调地址
-    URL_CONFIG = 'https://core-b.caimei365.com'
-    // URL_CONFIG = 'https://core.caimei365.com'
+    // URL_CONFIG = 'https://core-b.caimei365.com'
+    URL_CONFIG = 'https://core.caimei365.com'
 }else{
     // 生产环境
     // URL_CONFIG = 'https://core-b.caimei365.com'