Przeglądaj źródła

commit -m 首页改版

zhengjinyi 4 lat temu
rodzic
commit
4c31afb0d3

+ 0 - 1
components/cm-module/homeIndex/pageFloor.vue

@@ -86,7 +86,6 @@
 		methods:{
 			initData(data){
 				this.pageFloorList = data
-				console.log(this.pageType)
 			},
 			NavToDetailPage(page) {//跳转
 				this.$api.navigateTo(`/pages/goods/good-floorMore?pageType=${this.pageType}&floorId=${page.id}&title=${page.title}`)

+ 0 - 1
components/cm-module/homeIndex/pageSpecial.vue

@@ -93,7 +93,6 @@
 		methods:{
 			initData(data){
 				this.tempData = data
-				console.log(this.tempData)
 			},
 			NavToDetailPage(floor) {//跳转
 				/**

+ 9 - 9
components/cm-module/pageTemplate/templateNav.vue

@@ -36,15 +36,15 @@
 				this.navList = list
 				console.log(this.navList)
 			},
-			NavToDetailPage(pro){//分类导航跳转
-				let self = this;
-				uni.setStorage({
-					key: 'commodity_id',
-					data: pro.tinyTypeID,
-					success: function () {
-						self.$api.navigateTo(`/pages/goods/goods-classify?title=${pro.name}&id=${pro.bigTypeID}`)
-					}
-				})
+			NavToDetailPage(item){//分类导航跳转
+				this.$api.navigateTo(`/pages/goods/goods-classify?classType=1&id=${item.bigTypeID}&title=${item.name}`)
+				// uni.setStorage({
+				// 	key: 'commodity_id',
+				// 	data: pro.tinyTypeID,
+				// 	success: function () {
+				// 		self.$api.navigateTo(`/pages/goods/goods-classify?title=${pro.name}&id=${pro.bigTypeID}`)
+				// 	}
+				// })
 			}
 		}
 	}

+ 8 - 10
pages/goods/goods-classify.vue

@@ -133,14 +133,12 @@
 	import listSkeleton from '@/components/cm-module/listTemplate/listSkeleton'
 	import customFloor from '@/components/cm-custom/custom-floor' 		 //自定义导航
 	const defaultListQuery = {
+			id:0,
 			pageNum:1,
 			pageSize:10,
+			sortField:'',
 			sortType:0,
-			sortfield:'',
-			sorttype:0,
-			bigTypeID:0,//一级
-			smallTypeID:'',//二级
-			tinyTypeID:''//三级
+			idType:0,//一级
 	};
 	export default{
 		components:{
@@ -176,12 +174,12 @@
 				nomoreText: '上拉显示更多',
 				rightDrawer: false,
 				setNavigationBarTitle:'',
+				classifyType:0,
 			}
 		},
 		onLoad(option) {
 			console.log(option)
 			this.initOption(option);
-			
 		},
 		computed: {
 			...mapState(['hasLogin','userInfo','identity'])
@@ -193,8 +191,8 @@
 		},	
 		methods:{
 			initOption(option) {
-				const {id , from: value } = option;
-				this.listQuery.bigTypeID = id;
+				this.listQuery.id = option.id;
+				this.listQuery.idType = Number(option.classType);
 				this.setNavigationBarTitle = option.title
 				uni.setNavigationBarTitle({title:option.title});
 				this.$api.getComStorage('userInfo').then((resolve) =>{
@@ -210,9 +208,9 @@
 			InfoSecondClassly(){//根据一级分类ID 查询二三级分类
 				
 			},
-			GetProductListInfo(){
+			GetProductListInfo(){//查询分类商品列表
 				this.listQuery.pageNum = 1
-				this.ProductService.GetProductListByTypeID(this.listQuery).then(response =>{
+				this.ProductService.GetSearchProductTypeData(this.listQuery).then(response =>{
 					let data = response.data.productPage
 					this.hasNextPage = data.hasNextPage
 					if(data.results && data.results.length > 0){

+ 19 - 17
pages/search/search.vue

@@ -36,18 +36,18 @@
 				<view class="list">
 					<view class="list-title">产品</view>
 					<view class="list-main">
-						<view v-for="(item,index) in hotSearchList" :key="index" @click="keywordsClick(item.keyword)" :class="item.type == '1' ? 'list-active' : ''">
-							{{item.keyword}}
-							<text class="iconfont icon-resou" v-if="item.type === '1'"></text>
+						<view v-for="(item,index) in productHotSearch" :key="index" @click="keywordsClick(item.name)" :class="item.isHot == '1' ? 'list-active' : ''">
+							{{item.name}}
+							<text class="iconfont icon-resou" v-if="item.isHot === '1'"></text>
 						</view>
 					</view>
 				</view>
 				<view class="list">
 					<view class="list-title">仪器</view>
 					<view class="list-main">
-						<view v-for="(item,index) in hotSearchList" :key="index" @click="keywordsClick(item.keyword)" :class="item.type == '1' ? 'list-active' : ''">
-							{{item.keyword}}
-							<text class="iconfont icon-resou" v-if="item.type === '1'"></text>
+						<view v-for="(item,index) in instrumentHotSearch" :key="index" @click="keywordsClick(item.name)" :class="item.isHot == '1' ? 'list-active' : ''">
+							{{item.name}}
+							<text class="iconfont icon-resou" v-if="item.isHot === '1'"></text>
 						</view>
 					</view>
 				</view>
@@ -179,16 +179,8 @@
 				isShowClose:false,	//是否显示清空输入框图标
 				isSearchHistory:false,//是都显示搜索历史
 				serachRecordList:[],//历史搜索记录
-				hotSearchList:[
-					{keyword:'玻尿酸',type:'1',name:''},
-					{keyword:'械字号',type:'1',name:''},
-					{keyword:'导入液含税',type:'1',name:''},
-					{keyword:'热门仪器',type:'1',name:''},
-					{keyword:'除皱',type:'1',name:''},
-					{keyword:'微整形 ',type:'0',name:''},
-					{keyword:'纹绣',type:'0',name:''},
-					{keyword:'美白嫩肤',type:'0',name:''}
-				],
+				instrumentHotSearch:[],
+				productHotSearch:[],
 				isShowWrapper:false,
 				isModallayer:false,
 				isFocus:false,
@@ -215,7 +207,6 @@
 		},
 		onLoad(option) {
 			console.log(option)
-			
 			this.$api.getStorage().then((resolve) =>{
 				this.userID = resolve.userID ? resolve.userID : 0;
 				this.shopId = resolve.shopID ? resolve.shopID : 0;
@@ -241,6 +232,16 @@
 			...mapState(['hasLogin','userInfo','identity'])
 		},
 		methods:{
+			GetHomeHotSearchTerms(){//金刚区分类
+				this.CommonService.GetHomeHotSearchTerms({}).then(response =>{
+					let data = response.data
+					console.log(data)
+					this.instrumentHotSearch = data.instrumentHotSearch
+					this.productHotSearch = data.productHotSearch
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})
+			},
 			initGetSerachRecord(){//查询搜索历史记录
 				this.ProductService.GetProductSearchHistory({userId:this.userID}).then(response =>{
 					if(response.code == 0){
@@ -441,6 +442,7 @@
 		},
 		onShow() {
 			this.setScrollHeight();
+			this.GetHomeHotSearchTerms()
 		}
 	}
 </script>

+ 3 - 3
pages/tabBar/category/index.vue

@@ -116,13 +116,13 @@
 			navToListPage(item,index){//分类导航跳转
 				switch(index){
 					case 1:
-						this.$api.navigateTo(`/pages/goods/goods-classify?title=${item.name}&id=${item.bigTypeID}`)
+						this.$api.navigateTo(`/pages/goods/goods-classify?classType=1&id=${item.bigTypeID}&title=${item.name}`)
 						break;
 					case 2:
-						this.$api.navigateTo(`/pages/goods/goods-classify?title=${item.name}&id=${item.smallTypeID}`)
+						this.$api.navigateTo(`/pages/goods/goods-classify?classType=2&id=${item.smallTypeID}&title=${item.name}`)
 						break;
 					case 3:
-						this.$api.navigateTo(`/pages/goods/goods-classify?title=${item.name}&id=${item.tinyTypeID}`)
+						this.$api.navigateTo(`/pages/goods/goods-classify?classType=3&id=${item.tinyTypeID}&title=${item.name}`)
 						break;
 				}
 			},

+ 0 - 1
pages/tabBar/home/index.vue

@@ -136,7 +136,6 @@
 					this.liveList = data.liveList;
 					this.pageList = data.homePageFloor;
 					this.supplierObj = data.supplierImage;
-					console.log(this.pageList)
 					this.skeletonShow = false;
 					this.isRequest = true;
 				}).catch(error =>{

+ 7 - 3
services/product.service.js

@@ -143,17 +143,21 @@ export default class ProductService {
 		return this.AjaxService.get({ url:'/search/query/product', data, isLoading: true })
 	}
 	/* 搜索一级分类商品列表 */
-	GetQuertProductBigType (data = {}) {
+	GetSearchProductBigType (data = {}) {
 		return this.AjaxService.get({ url:'/search/query/product/bigType', data, isLoading: true })
 	}
 	/* 搜索二级分类商品列表 */
-	GetQuertProductSmallType (data = {}) {
+	GetSearchProductSmallType (data = {}) {
 		return this.AjaxService.get({ url:'/search/query/product/smallType', data, isLoading: true })
 	}
 	/* 搜索三级分类商品列表 */
-	GetQuertProductTinyType (data = {}) {
+	GetSearchProductTinyType (data = {}) {
 		return this.AjaxService.get({ url:'/search/query/product/tinyType', data, isLoading: true })
 	}
+	/* 搜索三级分类商品列表 */
+	GetSearchProductTypeData (data = {}) {
+		return this.AjaxService.get({ url:'/search/query/product/type', data, isLoading: true })
+	}
 	/* 获取商品评价 */
 	GetProductEvaluate (data = {}) {
 		return this.AjaxService.get({ url:'/product/evaluate', data, isLoading: false })