mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-17 08:03:49 +08:00
@@ -1,5 +1,9 @@
|
||||
<template>
|
||||
<div>
|
||||
<transition name="fade">
|
||||
<div class="userloding" v-show="isLoading"></div>
|
||||
</transition>
|
||||
|
||||
<Myheader></Myheader>
|
||||
<div class="rc-top"></div>
|
||||
<div class="rc-max-width--xl rc-main">
|
||||
@@ -11,6 +15,7 @@
|
||||
class="rc-cat"
|
||||
v-for="(item, index) in userproduct"
|
||||
:key="index"
|
||||
ref="userclicks"
|
||||
@click="selectGoods(item, index)"
|
||||
:class="activeIndex == index ? 'active' : 'unactive'"
|
||||
>
|
||||
@@ -27,7 +32,7 @@
|
||||
v-for="(item, index) in prefecture"
|
||||
:key="index"
|
||||
@click="selectproduct(item, index)"
|
||||
:class="activeIndexb == index ? 'active' : 'unactive'"
|
||||
:class="item.checked ? 'active' : 'unactive'"
|
||||
ref="chosebox"
|
||||
>
|
||||
{{ item.tagName }}
|
||||
@@ -42,7 +47,7 @@
|
||||
v-for="(item, index) in catage"
|
||||
:key="index"
|
||||
@click="selectage(item, index)"
|
||||
:class="activeIndexc == index ? 'active' : 'unactive'"
|
||||
:class="item.checked ? 'active' : 'unactive'"
|
||||
ref="chosebox1"
|
||||
>
|
||||
{{ item.tagName }}
|
||||
@@ -57,8 +62,8 @@
|
||||
v-for="(item, index) in catagea"
|
||||
:key="index"
|
||||
@click="selectagc(item, index)"
|
||||
:class="activeIndexd == index ? 'active' : 'unactive'"
|
||||
ref="chosebox2"
|
||||
:class="item.checked ? 'active' : 'unactive'"
|
||||
ref="cgosebox4"
|
||||
>
|
||||
{{ item.tagName }}
|
||||
</li>
|
||||
@@ -72,7 +77,7 @@
|
||||
v-for="(item, index) in catageb"
|
||||
:key="index"
|
||||
@click="selectagd(item, index)"
|
||||
:class="activeIndexe == index ? 'active' : 'unactive'"
|
||||
:class="item.checked ? 'active' : 'unactive'"
|
||||
ref="chosebox3"
|
||||
>
|
||||
{{ item.tagName }}
|
||||
@@ -106,7 +111,7 @@
|
||||
<div class="rc-column">
|
||||
<div class="rc-click" @click="selectproduce(item)">
|
||||
<span>{{ item.categoryName }}</span>
|
||||
<i>0.001{{ item.price }}</i>
|
||||
<i>¥{{ item.ecPrice }}</i>
|
||||
</div>
|
||||
<strong
|
||||
class="
|
||||
@@ -181,7 +186,7 @@
|
||||
:key="index"
|
||||
@click="selectagc(item, index)"
|
||||
:class="activeIndexd == index ? 'active' : 'unactive'"
|
||||
ref="chosebox2"
|
||||
ref="cgosebox4"
|
||||
>
|
||||
{{ item.tagName }}
|
||||
</li>
|
||||
@@ -219,6 +224,7 @@
|
||||
v-for="(item, index) in userproduct"
|
||||
:key="index"
|
||||
@click="selectGoodsa(item, index)"
|
||||
ref="usercliak"
|
||||
:class="activeIndex1 == index ? 'active' : 'unactive'"
|
||||
>
|
||||
<img :src="item.name" alt="" />
|
||||
@@ -262,7 +268,7 @@
|
||||
:key="index"
|
||||
@click="selectagc(item, index)"
|
||||
:class="activeIndexd == index ? 'active' : 'unactive'"
|
||||
ref="chosebox2"
|
||||
ref="cgosebox4"
|
||||
>
|
||||
{{ item.tagName }}
|
||||
</li>
|
||||
@@ -298,7 +304,7 @@
|
||||
import Myheader from "~/components/header.vue";
|
||||
import {
|
||||
userstype,
|
||||
biaomessa,
|
||||
biaome,
|
||||
biaomessage,
|
||||
searchchanpin,
|
||||
} from "../../ajax/getData";
|
||||
@@ -306,14 +312,23 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
value: "",
|
||||
isLoading: true,
|
||||
userstype: [],
|
||||
activeIndex: "0",
|
||||
allacindex:0,
|
||||
allacindex: 0,
|
||||
userishwo: true,
|
||||
userishwo1: true,
|
||||
userishwo2: true,
|
||||
userishwo3: true,
|
||||
userserachlist: [{}],
|
||||
userishwo4: true,
|
||||
userserachlist: [
|
||||
{
|
||||
categoryName: "", //专区
|
||||
tagUsedAge: "", //年龄
|
||||
tagFunction: "", //功能
|
||||
tagBreed: "", //品种
|
||||
},
|
||||
],
|
||||
activeIndex1: 0,
|
||||
activeIndexa: "-1",
|
||||
dialogInfo1: false,
|
||||
@@ -496,20 +511,19 @@ export default {
|
||||
this.activeIndex = stype;
|
||||
if (stype !== "" && stype !== undefined) {
|
||||
this.onmessage(stype);
|
||||
|
||||
} else {
|
||||
this.usetmessage();
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
async usersearch(stype) {
|
||||
let data = await searchchanpin(stype);
|
||||
async usersearch(stype, usertype) {
|
||||
let data = await searchchanpin(stype, usertype, 1, 10);
|
||||
if (data) {
|
||||
this.rccontair = data;
|
||||
}
|
||||
},
|
||||
async userst() {
|
||||
this.isLoading = true;
|
||||
let pinzhong = [];
|
||||
let zhuanqu = [];
|
||||
let age = [];
|
||||
@@ -517,39 +531,58 @@ export default {
|
||||
let data = await userstype();
|
||||
if (data) {
|
||||
this.userstype = data;
|
||||
this.isLoading = false;
|
||||
}
|
||||
this.usercatlist = this.userstype.filter((item) => item.petType == "0");
|
||||
this.usercatlist.map((element) => {
|
||||
if (element.name == "品种") {
|
||||
pinzhong.push(element);
|
||||
this.catageb = pinzhong;
|
||||
this.catageb.forEach((element) => {
|
||||
element.checked = false;
|
||||
});
|
||||
}
|
||||
if (element.name == "功能") {
|
||||
gonneg.push(element);
|
||||
this.catagea = gonneg;
|
||||
this.catagea.forEach((element) => {
|
||||
element.checked = false;
|
||||
});
|
||||
}
|
||||
if (element.name == "年龄") {
|
||||
age.push(element);
|
||||
this.catage = age;
|
||||
this.catage.forEach((element) => {
|
||||
element.checked = false;
|
||||
});
|
||||
}
|
||||
if (element.name == "专区") {
|
||||
zhuanqu.push(element);
|
||||
this.prefecture = gonneg;
|
||||
this.prefecture = zhuanqu;
|
||||
this.prefecture.forEach((element) => {
|
||||
element.checked = false;
|
||||
});
|
||||
}
|
||||
console.log(pinzhong);
|
||||
// debugger
|
||||
});
|
||||
this.userdoglisgt = this.userstype.filter((item) => item.petType == "1");
|
||||
},
|
||||
|
||||
async usetmessage() {
|
||||
let data = await biaomessa();
|
||||
this.isLoading = true;
|
||||
let data = await biaome(this.activeIndex1, "", 1, 10);
|
||||
if (data) {
|
||||
this.rccontair = data;
|
||||
this.isLoading = false;
|
||||
}
|
||||
},
|
||||
async onmessage(stype) {
|
||||
let data = await biaomessage(stype);
|
||||
this.isLoading = true;
|
||||
let data = await biaomessage(stype, "", 1, 10);
|
||||
if (data) {
|
||||
this.rccontair = data;
|
||||
this.isLoading = false;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -597,35 +630,98 @@ export default {
|
||||
) {
|
||||
console.log("当前是电脑打开");
|
||||
this.$nextTick(() => {
|
||||
this.isadrond = false;
|
||||
this.dialogInfo1 = true;
|
||||
this.isadrond = false;
|
||||
this.isshow = false;
|
||||
this.isadrond = false;
|
||||
this.dialogInfo1 = true;
|
||||
this.isadrond = false;
|
||||
this.isshow = false;
|
||||
});
|
||||
} else {
|
||||
console.log("当前是手机打开");
|
||||
this.$nextTick(() => {
|
||||
this.isadrond = true;
|
||||
this.isshow = true;
|
||||
this.$refs.usercontent.style.display = "none ";
|
||||
this.dialogInfo1 = false;
|
||||
this.isadrond = true;
|
||||
this.isshow = true;
|
||||
this.$refs.usercontent.style.display = "none ";
|
||||
this.dialogInfo1 = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
selectGoods(item, index) {
|
||||
this.activeIndex1 = index;
|
||||
this.activeIndex = index;
|
||||
this.allacindex=index
|
||||
console;
|
||||
let petType = {
|
||||
petType: this.allacindex,
|
||||
};
|
||||
for (let i = 0; i < this.userserachlist.length; i++) {
|
||||
if (!this.userserachlist.includes(petType)) {
|
||||
this.userserachlist.push(petType);
|
||||
}
|
||||
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: "", //品种
|
||||
},
|
||||
];
|
||||
let pinzhong = [];
|
||||
let zhuanqu = [];
|
||||
let age = [];
|
||||
let gonneg = [];
|
||||
if (this.activeIndex1 == 0) {
|
||||
this.usercatlist.map((element) => {
|
||||
if (element.name == "品种") {
|
||||
pinzhong.push(element);
|
||||
this.catageb = pinzhong;
|
||||
}
|
||||
if (element.name == "功能") {
|
||||
gonneg.push(element);
|
||||
this.catagea = gonneg;
|
||||
}
|
||||
if (element.name == "年龄") {
|
||||
age.push(element);
|
||||
this.catage = age;
|
||||
}
|
||||
if (element.name == "专区") {
|
||||
zhuanqu.push(element);
|
||||
this.prefecture = zhuanqu;
|
||||
}
|
||||
});
|
||||
} else if (this.activeIndex1 == 1) {
|
||||
this.userdoglisgt.map((element) => {
|
||||
if (element.name == "品种") {
|
||||
pinzhong.push(element);
|
||||
this.catageb = pinzhong;
|
||||
this.catageb.forEach((element) => {
|
||||
element.checked = false;
|
||||
});
|
||||
}
|
||||
if (element.name == "功能") {
|
||||
gonneg.push(element);
|
||||
this.catagea = gonneg;
|
||||
this.catagea.forEach((element) => {
|
||||
element.checked = false;
|
||||
});
|
||||
}
|
||||
if (element.name == "年龄") {
|
||||
age.push(element);
|
||||
this.catage = age;
|
||||
this.catage.forEach((element) => {
|
||||
element.checked = false;
|
||||
});
|
||||
}
|
||||
if (element.name == "专区") {
|
||||
zhuanqu.push(element);
|
||||
this.prefecture = zhuanqu;
|
||||
this.prefecture.forEach((element) => {
|
||||
element.checked = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
this.usersearch(this.userserachlist);
|
||||
|
||||
this.activeIndex = index;
|
||||
},
|
||||
selectGoodsa(item, index) {
|
||||
this.activeIndex1 = index;
|
||||
@@ -651,99 +747,107 @@ export default {
|
||||
this.activeIndexc = index;
|
||||
this.userishwo1 = !this.userishwo1;
|
||||
console.log(this.userishwo1);
|
||||
if (this.userishwo1 == false) {
|
||||
tagUsedAge = {
|
||||
petType: this.allacindex,
|
||||
tagUsedAge: item.tagName,
|
||||
};
|
||||
if (item.checked == false) {
|
||||
item.checked = true;
|
||||
this.userserachlist[0].tagUsedAge = item.tagName;
|
||||
this.$refs.chosebox1[index].className = "active";
|
||||
} else {
|
||||
console.log("这是false");
|
||||
tagUsedAge = {
|
||||
petType: this.allacindex,
|
||||
};
|
||||
this.userserachlist[0].tagUsedAge = "";
|
||||
item.checked = false;
|
||||
this.$refs.chosebox1[index].className = "unactive";
|
||||
}
|
||||
this.$refs.chosebox1[index].className = "unactive";
|
||||
for (let i = 0; i < this.userserachlist.length; i++) {
|
||||
if (!this.userserachlist.includes(tagUsedAge)) {
|
||||
this.userserachlist.push(tagUsedAge);
|
||||
}
|
||||
}
|
||||
this.usersearch(this.userserachlist);
|
||||
|
||||
// for (let i = 0; i < this.userserachlist.length; i++) {
|
||||
// if (!this.userserachlist.includes(tagUsedAge)) {
|
||||
// this.userserachlist.push(tagUsedAge);
|
||||
// }
|
||||
// }
|
||||
this.usersearch(this.userserachlist, this.activeIndex1);
|
||||
},
|
||||
selectagc(item, index) {
|
||||
let tagFunction = {};
|
||||
// let tagFunction = {};
|
||||
this.activeIndexd = index;
|
||||
this.userishwo2 = !this.userishwo2;
|
||||
if (this.userishwo2 == false) {
|
||||
tagFunction = {
|
||||
petType: this.allacindex,
|
||||
tagFunction: item.tagName,
|
||||
};
|
||||
if (item.checked == false) {
|
||||
item.checked = true;
|
||||
this.$refs.cgosebox4[index].className = "active";
|
||||
this.userserachlist[0].tagFunction = item.tagName;
|
||||
} else {
|
||||
console.log("这是false");
|
||||
tagFunction = {
|
||||
petType: this.allacindex,
|
||||
};
|
||||
item.checked = false;
|
||||
this.$refs.cgosebox4[index].className = "unactive";
|
||||
this.userserachlist[0].tagFunction = "";
|
||||
}
|
||||
this.$refs.chosebox2[index].className = "unactive";
|
||||
|
||||
for (let i = 0; i < this.userserachlist.length; i++) {
|
||||
if (!this.userserachlist.includes(tagFunction)) {
|
||||
this.userserachlist.push(tagFunction);
|
||||
}
|
||||
}
|
||||
this.usersearch(this.userserachlist);
|
||||
// if (this.userishwo2 == false) {
|
||||
// tagFunction = {
|
||||
// petType: this.allacindex,
|
||||
// tagFunction: item.tagName,
|
||||
// };
|
||||
// } else {
|
||||
// console.log("这是false");
|
||||
// tagFunction = {
|
||||
// petType: this.allacindex,
|
||||
// };
|
||||
// }
|
||||
// for (let i = 0; i < this.userserachlist.length; i++) {
|
||||
// if (!this.userserachlist.includes(tagFunction)) {
|
||||
// this.userserachlist.push(tagFunction);
|
||||
// }
|
||||
// }
|
||||
this.usersearch(this.userserachlist, this.activeIndex1);
|
||||
},
|
||||
selectagd(item, index) {
|
||||
let tagBreed = {};
|
||||
this.activeIndexe = index;
|
||||
this.userishwo3 = !this.userishwo3;
|
||||
if (this.userishwo3 == false) {
|
||||
tagBreed = {
|
||||
petType: this.allacindex,
|
||||
tagBreed: item.tagName,
|
||||
};
|
||||
if (item.checked == false) {
|
||||
item.checked = true;
|
||||
this.$refs.chosebox3[index].className = "active";
|
||||
this.userserachlist[0].tagBreed = item.tagName;
|
||||
} else {
|
||||
console.log("这是false");
|
||||
tagBreed = {
|
||||
petType: this.allacindex,
|
||||
};
|
||||
}
|
||||
this.$refs.chosebox3[index].className = "unactive";
|
||||
for (let i = 0; i < this.userserachlist.length; i++) {
|
||||
if (!this.userserachlist.includes(tagBreed)) {
|
||||
this.userserachlist.push(tagBreed);
|
||||
}
|
||||
}
|
||||
this.usersearch(this.userserachlist);
|
||||
},
|
||||
selectproduct(item, index) {
|
||||
// console.log(this.userishwo=!this.userishwo)
|
||||
let categoryName = {};
|
||||
this.activeIndexb = index;
|
||||
console.log(this.activeIndex);
|
||||
this.userishwo = !this.userishwo;
|
||||
console.log(this.userishwo);
|
||||
if (this.userishwo == false) {
|
||||
console.log("====");
|
||||
categoryName = {
|
||||
petType: this.allacindex,
|
||||
categoryName: item.tagName,
|
||||
};
|
||||
} else {
|
||||
categoryName = {
|
||||
petType: this.allacindex,
|
||||
};
|
||||
}
|
||||
console.log(this.$refs.chosebox);
|
||||
this.$refs.chosebox[index].className = "unactive";
|
||||
for (let i = 0; i < this.userserachlist.length; i++) {
|
||||
if (!this.userserachlist.includes(categoryName)) {
|
||||
this.userserachlist.push(categoryName);
|
||||
}
|
||||
item.checked = false;
|
||||
this.$refs.chosebox3[index].className = "unactive";
|
||||
this.userserachlist[0].tagBreed = "";
|
||||
}
|
||||
|
||||
this.usersearch(this.userserachlist);
|
||||
// this.$refs.chosebox3[index].className = "unactive";
|
||||
// for (let i = 0; i < this.userserachlist.length; i++) {
|
||||
// if (!this.userserachlist.includes(tagBreed)) {
|
||||
// this.userserachlist.push(tagBreed);
|
||||
// }
|
||||
// }
|
||||
this.usersearch(this.userserachlist, this.activeIndex1);
|
||||
},
|
||||
selectproduct(item, index) {
|
||||
this.activeIndexb = index;
|
||||
// console.log(this.userishwo=!this.userishwo)
|
||||
if (item.checked == false) {
|
||||
item.checked = true;
|
||||
this.$refs.chosebox[index].className = "active";
|
||||
this.userserachlist[0].categoryName = item.tagName;
|
||||
} else {
|
||||
item.checked = false;
|
||||
this.$refs.chosebox[index].className = "unactive";
|
||||
this.userserachlist[0].categoryName = "";
|
||||
}
|
||||
// if (this.userishwo == false) {
|
||||
// console.log("====");
|
||||
// categoryName = {
|
||||
// petType: this.allacindex,
|
||||
// categoryName: item.tagName,
|
||||
// };
|
||||
// } else {
|
||||
// categoryName = {
|
||||
// petType: this.allacindex,
|
||||
// };
|
||||
// }
|
||||
// this.$refs.chosebox[index].className = "unactive";
|
||||
// for (let i = 0; i < this.userserachlist.length; i++) {
|
||||
// if (!this.userserachlist.includes(categoryName)) {
|
||||
// this.userserachlist.push(categoryName);
|
||||
// }
|
||||
// }
|
||||
|
||||
this.usersearch(this.userserachlist, this.activeIndex1);
|
||||
},
|
||||
|
||||
//弹框的显示隐藏
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user