diff --git a/rc-busness/ajax/getData.js b/rc-busness/ajax/getData.js index 56dd089d..4010f07e 100644 --- a/rc-busness/ajax/getData.js +++ b/rc-busness/ajax/getData.js @@ -211,18 +211,38 @@ export const biaomessage = (stype,name) => { return fetch('product/query?petType='+stype, data, 'POST' ) } -export const searchchanpin = (stype,categoryName,tagUsedAge,tagFunction,tagBreed) => { - console.log(stype); +export const searchchanpin = (stype) => { + + let list={}; + stype.map(item=>{ + console.log(item); + list=item + }) + var str = "?"; + for(var key in list){ + + str = str + key + "=" + list[key] + "&"; + } + str = str.substr(0,str.length-1); var data = { - petType:stype, page:1, row:10 } - // return fetch('product/query?petType='+stype+'&categoryName='+categoryName+'&tagUsedAge='+tagUsedAge+'&tagFunction='+tagFunction+'&tagBreed='+tagBreed, data, 'POST' ) + return fetch('product/query'+ str, data, 'POST' ) } + + + +// var str = "?"; +// for(var key in data){ +// str = str + key + "=" + data[key] + "&"; +// } +// str = str.substr(0,str.length-1); + + //查询订单 export const userindent = (phoneNumber,orderNumber,) => { var data = { diff --git a/rc-busness/assets/css/search.less b/rc-busness/assets/css/search.less index 3814f7e6..9fcef91a 100644 --- a/rc-busness/assets/css/search.less +++ b/rc-busness/assets/css/search.less @@ -16,6 +16,18 @@ margin: 0 auto; overflow: hidden; } + .active{ + border: 2px solid #E2001A; + color: #E2001A; + cursor: pointer; + + } + .unactive{ + border: 2px solid #d7d7d7; + color:#999999; + cursor: pointer; + + } } //手机端 @media screen and (max-width: 768px) { @@ -65,18 +77,7 @@ .rc-cat{ margin-top: 0.24rem; } - .active{ - border: 2px solid #E2001A; - color: #E2001A; - cursor: pointer; - - } - .unactive{ - border: 2px solid #d7d7d7; - color:#999999; - cursor: pointer; - - } + .rc-productcat { display: flex; diff --git a/rc-busness/pages/usersearch/search.vue b/rc-busness/pages/usersearch/search.vue index 4ffd8cc9..8b8d62c7 100644 --- a/rc-busness/pages/usersearch/search.vue +++ b/rc-busness/pages/usersearch/search.vue @@ -96,7 +96,7 @@
-
+
{{ item.title }}
@@ -215,10 +215,15 @@ export default { data() { return { value: "", + userserachlist:[ + { + + } + ], userstype:[], activeIndex:0, activeIndex1:0, - activeIndexa:'-1', + activeIndexa:0, dialogInfo1:false, activeIndexb:'-1', activeIndexc:'-1', @@ -401,10 +406,13 @@ this.userst(); }, methods: { - async usersearch(stype,categoryName,tagUsedAge,tagFunction,tagBreed){ - let data=await searchchanpin(stype,categoryName,tagUsedAge,tagFunction,tagBreed); + async usersearch(stype){ + let data=await searchchanpin(stype); console.log(data); + if(data){ + this.rccontair=data; + } }, async userst() { let pinzhong=[]; @@ -532,11 +540,22 @@ this.dialogInfo1=false; console.log(e); }, selectGoods(item, index) { + this.activeIndex1=index; + let petType={ + petType:this.activeIndex1, + } + for(let i =0;i{ if(element.name=='品种'){ @@ -557,7 +576,7 @@ this.dialogInfo1=false; } }) console.log(pinzhong); - + }else if(this.activeIndex1==1){ this.userdoglisgt.map(element=>{ @@ -655,36 +674,78 @@ this.dialogInfo1=false; selectsearch(item, index) { console.log(item) - + this.value=item.title; this.activeIndexa=index; }, selectage(item, index) { console.log(item) + let tagUsedAge={ + petType:this.activeIndex1, + tagUsedAge:item.tagName + } + for(let i =0;i