2024-08-07 10:31:42 +08:00
|
|
|
<template>
|
|
|
|
<!-- SKU 选择的提示框 -->
|
|
|
|
<detail-cell label="选择" :value="value" />
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { computed } from 'vue';
|
|
|
|
import detailCell from './detail-cell.vue';
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
modelValue: {
|
|
|
|
type: Array,
|
|
|
|
default() {
|
|
|
|
return [];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
sku: {
|
2024-08-07 21:40:27 +08:00
|
|
|
type: Object,
|
|
|
|
},
|
2024-08-07 10:31:42 +08:00
|
|
|
});
|
|
|
|
const value = computed(() => {
|
|
|
|
if (!props.sku?.id) {
|
|
|
|
return '请选择商品规格';
|
|
|
|
}
|
|
|
|
let str = '';
|
2024-08-07 21:40:27 +08:00
|
|
|
props.sku.properties.forEach((property) => {
|
2024-08-07 10:31:42 +08:00
|
|
|
str += property.propertyName + ':' + property.valueName + ' ';
|
|
|
|
});
|
|
|
|
return str;
|
|
|
|
});
|
|
|
|
</script>
|