Browse Source

commit -m 分类筛选条件增加项

zhengjinyi 3 years ago
parent
commit
9c9e9466bc
4 changed files with 59 additions and 36 deletions
  1. 51 33
      pages/goods/goods-classify.vue
  2. 5 0
      pages/search/search.vue
  3. 2 2
      services/config.env.js
  4. 1 1
      services/sellse.service.js

+ 51 - 33
pages/goods/goods-classify.vue

@@ -342,7 +342,12 @@
 					</view>
 					<view class="drawer-main">
 						<view class="drawer-main-brand clearfix">
-							<view class="drawer-brand-list">全部</view>
+							<view
+								class="drawer-brand-list"
+								:class="isAllcheckedBrand ? 'checked' : ''"
+								@click="choiceBrandAll"
+								>全部</view
+							>
 							<view
 								class="drawer-brand-list"
 								:class="brand.isChecked ? 'checked' : ''"
@@ -359,7 +364,10 @@
 						<view class="drawer-main-radio">
 							<view class="drawer-radio-name">新品</view>
 							<view class="drawer-radio-input" @click="choiceNewType">
-								<text class="iconfont" :class="isChoiceNewType ? 'icon-yixuanze' : 'icon-weixuanze'"></text>
+								<text
+									class="iconfont"
+									:class="isChoiceNewType ? 'icon-yixuanze' : 'icon-weixuanze'"
+								></text>
 							</view>
 						</view>
 						<view class="drawer-main-radio">
@@ -392,16 +400,6 @@ import uniGrader from '@/components/uni-grade/uni-grade.vue'
 import modalLayer from '@/components/modal-layer'
 import authorize from '@/common/config/authorize.js'
 import wxLogin from '@/common/config/wxLogin.js'
-const defaultListQuery = {
-	id: 0,
-	identity: 0,
-	pageNum: 1,
-	pageSize: 10,
-	sortField: '',
-	sortType: 1,
-	brandIds:'',
-	idType: 0 //一级
-}
 export default {
 	components: {
 		customFloor,
@@ -423,7 +421,7 @@ export default {
 			isSearchPrice: true,
 			isChoiceNewType: false,
 			isChoiceActiType: false,
-			isAllcheckedBrand:false,
+			isAllcheckedBrand: false,
 			headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
 			systeminfo: this.setSysteminfo(), //获取设备信息
 			CustomBar: this.CustomBar, // 顶部导航栏高度
@@ -435,14 +433,25 @@ export default {
 			userId: 0,
 			vipFlag: 0,
 			userIdentity: 0,
-			actasFlag:2,
+			actasFlag: 2,
 			listData: [],
 			brandLists: [],
 			checkedBrandList: [],
 			checkedBrandLength: 0,
 			windowHeight: '',
 			scrollHeight: '',
-			listQuery: Object.assign({}, defaultListQuery),
+			listQuery: {
+				id: 0,
+				identity: 0,
+				pageNum: 1,
+				pageSize: 10,
+				sortField: '',
+				sortType: 1,
+				brandIds: '', // 品牌Id
+				newFlag: 0, // 查询新品标记,默认0,新品1
+				promotionFlag: 0, // 查询促销标记,默认0,促销1
+				idType: 0 //一级
+			},
 			brandParam: {
 				keyword: '',
 				id: '',
@@ -459,8 +468,8 @@ export default {
 			classifyType: 0,
 			classData: {},
 			searchCheckedId: null,
-			height:0,
-			drawerH:0 // 抽屉内部scrollview高度
+			height: 0,
+			drawerH: 0 // 抽屉内部scrollview高度
 		}
 	},
 	computed: {
@@ -484,17 +493,17 @@ export default {
 	methods: {
 		async initGetStotage(option) {
 			const userInfo = await this.$api.getStorage()
-			this.listQuery.id = option.id
+			this.listQuery.id = this.brandParam.id = option.id
 			this.listQuery.identity = this.identity
-			this.listQuery.idType = this.classifyType = Number(option.classType)
+			this.listQuery.idType = this.classifyType = this.brandParam.idType = Number(option.classType)
 			uni.setNavigationBarTitle({ title: option.title })
 			this.userId = userInfo.userId ? userInfo.userId : 0
 			this.shopId = userInfo.shopId ? userInfo.shopId : 0
 			this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
 			this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
-			if(this.userIdentity == 1){
+			if (this.userIdentity == 1) {
 				this.actasFlag = this.userIdentity
-			}else{
+			} else {
 				this.actasFlag = 2
 			}
 			this.isRequest = true
@@ -525,7 +534,12 @@ export default {
 						el.isChecked = false
 						return el
 					})
-					this.brandLists = this.defaultBrandLists.slice(0,8)
+					if(this.defaultBrandLists.length>8){
+						this.isShowAllBrands = false
+					}else{
+						this.isShowAllBrands = true
+					}
+					this.brandLists = this.defaultBrandLists.slice(0, 8)
 					console.log('品牌=============>', this.brandLists)
 				})
 				.catch(error => {
@@ -613,7 +627,7 @@ export default {
 			this.priceLoading = true
 			this.productIds = productIdArr.join(',')
 			this.ProductService.querySearchProductPrice({
-				flag:this.actasFlag, //查询促销标记 1协销 2机构 3供应商
+				flag: this.actasFlag, //查询促销标记 1协销 2机构 3供应商
 				userId: this.userId,
 				productIds: this.productIds,
 				source: 2
@@ -650,6 +664,7 @@ export default {
 				this.isSearchPriceFirst = true
 				this.listQuery.sortType = 1
 				this.listQuery.sortField = ''
+				this.GetProductListInfo()
 			} else if (index == 1) {
 				this.tabIndex = 1
 				this.isSearchSalesFirst = false
@@ -662,6 +677,7 @@ export default {
 					this.listQuery.sortType = 0
 				}
 				this.listQuery.sortField = 'p_sales'
+				this.GetProductListInfo()
 			} else if (index == 2) {
 				this.tabIndex = 2
 				this.isSearchSalesFirst = true
@@ -674,6 +690,7 @@ export default {
 					this.listQuery.sortType = 0
 				}
 				this.listQuery.sortField = 'p_favorite'
+				this.GetProductListInfo()
 			} else if (index == 3) {
 				this.tabIndex = 3
 				this.isSearchSalesFirst = true
@@ -686,16 +703,17 @@ export default {
 					this.listQuery.sortType = 0
 				}
 				this.listQuery.sortField = 'p_price'
+				this.GetProductListInfo()
 			} else if (index == 4) {
+				console.log('type', this.listQuery.id)
 				this.searchClickFn()
 				this.getCommoditySearchQUeryBrand()
 			}
-			this.GetProductListInfo()
 		},
 		handSearchList() {
 			//确定筛选
-			if (this.searchCheckedId == '') {
-				this.listQuery.id = this.classData.bigTypeID
+			if (this.searchCheckedId == null) {
+				this.listQuery.id = this.classData.bigTypeId
 			} else {
 				this.listQuery.id = this.searchCheckedId
 			}
@@ -779,7 +797,7 @@ export default {
 			this.brandLists = this.defaultBrandLists
 		},
 		choiceBrand(brand, index) {
-			// 选择品牌 
+			// 选择品牌
 			brand.isChecked = !brand.isChecked
 			if (brand.isChecked) {
 				this.checkedBrandList.push(brand.id)
@@ -792,28 +810,28 @@ export default {
 			this.listQuery.brandIds = this.checkedBrandList.join(',')
 			console.log('this.listQuery.brandIds', this.listQuery.brandIds)
 		},
-		choiceBrandAll(){
+		choiceBrandAll() {
 			// 点击选择全部品牌
 			this.isAllcheckedBrand = true
-			this.brandLists.forEach(el=>{
+			this.brandLists.forEach(el => {
 				el.isChecked = false
 			})
 		},
 		choiceNewType() {
 			// 选择筛选项新品
 			this.isChoiceNewType = !this.isChoiceNewType
-			if(this.isChoiceNewType){
+			if (this.isChoiceNewType) {
 				this.listQuery.newFlag = 1
-			}else{
+			} else {
 				this.listQuery.newFlag = 0
 			}
 		},
 		choiceActiType() {
 			// 选择筛选项促销商品
 			this.isChoiceActiType = !this.isChoiceActiType
-			if(this.isChoiceNewType){
+			if (this.isChoiceNewType) {
 				this.listQuery.promotionFlag = 1
-			}else{
+			} else {
 				this.listQuery.promotionFlag = 0
 			}
 		},

+ 5 - 0
pages/search/search.vue

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

+ 2 - 2
services/config.env.js

@@ -1,10 +1,10 @@
 let URL_CONFIG = ''
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
-    URL_CONFIG = 'http://192.168.2.67:18002'	 //智捷联调地址
+    // 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-b.caimei365.com'
     // URL_CONFIG = 'https://core.caimei365.com'
 }else{
     // 生产环境

+ 1 - 1
services/sellse.service.js

@@ -295,7 +295,7 @@ export default class SellerService {
 	 */
     SellerProductRechargeGoods (data = {}) {
         return this.AjaxService.get({ 
-            url:'/product/rechargeGoods', 
+            url:'/commodity/recharge/details', 
             data, 
             isLoading: true ,
         })