From 358f0f66b920558f5a4fdacc6963fbc736b37380 Mon Sep 17 00:00:00 2001 From: Vion Date: Sat, 22 Jan 2022 23:04:56 +0800 Subject: [PATCH] Rx goods modified --- rc-busness/ajax/getData.js | 8 +++----- rc-busness/pages/index.vue | 20 +++++++++++-------- .../pages/productdetails/productlist.vue | 10 +++++++--- rc-busness/pages/usersearch/search.vue | 8 ++++++-- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/rc-busness/ajax/getData.js b/rc-busness/ajax/getData.js index 1f0f0b66..e1c457f0 100644 --- a/rc-busness/ajax/getData.js +++ b/rc-busness/ajax/getData.js @@ -188,16 +188,14 @@ export const userquery = (stype, ) => { return fetch('goods?petType='+stype, data, 'POST' ) } //处方信息 -export const userque = (stype, curPage,curRow) => { +export const userque = (goodsName, curPage,curRow) => { if(!curPage) curPage=1; if(!curRow) curRow=10; let queryTail='page='+curPage+'&rows='+curRow; - if(stype) - queryTail = '?stype='+queryTail+'&'+queryTail; - else - queryTail = '?'+queryTail; + if(goodsName) + queryTail = '?goodsName='+goodsName; var data = { } return fetch('goods'+queryTail, data, 'POST' ) diff --git a/rc-busness/pages/index.vue b/rc-busness/pages/index.vue index 40b9c591..be5fa08a 100644 --- a/rc-busness/pages/index.vue +++ b/rc-busness/pages/index.vue @@ -1164,7 +1164,7 @@ } window.addEventListener("scroll", this.handleScroll, true); this.userchufang();//查询处方粮商品信息 - + this.catmessage();//查询猫的信息 this.catclickGan(); this.catclickShi(); @@ -1468,9 +1468,9 @@ this.dataLoaded=false; let data=[]; if(stype==undefined||stype==null){ - data = await biaomessage(0,'',1,6); + data = await biaomessage(0,'',1,12); }else{ - data = await biaomessage(this.userserachlist,'',1,6); + data = await biaomessage(this.userserachlist,'',1,12); } if(data){ let userlist=[]; @@ -1546,12 +1546,14 @@ }, //请求处方量信息数据 - async userchufang() { + async userchufang(item) { + if(!item) + item = this.discounchufang[0].title; this.dataLoaded=false; let list=[]; - let data = await userque(); + let data = await userque(item,1,8); if(data){ - list=data.slice(0,6); + list=data.slice(0,8); this.processinformation=list; this.chufanlist=data; this.dataLoaded=true; @@ -1560,15 +1562,17 @@ //点击请求处方量标签信息数据 async userquery(item) { this.dataLoaded=false; + let list=[]; let data = await userquery(item); if(data){ - this.processinformation=data; + list=data.slice(0,8); + this.processinformation=list; this.dataLoaded=true; } }, //处方用粮筛选 userclick(item,index){ - this.userquery(index) + this.userchufang(index) }, //全价猫干粮筛选 catclickGan(){ diff --git a/rc-busness/pages/productdetails/productlist.vue b/rc-busness/pages/productdetails/productlist.vue index 57219a10..0eda6010 100644 --- a/rc-busness/pages/productdetails/productlist.vue +++ b/rc-busness/pages/productdetails/productlist.vue @@ -343,6 +343,7 @@ export default { activeIndexd: "-1", activeIndexe: "-1", activeIndexf: "-1", + inRxGoods:false, isadrond: true, isshow: false, openshow: false, @@ -527,7 +528,7 @@ export default { } } } - data = await searchchanpin(searchCriteria, usertype, 1, 12); + data = await searchchanpin(searchCriteria, usertype, 1, 120); } if (data) { this.rccontair = data; @@ -698,9 +699,12 @@ export default { tmp.checked=true; } }); + this.inRxGoods=true; } - else + else { this.prefecture[this.rxGoodsIndexPointer].checked=false; + this.inRxGoods=false; + } }, resetAllOptions(){ let _self = this; @@ -736,7 +740,7 @@ export default { let isRxGoods=false; let productCode = []; let mainProductCode = item.productCode; - if(!item.ecPrice && !item.price) + if(this.inRxGoods) { isRxGoods=1; productCode = [item.productCode]; diff --git a/rc-busness/pages/usersearch/search.vue b/rc-busness/pages/usersearch/search.vue index 5583b652..5b3a654f 100644 --- a/rc-busness/pages/usersearch/search.vue +++ b/rc-busness/pages/usersearch/search.vue @@ -363,6 +363,7 @@ export default { activeIndexd: "-1", activeIndexe: "-1", activeIndexf: "-1", + inRxGoods:false, isadrond: true, isshow: false, openshow: false, @@ -590,7 +591,7 @@ export default { } } } - data = await searchchanpin(searchCriteria, usertype, 1, 12); + data = await searchchanpin(searchCriteria, usertype, 1, 120); } if (data) { this.rccontair = data; @@ -706,9 +707,12 @@ export default { tmp.checked=true; } }); + this.inRxGoods=true; } - else + else { this.prefecture[this.rxGoodsIndexPointer].checked=false; + this.inRxGoods=false; + } }, resetAllOptions(){ let _self = this;