From 8e464641d319fd85c04abdcf49d5ee349d7d2e0a Mon Sep 17 00:00:00 2001 From: Vion Date: Fri, 21 Jan 2022 20:48:13 +0800 Subject: [PATCH 1/2] Product list & search list completed --- rc-busness/assets/css/search.less | 41 +-- rc-busness/pages/index.vue | 2 +- .../pages/productdetails/productlist.vue | 50 +-- rc-busness/pages/usersearch/search.vue | 295 +++++++++++------- 4 files changed, 237 insertions(+), 151 deletions(-) diff --git a/rc-busness/assets/css/search.less b/rc-busness/assets/css/search.less index e843f622..d08b2cb1 100644 --- a/rc-busness/assets/css/search.less +++ b/rc-busness/assets/css/search.less @@ -230,7 +230,7 @@ margin-left: 0.18rem; display: block; margin-left: 0.5rem; display: block; - + cursor: pointer; } } @@ -387,11 +387,11 @@ border-radius: 100px; overflow: hidden; margin-top: 40px; .ts-scrollable-container{ - h2{ - font-weight: bold; - color: #333333; - -} + h2{ + font-weight: bold; + color: #333333; + width: 3.25rem; + } } .rc-padding--md{ padding: 0; @@ -452,6 +452,7 @@ cursor: pointer; /deep/.el-dialog { width: 920px; background: #FFFFFF; + max-width:unset; } /deep/.van-search__action{ display: block; @@ -511,7 +512,7 @@ margin-left: 8px; display: block; margin-left: 0.5rem; display: block; - + cursor:pointer; } } @@ -624,6 +625,7 @@ border-radius: 30px; } /deep/.van-search{ padding-left: 0; + width:100%; } .van-search__content--square{ display: flex; @@ -632,7 +634,7 @@ border-radius: 30px; background: white; border: 1px solid #D7D7D7; height: 50px; - width: 1200px; + width:100%; border-radius: 200px; } /deep/.van-field__left-icon @@ -658,17 +660,18 @@ border-radius: 30px; } ul li { - width: 130px; - height: 40px; - background: #ffffff; - border: 2px solid #D7D7D7; - border-radius: 30px; - text-align: center; - font-size: 14px; - display: flex; - align-items: center; - justify-content: center; - margin-left: 32px; + width: 130px; + height: 40px; + background: #ffffff; + border: 2px solid #D7D7D7; + border-radius: 30px; + text-align: center; + font-size: 14px; + display: flex; + align-items: center; + justify-content: center; + margin-left: 32px; + cursor: pointer; } li:first-child{ margin-left: 0; diff --git a/rc-busness/pages/index.vue b/rc-busness/pages/index.vue index 7f84721c..bec8625d 100644 --- a/rc-busness/pages/index.vue +++ b/rc-busness/pages/index.vue @@ -995,7 +995,7 @@ title: "主食级狗湿粮", video:"/images/dog/one.mp4", catimage: "/images/dog/one.jpg", - productimage: "/images/cat/star-1.png", + productimage: "/images/dog/star-1.png", detail:'柔软细腻慕斯 适合离乳期幼犬舔食', price:'¥77', }, diff --git a/rc-busness/pages/productdetails/productlist.vue b/rc-busness/pages/productdetails/productlist.vue index 9d792290..999ab243 100644 --- a/rc-busness/pages/productdetails/productlist.vue +++ b/rc-busness/pages/productdetails/productlist.vue @@ -481,8 +481,9 @@ export default { let stype = this.routeParams.stype; stype = (stype=='0'?0:1); - if(stype>-1) - this.activeIndex = this.routeParams.stype;//Initialized pet type selection + if(stype>-1){ + this.activeIndex = this.routeParams.stype;//Initialized pet type selection + } }, mounted() { @@ -492,6 +493,7 @@ export default { let tagSettingPromise = this.userst(); let _self = this; tagSettingPromise.then(function(resolve){ + _self.selectGoods(null,_self.activeIndex,true); _self.chooseDefaultOptions(); //_self.usetmessage(); }); @@ -508,7 +510,7 @@ export default { this.isLoading=true; let data = undefined; if(this.prefecture[this.rxGoodsIndexPointer].checked==true){ - data = await userquery(usertype, 1, 10); + data = await userquery(usertype, 1, 12); } else{ let searchCriteria=[{}]; @@ -525,7 +527,7 @@ export default { } } } - data = await searchchanpin(searchCriteria, usertype, 1, 10); + data = await searchchanpin(searchCriteria, usertype, 1, 12); } if (data) { this.rccontair = data; @@ -543,7 +545,7 @@ export default { this.userstype = data; this.isLoading = false; } - this.usercatlist = this.userstype.filter((item) => item.petType == this.activeIndex); + this.usercatlist = this.userstype.filter((item) => item.petType == "0"); this.usercatlist.map((element) => { if (element.name == "品种") { pinzhong.push(element); @@ -700,6 +702,25 @@ export default { else this.prefecture[this.rxGoodsIndexPointer].checked=false; }, + resetAllOptions(){ + let _self = this; + let categoriesSelectionEles=this.prefecture; + let functionalSelectionEles=this.catagea; + let ageSelectionEles=this.catage; + let breedSelectionEles=this.catageb; + let allSelectionEles=categoriesSelectionEles.concat(functionalSelectionEles,ageSelectionEles,breedSelectionEles); + allSelectionEles.forEach(function(tmp,index){ + tmp.checked=false; + }); + this.userserachlist = [ + { + categoryName: [], //专区 + tagUsedAge: [], //年龄 + tagFunction: [], //功能 + tagBreed: [], //品种 + }, + ]; + }, userbuy() { this.$router.push({ path: "/myorder/userrecord", @@ -760,24 +781,13 @@ export default { } }, - selectGoods(item, index) { + selectGoods(item, index, onlyRefreshCategory) { this.activeIndex1 = index; this.activeIndex = index; this.allacindex = index; - this.usersearch(this.userserachlist, this.activeIndex1); - // for (let i = 0; i < this.userserachlist.length; i++) { - // if (!this.userserachlist.includes(petType)) { - // this.userserachlist.push(petType); - // } - // } - this.userserachlist = [ - { - categoryName: [], //专区 - tagUsedAge: [], //年龄 - tagFunction: [], //功能 - tagBreed: [], //品种 - }, - ]; + this.resetAllOptions(); + if(!onlyRefreshCategory) + this.usersearch(this.userserachlist, this.activeIndex1); let pinzhong = []; let zhuanqu = []; let age = []; diff --git a/rc-busness/pages/usersearch/search.vue b/rc-busness/pages/usersearch/search.vue index c933d390..e10d47a2 100644 --- a/rc-busness/pages/usersearch/search.vue +++ b/rc-busness/pages/usersearch/search.vue @@ -100,7 +100,7 @@
-
+
    @@ -120,7 +120,7 @@
    {{ item.categoryName }} - ¥{{ item.ecPrice }} + {{ item.ecPrice?("¥"+item.ecPrice):'' }}
    +
    +
    + 数据加载中 +
@@ -320,7 +325,7 @@ diff --git a/rc-busness/pages/useraddress/editaddress.vue b/rc-busness/pages/useraddress/editaddress.vue index 077d26fe..a91488ac 100644 --- a/rc-busness/pages/useraddress/editaddress.vue +++ b/rc-busness/pages/useraddress/editaddress.vue @@ -8,15 +8,15 @@ 收货人:
-
+
手机号码:
-
+
所在地区:
-
+
详细地址:
@@ -254,6 +254,5 @@ export default {