Merged 0 version

This commit is contained in:
Vion 2022-01-11 20:36:54 +08:00
parent 115d1510d8
commit abd4ea6a6b
8 changed files with 498 additions and 139 deletions

View File

@ -205,8 +205,8 @@ img, picture {
color: #666666; color: #666666;
} }
.tuntop{ .tuntop{
width: 100%; width: 1.25rem;
height: 60px; height: auto;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.1); box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.1);
opacity: 1; opacity: 1;

View File

@ -0,0 +1,270 @@
// 手机端
@media screen and(min-width: 320px) and(max-width:768px) {
.van-field-one{
width: 335px;
background: #F6F6F6;
border-radius: 4px;
margin: 0 auto;
}
.van-field-two{
margin: 0 auto;
width: 335px;
height: 48px;
background: #F6F6F6;
margin: 0 auto;
border-radius: 4px;
margin-top: 24px;
}
.usecheck{
display: flex;
text-align: left;
width: 335px;
margin: 0 auto;
align-items: center;
margin-top: 18px;
}
.container {
font-size: 0.1rem;
.van-field__body {
border-bottom: 1px solid red;
}
.content {
margin-top: 24px;
}
.userfoget {
font-size: 14px;
color: #333333;
border-bottom: 1px solid #333333;
margin-left: 20px;
}
.rc-header {
text-align: center;
}
.rc-header span:first-of-type {
margin-right: 60px;
}
.rc-header span:last-child {
margin-right: 20px;
}
.active {
font-size: 18px;
color: #666666;
}
.unactive {
font-size: 18px;
color: #999999;
}
.rc-use {
width: 155px;
height: 48px;
opacity: 1;
border-radius: 30px;
outline: none;
border: none;
border: 2px solid #e1001a;
color: #e1001a;
font-size: 14px;
}
.rc-user {
width: 100%;
display: flex;
align-items: center;
margin-top: 40px;
}
.userbutton {
width: 335px;
height: 48px;
background: #e2001a;
opacity: 1;
border-radius: 30px;
outline: none;
border: none;
margin: 0 auto;
}
van-button {
width: 335px;
height: 48px;
background: #e2001a;
opacity: 1;
border-radius: 30px;
}
input {
border: none;
outline: none;
}
button {
outline: none;
border: none;
list-style: none;
background: none;
}
.rc-center {
font-size: 30px;
color: #333333;
text-align: center;
}
.rc-center input {
color: #999999;
font-size: 14px;
}
.userlogin {
width: 92%;
margin: 0 auto;
}
.rc-button {
font-size: 14px;
width:335px;
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 auto;
color: #333333;
}
.rc-button span {
border-bottom: 1px solid #333333;
}
.rc-button span {
margin-left: 20px;
margin-top: 24px;
}
.rc-button span:last-child {
margin-right: 20px;
display: block;
}
}
}
// /* 最小768px最大1920 *pc端/
@media screen and (min-width: 768px) and (max-width: 1920px) {
.usecheck{
display: flex;
text-align: left;
width: 395px;
margin: 0 auto;
align-items: center;
margin-top: 18px;
}
/deep/
.van-field-one{
width: 395px;
height: 48px;
background: #F6F6F6;
border-radius: 4px;
margin: 0 auto;
}
.van-field-two{
margin: 0 auto;
width: 395px;
height: 48px;
background: #F6F6F6;
margin: 0 auto;
border-radius: 4px;
margin-top: 24px;
}
.container {
.content {
margin-top: 24px;
}
.userfoget {
font-size: 14px;
color: #333333;
border-bottom: 1px solid #333333;
margin-left: 20px;
}
.rc-header {
text-align: center;
}
.rc-header span:first-of-type {
margin-right: 60px;
}
.rc-header span:last-child {
margin-right: 20px;
}
.active {
font-size: 0.1rem;
color: #666666;
}
.unactive {
font-size: 0.1rem;
color: #999999;
}
.rc-use {
width: 1.55rem;
height: 0.48rem;
opacity: 1;
border-radius: 0.15rem;
border: 2px solid #e1001a;
color: #e1001a;
font-size: 0.14rem;
background: white;
}
.rc-user {
width: 100%;
display: flex;
align-items: center;
margin-top: 40px;
}
.userbutton {
width: 3.8rem;
height: 0.48rem;
background: #e2001a;
border-radius: 0.15rem;
outline: none;
border: none;
margin: 0 auto;
}
van-button {
width: 335px;
height: 48px;
background: #e2001a;
opacity: 1;
border-radius: 30px;
}
input {
border: none;
outline: none;
}
button {
outline: none;
border: none;
list-style: none;
background: none;
}
.rc-center {
font-size: 30px;
color: #333333;
text-align: center;
}
.rc-center input {
color: #999999;
font-size: 14px;
}
.userlogin {
width: 92%;
margin: 0 auto;
}
.rc-button {
font-size: 14px;
width:395px;
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 auto;
color: #333333;
}
.rc-button span {
border-bottom: 1px solid #333333;
}
.rc-button span {
margin-left: 20px;
margin-top: 24px;
}
.rc-button span:last-child {
margin-right: 20px;
display: block;
}
}
}

View File

@ -177,7 +177,7 @@
<a href="/"> <a href="/">
<span class="rc-screen-reader-text">Royal Canin Logo</span> <span class="rc-screen-reader-text">Royal Canin Logo</span>
<object id="main-logo" data="/images/logo--crown.svg?v=8-11-2" type="image/svg+xml" class="rc-modal__logo" data-js-import-interactive-svg> <object id="main-logo" data="/images/logo--crown.svg?v=8-11-2" type="image/svg+xml" class="rc-modal__logo" data-js-import-interactive-svg>
<img src="#profiles/custom/royal_canin_profile/themes/royal_canin/images/1x1.gif" style="background-image: url(#profiles/custom/royal_canin_profile/themes/royal_canin/images/logo--crown.png?v=8-11-2)" width="150" height="100" alt="Royal Canin logo" /> <img src="/images/1x1.gif" style="background-image: url(/images/logo--crown.png?v=8-11-2)" width="150" height="100" alt="Royal Canin logo" />
</object> </object>
</a> </a>
</header> </header>

View File

@ -630,7 +630,7 @@
import unlogin from "~/components/unlogin.vue"; import unlogin from "~/components/unlogin.vue";
import tabs from "@/components/tabs.vue"; import tabs from "@/components/tabs.vue";
import '@vant/touch-emulator'; import '@vant/touch-emulator';
import { userquery,postCourseId,biaomessage,userque } from "../ajax/getData"; import { userquery,postCourseId,biaomessage,userque,searchchanpin } from "../ajax/getData";
const settings = require("@/config"); const settings = require("@/config");
export default { export default {
middleware: 'metaTitle', middleware: 'metaTitle',
@ -640,10 +640,12 @@
return{ return{
processinformation:[], processinformation:[],
catshi:[], catshi:[],
userstype:'',
userunlogin:false, userunlogin:false,
searchBar:true, searchBar:true,
usermessage:[], usermessage:[],
catgan:[], catgan:[],
userserachlist:[{}],
doggan:[], doggan:[],
dogtype:[ dogtype:[
{ {
@ -656,14 +658,7 @@
{ {
title: "老年犬", title: "老年犬",
}, },
// {
// title: "",
// },
// {
// title: "",
// },
], ],
dogshi:[], dogshi:[],
catlist:[], catlist:[],
@ -970,14 +965,22 @@ activeInde3:0,
}, },
methods:{ methods:{
userdog(item,index){ userdog(item,index){
this.dogmessage(index) this.userstype=1;
let petType={
petType:1,
name:index,
}
for(let i =0;i<this.userserachlist.length;i++){
if(!this.userserachlist.includes(petType)){
this.userserachlist.push(petType)
}
}
this.dogmessage(this.userserachlist)
}, },
userlook(order){ userlook(order){
console.log(order);
if(order==0){ if(order==0){
console.log(this.catlist);
this.catshi=this.catlist; this.catshi=this.catlist;
} }
if(order==1){ if(order==1){
@ -1003,7 +1006,7 @@ activeInde3:0,
{ {
let fixedCatbarSeperator = document.getElementById("fixed-catbar-seperator"); let fixedCatbarSeperator = document.getElementById("fixed-catbar-seperator");
let scrolltop = document.documentElement.scrollTop || document.body.scrollTop; let scrolltop = document.documentElement.scrollTop || document.body.scrollTop;
if((scrolltop-fixedCatbarSeperator.offsetTop)>=0) if((scrolltop-fixedCatbarSeperator.offsetTop)>0)
{ {
this.gotop = true this.gotop = true
this.searchBar=false this.searchBar=false
@ -1025,37 +1028,44 @@ activeInde3:0,
}, 10); }, 10);
}, },
async courseId(item) { async courseId(item) {
console.log(item);
console.log(this.usermessage);
let data = await postCourseId(this.productCode,1,this.usermessage.data.id,this.usermessage.data.mobile,item.picFile,item.name,item.basePrice,item.specifications); let data = await postCourseId(this.productCode,1,this.usermessage.data.id,this.usermessage.data.mobile,item.picFile,item.name,item.basePrice,item.specifications);
if(data){ if(data){
this.productlist=data; this.productlist=data;
} }
console.log(data);
}, },
// //
async catmessage() { async catmessage(stype) {
let data = await biaomessage(0); let data=[];
if(stype==undefined||stype==null){
data = await biaomessage(0);
}else{
data = await biaomessage(this.userserachlist);
}
if(data){ if(data){
console.log(data);
this.catlist=data; this.catlist=data;
let userlist=[]; let userlist=[];
userlist=data.slice(0,6); userlist=data.slice(0,6);
console.log(userlist);
this.catshi=userlist; this.catshi=userlist;
this.catgan=userlist; this.catgan=userlist;
} }
}, },
// //
async dogmessage(name) { async dogmessage(stype) {
let data = await biaomessage(1,name); let data=[];
if(stype==undefined||stype==null){
data = await biaomessage(1);
}else{
data = await biaomessage(this.userserachlist);
}
if(data){ if(data){
let userlist=[]; let userlist=[];
userlist=data.slice(0,6); userlist=data.slice(0,6);
this.doglist=data; this.doglist=data;
this.doggan=userlist; this.doggan=userlist;
this.dogshi=userlist; this.dogshi=userlist;
} }
@ -1079,7 +1089,6 @@ activeInde3:0,
// //
async userchufang() { async userchufang() {
console.log("-----");
let list=[]; let list=[];
let data = await userque(); let data = await userque();
if(data){ if(data){
@ -1089,27 +1098,38 @@ activeInde3:0,
} }
console.log(data);
}, },
// //
async userquery(item) { async userquery(item) {
console.log("-----");
let data = await userquery(item); let data = await userquery(item);
if(data){ if(data){
this.processinformation=data; this.processinformation=data;
console.log(this.processinformation);
console.log(data);
} }
console.log(data);
}, },
//
userclick(item,index){ userclick(item,index){
this.userquery(index) this.userquery(index)
}, },
//湿
catclick(item,index){
this.userstype=0;
let petType={
petType:0,
name:index,
}
for(let i =0;i<this.userserachlist.length;i++){
if(!this.userserachlist.includes(petType)){
this.userserachlist.push(petType)
}
}
this.catmessage(this.userserachlist)
},
lianxi(item,index){ lianxi(item,index){
console.log(item,index);
if(item.title=='在线客服'){ if(item.title=='在线客服'){
var option = { var option = {
customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'} customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'}
@ -1117,7 +1137,6 @@ activeInde3:0,
dis_livchat(option); dis_livchat(option);
} }
if(item.title=='购物车'){ if(item.title=='购物车'){
console.log('---12314');
this.$router.push({ this.$router.push({
path: "/myorder/userrecord", path: "/myorder/userrecord",
@ -1133,7 +1152,6 @@ activeInde3:0,
}, },
userbuy(item){ userbuy(item){
let user= localStorage.getItem("userInfo"); let user= localStorage.getItem("userInfo");
console.log(item);
this.courseId(item) this.courseId(item)
this.$router.push({ this.$router.push({
path: "/myorder/userrecord", path: "/myorder/userrecord",
@ -1144,12 +1162,10 @@ activeInde3:0,
selectGoods(item,index){ selectGoods(item,index){
let jump = document.querySelectorAll('.selectionswitch') let jump = document.querySelectorAll('.selectionswitch')
let total = jump[index].offsetTop let total = jump[index].offsetTop
console.log(total);
$('html body').animate({scrollTop: total}, 500); $('html body').animate({scrollTop: total}, 500);
this.activeIndex=index; this.activeIndex=index;
this.catfood=true; this.catfood=true;
this.catproduct=false; this.catproduct=false;
console.log(item)
if(item.title=="猫湿粮"){ if(item.title=="猫湿粮"){
this.catproduct=false; this.catproduct=false;
this.catfood=true; this.catfood=true;
@ -1161,7 +1177,6 @@ selectGoods(item,index){
}, },
selectGo(item,index){ selectGo(item,index){
console.log(index);
this.activeInde2=index; this.activeInde2=index;
}, },
selectGoo(item,index){ selectGoo(item,index){

View File

@ -69,7 +69,7 @@
<div class="rc-usermain"> <div class="rc-usermain">
<h2>服务工具</h2> <h2>服务工具</h2>
<div class="rc-buymain"> <div class="rc-buymain">
<div class="rc-buy" v-for="(item, index) in personallist" :key="index" @click="openaddress(index)"> <div class="rc-buy" v-for="(item, index) in personallist" :key="index" @click="openaddress(item,index)">
<div class="rc-cord"> <div class="rc-cord">
<img :src="item.buyimage" alt="" /> <img :src="item.buyimage" alt="" />
<em>{{ item.title }}</em> <em>{{ item.title }}</em>
@ -186,38 +186,42 @@ export default {
}, },
methods: { methods: {
userinter(){ userinter(){
console.log(this.userid); let user= localStorage.getItem("userInfo");
if(this.userid!==null||this.userid!==undefined){ if(user==undefined||user==null||user==''){
this.$router.push({ this.$message({
type: 'warning',
message: '您还未登录'
});
return
}else{
this.$router.push({
path: "/personal/integral/", path: "/personal/integral/",
query: { query: {
stype: 1, stype: 1,
}, },
}); });
}else{
this.$message({
type: 'warning',
message: '您还未登录'
});
return
} }
}, },
findall(){ findall(){
console.log('PPP'); console.log('PPP');
console.log(this.userid.length); console.log(this.userid.length);
if(this.userid!==null||this.userid!==undefined){
this.$router.push({ let user= localStorage.getItem("userInfo");
if(user==undefined||user==null||user==''){
this.$message({
type: 'warning',
message: '您还未登录'
});
return
}else{
this.$router.push({
path: "/personal/useraddress/", path: "/personal/useraddress/",
query: { query: {
stype: 0, stype: 0,
}, },
}); });
}else{
this.$message({
type: 'warning',
message: '您还未登录'
});
return
} }
}, },
@ -225,9 +229,17 @@ userinter(){
obligation(item,index){ obligation(item,index){
console.log(index); console.log(index);
console.log(item); console.log(item);
let user= localStorage.getItem("userInfo");
if(user==undefined||user==null||user==''){
this.$message({
type: 'warning',
message: '您还未登录'
});
return
if(this.userid!==null||this.userid!==undefined){
if(item.title=='待付款'){ }else{
if(item.title=='待付款'){
this.$router.push({ this.$router.push({
path: "/personal/useraddress", path: "/personal/useraddress",
query: { query: {
@ -253,13 +265,6 @@ obligation(item,index){
}, },
}); });
} }
}else{
this.$message({
type: 'warning',
message: '您还未登录'
});
return
} }
}, },
@ -299,12 +304,21 @@ obligation(item,index){
this.dialogInfo1=false; this.dialogInfo1=false;
} }
}, },
openaddress(index){ openaddress(item,index){
console.log(index); console.log(item,index);
if(this.userid!==null||this.userid!==undefined){ let user= localStorage.getItem("userInfo");
if(index==2){ if(user==undefined||user==null||user==''){
console.log('---=');
this.$message({
type: 'warning',
message: '您还未登录'
});
return
}else{
if(index==2){
this.$router.push({ this.$router.push({
path: `/useraddress/openaddress/` path: `/personal/useraddress/`
}) })
console.log('这是地址的跳转'); console.log('这是地址的跳转');
@ -322,13 +336,6 @@ this.$router.push({
} }
}else{
console.log('---=');
this.$message({
type: 'warning',
message: '您还未登录'
});
return
} }
}, },

View File

@ -214,7 +214,7 @@ export default {
productCode:'',//code productCode:'',//code
productlist:[], productlist:[],
userbuy:true, userbuy:true,
sales_num:1, sales_num:1,
usernewlist: [ usernewlist: [
{ {
price: "30", price: "30",
@ -538,9 +538,18 @@ usertanchu(item,orderm){
}, },
userget(){ userget(){
this.userdraw(this.usermessage.data.mobile);
let user= localStorage.getItem("userInfo");
if(user==undefined||user==null||user==''){
this.dialogInfo2=true;
return
}else{
this.userdraw(this.usermessage.data.mobile);
this.alldrawlist(this.usermessage.data.id); this.alldrawlist(this.usermessage.data.id);
this.dialogInfo1=true; this.dialogInfo1=true;
}
}, },
selectsearch(item, index) { selectsearch(item, index) {
@ -554,6 +563,7 @@ usertanchu(item,orderm){
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

View File

@ -19,7 +19,7 @@
<h2>专区:</h2> <h2>专区:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li v-for="(item, index) in prefecture" :key="index" @click="selectproduct(item, index)" :class="activeIndexb == index ? 'active' : 'unactive'" > <li v-for="(item, index) in prefecture" :key="index" @click="selectproduct(item, index)" :class="activeIndexb == index ? 'active' : 'unactive'" >
{{ item.title }} {{ item.tagName }}
</li> </li>
</ol> </ol>
</div> </div>
@ -28,7 +28,7 @@
<h2>年龄:</h2> <h2>年龄:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li v-for="(item, index) in catage" :key="index" @click="selectage(item, index)" :class="activeIndexc == index ? 'active' : 'unactive'"> <li v-for="(item, index) in catage" :key="index" @click="selectage(item, index)" :class="activeIndexc == index ? 'active' : 'unactive'">
{{ item.title }} {{ item.tagName }}
</li> </li>
</ol> </ol>
</div> </div>
@ -37,7 +37,7 @@
<h2>功能:</h2> <h2>功能:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li v-for="(item, index) in catagea" :key="index" @click="selectagc(item, index)" :class="activeIndexd == index ? 'active' : 'unactive'"> <li v-for="(item, index) in catagea" :key="index" @click="selectagc(item, index)" :class="activeIndexd == index ? 'active' : 'unactive'">
{{ item.title }} {{ item.tagName }}
</li> </li>
</ol> </ol>
</div> </div>
@ -46,7 +46,7 @@
<h2>品种:</h2> <h2>品种:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li v-for="(item, index) in catageb" :key="index" @click="selectagd(item, index)" :class="activeIndexe == index ? 'active' : 'unactive'"> <li v-for="(item, index) in catageb" :key="index" @click="selectagd(item, index)" :class="activeIndexe == index ? 'active' : 'unactive'">
{{ item.title }} {{ item.tagName }}
</li> </li>
</ol> </ol>
</div> </div>
@ -91,7 +91,7 @@
<div class="rc-productcat ts-scrollable"> <div class="rc-productcat ts-scrollable">
<div class="rc-cat" v-for="(item, index) in userproduct" :key="index" @click="selectGoodsa(item, index)" :class="activeIndex1 == index ? 'active' : 'unactive'" > <div class="rc-cat" v-for="(item, index) in userproduct" :key="index" @click="selectGoodsa(item, index)" :class="activeIndex1 == index ? 'active' : 'unactive'" >
<img :src="item.catimage" alt="" /> <img :src="item.catimage" alt="" />
<span>{{ item.title }}</span> <span>{{ item.tagName }}</span>
</div> </div>
</div> </div>
@ -99,7 +99,7 @@
<h2>专区:</h2> <h2>专区:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li v-for="(item, index) in prefecture" :key="index" @click="selectproduct(item, index)" :class="activeIndexb == index ? 'active' : 'unactive'" > <li v-for="(item, index) in prefecture" :key="index" @click="selectproduct(item, index)" :class="activeIndexb == index ? 'active' : 'unactive'" >
{{ item.title }} {{ item.tagName }}
</li> </li>
</ol> </ol>
</div> </div>
@ -108,7 +108,7 @@
<h2>年龄:</h2> <h2>年龄:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li v-for="(item, index) in catage" :key="index" @click="selectage(item, index)" :class="activeIndexc == index ? 'active' : 'unactive'"> <li v-for="(item, index) in catage" :key="index" @click="selectage(item, index)" :class="activeIndexc == index ? 'active' : 'unactive'">
{{ item.title }} {{ item.tagName }}
</li> </li>
</ol> </ol>
</div> </div>
@ -116,7 +116,7 @@
<h2>功能:</h2> <h2>功能:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li v-for="(item, index) in catagea" :key="index" @click="selectagc(item, index)" :class="activeIndexd == index ? 'active' : 'unactive'"> <li v-for="(item, index) in catagea" :key="index" @click="selectagc(item, index)" :class="activeIndexd == index ? 'active' : 'unactive'">
{{ item.title }} {{ item.tagName }}
</li> </li>
</ol> </ol>
</div> </div>
@ -125,7 +125,7 @@
<h2>品种:</h2> <h2>品种:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li v-for="(item, index) in catageb" :key="index" @click="selectagd(item, index)" :class="activeIndexe == index ? 'active' : 'unactive'"> <li v-for="(item, index) in catageb" :key="index" @click="selectagd(item, index)" :class="activeIndexe == index ? 'active' : 'unactive'">
{{ item.title }} {{ item.tagName }}
</li> </li>
</ol> </ol>
</div> </div>
@ -159,7 +159,7 @@
<h2>专区:</h2> <h2>专区:</h2>
<ol> <ol>
<li v-for="(item, index) in prefecture" :key="index" @click="selectproduct(item, index)" :class="activeIndexb == index ? 'active' : 'unactive'" > <li v-for="(item, index) in prefecture" :key="index" @click="selectproduct(item, index)" :class="activeIndexb == index ? 'active' : 'unactive'" >
{{ item.title }} {{ item.tagName }}
</li> </li>
</ol> </ol>
</div> </div>
@ -168,7 +168,7 @@
<h2>年龄:</h2> <h2>年龄:</h2>
<ol> <ol>
<li v-for="(item, index) in catage" :key="index" @click="selectage(item, index)" :class="activeIndexc == index ? 'active' : 'unactive'"> <li v-for="(item, index) in catage" :key="index" @click="selectage(item, index)" :class="activeIndexc == index ? 'active' : 'unactive'">
{{ item.title }} {{ item.tagName }}
</li> </li>
</ol> </ol>
</div> </div>
@ -176,7 +176,7 @@
<h2>功能:</h2> <h2>功能:</h2>
<ol> <ol>
<li v-for="(item, index) in catagea" :key="index" @click="selectagc(item, index)" :class="activeIndexd == index ? 'active' : 'unactive'"> <li v-for="(item, index) in catagea" :key="index" @click="selectagc(item, index)" :class="activeIndexd == index ? 'active' : 'unactive'">
{{ item.title }} {{ item.tagName }}
</li> </li>
</ol> </ol>
</div> </div>
@ -185,7 +185,7 @@
<h2>品种:</h2> <h2>品种:</h2>
<ol> <ol>
<li v-for="(item, index) in catageb" :key="index" @click="selectagd(item, index)" :class="activeIndexe == index ? 'active' : 'unactive'"> <li v-for="(item, index) in catageb" :key="index" @click="selectagd(item, index)" :class="activeIndexe == index ? 'active' : 'unactive'">
{{ item.title }} {{ item.tagName }}
</li> </li>
</ol> </ol>
</div> </div>
@ -202,12 +202,16 @@
<script> <script>
import Myheader from '~/components/header.vue' import Myheader from '~/components/header.vue'
import { userstype,biaomessa,biaomessage } from "../../ajax/getData"; import { userstype,biaomessa,biaomessage,searchchanpin } from "../../ajax/getData";
export default { export default {
data() { data() {
return { return {
value: "", value: "",
userstype:[],
activeIndex:0, activeIndex:0,
userserachlist:[
{}
],
activeIndex1:0, activeIndex1:0,
activeIndexa:'-1', activeIndexa:'-1',
dialogInfo1:false, dialogInfo1:false,
@ -385,32 +389,67 @@ export default {
Myheader, Myheader,
}, },
mounted(){ mounted(){
let stype=this.$route.query.stype; let stype=this.$route.query.stype;
this.userst();
this.activeIndex=stype; this.activeIndex=stype;
console.log(stype);
if(stype!==''&&stype!==undefined){ if(stype!==''&&stype!==undefined){
this.onmessage(stype) this.onmessage(stype)
}else{ }else{
this.usetmessage(); this.usetmessage();
} }
}, },
methods: { methods: {
async usersearch(stype){
let data=await searchchanpin(stype);
if(data){
this.rccontair=data;
}
},
async userst() {
let pinzhong=[];
let zhuanqu=[];
let age=[];
let gonneg=[];
let data = await userstype();
if(data){
this.userstype=data;
}
this.usercatlist=this.userstype.filter(item=>item.petType=='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=gonneg
}
})
this.userdoglisgt=this.userstype.filter(item=>item.petType=='1')
},
async usetmessage() { async usetmessage() {
let data = await biaomessa(); let data = await biaomessa();
if(data){ if(data){
this.rccontair=data; this.rccontair=data;
} }
console.log( this.rccontair);
}, },
async onmessage(stype) { async onmessage(stype) {
let data = await biaomessage(stype); let data = await biaomessage(stype);
if(data){ if(data){
this.rccontair=data; this.rccontair=data;
} }
console.log( this.rccontair);
}, },
@ -476,19 +515,25 @@ this.dialogInfo1=false;
onSearch() {}, onSearch() {},
selectGoods(item, index) { selectGoods(item, index) {
this.activeIndex=index; this.activeIndex=index;
console.log('----'); let petType={
petType:this.activeIndex,
}
for(let i =0;i<this.userserachlist.length;i++){
if(!this.userserachlist.includes(petType)){
this.userserachlist.push(petType)
}
}
this.usersearch(this.userserachlist)
}, },
selectGoodsa(item, index) { selectGoodsa(item, index) {
this.activeIndex1=index; this.activeIndex1=index;
console.log('----');
}, },
userselect(){ userselect(){
this.$nextTick(() => { this.$nextTick(() => {
this.ifadroind(); this.ifadroind();
console.log( this.$refs.usercontent)
}) })
}, },
@ -505,23 +550,60 @@ this.dialogInfo1=false;
this.activeIndexa=index; this.activeIndexa=index;
}, },
selectage(item, index) { selectage(item, index) {
let tagUsedAge={
petType:this.activeIndex1,
tagUsedAge:item.tagName
}
for(let i =0;i<this.userserachlist.length;i++){
if(!this.userserachlist.includes(tagUsedAge)){
this.userserachlist.push(tagUsedAge)
}
}
this.usersearch(this.userserachlist)
this.activeIndexc=index; this.activeIndexc=index;
}, },
selectagc(item, index) { selectagc(item, index) {
let tagFunction={
petType:this.activeIndex1,
tagFunction:item.tagName
}
for(let i =0;i<this.userserachlist.length;i++){
if(!this.userserachlist.includes(tagFunction)){
this.userserachlist.push(tagFunction)
}
}
this.usersearch(this.userserachlist)
this.activeIndexd=index; this.activeIndexd=index;
}, },
selectagd(item, index) { selectagd(item, index) {
let tagBreed={
petType:this.activeIndex1,
tagBreed:item.tagName
}
for(let i =0;i<this.userserachlist.length;i++){
if(!this.userserachlist.includes(tagBreed)){
this.userserachlist.push(tagBreed)
}
}
this.usersearch(this.userserachlist)
this.activeIndexe=index; this.activeIndexe=index;
}, },
selectproduct(item, index){ selectproduct(item, index){
this.activeIndexb=index; this.activeIndexb=index;
let categoryName={
petType:this.activeIndex1,
categoryName:item.tagName,
}
for(let i =0;i<this.userserachlist.length;i++){
if(!this.userserachlist.includes(categoryName)){
this.userserachlist.push(categoryName)
}
}
this.usersearch(this.userserachlist)
}, },
selectage(item, index) {
this.activeIndexc=index;
},
selectage(item, index) {
this.activeIndexc=index;
},
// //
}, },

View File

@ -3,7 +3,7 @@
<Myheader></Myheader> <Myheader></Myheader>
<div class="rc-top"> <div class="rc-top">
<div class="rc-max-width--xl rc-main"> <div class="rc-main">
<div class="usersearch"> <div class="usersearch">
<div class="form-search"> <div class="form-search">
<van-search <van-search
@ -33,7 +33,6 @@
<div class="usercontentshow" ref="usercontent"> <div class="usercontentshow" ref="usercontent">
<div class="rc-product"> <div class="rc-product">
<h2>我想搜</h2> <h2>我想搜</h2>
<div class="ts-scrollable-container">
<div class="rc-productcat ts-scrollable"> <div class="rc-productcat ts-scrollable">
<div class="rc-cat" v-for="(item, index) in userproduct" :key="index" @click="selectGoods(item, index)" :class="activeIndex == index ? 'active' : 'unactive'" > <div class="rc-cat" v-for="(item, index) in userproduct" :key="index" @click="selectGoods(item, index)" :class="activeIndex == index ? 'active' : 'unactive'" >
<img :src="item.catimage" alt="" /> <img :src="item.catimage" alt="" />
@ -44,10 +43,9 @@
<span @click="usershow()">筛选</span> <span @click="usershow()">筛选</span>
</div> </div>
</div> </div>
</div>
</div> </div>
<div class="ts-scrollable-container"> <div class="rc-age">
<h2>专区:</h2> <h2>专区:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li v-for="(item, index) in prefecture" :key="index" @click="selectproduct(item, index)" :class="activeIndexb == index ? 'active' : 'unactive'" > <li v-for="(item, index) in prefecture" :key="index" @click="selectproduct(item, index)" :class="activeIndexb == index ? 'active' : 'unactive'" >
@ -56,7 +54,7 @@
</ol> </ol>
</div> </div>
<div class="ts-scrollable-container"> <div class="rc-age">
<h2>年龄:</h2> <h2>年龄:</h2>
<ol class="ts-scrollable"> <ol class="ts-scrollable">
<li v-for="(item, index) in catage" :key="index" @click="selectage(item, index)" :class="activeIndexc == index ? 'active' : 'unactive'"> <li v-for="(item, index) in catage" :key="index" @click="selectage(item, index)" :class="activeIndexc == index ? 'active' : 'unactive'">
@ -446,29 +444,6 @@ this.userst();
}) })
this.userdoglisgt=this.userstype.filter(item=>item.petType=='1') this.userdoglisgt=this.userstype.filter(item=>item.petType=='1')
// console.log(this.userdoglisgt)
// console.log(this.usercatlist,this.userdoglisgt);
// if(this.userstype[i].name==''){
// pinzhong.push(this.userstype[i]);
//
// }
// else if(this.userstype[i].name==''){
// zhuanqu.push(this.userstype[i]);
// this.prefecture=zhuanqu
// }
// else if(this.userstype[i].name==''){
// age.push(this.userstype[i]);
// this.catage=age;
// }
// else if(this.userstype[i].name==''){
// gonneg.push(this.userstype[i]);
// this.catagea=gonneg;
// }
console.log(pinzhong,zhuanqu,age,gonneg);
console.log(this.userstype);
}, },