Product list & search list completed

This commit is contained in:
Vion
2022-01-21 20:48:13 +08:00
parent f3c9a9c65b
commit 8e464641d3
4 changed files with 237 additions and 151 deletions

View File

@@ -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 = [];