let hotProducts={
template:`
`,
props:{
title:{
type: [String],
default:'',
},
name:{
type: [String],
default:'',
},
value:{
type: [String],
default:'',
},
num:Number,
},
data() {
return {
swiper:null,
url:"https://bestpeatsk.click/product_details/",
urlNav:"https://bestpeatsk.click/category",
data:[],
listShow:true,
productListAShow:true,
}
},
created() {
this.productNew();
},
filters: {
nameSud(value){
if(value.length > 20){
value = value.substring(0,20);
value = value+'...'
return value
}else{
return value
}
}
},
mounted() {
},
methods: {
productNew(){
let that=this;
this.productListAShow = true;
this.$http.get('/api/item/random',{params:{num:7,name:this.name}}).then(async function(response){
if(response.data.code == 200){
this.listShow = false;
this.data = response.data.data;
this.productListAShow = false;
for(var i=0;i=30){
this.data[z].nameS = this.data[z].name.slice(0,30) + "...";
}else{
this.data[z].nameS = this.data[z].name;
}
}
$(document).ready(function () {
$('.layout-grid #Slider-template--18088238481455__featured_collection_WLdhnf.product-grid.owl-carousel').owlCarousel({
loop: !0,
nav: !0,
dots: !1,
autoplay: !1,
responsive: {
0: {
items: 1
},
320: {
items: 2
},
480: {
items: 2
},
600: {
items: 3
},
768: {
items: 4
},
850: {
items: 3
},
990: {
items: 3
},
1025: {
items: 4
}
}
})
});
// let next = '.button-next'+this.value;
// let prev = '.button-prev'+this.value;
// setTimeout(() => {
// this.swiper = new Swiper('#'+this.value, {
// // pagination: '.swiper-pagination',
// // paginationClickable: true,
// observer: true,//修改swiper自己或子元素时,自动初始化swiper
// observeParents: true,//修改swiper的父元素时,自动初始化swiper
// navigation: {
// nextEl: next,
// prevEl: prev,
// },
// spaceBetween: 30,
// pagination: {
// el: ".swiper-pagination",
// clickable: true,
// },
// loop: true,
// loopAdditionalSlides: 1,
// slidesPerView:5,
// // autoplay: {
// // delay: 2000,//1秒切换一次
// // disableOnInteraction: false,
// // },
// breakpoints: {
// 200: { //clientWidth > 320
// slidesPerView: 1,
// },
// 320: { //clientWidth > 320
// slidesPerView: 1,
// // spaceBetween: 10
// },
//
// 768: { //clientWidth > 768
// slidesPerView: 4,
// },
// 1000: { //clientWidth > 768
// slidesPerView: 4,
// },
// }
// });
// }, 0);
}else{
this.$toast({message: response.data.message,icon: 'warning-o',});
this.listShow = false;
}
},function(res){
this.$toast({message: res.data.message,icon: 'warning-o',});
this.listShow = false;
});
}
},
watch: {
},
}