|
|
@ -4,19 +4,22 @@ |
|
|
|
<div class="in-left"> |
|
|
|
<div class="in-left"> |
|
|
|
<img :src="dataObj.image" :alt="dataObj.imageAlt" /> |
|
|
|
<img :src="dataObj.image" :alt="dataObj.imageAlt" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="in-right"> |
|
|
|
<div class="in-right"> |
|
|
|
<!-- 商品名称 --> |
|
|
|
<!-- 商品名称 --> |
|
|
|
<p class="title twoline-hide" :style="{ width: `${dataObj.titleWidth}px` }">{{ dataObj.title }}</p> |
|
|
|
<a-tooltip placement="topLeft" :title="dataObj.title"> |
|
|
|
|
|
|
|
<p class="title twoline-hide" :style="{ width: `${dataObj.titleWidth}px` }">{{ dataObj.title }}</p></a-tooltip |
|
|
|
|
|
|
|
> |
|
|
|
<!-- 副标题 --> |
|
|
|
<!-- 副标题 --> |
|
|
|
<p |
|
|
|
<p v-if="isEmpty(dataObj.goodsProps)" class="subtitle" :class="{ 'c-p': subTitleColor }"> |
|
|
|
v-if="isEmpty(dataObj.goodsProps)" |
|
|
|
<a-tooltip placement="topLeft" :title="dataObj.subtitle"> {{ dataObj.subtitle }}</a-tooltip> |
|
|
|
class="subtitle" |
|
|
|
</p> |
|
|
|
:class="{ 'c-p': subTitleColor }" |
|
|
|
|
|
|
|
>{{ dataObj.subtitle }}</p> |
|
|
|
|
|
|
|
<!-- 商品规格 --> |
|
|
|
<!-- 商品规格 --> |
|
|
|
<div v-else class="goods-props clearfix"> |
|
|
|
<div v-else class="goods-props clearfix"> |
|
|
|
<div class="goods-props-item" v-for="(props, idx) in dataObj.goodsProps" :key="idx"> |
|
|
|
<div class="goods-props-item" v-for="(props, idx) in dataObj.goodsProps" :key="idx"> |
|
|
|
<span>{{ props.value.name }}</span> |
|
|
|
<a-tooltip placement="topLeft" :title="props.value.name"> |
|
|
|
|
|
|
|
<span>{{ props.value.name }}</span></a-tooltip |
|
|
|
|
|
|
|
> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -34,28 +37,29 @@ export default { |
|
|
|
// 商品信息 |
|
|
|
// 商品信息 |
|
|
|
data: PropTypes.object.def({}), |
|
|
|
data: PropTypes.object.def({}), |
|
|
|
// 副标题颜色 |
|
|
|
// 副标题颜色 |
|
|
|
subTitleColor: PropTypes.bool.def(false) |
|
|
|
subTitleColor: PropTypes.bool.def(false), |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
dataObj () { |
|
|
|
dataObj() { |
|
|
|
return Object.assign({ |
|
|
|
return Object.assign( |
|
|
|
image: '', |
|
|
|
{ |
|
|
|
imageAlt: '', |
|
|
|
image: '', |
|
|
|
title: '', |
|
|
|
imageAlt: '', |
|
|
|
subtitle: '', |
|
|
|
title: '', |
|
|
|
goodsProps: [], |
|
|
|
subtitle: '', |
|
|
|
titleWidth: 200 |
|
|
|
goodsProps: [], |
|
|
|
}, this.$props.data) |
|
|
|
titleWidth: 200, |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
this.$props.data |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
data () { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
isEmpty |
|
|
|
isEmpty, |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: {}, |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|