!16 2022-1-17 Leung

Merge pull request !16 from Admin/sit-Leung
This commit is contained in:
Admin 2022-01-17 03:05:03 +00:00 committed by Gitee
commit 8952050e8a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 315 additions and 435 deletions

View File

@ -282,11 +282,6 @@ img, picture {
.rc-top{ .rc-top{
margin-top: 74px; margin-top: 74px;
} }
.rc-list__header {
background: none;
padding: .5rem 0;
border-bottom: none;
}
.ts-right-arr { .ts-right-arr {
border-bottom:1px solid #E1001A; border-bottom:1px solid #E1001A;
padding-bottom:2px; padding-bottom:2px;

View File

@ -313,8 +313,6 @@ object-fit: cover;
color: #fff; color: #fff;
height: 100%; height: 100%;
width: 100%; width: 100%;
font-size: 1.25rem;
line-height: 9.375rem;
text-align: center; text-align: center;

View File

@ -39,56 +39,54 @@
</ul> </ul>
</div> </div>
</div> </div>
</div> <div class="online bold rc-md-up" v-show="catproduct"></div>
<div class="online bold rc-md-up" v-show="catproduct"></div>
<div class="rc-full-width"> <div class="rc-full-width">
<div class="rc-lunbo rc-full-width"> <div class="rc-lunbo rc-full-width">
<!-- <h2>明星猫粮</h2> --> <!-- <h2>明星猫粮</h2> -->
<div class="pageFullScreen" id="xxxFullScreen" v-show="catproduct" ref="mingxing"> <div class="pageFullScreen" id="xxxFullScreen" v-show="catproduct" ref="mingxing">
<!-- 内容 --> <!-- 内容 -->
<div class="swiper-container rc-full-width rc-padding-y--md" id="swiper1"> <div class="swiper-container rc-full-width rc-padding-y--md" id="swiper1">
<h2 class="rc-beta rc-text--center">{{usertitle}}</h2> <h2 class="rc-beta rc-text--center">{{usertitle}}</h2>
<!-- 轮播图 --> <!-- 轮播图 -->
<swiper :options="swiperOption"> <van-swipe class="rc-padding-bottom--md">
<swiper-slide class="swiper-slide" v-for="(item, key) in catlistvideo" :key="key" > <van-swipe-item v-for="(item, index) in catlistvideo" :key="index">
<div class="rc-video"> <div class="rc-video">
<div class="uservideo"> <div class="uservideo">
</div> </div>
<div class="rc-right"> <div class="rc-right">
<img :src=item.catimage alt=""> <img :src=item.catimage alt="">
<span>{{item.title}}</span> <span>{{item.title}}</span>
<p>{{item.detail}}</p> <p>{{item.detail}}</p>
<em>{{item.price}}</em> <em>{{item.price}}</em>
<strong class="ts-standard-btn ts-standard-btn--two center" @click="userbuy(item,index)">立即购买</strong> <strong class="ts-standard-btn ts-standard-btn--two center" @click="userbuy(item,index)">立即购买</strong>
</div> </div>
</div> </div>
<div class="sw-center" > <div class="sw-center" >
<div class="rc-click" @click="selectproduce(item,index)"> <div class="rc-click" @click="selectproduce(item,index)">
<div class="uservideo"> <div class="uservideo">
<video width="300px" height="251" controls="controls"> <video width="300px" height="251" controls="controls">
<source :src= item.video type="video/ogg" autoplay> <source :src= item.video type="video/ogg" autoplay>
</video> </video>
</div>
<img :src=item.catimage alt="">
<span>{{item.title}}</span>
<p>{{item.detail}}</p>
<em>{{item.price}}</em>
</div> </div>
<div class="rc-full-width rc-margin-y--md">
<i @click="userbuy(item,index)" class="ts-standard-btn ts-standard-btn--two center">立即购买</i>
</div>
</div>
</swiper-slide> <img :src=item.catimage alt="">
</swiper> <span>{{item.title}}</span>
</div> <p>{{item.detail}}</p>
<em>{{item.price}}</em>
</div>
<div class="rc-full-width rc-margin-y--md">
<i @click="userbuy(item,index)" class="ts-standard-btn ts-standard-btn--two center">立即购买</i>
</div>
</div>
</van-swipe-item>
</van-swipe>
</div>
</div> </div>
@ -96,102 +94,14 @@
<div class="online bold" v-show="onemao"></div> <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"> <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> <h2 class="rc-beta rc-text--center" >全价猫湿粮</h2>
<van-tabs @change='catclick' class="van-tabs"> <van-tabs @change='catclick' class="van-tabs">
<van-tab v-for="(item,index) in discoun" :key="index" :title="item.title"> <van-tab v-for="(item,index) in discoun" :key="index" :title="item.title">
<div class="rc-contair"> <div class="rc-contair">
<ul class="ts-product-list rc-margin-bottom--lg"> <ul class="ts-product-list rc-margin-bottom--lg">
<li v-for="(item,index) in catshi" :key="index" class="rc-margin-top--md"> <li v-for="(item,index) in catshi" :key="index" class="rc-margin-top--md">
<div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)">
<div class="rc-rccontair">
<img :src=item.picture alt="">
</div>
</div>
<div class="rc-column">
<div class="rc-click" @click="selectproduce(item,index)">
<span>{{item.name}}</span>
<i>0.001{{item.price}}</i>
</div>
<strong class="ts-standard-btn ts-standard-btn--two rc-margin-y--md center" @click="selectproduce(item,index)">立即购买</strong>
</div>
</li>
</ul>
<nuxt-link :to="`/productdetails/productlist/`">
<div class="userserlect">
<span class="ts-standard-btn center">查看更多</span>
</div>
</nuxt-link>
</div>
</van-tab>
</van-tabs>
<div class="rc-selection">
<ol>
<li
v-for="(item, index) in selection"
:key="index"
@click="selectGo(item, index)"
:class="activeInde2 == index ? 'userselection' : 'unselection'"
>
<span>{{ item.title }}</span>
</li>
</ol>
<div class="rc-maa">
<ul>
<li
v-for="(item, index) in doglist"
:key="index"
@click="selectGoo(item, index)"
:class="activeInde3 == index ? 'active' : 'unactive'"
>
<img :src="item.catimage" alt="">
<span>{{ item.title }}</span>
</li>
</ul>
</div>
<div class="">
<ul class="ts-product-list rc-margin-bottom--lg">
<li v-for="(item,index) in rccontair" :key="index" class="rc-margin-top--md">
<div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)">
<div class="rc-rccontair">
<img :src=item.catimage alt="">
</div>
</div>
<div class="rc-column">
<div class="rc-click" @click="selectproduce(item,index)">
<span>{{item.title}}</span>
<i>0.001{{item.price}}</i>
</div>
<strong class="ts-standard-btn ts-standard-btn--two rc-margin-y--md center" @click="selectproduce(item,index)">立即购买</strong>
</div>
</li>
</ul>
<nuxt-link :to="`/productdetails/productlist/`">
<div class="userserlect">
<span class="ts-standard-btn center">查看更多</span>
</div>
</nuxt-link>
</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">
<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">
<li v-for="(item,index) in catgan" :key="index" class="rc-margin-top--md">
<div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)"> <div class="rc-click rc-margin-bottom--md" @click="selectproduce(item,index)">
<div class="rc-rccontair"> <div class="rc-rccontair">
<img :src=item.picture alt=""> <img :src=item.picture alt="">
@ -715,11 +625,10 @@
import { userquery,postCourseId,biaomessage,userque,searchchanpin } 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',
// middleware: 'metaTitle', meta: {title: '首页'},
meta: {title: '首页'}, data(){
data(){ return{
return{
useraindex:0, useraindex:0,
usertitle:'明星猫粮', usertitle:'明星猫粮',
dogtitle:'明星狗粮', dogtitle:'明星狗粮',
@ -888,7 +797,7 @@ activeInde3:0,
}, },
], ],
discounchufang: [ discounchufang: [
{ {
title: "消化道", title: "消化道",
catimage: require("../assets/cat.png"), catimage: require("../assets/cat.png"),
@ -1081,228 +990,216 @@ activeInde3:0,
} }
}, },
} }
}, },
components:{ components:{
Myheader, Myheader,
Myfooter, Myfooter,
unlogin, unlogin,
// userswiper // userswiper
}, },
created(){ created(){
vm=this; vm=this;
}, },
watch:{ watch:{
},
mounted(){
const that = this
this.ifAdoid()
// window.onresize = () => {
// setTimeout(() => {
// this.ifAdoid()
// }, 500);
// } },
this.usermessage= JSON.parse(localStorage.getItem("userInfo")); mounted(){
const that = this
this.ifAdoid();
this.usermessage= JSON.parse(localStorage.getItem("userInfo"));
if(this.usermessage==null ||this.usermessage==undefined){
this.userunlogin=true
}
window.addEventListener("scroll", this.handleScroll, true);
this.userchufang();//
this.catmessage();//
this.dogmessage();//
},
destroyed () {
window.removeEventListener('scroll', this.scrollToTop);
},
methods:{
ifAdoid(item,index){
//console.log(index);
this.userindex=index;
var sUserAgent = navigator.userAgent.toLowerCase();
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
var bIsAndroid = sUserAgent.match(/android/i) == "android";
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("当前是电脑打开")
this.stypechange=false;
//console.log(this.usertitle)
if(this.usermessage==null ||this.usermessage==undefined){ this.catproduct=true;
this.userunlogin=true this.onemao=false;
} this.twomao=false;
window.addEventListener("scroll", this.handleScroll, true); this.threemao=false;
this.userchufang();// this.fourmao=false;
this.catmessage();// this.fivemao=false;
this.dogmessage();// this.sixmao=false;
// this.usershi();// this.dogshow=false
// this.userhot(); this.showingBanners=this.banners.pc;
}
else
{
console.log("当前是手机打开")
this.showingBanners=this.banners.mobile;
this.stypechange=true;
this.onemao=true;
this.twomao=true;
this.threemao=true;
this.fourmao=true;
this.fivemao=true;
this.dogshow=true;
this.catproduct=true
this.sixmao=true;
}, }
destroyed () { },
window.removeEventListener('scroll', this.scrollToTop);
}, ifadroind(item,index,order){
methods:{ //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";
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
var bIsAndroid = sUserAgent.match(/android/i) == "android";
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(item.title=='明星猫粮'){
this.catproduct=true;
this.twomao=false;
this.threemao=false;
this.fourmao=false;
this.fivemao=false;
this.dogshow=false;
this.sixmao=false;
this.onemao=false;
}
if(item.title=='猫湿粮'){
this.onemao=true;
this.dogshow=false;
//console.log(this.onemao);
this.twomao=false;
this.threemao=false;
this.fourmao=false;
this.fivemao=false;
this.catproduct=false;
ifAdoid(item,index){ }if(item.title=='猫干粮'){
console.log(index); this.onemao=false;
this.userindex=index; this.twomao=true;
var sUserAgent = navigator.userAgent.toLowerCase(); this.dogshow=false;
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad"; this.threemao=false;
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os"; this.fourmao=false;
var bIsMidp = sUserAgent.match(/midp/i) == "midp"; this.chufang=false;
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4"; this.catproduct=false;
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb"; }
var bIsAndroid = sUserAgent.match(/android/i) == "android";
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)) { if(item.title=='犬干粮'){
console.log("当前是电脑打开") this.onemao=false;
this.stypechange=false; this.twomao=false;
console.log(this.usertitle) this.threemao=false;
this.fourmao=true;
this.chufang=false;
this.dogshow=false;
this.catproduct=false;
}
// let catshiid=document.querySelectorAll('.selectionswitch'); if(item.title=='犬湿粮'){
// catshiid[this.userindex].style.display='none'; this.onemao=false;
// catshiid[this.userindex].style.display='none'; this.twomao=false;
this.catproduct=true; this.threemao=true;
this.onemao=false; this.fourmao=false;
this.twomao=false; this.chufang=false;
this.threemao=false; this.catproduct=false;
this.fourmao=false; this.dogshow=false;
this.fivemao=false; }
this.sixmao=false; if(item.title=='处方用粮'){
this.dogshow=false this.onemao=false;
// console.log(catshiid); this.twomao=false;
}else{ this.threemao=false;
console.log("当前是手机打开") this.fourmao=false;
this.stypechange=true; this.fivemao=true;
this.onemao=true; this.dogshow=false;
this.twomao=true; this.catproduct=false;
this.threemao=true; }
this.fourmao=true; if(item.title=='明星狗粮'){
this.fivemao=true; this.onemao=false;
this.dogshow=true; this.twomao=false;
this.catproduct=true this.threemao=false;
this.sixmao=true; this.fourmao=false;
this.fivemao=false;
this.dogshow=true;
this.catproduct=false;
}
// this.usertitle=item.title
// this.catlistvideo[order]=item;
// this.catproduct=true;
} }else{
}, this.catfood=true;
// this.catproduct=false;
let userindex=index
//console.log(item,index);
let mingxin=document.querySelector('.pageFullScreen');
let dogtop=document.querySelector('.oc-top');
//console.log(dogtop);
//console.log(mingxin.offsetTop);
if(item.title=='犬湿粮'||item.title=='犬干粮'||item.title=='处方用粮'){
userindex=userindex-2
}else{
userindex=userindex-1
}
if(item.title=='明星猫粮'){
mingxin.scrollIntoView(true);
}else{
let catshiid=document.querySelectorAll('.selectionswitch');
catshiid[userindex].scrollIntoView(true);
}
if(item.title=='明星狗粮')
dogtop.scrollIntoView(true);
// if(item.title=="湿"){
// this.catproduct=false;
// this.catfood=true;
// }else if(item.title==""){
// this.catproduct=true;
// this.catfood=false;
ifadroind(item,index,order){ // }
console.log(item,index,order); //console.log("")
}
},
var sUserAgent = navigator.userAgent.toLowerCase(); userdog(item,index){
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad"; this.userstype=1;
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os"; let petType={
var bIsMidp = sUserAgent.match(/midp/i) == "midp"; petType:1,
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4"; name:index,
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb"; }
var bIsAndroid = sUserAgent.match(/android/i) == "android"; for(let i =0;i<this.userserachlist.length;i++){
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce"; if(!this.userserachlist.includes(petType)){
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile"; this.userserachlist.push(petType)
}W
if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) { }
console.log("当前是电脑打开啊啊啊") this.dogmessage(this.userserachlist)
if(item.title=='明星猫粮'){ },
this.catproduct=true;
this.twomao=false;
this.threemao=false;
this.fourmao=false;
this.fivemao=false;
this.dogshow=false;
this.sixmao=false;
this.onemao=false;
}
if(item.title=='猫湿粮'){
this.onemao=true;
this.dogshow=false;
console.log(this.onemao);
this.twomao=false;
this.threemao=false;
this.fourmao=false;
this.fivemao=false;
this.catproduct=false;
}if(item.title=='猫干粮'){
this.onemao=false;
this.twomao=true;
this.dogshow=false;
this.threemao=false;
this.fourmao=false;
this.chufang=false;
this.catproduct=false;
}
if(item.title=='犬干粮'){
this.onemao=false;
this.twomao=false;
this.threemao=false;
this.fourmao=true;
this.chufang=false;
this.dogshow=false;
this.catproduct=false;
}
if(item.title=='犬湿粮'){
this.onemao=false;
this.twomao=false;
this.threemao=true;
this.fourmao=false;
this.chufang=false;
this.catproduct=false;
this.dogshow=false;
}
if(item.title=='处方用粮'){
this.onemao=false;
this.twomao=false;
this.threemao=false;
this.fourmao=false;
this.fivemao=true;
this.dogshow=false;
this.catproduct=false;
}
if(item.title=='明星狗粮'){
this.onemao=false;
this.twomao=false;
this.threemao=false;
this.fourmao=false;
this.fivemao=false;
this.dogshow=true;
this.catproduct=false;
}
// this.usertitle=item.title
// this.catlistvideo[order]=item;
// this.catproduct=true;
}else{
this.catfood=true;
// this.catproduct=false;
let userindex=index
console.log(item,index);
let mingxin=document.querySelector('.pageFullScreen');
let dogtop=document.querySelector('.oc-top');
console.log(dogtop);
console.log(mingxin.offsetTop);
if(item.title=='犬湿粮'||item.title=='犬干粮'||item.title=='处方用粮'){
userindex=userindex-2
}else{
userindex=userindex-1
}
if(item.title=='明星猫粮'){
mingxin.scrollIntoView(true);
}else{
let catshiid=document.querySelectorAll('.selectionswitch');
catshiid[userindex].scrollIntoView(true);
}
if(item.title=='明星狗粮')
dogtop.scrollIntoView(true);
// if(item.title=="湿"){
// this.catproduct=false;
// this.catfood=true;
// }else if(item.title==""){
// this.catproduct=true;
// this.catfood=false;
// }
console.log("当前是手机打开")
}
},
userdog(item,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){
@ -1345,10 +1242,6 @@ dogtop.scrollIntoView(true);
this.gotop = false; this.gotop = false;
this.searchBar=true this.searchBar=true
} }
}
}, },
toTop() { toTop() {
let top = document.documentElement.scrollTop || document.body.scrollTop; let top = document.documentElement.scrollTop || document.body.scrollTop;
@ -1462,65 +1355,59 @@ dogtop.scrollIntoView(true);
lianxi(item,index){ lianxi(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'}
} }
dis_livchat(option); dis_livchat(option);
} }
if(item.title=='购物车'){ if(item.title=='购物车'){
this.$router.push({ this.$router.push({
path: "/myorder/userrecord", path: "/myorder/userrecord",
});
}
if(item.title=='营养专家'){
var option = {
customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'}
}
dis_livchat(option);
}
}); },
} userbuy(item){
if(item.title=='营养专家'){ let user= localStorage.getItem("userInfo");
var option = { this.courseId(item)
customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'} this.$router.push({
} path: "/myorder/userrecord",
dis_livchat(option); });
} },
}, selectGoods(item,index){
userbuy(item){ //console.log(item,index);
let user= localStorage.getItem("userInfo"); this.activeIndex=index;
this.courseId(item) //console.log(item.title);
this.$router.push({ this.ifadroind(item,index,this.useraindex)
path: "/myorder/userrecord", // this.ifAdoid(item,index);
}); },
}, quanshi(item,index){
//console.log(item,index);
this.activeIndex5=index
//console.log(this.activeIndex5);
},
userdoghot(item,index){
this.activeIndex6=index
selectGoods(item,index){ },
console.log(item,index); selectGo(item,index){
this.activeIndex=index; this.activeInde2=index;
console.log(item.title); },
this.ifadroind(item,index,this.useraindex) selectGoo(item,index){
// this.ifAdoid(item,index); this.activeInde3=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;
} }
},
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@media screen and(min-width: 320px) and(max-width:768px){ @media screen and(min-width: 320px) and(max-width:768px){