Authored by Aiden Xu

商品详情

... ... @@ -2,7 +2,7 @@
<div class="image-carousel">
<swipe :continuous="false" :auto="0" :show-indicators="goods && goods.length > 1">
<swipe-item v-for="item in goods">
<a href="#" title="{{item.title}}">
<a href="javascript:void(0);" title="{{item.title}}" @click.prevent="showcase()">
<img :src="item.colorImage | resize 750 1000" width="100%" alt="">
</a>
</swipe-item>
... ... @@ -41,6 +41,7 @@
</style>
<script>
const swipe = require('yoho-vue-swipe');
const yoho = require('yoho');
require('common/vue-filter');
... ... @@ -49,11 +50,24 @@
goods: [Object]
},
data() {
return {};
return {
};
},
components: {
swipe: swipe.Swipe,
swipeItem: swipe.SwipeItem,
},
methods: {
showcase: function() {
const opts = {
images: this.goods.map((item)=> {
return item.colorImage;
}),
index: 0 // TODO: 活动下标无法获取
};
yoho.goImageBrowser(opts);
}
}
};
</script>
... ...