... ... @@ -64,7 +64,7 @@ const component = {
product.formatPrice = product.format_sales_price !== '0' ? product.format_sales_price : product.format_market_price;//eslint-disable-line
product.isDiscount = product.market_price > product.sales_price;
product.coverImage = product.goods_list[0].color_image;
product.coverImage = product.goods_list[0].images_list[0].image_url;
res.render('pdetail', {
module: 'product',
... ...
... ... @@ -4,7 +4,7 @@
<swiper :options="swiperOption" ref="swiper">
<swiper-slide v-for="item in goodsList" :key="item.title">
<img :title="item.title"
v-img-src="{src: item.color_image, width: 580, height: 770}"
v-img-src="{src: item.image_url, width: 580, height: 770}"
width="100%">
</swiper-slide>
</swiper>
... ... @@ -19,6 +19,7 @@
</template>
<script>
require('swiper/dist/css/swiper.css');
import _ from 'lodash';
import yoho from 'yoho';
import util from 'common/util';
import vas from 'vue-awesome-swiper';
... ... @@ -31,6 +32,7 @@
let vm = this;
return {
imageList: [],
slideCount: 0,
activeIndex: 0,
goodsList: [],
... ... @@ -55,8 +57,16 @@
}
},
watch: {
goods(val) {
let temp = val.slice();
goods(list) {
let temp = [];
_.each(list, item => {
_.each(item.images_list, img => {
temp.push({
image_url: img.image_url
});
});
});
const len = temp.length;
if (len > 1) {
... ... @@ -64,7 +74,7 @@
}
this.goodsList = temp;
this.slideCount = this.goodsList.length;
this.slideCount = len;
}
},
methods: {
... ...