细节修改

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

@ -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: '', image: '',
imageAlt: '', imageAlt: '',
title: '', title: '',
subtitle: '', subtitle: '',
goodsProps: [], goodsProps: [],
titleWidth: 200 titleWidth: 200,
}, this.$props.data) },
} this.$props.data
)
}, },
data () { },
data() {
return { return {
isEmpty isEmpty,
} }
}, },
methods: { methods: {},
}
} }
</script> </script>

@ -176,6 +176,19 @@
</div> </div>
<!-- 单规格的表单内容 --> <!-- 单规格的表单内容 -->
<div v-if="form.getFieldValue('spec_type') == 10"> <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 <a-form-item
label="商品价格" label="商品价格"
:labelCol="labelCol" :labelCol="labelCol"

Loading…
Cancel
Save