|
@ -2,6 +2,19 @@ |
|
|
<view class="bg" id="bg" v-if="info"> |
|
|
<view class="bg" id="bg" v-if="info"> |
|
|
<view class="swipe-box"> |
|
|
<view class="swipe-box"> |
|
|
<swiper class="swiper" :autoplay="true" :interval="3000" :duration="1000" circular indicator-dots indicator-color="rgba(255,255,255,.5)" indicator-active-color="#fff"> |
|
|
<swiper class="swiper" :autoplay="true" :interval="3000" :duration="1000" circular indicator-dots indicator-color="rgba(255,255,255,.5)" indicator-active-color="#fff"> |
|
|
|
|
|
<swiper-item v-if="info && info.videourl"> |
|
|
|
|
|
<video |
|
|
|
|
|
:src="info.videourl" |
|
|
|
|
|
id="detailVideo" |
|
|
|
|
|
:poster=" |
|
|
|
|
|
smallSwipeList.length > 0 ? smallSwipeList[0] : '' |
|
|
|
|
|
" |
|
|
|
|
|
controls |
|
|
|
|
|
playsinline="" |
|
|
|
|
|
webkit-playsinline="" |
|
|
|
|
|
x5-video-player-type="h5-page" |
|
|
|
|
|
></video> |
|
|
|
|
|
</swiper-item> |
|
|
<swiper-item v-for="(item, index) in info.list_images.split(',')" :key="item.id"> |
|
|
<swiper-item v-for="(item, index) in info.list_images.split(',')" :key="item.id"> |
|
|
<view class="swiper-item"> |
|
|
<view class="swiper-item"> |
|
|
<image class="item-img" :src="showImg(item)" mode="aspectFill"></image> |
|
|
<image class="item-img" :src="showImg(item)" mode="aspectFill"></image> |
|
@ -161,9 +174,7 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
// import Base from '@/components/Base'; |
|
|
|
|
|
export default { |
|
|
export default { |
|
|
extends: Base, |
|
|
|
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
id: null, |
|
|
id: null, |
|
@ -187,62 +198,19 @@ |
|
|
commentNum: '' |
|
|
commentNum: '' |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
// onLoad(option) { |
|
|
onLoad(option) { |
|
|
// this.id = option.id; |
|
|
this.id = option.id; |
|
|
// this.getInfo(); |
|
|
this.getDetail(); |
|
|
// this.getSpecificationsByGoodsId(); |
|
|
}, |
|
|
// this.getBusinessInfo(); |
|
|
|
|
|
// }, |
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
// getComment() { |
|
|
getDetail() { |
|
|
// this.Post({ |
|
|
|
|
|
// goods_id: this.info.id, |
|
|
|
|
|
// offset: 0, |
|
|
|
|
|
// limit: 2 |
|
|
|
|
|
// }, '/api/scenic/getGoodsCommentByScenicId').then(res => { |
|
|
|
|
|
// this.commentList = res.data |
|
|
|
|
|
// this.commentNum = res.msg |
|
|
|
|
|
// }) |
|
|
|
|
|
// }, |
|
|
|
|
|
// changeNav(item,index) { |
|
|
|
|
|
// this.navIndex = index |
|
|
|
|
|
// console.log(item.name); |
|
|
|
|
|
// // 获取要滚动到的元素id |
|
|
|
|
|
// let to = item.id |
|
|
|
|
|
// // 获取目标元素 |
|
|
|
|
|
// uni.createSelectorQuery().select('#' + to).boundingClientRect(function(rect){ |
|
|
|
|
|
// // 使用scrollIntoView方法滚动到目标元素 |
|
|
|
|
|
// console.log(rect); |
|
|
|
|
|
// uni.pageScrollTo({ |
|
|
|
|
|
// scrollTop: rect.top, |
|
|
|
|
|
// duration: 200 |
|
|
|
|
|
// }) |
|
|
|
|
|
// }).exec(); |
|
|
|
|
|
// }, |
|
|
|
|
|
// changeProduct(index) { |
|
|
|
|
|
// this.productIndex = index |
|
|
|
|
|
// }, |
|
|
|
|
|
getInfo() { |
|
|
|
|
|
this.Post({ |
|
|
this.Post({ |
|
|
goods_id: this.id |
|
|
goods_id: this.id |
|
|
}, |
|
|
},'/api/goods/getGoodDetail').then(res => { |
|
|
'/api/goods/getGoodDetail' |
|
|
res.data.goods_new_tag = (res.data.goods_new_tag ? res.data.goods_new_tag.split(',') : []).splice(0, 2); |
|
|
).then(res => { |
|
|
this.info = res.data |
|
|
if (res.data.flag == 0) { |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '商品不存在或已下架', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
}, 0) |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.goBack() |
|
|
|
|
|
}, 2000) |
|
|
|
|
|
} |
|
|
|
|
|
this.info = res.data; |
|
|
|
|
|
this.isCollect = res.data.is_collect; |
|
|
|
|
|
this.getComment() |
|
|
this.getComment() |
|
|
}); |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
getSpecificationsByGoodsId() { |
|
|
getSpecificationsByGoodsId() { |
|
|
this.Post({ |
|
|
this.Post({ |
|
|