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