细节修改

main
fanfan 8 months ago
parent 81215ff0a7
commit 6837567d7a
  1. 50
      src/components/Table/GoodsItem/GoodsItem.vue
  2. 13
      src/views/dataCenter/goods/Update.vue

@ -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>

@ -176,6 +176,19 @@
</div>
<!-- 单规格的表单内容 -->
<div v-if="form.getFieldValue('spec_type') == 10">
<a-form-item
label="规格值"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
extra="规格值仅用于商品页展示"
>
<a-input-number
:min="0"
:precision="2"
v-decorator="['specific_value', { rules: [{ required: true, message: '请输入规格值' }] }]"
/>
<span class="ml-10"></span>
</a-form-item>
<a-form-item
label="商品价格"
:labelCol="labelCol"

Loading…
Cancel
Save