mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-02 10:16:38 +08:00
Index bug fixed
This commit is contained in:
parent
a1f6e32213
commit
37a7e4706d
@ -8,17 +8,35 @@ body{
|
||||
.fade-leave-active {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.ts-mask{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position: fixed;
|
||||
top:0;
|
||||
left:0;
|
||||
display:flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index:99;
|
||||
|
||||
.ts-mask-bg{
|
||||
background-color:#000;
|
||||
opacity:.6;
|
||||
width:100%;
|
||||
height:100%;
|
||||
z-index:0;
|
||||
position:absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
}
|
||||
}
|
||||
.userloding {
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
margin-left: -1.56rem;
|
||||
top: 50%;
|
||||
margin-top: -3.75rem;
|
||||
background: url(../image/onloading.png) center center no-repeat;
|
||||
width: 3.12rem;
|
||||
background-size: contain;
|
||||
height: 7.5rem;
|
||||
z-index: 1000;
|
||||
height: 3.12rem;
|
||||
animation: rolling 4s infinite;
|
||||
-webkit-animation:rolling 4s infinite;
|
||||
}
|
||||
@ -229,13 +247,12 @@ img, picture {
|
||||
right: 0;
|
||||
top: 30%;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 0px .62rem rgba(0, 0, 0, 0.16);
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.16);
|
||||
border-radius: .25rem;
|
||||
z-index:3;
|
||||
ul{
|
||||
width: 60px;
|
||||
height: 181px;
|
||||
box-shadow: 0px 0px 6px rgb(0 0 0 / 10%);
|
||||
background-color: white;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -323,9 +340,7 @@ img, picture {
|
||||
margin-top: 90px;
|
||||
}
|
||||
.rc-list__header {
|
||||
background: none;
|
||||
padding: .5rem 0;
|
||||
border-bottom: none;
|
||||
|
||||
}
|
||||
.ts-right-arr {
|
||||
border-bottom:1px solid #E1001A;
|
||||
|
@ -18,28 +18,31 @@
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.ts-position-identifier{
|
||||
|
||||
li{
|
||||
background: unset;;
|
||||
img{
|
||||
border-radius: 50%;
|
||||
}
|
||||
&.active {
|
||||
}
|
||||
.ul-zhuan,.ul-dog{
|
||||
li{
|
||||
background: unset;
|
||||
img{
|
||||
border: 3px solid #E2001A;
|
||||
border-radius: 50%;
|
||||
}
|
||||
color: #E2001A;
|
||||
&.active {
|
||||
img{
|
||||
border: 3px solid #E2001A;
|
||||
}
|
||||
color: #E2001A;
|
||||
|
||||
}
|
||||
&.unactive {
|
||||
color: #444444;
|
||||
img{
|
||||
border: 3px solid #D7D7D7;
|
||||
}
|
||||
&.unactive {
|
||||
color: #444444;
|
||||
img{
|
||||
border: 3px solid #D7D7D7;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.uservideo{
|
||||
overflow: hidden;
|
||||
video{
|
||||
@ -47,9 +50,40 @@ li{
|
||||
width:auto;
|
||||
}
|
||||
}
|
||||
.ul-dog{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: row;
|
||||
|
||||
span{
|
||||
margin-top: .5rem;
|
||||
display: block;
|
||||
}
|
||||
img{
|
||||
width: 9.5rem;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
li{
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
margin-top:3rem;
|
||||
margin-left:3rem;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width:768px){
|
||||
.ul-dog{
|
||||
display: none;
|
||||
justify-content: space-evenly;
|
||||
img{
|
||||
width:4rem;
|
||||
height:auto;
|
||||
}
|
||||
li{
|
||||
margin-top:1.875rem;
|
||||
}
|
||||
}
|
||||
.ts-banner-swiper-container{
|
||||
margin-bottom:2.5rem;
|
||||
@ -57,9 +91,9 @@ li{
|
||||
.searchBara{
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
top:66px;
|
||||
top:3.75rem;
|
||||
background: white;
|
||||
z-index: 9999;
|
||||
z-index: 60;
|
||||
overflow-x: auto;
|
||||
white-space: nowrap;
|
||||
overflow-y:hidden;
|
||||
@ -76,7 +110,6 @@ li{
|
||||
display: inline-block;
|
||||
margin-left: 0.20rem;
|
||||
text-align: center;
|
||||
background: #F6F6F6;
|
||||
border-radius: 50%;
|
||||
opacity: 1;
|
||||
}
|
||||
@ -203,7 +236,7 @@ li{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
img{
|
||||
@ -560,30 +593,7 @@ img{
|
||||
|
||||
}
|
||||
.usermain{
|
||||
.ul-dog{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: row;
|
||||
|
||||
span{
|
||||
margin-top: .5rem;
|
||||
display: block;
|
||||
}
|
||||
img{
|
||||
width: 9.5rem;
|
||||
height: 9.5rem;
|
||||
display: block;
|
||||
}
|
||||
li{
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
margin-top:3rem;
|
||||
margin-left:3rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
.rc-main{
|
||||
width: 100%;
|
||||
|
@ -37,7 +37,7 @@
|
||||
<div class="online bold rc-md-up" v-show="catproduct"></div>
|
||||
|
||||
<div class="rc-full-width">
|
||||
<div class="rc-lunbo rc-full-width">
|
||||
<div class="rc-lunbo rc-full-width ts-position-identifier" data-rel="明星猫粮">
|
||||
<!-- <h2>明星猫粮</h2> -->
|
||||
<div class="pageFullScreen" id="xxxFullScreen" v-show="catproduct" ref="mingxing">
|
||||
<!-- 内容 -->
|
||||
@ -91,8 +91,8 @@
|
||||
|
||||
<div class="online bold" v-show="onemao"></div>
|
||||
<div class="selectionswitch rc-full-width rc-max-width--xl rc-padding-y--md" ref="usercontent" v-show="onemao">
|
||||
<h2 class="rc-beta rc-text--center" >全价猫湿粮</h2>
|
||||
<van-tabs @change='catclick' class="van-tabs" v-if="onemao">
|
||||
<h2 class="rc-beta rc-text--center ts-position-identifier" data-rel="猫湿粮" >全价猫湿粮</h2>
|
||||
<van-tabs @click='catclickShi' class="van-tabs" v-if="onemao" v-model="maoshiCurIndex">
|
||||
<van-tab v-for="(item,index) in discoun" :key="index" :title="item.title">
|
||||
<div class="rc-contair">
|
||||
<ul class="ts-product-list rc-margin-bottom--lg">
|
||||
@ -165,22 +165,18 @@
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<nuxt-link :to="`/productdetails/productlist/`">
|
||||
<div class="userserlect">
|
||||
<span class="ts-standard-btn center">查看更多</span>
|
||||
</div>
|
||||
</nuxt-link>
|
||||
|
||||
|
||||
<nuxt-link :to="`/productdetails/productlist/`">
|
||||
<div class="userserlect">
|
||||
<span class="ts-standard-btn center">查看更多</span>
|
||||
</div>
|
||||
</nuxt-link>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="online bold" v-show="twomao"></div>
|
||||
<div class="selectionswitch rc-full-width rc-max-width--xl rc-padding-y--md" v-show="twomao" ref="catgan">
|
||||
<h2 class="rc-beta rc-text--center">全价猫干粮</h2>
|
||||
<van-tabs @change='catclick' class="van-tabs" v-if="twomao">
|
||||
<h2 class="rc-beta rc-text--center ts-position-identifier" data-rel="猫干粮">全价猫干粮</h2>
|
||||
<van-tabs @click='catclickGan' class="van-tabs" v-if="twomao" v-model="maoganCurIndex">
|
||||
<van-tab v-for="(item,index) in discoun" :key="index" :title="item.title">
|
||||
<div class="rc-contair">
|
||||
<ul class="ts-product-list rc-margin-bottom--lg">
|
||||
@ -275,7 +271,7 @@
|
||||
<!-- 内容 -->
|
||||
<div class="swiper-container rc-full-width rc-padding-y--md" id="swiper2">
|
||||
<div class="oc-top">
|
||||
<h2 class="rc-beta rc-text--center">{{dogtitle}}</h2>
|
||||
<h2 class="rc-beta rc-text--center ts-position-identifier" data-rel="明星犬粮">{{dogtitle}}</h2>
|
||||
</div>
|
||||
<!-- 轮播图 -->
|
||||
<div class="ts-carousel-container">
|
||||
@ -328,21 +324,20 @@
|
||||
|
||||
|
||||
<div class="selectionswitch rc-full-width rc-max-width--xl rc-padding-y--md" v-show="threemao" ref="doggshi">
|
||||
<h2 class="rc-beta rc-text--center">全价犬湿粮</h2>
|
||||
<van-tabs @change='userdog' class="van-tabs" v-if="threemao">
|
||||
<div class="online bold rc-md-down" v-show="threemao"></div>
|
||||
<h2 class="rc-beta rc-text--center ts-position-identifier" data-rel="犬湿粮">全价犬湿粮</h2>
|
||||
<van-tabs @click='userdogShi' class="van-tabs" v-if="threemao" v-model="quanshiCurIndex">
|
||||
<van-tab v-for="(item,index) in dogtype" :key="index" :title="item.title">
|
||||
<div class="online bold" v-show="threemao"></div>
|
||||
<div class="online bold rc-md-up" v-show="threemao"></div>
|
||||
<div class="usermain">
|
||||
<ul class="ul-dog usermain">
|
||||
<li
|
||||
v-for="(item, index) in userdoglist"
|
||||
:key="index"
|
||||
@click="quanshi(item, index)"
|
||||
:class="activeIndex5 == index ? 'active' : 'unactive'"
|
||||
v-for="(dogListitem, dogListIndex) in userdoglist"
|
||||
:key="dogListIndex"
|
||||
@click="quanshi(dogListitem, dogListIndex)"
|
||||
:class="activeIndex5 == dogListIndex ? 'active' : 'unactive'"
|
||||
>
|
||||
<img :src="item.catimage" alt="">
|
||||
<span>{{ item.title }}</span>
|
||||
<img :src="dogListitem.catimage" alt="">
|
||||
<span>{{ dogListitem.title }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -425,12 +420,11 @@
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<nuxt-link :to="`/productdetails/productlist/`">
|
||||
<div class="userserlect">
|
||||
<span class="ts-standard-btn center">查看更多</span>
|
||||
</div>
|
||||
</nuxt-link>
|
||||
<nuxt-link :to="`/productdetails/productlist/`">
|
||||
<div class="userserlect">
|
||||
<span class="ts-standard-btn center">查看更多</span>
|
||||
</div>
|
||||
</nuxt-link>
|
||||
|
||||
|
||||
</div>
|
||||
@ -445,20 +439,20 @@
|
||||
|
||||
<div class="online bold" v-show="fourmao"></div>
|
||||
<div class="selectionswitch rc-full-width rc-max-width--xl rc-padding-y--md" v-show="fourmao" ref="dogan">
|
||||
<h2 class="rc-beta rc-text--center">全价犬干粮</h2>
|
||||
<van-tabs @change='userdog' class="van-tabs" v-if="fourmao">
|
||||
<div class="online bold" v-show="fourmao"></div>
|
||||
<h2 class="rc-beta rc-text--center ts-position-identifier" data-rel="犬干粮">全价犬干粮</h2>
|
||||
<van-tabs @click='userdogGan' class="van-tabs" v-if="fourmao" v-model="quanganCurIndex">
|
||||
<div class="online bold rc-md-up" v-show="fourmao"></div>
|
||||
<van-tab v-for="(item,index) in dogtype" :key="index" :title="item.title">
|
||||
<div class="usermain">
|
||||
<ul class="ul-dog usermain">
|
||||
<li
|
||||
v-for="(item, index) in userdoglist"
|
||||
:key="index"
|
||||
@click="userdoghot(item, index)"
|
||||
:class="activeIndex6 == index ? 'active' : 'unactive'"
|
||||
v-for="(userDogListItem, userDogListIndex) in userdoglist"
|
||||
:key="userDogListIndex"
|
||||
@click="userdoghot(userDogListItem, userDogListIndex)"
|
||||
:class="activeIndex6 == userDogListIndex ? 'active' : 'unactive'"
|
||||
>
|
||||
<img :src="item.catimage" alt="">
|
||||
<span>{{ item.title }}</span>
|
||||
<img :src="userDogListItem.catimage" alt="">
|
||||
<span>{{ userDogListItem.title }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -538,12 +532,11 @@
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<nuxt-link :to="`/productdetails/productlist/`">
|
||||
<div class="userserlect">
|
||||
<span class="ts-standard-btn center">查看更多</span>
|
||||
</div>
|
||||
</nuxt-link>
|
||||
<nuxt-link :to="`/productdetails/productlist/`">
|
||||
<div class="userserlect">
|
||||
<span class="ts-standard-btn center">查看更多</span>
|
||||
</div>
|
||||
</nuxt-link>
|
||||
|
||||
|
||||
</div>
|
||||
@ -556,8 +549,8 @@
|
||||
<div class="online bold" v-show="fivemao"></div>
|
||||
|
||||
<div class="selectionswitch rc-full-width rc-max-width--xl rc-padding-y--md" v-show="fivemao" ref="chufang">
|
||||
<h2 class="rc-beta rc-text--center">处方用粮</h2>
|
||||
<van-tabs @change='userclick' class="van-tabs" v-if="fivemao">
|
||||
<h2 class="rc-beta rc-text--center ts-position-identifier" data-rel="处方用粮">处方用粮</h2>
|
||||
<van-tabs @click='userclick' class="van-tabs" v-if="fivemao">
|
||||
<van-tab v-for="(item,index) in discounchufang" :key="index" :title="item.title">
|
||||
<div class="rc-contair">
|
||||
<ul class="ts-product-list rc-margin-bottom--lg">
|
||||
@ -701,7 +694,11 @@
|
||||
<span>回到顶部</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="!dataLoaded" class="ts-mask">
|
||||
<div class="ts-mask-bg"></div>
|
||||
<div class="userloding"></div>
|
||||
<span>数据加载中</span>
|
||||
</div>
|
||||
<Myfooter v-on:litentop='showmesg'></Myfooter>
|
||||
</div>
|
||||
</template>
|
||||
@ -718,6 +715,8 @@
|
||||
meta: {title: '首页'},
|
||||
data(){
|
||||
return{
|
||||
fixedHeader:false,
|
||||
dataLoaded:true,
|
||||
useraindex:0,
|
||||
usertitle:'明星猫粮',
|
||||
dogtitle:'明星犬粮',
|
||||
@ -740,18 +739,22 @@
|
||||
userserachlist:[{}],
|
||||
doggan:[],
|
||||
dogtype:[
|
||||
{
|
||||
title: "幼犬",
|
||||
|
||||
},
|
||||
{
|
||||
title: "成犬",
|
||||
},
|
||||
{
|
||||
title: "老年犬",
|
||||
},
|
||||
|
||||
],
|
||||
{
|
||||
title: "幼犬",
|
||||
},
|
||||
{
|
||||
title: "成犬",
|
||||
},
|
||||
{
|
||||
title: "老年犬",
|
||||
},
|
||||
{
|
||||
title: "品种犬",
|
||||
},
|
||||
{
|
||||
title: "亚健康",
|
||||
}
|
||||
],
|
||||
anchor:'',
|
||||
dogshi:[],
|
||||
catlist:[],
|
||||
@ -800,43 +803,43 @@
|
||||
]
|
||||
},
|
||||
showingBanners:[],
|
||||
maoganCurIndex:0,
|
||||
maoshiCurIndex:0,
|
||||
quanshiCurIndex:0,
|
||||
quanganCurIndex:0,
|
||||
userdoglist: [
|
||||
{
|
||||
title: "小型犬",
|
||||
catimage: "/images/dog/small.png",
|
||||
},
|
||||
{
|
||||
title: "中型犬",
|
||||
catimage: "/images/dog/medium.png",
|
||||
},
|
||||
{
|
||||
title: "大型犬",
|
||||
catimage: "/images/dog/big.png",
|
||||
},
|
||||
|
||||
],
|
||||
discoun: [
|
||||
{
|
||||
title: "幼猫",
|
||||
},
|
||||
{
|
||||
title: "成猫",
|
||||
},
|
||||
{
|
||||
title: "老年猫",
|
||||
},
|
||||
{
|
||||
title: "品种猫",
|
||||
{
|
||||
title: "小型犬",
|
||||
catimage: "/images/dog/small.png",
|
||||
},
|
||||
{
|
||||
title: "中型犬",
|
||||
catimage: "/images/dog/medium.png",
|
||||
},
|
||||
{
|
||||
title: "大型犬",
|
||||
catimage: "/images/dog/big.png",
|
||||
},
|
||||
],
|
||||
discoun: [
|
||||
{
|
||||
title: "幼猫",
|
||||
},
|
||||
{
|
||||
title: "成猫",
|
||||
},
|
||||
{
|
||||
title: "老年猫",
|
||||
},
|
||||
{
|
||||
title: "品种猫",
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
title: "亚健康猫",
|
||||
|
||||
|
||||
},
|
||||
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "亚健康猫"
|
||||
},
|
||||
],
|
||||
|
||||
discountlist: [
|
||||
{
|
||||
@ -1147,8 +1150,14 @@
|
||||
}
|
||||
window.addEventListener("scroll", this.handleScroll, true);
|
||||
this.userchufang();//查询处方粮商品信息
|
||||
|
||||
this.catmessage();//查询猫的信息
|
||||
this.catclickGan();
|
||||
this.catclickShi();
|
||||
|
||||
this.dogmessage();//查询狗的信息
|
||||
this.userdogShi();
|
||||
this.userdogGan();
|
||||
},
|
||||
destroyed () {
|
||||
window.removeEventListener('scroll', this.scrollToTop);
|
||||
@ -1200,8 +1209,6 @@
|
||||
|
||||
ifadroind(item,index,order){
|
||||
//console.log(item,index,order);
|
||||
|
||||
|
||||
var sUserAgent = navigator.userAgent.toLowerCase();
|
||||
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
|
||||
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
|
||||
@ -1212,8 +1219,8 @@
|
||||
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
|
||||
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
|
||||
|
||||
if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
|
||||
//console.log("当前是电脑打开啊啊啊")
|
||||
if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
|
||||
//console.log("当前是电脑打开啊啊啊")
|
||||
if(item.title=='明星猫粮'){
|
||||
this.catproduct=true;
|
||||
this.twomao=false;
|
||||
@ -1298,19 +1305,43 @@
|
||||
let dogtop=document.querySelector('.oc-top');
|
||||
//console.log(dogtop);
|
||||
//console.log(mingxin.offsetTop);
|
||||
|
||||
let positionIdentifier=document.querySelectorAll('.ts-position-identifier');
|
||||
let tmpTitle='';
|
||||
let scrollToTop=0;
|
||||
let _self=this;
|
||||
let transition = 230;
|
||||
positionIdentifier.forEach(function(ele,index){
|
||||
tmpTitle = ele.getAttribute("data-rel");
|
||||
if(item.title==tmpTitle)
|
||||
{
|
||||
if(_self.fixedHeader && item.title!='明星猫粮')
|
||||
{
|
||||
transition+=130;
|
||||
}
|
||||
scrollToTop = _self.heightToTop(positionIdentifier[index]) - transition;
|
||||
//positionIdentifier[index].scrollIntoView(true);
|
||||
window.scrollTo({
|
||||
top:scrollToTop,
|
||||
behavior:'smooth'
|
||||
})
|
||||
//document.body.scrollTop = oPos;
|
||||
}
|
||||
})
|
||||
/*
|
||||
if(item.title=='犬湿粮'||item.title=='犬干粮'||item.title=='处方用粮'){
|
||||
userindex=userindex-2
|
||||
userindex=userindex-2
|
||||
}else{
|
||||
userindex=userindex-1
|
||||
userindex=userindex-1
|
||||
}
|
||||
if(item.title=='明星猫粮'){
|
||||
mingxin.scrollIntoView(true);
|
||||
mingxin.scrollIntoView(true);
|
||||
}else{
|
||||
let catshiid=document.querySelectorAll('.selectionswitch');
|
||||
catshiid[userindex].scrollIntoView(true);
|
||||
let catshiid=document.querySelectorAll('.selectionswitch');
|
||||
catshiid[userindex].scrollIntoView(true);
|
||||
}
|
||||
if(item.title=='明星犬粮')
|
||||
dogtop.scrollIntoView(true);
|
||||
dogtop.scrollIntoView(true);
|
||||
// if(item.title=="猫湿粮"){
|
||||
// this.catproduct=false;
|
||||
// this.catfood=true;
|
||||
@ -1320,83 +1351,117 @@
|
||||
|
||||
// }
|
||||
//console.log("当前是手机打开")
|
||||
*/
|
||||
}
|
||||
},
|
||||
userdog(item,index){
|
||||
heightToTop(ele){
|
||||
//ele为指定跳转到该位置的DOM节点
|
||||
let root = document.body;
|
||||
let height = 0;
|
||||
do{
|
||||
height += ele.offsetTop;
|
||||
ele = ele.offsetParent;
|
||||
}while( ele !== root )
|
||||
return height;
|
||||
},
|
||||
userdogShi(){
|
||||
this.activeIndex5=(this.activeIndex5?this.activeIndex5:0);
|
||||
let apiDogSize=this.userdoglist[this.activeIndex5].title;
|
||||
let apiDogFoodType=this.dogtype[this.quanshiCurIndex].title;
|
||||
|
||||
this.userstype=1;
|
||||
let petType={
|
||||
petType:1,
|
||||
name:index,
|
||||
categoryName:"皇家犬湿粮",
|
||||
name:apiDogFoodType,
|
||||
}
|
||||
for(let i =0;i<this.userserachlist.length;i++){
|
||||
if(!this.userserachlist.includes(petType)){
|
||||
this.userserachlist.push(petType)
|
||||
this.userserachlist.push(petType)
|
||||
}
|
||||
}
|
||||
this.dogmessage(this.userserachlist)
|
||||
},
|
||||
//TODO how to combine "apiName" here?
|
||||
this.dogmessage(this.userserachlist,"Shi");
|
||||
},
|
||||
userdogGan(){
|
||||
this.activeIndex6=(this.activeIndex6?this.activeIndex6:0);
|
||||
let apiDogSize=this.userdoglist[this.activeIndex6].title;
|
||||
let apiDogFoodType=this.dogtype[this.quanganCurIndex].title;
|
||||
|
||||
|
||||
userlook(order){
|
||||
if(order==0){
|
||||
this.catshi=this.catlist;
|
||||
}
|
||||
if(order==1){
|
||||
this.catgan=this.catlist;
|
||||
|
||||
}else if(order==2){
|
||||
this.dogshi=this.doglist
|
||||
}
|
||||
else if(order==3){
|
||||
this.doggan=this.doglist
|
||||
}
|
||||
else if(order==4){
|
||||
this.processinformation=this.chufanlist
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
showmesg(){
|
||||
this.toTop();
|
||||
},
|
||||
handleScroll(e)
|
||||
{
|
||||
let fixedCatbarSeperator = document.getElementById("fixed-catbar-seperator");
|
||||
if(!fixedCatbarSeperator)
|
||||
this.userstype=1;
|
||||
let petType={
|
||||
petType:1,
|
||||
name:apiDogFoodType,
|
||||
}
|
||||
for(let i =0;i<this.userserachlist.length;i++){
|
||||
if(!this.userserachlist.includes(petType)){
|
||||
this.userserachlist.push(petType)
|
||||
}
|
||||
}
|
||||
//TODO how to combine "apiName" here?
|
||||
this.dogmessage(this.userserachlist,"Gan");
|
||||
},
|
||||
userlook(order){
|
||||
if(order==0){
|
||||
this.catshi=this.catlist;
|
||||
}
|
||||
if(order==1){
|
||||
this.catgan=this.catlist;
|
||||
}else if(order==2){
|
||||
this.dogshi=this.doglist
|
||||
}
|
||||
else if(order==3){
|
||||
this.doggan=this.doglist
|
||||
}
|
||||
else if(order==4){
|
||||
this.processinformation=this.chufanlist
|
||||
}
|
||||
},
|
||||
showmesg(){
|
||||
this.toTop();
|
||||
},
|
||||
handleScroll(e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
let scrolltop = document.documentElement.scrollTop || document.body.scrollTop;
|
||||
if((scrolltop-fixedCatbarSeperator.offsetTop)>0)
|
||||
{
|
||||
this.gotop = true
|
||||
this.searchBar=false
|
||||
}
|
||||
else
|
||||
{
|
||||
this.gotop = false;
|
||||
this.searchBar=true
|
||||
}
|
||||
},
|
||||
toTop() {
|
||||
let top = document.documentElement.scrollTop || document.body.scrollTop;
|
||||
// 实现滚动效果
|
||||
const timeTop = setInterval(() => {
|
||||
document.body.scrollTop = document.documentElement.scrollTop = top -= 400;
|
||||
if (top <= 0) {
|
||||
clearInterval(timeTop);
|
||||
}
|
||||
}, 10);
|
||||
},
|
||||
async courseId(item) {
|
||||
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){
|
||||
this.productlist=data;
|
||||
}
|
||||
},
|
||||
//请求猫
|
||||
async catmessage(stype) {
|
||||
let fixedCatbarSeperator = document.getElementById("fixed-catbar-seperator");
|
||||
if(!fixedCatbarSeperator)
|
||||
{
|
||||
return;
|
||||
}
|
||||
let scrolltop = document.documentElement.scrollTop || document.body.scrollTop;
|
||||
if((scrolltop-fixedCatbarSeperator.offsetTop)>0)
|
||||
{
|
||||
this.fixedHeader=false;
|
||||
this.gotop = true
|
||||
this.searchBar=false
|
||||
}
|
||||
else
|
||||
{
|
||||
this.fixedHeader=true;
|
||||
this.gotop = false;
|
||||
this.searchBar=true
|
||||
}
|
||||
},
|
||||
toTop() {
|
||||
let top = document.documentElement.scrollTop || document.body.scrollTop;
|
||||
// 实现滚动效果
|
||||
const timeTop = setInterval(() => {
|
||||
document.body.scrollTop = document.documentElement.scrollTop = top -= 400;
|
||||
if (top <= 0) {
|
||||
clearInterval(timeTop);
|
||||
}
|
||||
}, 10);
|
||||
},
|
||||
async courseId(item) {
|
||||
this.dataLoaded=false;
|
||||
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){
|
||||
this.productlist=data;
|
||||
this.dataLoaded=true;
|
||||
}
|
||||
},
|
||||
//请求猫
|
||||
async catmessage(stype,dataType) {
|
||||
this.dataLoaded=false;
|
||||
let data=[];
|
||||
if(stype==undefined||stype==null){
|
||||
data = await biaomessage(0,'',1,6);
|
||||
@ -1404,33 +1469,55 @@
|
||||
data = await biaomessage(this.userserachlist,'',1,6);
|
||||
}
|
||||
if(data){
|
||||
this.catlist=data;
|
||||
let userlist=[];
|
||||
userlist=data.slice(0,6);
|
||||
this.catshi=userlist;
|
||||
this.catgan=userlist;
|
||||
//userlist=data.slice(0,6);
|
||||
if(dataType)
|
||||
{
|
||||
if(dataType=='Shi')
|
||||
this.catshi=data;
|
||||
else if(dataType=='Gan')
|
||||
this.catgan=data;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.catlist=data;
|
||||
//this.catgan=userlist;
|
||||
//this.catshi=userlist;
|
||||
}
|
||||
this.dataLoaded=true;
|
||||
}
|
||||
},
|
||||
|
||||
//请求犬
|
||||
async dogmessage(stype) {
|
||||
let data=[];
|
||||
if(stype==undefined||stype==null){
|
||||
//请求犬
|
||||
async dogmessage(stype,dataType) {
|
||||
this.dataLoaded=false;
|
||||
let data=[];
|
||||
if(stype==undefined||stype==null){
|
||||
data = await biaomessage(1,'',1,6);
|
||||
}else{
|
||||
data = await biaomessage(this.userserachlist,'',1,6);
|
||||
}
|
||||
if(data){
|
||||
let userlist=[];
|
||||
//userlist=data.slice(0,6);
|
||||
if(dataType)
|
||||
{
|
||||
if(dataType=='Shi')
|
||||
this.dogshi=data;
|
||||
else if(dataType=='Gan')
|
||||
this.doggan=data;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.doglist=data;
|
||||
//this.doggan=userlist;
|
||||
//this.dogshi=userlist;
|
||||
}
|
||||
this.dataLoaded=true;
|
||||
}
|
||||
},
|
||||
|
||||
data = await biaomessage(1);
|
||||
}else{
|
||||
data = await biaomessage(this.userserachlist);
|
||||
}
|
||||
if(data){
|
||||
let userlist=[];
|
||||
userlist=data.slice(0,6);
|
||||
this.doglist=data;
|
||||
this.doggan=userlist;
|
||||
this.dogshi=userlist;
|
||||
}
|
||||
},
|
||||
|
||||
selectproduce(item,index){
|
||||
selectproduce(item,index){
|
||||
if(item.productList[0]==undefined){
|
||||
item.productlist[0].productCode=0;
|
||||
}
|
||||
@ -1444,107 +1531,118 @@
|
||||
productCode:item.productList[0].productCode
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
//请求处方量信息数据
|
||||
async userchufang() {
|
||||
let list=[];
|
||||
let data = await userque();
|
||||
if(data){
|
||||
list=data.slice(0,6);
|
||||
this.processinformation=list;
|
||||
this.chufanlist=data;
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
//点击请求处方量标签信息数据
|
||||
async userquery(item) {
|
||||
let data = await userquery(item);
|
||||
if(data){
|
||||
this.processinformation=data;
|
||||
}
|
||||
|
||||
},
|
||||
//请求处方量信息数据
|
||||
async userchufang() {
|
||||
this.dataLoaded=false;
|
||||
let list=[];
|
||||
let data = await userque();
|
||||
if(data){
|
||||
list=data.slice(0,6);
|
||||
this.processinformation=list;
|
||||
this.chufanlist=data;
|
||||
this.dataLoaded=true;
|
||||
}
|
||||
},
|
||||
//点击请求处方量标签信息数据
|
||||
async userquery(item) {
|
||||
this.dataLoaded=false;
|
||||
let data = await userquery(item);
|
||||
if(data){
|
||||
this.processinformation=data;
|
||||
this.dataLoaded=true;
|
||||
}
|
||||
},
|
||||
//处方用粮筛选
|
||||
userclick(item,index){
|
||||
this.userquery(index)
|
||||
},
|
||||
//全价猫湿粮筛选
|
||||
catclick(item,index){
|
||||
//全价猫干粮筛选
|
||||
catclickGan(){
|
||||
this.userstype=0;
|
||||
this.maoganCurIndex=this.maoganCurIndex?this.maoganCurIndex:0;
|
||||
let apiCatType=this.discoun[this.maoganCurIndex].title;
|
||||
let petType={
|
||||
petType:0,
|
||||
name:index,
|
||||
name:apiCatType,
|
||||
}
|
||||
for(let i =0;i<this.userserachlist.length;i++){
|
||||
if(!this.userserachlist.includes(petType)){
|
||||
this.userserachlist.push(petType)
|
||||
}
|
||||
}
|
||||
this.catmessage(this.userserachlist)
|
||||
this.catmessage(this.userserachlist,'Gan')
|
||||
},
|
||||
catclickShi(){
|
||||
this.userstype=0;
|
||||
this.maoshiCurIndex=this.maoshiCurIndex?this.maoshiCurIndex:0;
|
||||
let apiCatType=this.discoun[this.maoshiCurIndex].title;
|
||||
let petType={
|
||||
petType:0,
|
||||
categoryName:"皇家猫湿粮",
|
||||
name:apiCatType,
|
||||
}
|
||||
for(let i =0;i<this.userserachlist.length;i++){
|
||||
if(!this.userserachlist.includes(petType)){
|
||||
this.userserachlist.push(petType)
|
||||
}
|
||||
}
|
||||
this.catmessage(this.userserachlist,'Shi')
|
||||
},
|
||||
|
||||
|
||||
|
||||
lianxi(item,index){
|
||||
if(item.title=='在线客服'){
|
||||
var option = {
|
||||
customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'}
|
||||
}
|
||||
dis_livchat(option);
|
||||
}
|
||||
if(item.title=='购物车'){
|
||||
this.$router.push({
|
||||
path: "/myorder/userrecord",
|
||||
lianxi(item,index){
|
||||
if(item.title=='在线客服'){
|
||||
var option = {
|
||||
customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'}
|
||||
}
|
||||
dis_livchat(option);
|
||||
}
|
||||
if(item.title=='购物车'){
|
||||
this.$router.push({
|
||||
path: "/myorder/userrecord",
|
||||
});
|
||||
}
|
||||
if(item.title=='营养专家'){
|
||||
var option = {
|
||||
customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'}
|
||||
}
|
||||
dis_livchat(option);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
if(item.title=='营养专家'){
|
||||
var option = {
|
||||
customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'}
|
||||
}
|
||||
dis_livchat(option);
|
||||
}
|
||||
},
|
||||
userbuy(item){
|
||||
let user= localStorage.getItem("userInfo");
|
||||
this.courseId(item)
|
||||
this.$router.push({
|
||||
path: "/myorder/userrecord",
|
||||
});
|
||||
},
|
||||
|
||||
},
|
||||
userbuy(item){
|
||||
let user= localStorage.getItem("userInfo");
|
||||
this.courseId(item)
|
||||
this.$router.push({
|
||||
path: "/myorder/userrecord",
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
selectGoods(item,index){
|
||||
console.log(item,index);
|
||||
this.activeIndex=index;
|
||||
console.log(item.title);
|
||||
|
||||
this.ifadroind(item,index,this.useraindex)
|
||||
// this.ifAdoid(item,index);
|
||||
|
||||
},
|
||||
quanshi(item,index){
|
||||
console.log(item,index);
|
||||
this.activeIndex5=index
|
||||
console.log(this.activeIndex5);
|
||||
|
||||
},
|
||||
userdoghot(item,index){
|
||||
this.activeIndex6=index
|
||||
|
||||
},
|
||||
selectGo(item,index){
|
||||
this.activeInde2=index;
|
||||
},
|
||||
selectGoo(item,index){
|
||||
|
||||
this.activeInde3=index;
|
||||
}
|
||||
},
|
||||
selectGoods(item,index){
|
||||
//console.log(item,index);
|
||||
this.activeIndex=index;
|
||||
//console.log(item.title);
|
||||
this.ifadroind(item,index,this.useraindex)
|
||||
// this.ifAdoid(item,index);
|
||||
},
|
||||
quanshi(item,index){
|
||||
this.activeIndex5=index;
|
||||
this.userdogShi();
|
||||
},
|
||||
userdoghot(item,index){
|
||||
this.activeIndex6=index;
|
||||
this.userdogGan();
|
||||
},
|
||||
selectGo(item,index){
|
||||
this.activeInde2=index;
|
||||
},
|
||||
selectGoo(item,index){
|
||||
this.activeInde3=index;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user