').replace(/\n/g, '
').replace(/\s/g, ' ')
},
initProductSwiper() {
var swiper1 = new Swiper('#categoryProductList', {
pagination: {
el: '.product-swiper-pagination',
clickable: true
},
autoplay: {
delay: 3000,
stopOnLastSlide: false,
disableOnInteraction: true,
},
loop: true,
spaceBetween: 0
});
},
productListData() {
var that = this
// 获取二级类目
axios.post(requestApi + '/net/type/childrenList/' + getUrlCode().type, Qs.stringify())
.then(res => {
that.productList = res.data.data
that.showCategory = that.productList[0].name
// 获取对应产品详情
axios.get(requestApi + '/net/product/detail/' + that.productList[0].id, Qs.stringify()).then(resdetail => {
// resdetail.data.data = resdetail.data.data.map((item,index) => {
// item.picUrl = requestApi + item.picUrl
// return item
// })
// that.rightSwiperList = resdetail.data.data
// setTimeout(() =>{
// that.initProductSwiper()
// },0)
if(resdetail.data.data.length > 0) {
if(resdetail.data.data[0].collection !== null) {
this.showCollection = resdetail.data.data[0].collection
}
if(resdetail.data.data[0].description !== null) {
this.showDesc = resdetail.data.data[0].description
}
if(resdetail.data.data[0].picUrl !== null) {
this.showPic = requestApi + resdetail.data.data[0].picUrl
}
}else{
this.showCollection = ''
this.showDesc = ''
this.showPic = ''
}
})
})
},
categoryClick(index) {
var that = this
that.activeProduct = index
that.showCategory = that.productList[index].name
// 获取对应产品详情
axios.get(requestApi + '/net/product/detail/' + that.productList[index].id, Qs.stringify()).then(resdetail => {
// resdetail.data.data = resdetail.data.data.map((item,index) => {
// item.picUrl = requestApi + item.picUrl
// return item
// })
// that.rightSwiperList = resdetail.data.data
// setTimeout(() =>{
// that.initProductSwiper()
// },0)
if(resdetail.data.data.length > 0) {
if(resdetail.data.data[0].collection !== null) {
this.showCollection = resdetail.data.data[0].collection
}
if(resdetail.data.data[0].description !== null) {
this.showDesc = resdetail.data.data[0].description
}
if(resdetail.data.data[0].picUrl !== null) {
this.showPic = requestApi + resdetail.data.data[0].picUrl
}
}else{
this.showCollection = ''
this.showDesc = ''
this.showPic = ''
}
})
},
downloadData() {
axios.get(requestApi + '/net/album/list', Qs.stringify())
.then(res => {
res.data.rows = res.data.rows.filter((item,index) => {
item.url = requestApi + item.url
return item.type == getUrlCode().type
})
if(res.data.rows.length > 0) {
this.downloadUrl = res.data.rows[0].url
}
})
},
downloadTxt() {
var str = this.downloadUrl.split("/")
var targetStr = str[str.length-1]
getFileAndDownload(targetStr, this.downloadUrl)
}
}
})
var app = new Vue({
el: '#uniform',
data: {
uniformList: [],
},
created() {
var that = this
that.getUniformList()
},
methods: {
initUniformSwiper() {
var swiper = new Swiper('#uniform', {
pagination: {
el: '.uniform-swiper-pagination',
clickable: true,
},
direction: 'horizontal',
spaceBetween: 39,
autoplay: {
delay: 3000,
stopOnLastSlide: false,
disableOnInteraction: true,
},
loop: true,
slidesPerView : 3.7,
centeredSlides : true
});
},
getUniformList(){
var that = this
axios.get(requestApi + '/net/swiper/list', Qs.stringify())
.then(res => {
res.data.rows = res.data.rows.map((item,index)=>{
item.picUrl = requestApi + item.picUrl
return item
})
res.data.rows = res.data.rows.filter(item => {
return item.type == getUrlCode().type
})
that.uniformList = res.data.rows
setTimeout(() =>{
this.initUniformSwiper()
},0)
})
}
}
})