修复编辑商品详情的bug

This commit is contained in:
weipengfei 2023-10-14 10:51:13 +08:00
parent 48f7c566b7
commit f1139b29b5

View File

@ -127,7 +127,7 @@
@click="modalPicTap('1')"
>
<div v-if="formValidate.image" class="pictrue">
<img :src="formValidate.image">
<img :src="formValidate.image" />
</div>
<div v-else class="upLoad">
<i class="el-icon-camera cameraIconfont" />
@ -148,7 +148,7 @@
@dragenter="handleDragEnter($event, item)"
@dragend="handleDragEnd($event, item)"
>
<img :src="item">
<img :src="item" />
<i
class="el-icon-error btndel"
@click="handleRemove(index)"
@ -180,7 +180,7 @@
type="file"
style="display: none"
@change="zh_uploadFile_change"
>
/>
<el-button
type="primary"
icon="ios-cloud-upload-outline"
@ -195,13 +195,17 @@
:percentage="progress"
:text-inside="true"
:stroke-width="20"
style="margin-top: 10px;"
style="margin-top: 10px"
/>
</el-col>
<el-col :span="24">
<div v-if="formValidate.video_link" class="iview-video-style">
<video
style="width:100%;height: 100%!important;border-radius: 10px;"
style="
width: 100%;
height: 100% !important;
border-radius: 10px;
"
:src="formValidate.video_link"
controls="controls"
>
@ -255,11 +259,9 @@
@close="handleCloseCoupon(tag)"
>{{ tag.title }}
</el-tag>
<el-button
class="mr15"
size="mini"
@click="addCoupon"
>选择优惠券</el-button>
<el-button class="mr15" size="mini" @click="addCoupon"
>选择优惠券</el-button
>
</div>
</el-form-item>
</el-col>
@ -325,12 +327,11 @@
class="ml15"
size="small"
@click="confirm"
>确认</el-button>
<el-button
class="ml15"
size="small"
@click="addRule"
>添加规格模板</el-button>
>确认</el-button
>
<el-button class="ml15" size="small" @click="addRule"
>添加规格模板</el-button
>
</div>
</el-form-item>
<el-form-item v-if="formValidate.attr.length > 0">
@ -369,7 +370,8 @@
class="button-new-tag"
size="small"
@click="showInput(item)"
>+ 添加</el-button>
>+ 添加</el-button
>
</div>
</div>
</el-form-item>
@ -392,11 +394,9 @@
</el-col>
<el-col :xl="12" :lg="6" :md="6" :sm="24" :xs="24">
<el-form-item class="noLeft">
<el-button
type="primary"
class="mr15"
@click="createAttrName"
>确定</el-button>
<el-button type="primary" class="mr15" @click="createAttrName"
>确定</el-button
>
<el-button @click="offAttrName">取消</el-button>
</el-form-item>
</el-col>
@ -407,7 +407,8 @@
icon="md-add"
class="mr15"
@click="addBtn"
>添加新规格</el-button>
>添加新规格</el-button
>
</el-form-item>
</el-col>
<!-- 批量设置-->
@ -431,7 +432,7 @@
@click="modalPicTap('1', 'pi')"
>
<div v-if="scope.row.image" class="pictrue tabPic">
<img :src="scope.row.image">
<img :src="scope.row.image" />
</div>
<div v-else class="upLoad tabPic">
<i class="el-icon-camera cameraIconfont" />
@ -451,7 +452,6 @@
<el-input
v-if="formThead[iii].title === '付费会员价'"
v-model="scope.row[iii]"
:disabled="formValidate.svip_price_type == 1"
class="priceBox"
controls-position="right"
@ -525,11 +525,9 @@
</template>
<el-table-column align="center" label="操作" min-width="80">
<template>
<el-button
type="text"
class="submission"
@click="batchAdd"
>批量添加</el-button>
<el-button type="text" class="submission" @click="batchAdd"
>批量添加</el-button
>
</template>
</el-table-column>
</el-table>
@ -551,7 +549,7 @@
@click="modalPicTap('1', 'dan', 'pi')"
>
<div v-if="formValidate.image" class="pictrue tabPic">
<img :src="scope.row.image">
<img :src="scope.row.image" />
</div>
<div v-else class="upLoad tabPic">
<i class="el-icon-camera cameraIconfont" />
@ -677,7 +675,7 @@
@click="modalPicTap('1', 'duo', scope.$index)"
>
<div v-if="scope.row.image" class="pictrue tabPic">
<img :src="scope.row.image">
<img :src="scope.row.image" />
</div>
<div v-else class="upLoad tabPic">
<i class="el-icon-camera cameraIconfont" />
@ -779,7 +777,8 @@
type="text"
class="submission"
@click="delAttrTable(scope.$index)"
>删除</el-button>
>删除</el-button
>
</template>
</el-table-column>
</el-table>
@ -808,8 +807,13 @@
title="750*750px"
@click="modalPicTap('3')"
>
<div v-for="(item, index) in formValidate.content.image" class="pictrue details_pictrue">
<img :src="item" :key="index">
<div
v-for="(item, index) in formValidate.content.image"
class="pictrue details_pictrue"
@click.stop="deleteContentImg(index)"
:key="index + item"
>
<img :src="item" :key="index" />
</div>
<div class="upLoad details_pictrue">
<i class="el-icon-camera cameraIconfont" />
@ -939,11 +943,9 @@
:value="item.shipping_template_id"
/>
</el-select>
<el-button
class="ml15"
size="small"
@click="addTem"
>添加运费模板</el-button>
<el-button class="ml15" size="small" @click="addTem"
>添加运费模板</el-button
>
</div>
</el-form-item>
</el-col>
@ -1009,11 +1011,9 @@
:value="item.guarantee_template_id"
/>
</el-select>
<el-button
class="ml15"
size="small"
@click="addServiceTem"
>添加服务说明模板</el-button>
<el-button class="ml15" size="small" @click="addServiceTem"
>添加服务说明模板</el-button
>
</div>
</el-form-item>
</el-col>
@ -1080,7 +1080,8 @@
type="text"
class="submission"
@click.native.prevent="delSpecs(scope.$index)"
>删除</el-button>
>删除</el-button
>
</template>
</el-table-column>
</el-table>
@ -1090,7 +1091,8 @@
size="small"
class="mt20"
@click="addSpecs"
>添加参数</el-button>
>添加参数</el-button
>
<el-select
v-model="customSpecs"
multiple
@ -1103,7 +1105,6 @@
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
@ -1166,7 +1167,7 @@
</el-col>
</el-row>
<el-form-item style="margin-top:30px;">
<el-form-item style="margin-top: 30px">
<el-button
v-show="currentTab > 1"
type="primary"
@ -2197,7 +2198,7 @@ export default {
this.fullscreenLoading = true;
productDetailApi(this.$route.params.id)
.then(async res => {
if(res.data.content_arr)res.data.content = res.data.content_arr;
if (res.data.content_arr && res.data.content_arr.length > 0) res.data.content = res.data.content_arr;
let info = res.data;
this.infoData(info);
this.getSpecsLst(info.cate_id);
@ -2322,10 +2323,20 @@ export default {
_this.oneFormBatch[0].image = img[0];
}
if (tit === "3") {
_this.formValidate.content.image = img;
// console.log('', _this.formValidate?.content, img)
let image = _this.formValidate.content.image ? _this.formValidate.content.image : [];
_this.formValidate.content = {
image: [...image, ...img],
title: _this.formValidate.content.title
}
console.log('选择好的', _this.formValidate.content)
}
}, tit);
},
//
deleteContentImg (index) {
this.formValidate.content.image.splice(index, 1)
},
handleSubmitUp () {
this.currentTab = (Number(this.currentTab) - 1).toString();
},