Index updated

This commit is contained in:
Vion 2022-01-17 16:14:32 +08:00
parent 5c5b50b7ea
commit 847e27bc4a
5 changed files with 252 additions and 177 deletions

View File

@ -200,32 +200,27 @@ export const userque = (stype) => {
//标品全部信息
export const biaomessage = (stype,name) => {
console.log(stype);
if(stype.length>1){
console.log("========");
let list={};
stype.map(item=>{
console.log(item);
list=item
})
var str = "?";
for(var key in list){
str = str + key + "=" + list[key] + "&";
}
stype = str.substr(0,str.length-1);
var data = {
page:1,
row:10
}
return fetch('product/query'+stype, data, 'POST' )
}else{
console.log('-==');
return fetch('product/query?petType='+stype,data, 'POST' )
}
export const biaomessage = (stype,name,curPage,curRow) => {
if(!curPage)
curPage=1;
if(!curRow)
curRow=10;
let queryTail='&page='+curPage+'&rows='+curRow;
if(stype.length>1){
let list={};
stype.map(item=>{
console.log(item);
list=item
})
var str = "?";
for(var key in list){
str = str + key + "=" + list[key] + "&";
}
stype = str.substr(0,str.length-1);
return fetch('product/query'+stype+queryTail, '', 'POST' )
}else{
return fetch('product/query?petType='+stype+queryTail, '', 'POST' )
}
}
export const searchchanpin = (stype) => {

View File

@ -39,8 +39,7 @@ img, picture {
flex-wrap: wrap;
justify-content: space-evenly;
&:after{
content:"";
width:154px;
}
li{
border: 1px solid #D7D7D7;
@ -366,17 +365,25 @@ img, picture {
display:block;
li{
max-width:20rem;
margin-right:.9rem;
margin-left:.9rem;
//margin-right:.875rem;
margin-left:2.2vw;
.rc-column{
span{
font-size:1.875rem;
height: 5.2rem;
}
}
&:nth-child(4n+1){
margin-left:0;
}
&:nth-child(4n){
//margin-right:0;
}
}
img{
width:20rem;
max-width:320px;
min-width:160px;
}
}
.ts-right-arr {
@ -509,3 +516,14 @@ img, picture {
display: none!important;
}
}
@media screen and (min-width: 769px) and (max-width: 1370px)
{
.ts-product-list {
display:flex;
justify-content: space-between;
li{
margin-left:0;
margin-right:0;
}
}
}

View File

@ -5,6 +5,36 @@
/deep/.van-swipe__indicator--active{
background-color: #E1001A;
}
.rc-ma{
.ul-zhuan{
li{
background: unset;;
img{
border-radius: 50%;
}
&.active {
img{
border: 3px solid #E2001A;
}
color: #E2001A;
}
&.unactive {
color: #444444;
img{
border: 3px solid #D7D7D7;
}
}
}
}
}
.uservideo{
overflow: hidden;
video{
height:100%;
width:auto;
}
}
@media screen and (max-width:768px){
.ul-dog{
display: none;
@ -24,16 +54,14 @@
display: block;
}
img{
width: 0.64rem;
height: 0.64rem;
width: 4rem;
height: 4rem;
display: block;
}
li{
display: inline-block;
margin-left: 0.20rem;
width: 0.64rem;
text-align: center;
height: 0.64rem;
background: #F6F6F6;
border-radius: 50%;
opacity: 1;
@ -261,12 +289,7 @@
li{
display: inline-block;
margin-left: 1.25rem;
width: 4rem;
text-align: center;
height: 4rem;
background: #F6F6F6;
border-radius: 50%;
opacity: 1;
}
}
@ -281,15 +304,16 @@
}
}
.active {
font-size: 0.14rem;
border: 1px solid red;
color: red;
font-size: 0.14rem;
img{
border-width: 1px;
}
}
.unactive {
font-size: 0.14rem;
color: #444444;
border: 1px solid #D7D7D7;
font-size: 0.14rem;
img{
border-width: 1px;
}
}
// .usermain{
@ -412,35 +436,33 @@ object-fit: cover;
margin-top: 1rem;
}
}
.uservideo{
width: 35rem;
height: 31.6rem;
display: block;
border: 1px solid red;
}
.userleft{
position: absolute;
top: 50%;
left:0;
margin-top: -.72rem;
img{
width: .69rem;
height: 1.38rem;
display: block;
}
}
.userright{
position: absolute;
top: 50%;
right:0;
margin-top: -.72rem;
img{
width: .69rem;
height: 1.375rem;
display: block;
}
}
.uservideo{
width: 35rem;
height: 31.6rem;
display: block;
}
.userleft{
position: absolute;
top: 50%;
left:0;
margin-top: -.72rem;
img{
width: .69rem;
height: 1.38rem;
display: block;
}
}
.userright{
position: absolute;
top: 50%;
right:0;
margin-top: -.72rem;
img{
width: .69rem;
height: 1.375rem;
display: block;
}
}
}
}
@ -495,23 +517,19 @@ img{
flex-wrap: wrap;
flex-direction: row;
span{
margin-top: 2.5rem;
margin-top: 1vw;
display: block;
}
img{
width: 9.5rem;
height: 9.5rem;
width: 10vw;
height: 10vw;
display: block;
}
li{
cursor: pointer;
font-size: 16px;
width: 9.875rem;
text-align: center;
height: 9.875rem;
background: #F6F6F6;
border-radius: 50%;
margin-left:1.25rem;
margin-left:1.3vw;
}
}
@ -526,8 +544,6 @@ img{
}
.usermain{
margin-top: 2.5rem;
padding-bottom: 2.82rem;
.ul-dog{
width: 100%;
display: flex;
@ -594,17 +610,18 @@ margin-left: 2.5rem;
}
}
}
.active {
font-size: 1rem;
border: 3px solid red;
color: red;
}
.unactive {
font-size: 1rem;
color: #444444;
border: 1px solid #D7D7D7;
}
.active {
font-size: 1rem;
img{
border-width: 3px;
}
}
.unactive {
font-size: 1rem;
img{
border-width: 1px;
}
}
.rc-maa{
ul{
width: 100%;
@ -636,15 +653,12 @@ border-radius: 50%;
}
.userselection {
font-size: 0.16rem;
color: #E2001A;
}
.userselection {
font-size: 0.16rem;
color: #E2001A;
}
.unselection {
font-size: 0.16rem;
}
.rc-usermessage{
span{
@ -654,3 +668,14 @@ color: #E2001A;
}
}
}
@media screen and (min-width:600px) and (max-width:768px)
{
.ul-zhuan{
display: flex;
justify-content: space-evenly;
li{
margin-left:0;
}
}
}

View File

@ -379,17 +379,19 @@
</div>
</template>
<script>
const isReload={
needload:false
};
export default {
data() {
return {
headerScroll:false,
loginornot:true,//
usermessage:null,//
headerScroll:false,
loginornot:true,//
usermessage:null,//
};
},
created(){
},
mounted() {
//
let usernot=JSON.parse(localStorage.getItem("userInfo"));
@ -401,11 +403,45 @@ export default {
this.loginornot=false
this.usermessage=usernot;
}
//debugger;
if(isReload.needload)
location.reload();
if(isReload.needload==false)
isReload.needload=true;
//console.log(this.loginornot);
/*
if(RCDL && RCDL.utilities && RCDL.navigation && RCDL.navigation.rebuild)
{
if (["sm", "xs", "md-1"].includes(RCDL.utilities.breakpoints.values.width.current)) {
this.refreshMobileNav();
}
else
{
this.refreshDesktopNav();
}
}
*/
},
methods: {
refreshDesktopNav:function(){
RCDL.navigation.currentState=null;
RCDL.navigation.rebuild();
},
refreshMobileNav:function(){
let itemGroupList=document.querySelectorAll("nav[data-toggle-group=mobile] .rc-list--align[role=menu]");
itemGroupList.forEach(function(ele,i){
if(ele.className.indexOf("rc-expand--horizontal")<0 && ele.className.indexOf("rc-btn-offset--top")<0)
{
if(ele.id.indexOf("nav-list")>=0)
ele.classList.add("rc-expand--horizontal");
else if(ele.id.indexOf("nav-footer")>=0)
ele.classList.add("rc-expand--vertical");
}
})
},
bindTracking: function(){
//console.log('bindTracking');
},

View File

@ -45,35 +45,37 @@
<van-swipe class="rc-padding-bottom--md">
<van-swipe-item v-for="(item, index) in catlistvideo" :key="index">
<div class="rc-video">
<div class="uservideo">
</div>
<div class="rc-right">
<img :src=item.catimage alt="">
<span>{{item.title}}</span>
<p>{{item.detail}}</p>
<em>{{item.price}}</em>
<strong class="ts-standard-btn ts-standard-btn--two center" @click="userbuy(item,index)">立即购买</strong>
</div>
</div>
<div class="sw-center" >
<div class="rc-click" @click="selectproduce(item,index)">
<div class="uservideo">
<video width="300px" height="251" controls="controls">
<source :src= item.video type="video/ogg" autoplay>
<video controls="" :poster=item.catimage>
<source :src=item.video type="video/mp4">
</video>
</div>
<img :src=item.catimage alt="">
<span>{{item.title}}</span>
<p>{{item.detail}}</p>
<em>{{item.price}}</em>
<div class="rc-right">
<img :src=item.catimage alt="">
<span>{{item.title}}</span>
<p>{{item.detail}}</p>
<em>{{item.price}}</em>
<strong class="ts-standard-btn ts-standard-btn--two center" @click="userbuy(item,index)">立即购买</strong>
</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 class="sw-center" >
<div class="rc-click" @click="selectproduce(item,index)">
<div class="uservideo">
<video controls="controls" :poster=item.catimage>
<source :src= item.video type="video/ogg">
</video>
</div>
<img :src=item.catimage alt="">
<span>{{item.title}}</span>
<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>
</div>
</van-swipe-item>
</van-swipe>
</div>
@ -271,16 +273,18 @@
<div class="online bold" v-show="dogshow"></div>
<div class="pageFullScreen" id="xxxFullScreen" v-show="dogshow" 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="swiper2">
<div class="oc-top">
<h2 class="rc-beta rc-text--center">{{dogtitle}}</h2>
</div>
<!-- 轮播图 -->
<swiper :options="swiperOption">
<swiper-slide class="swiper-slide" v-for="(item, key) in doglistvideo" :key="key" >
<van-swipe class="rc-padding-bottom--md">
<van-swipe-item v-for="(item, key) in doglistvideo" :key="key">
<div class="rc-video">
<div class="uservideo">
<video controls="" :poster=item.catimage>
<source :src=item.video type="video/mp4">
</video>
</div>
<div class="rc-right">
@ -294,7 +298,7 @@
<div class="sw-center" >
<div class="rc-click" @click="selectproduce(item,index)">
<div class="uservideo">
<video width="300px" height="251" controls="controls">
<video controls="controls">
<source :src= item.video type="video/ogg">
</video>
</div>
@ -309,8 +313,8 @@
</div>
</div>
</swiper-slide>
</swiper>
</van-swipe-item>
</van-swipe>
</div>
@ -1278,7 +1282,7 @@
for(let i =0;i<this.userserachlist.length;i++){
if(!this.userserachlist.includes(petType)){
this.userserachlist.push(petType)
}W
}
}
this.dogmessage(this.userserachlist)
},
@ -1343,24 +1347,21 @@
}
},
//
async catmessage(stype) {
let data=[];
if(stype==undefined||stype==null){
data = await biaomessage(0);
}else{
data = await biaomessage(this.userserachlist);
}
if(data){
this.catlist=data;
let userlist=[];
userlist=data.slice(0,6);
this.catshi=userlist;
this.catgan=userlist;
}
},
async catmessage(stype) {
let data=[];
if(stype==undefined||stype==null){
data = await biaomessage(0,'',1,6);
}else{
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;
}
},
//
async dogmessage(stype) {
@ -1417,24 +1418,24 @@
}
},
//
userclick(item,index){
this.userquery(index)
},
//
userclick(item,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)
},
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)
},