|
@@ -79,7 +79,7 @@
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
- label="商品封面"
|
|
|
|
|
|
|
+ :label="`商品封面${sizemap.fmsize || ''}`"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
v-loading="coverLoading"
|
|
v-loading="coverLoading"
|
|
|
>
|
|
>
|
|
@@ -106,7 +106,7 @@
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
- label="轮播图片"
|
|
|
|
|
|
|
+ :label="`轮播图片${sizemap.lbsize || ''}`"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
v-loading="sliderLoading"
|
|
v-loading="sliderLoading"
|
|
|
>
|
|
>
|
|
@@ -133,7 +133,7 @@
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
- label="广告图片"
|
|
|
|
|
|
|
+ :label="`广告图片${sizemap.ggsize || ''}`"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
v-loading="picsLoading"
|
|
v-loading="picsLoading"
|
|
|
>
|
|
>
|
|
@@ -343,6 +343,27 @@ import { v4 as uuidv4 } from "uuid";
|
|
|
import {watch} from "vue";
|
|
import {watch} from "vue";
|
|
|
// 获取字典项(商品类型)
|
|
// 获取字典项(商品类型)
|
|
|
let typeOptions = ref([]);
|
|
let typeOptions = ref([]);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+const sizeData = [
|
|
|
|
|
+ { fmsize: '(340*330)', lbsize: '(750*750)',ggsize: '', name: '线上商品' },
|
|
|
|
|
+ { fmsize: '', lbsize: '',ggsize: '', name: '店内商品' },
|
|
|
|
|
+ { fmsize: '(750*305)', lbsize: '(750*360)',ggsize: '', name: '店内服务' },
|
|
|
|
|
+ { fmsize: '(750*208)', lbsize: '(750*360',ggsize: '', name: '课程商品' },
|
|
|
|
|
+];
|
|
|
|
|
+// 构建 Map(一次性)
|
|
|
|
|
+let sizeMap = new Map(
|
|
|
|
|
+ sizeData.map(item => [item.name, item])
|
|
|
|
|
+)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// ✅ 直接定义 computed:自动响应 goods_kind 的变化
|
|
|
|
|
+const sizemap = computed(() => {
|
|
|
|
|
+ return sizeMap.get(goods_kind.value) || {}
|
|
|
|
|
+})
|
|
|
|
|
+let goods_kind = ref("");
|
|
|
|
|
+
|
|
|
function getDictionary(dict_id) {
|
|
function getDictionary(dict_id) {
|
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
|
dictApi({ dict_id: dict_id }).then((data) => {
|
|
dictApi({ dict_id: dict_id }).then((data) => {
|
|
@@ -373,6 +394,7 @@ function handleClose(done) {
|
|
|
// catch error
|
|
// catch error
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
let title = ref("");
|
|
let title = ref("");
|
|
|
let ruleFormRef = ref(null);
|
|
let ruleFormRef = ref(null);
|
|
|
function initFun(type, row) {
|
|
function initFun(type, row) {
|
|
@@ -389,7 +411,8 @@ function initFun(type, row) {
|
|
|
ruleForm.value.truck_type = 1;
|
|
ruleForm.value.truck_type = 1;
|
|
|
ruleForm.value.status = 1;
|
|
ruleForm.value.status = 1;
|
|
|
ruleForm.value.is_integral = 0;
|
|
ruleForm.value.is_integral = 0;
|
|
|
-
|
|
|
|
|
|
|
+ goods_kind.value=""
|
|
|
|
|
+ sizemap.value={}
|
|
|
specsValue.value = "";
|
|
specsValue.value = "";
|
|
|
skuTable.value = [];
|
|
skuTable.value = [];
|
|
|
|
|
|
|
@@ -522,7 +545,6 @@ function getLabel() {
|
|
|
// 分类编号
|
|
// 分类编号
|
|
|
let classOptions = ref([]);
|
|
let classOptions = ref([]);
|
|
|
|
|
|
|
|
-let goods_kind = ref("");
|
|
|
|
|
function getClass() {
|
|
function getClass() {
|
|
|
classApi({goods_kind:goods_kind.value}).then((data) => {
|
|
classApi({goods_kind:goods_kind.value}).then((data) => {
|
|
|
classOptions.value = data;
|
|
classOptions.value = data;
|