detail删除所有衣服preview报错,进行design没有模特进行提示

This commit is contained in:
X1627315083
2025-09-26 17:13:29 +08:00
parent 5e51d8132b
commit aba2fd0363
7 changed files with 14 additions and 9 deletions

View File

@@ -308,7 +308,7 @@ export default defineComponent({
`${list[i].color.rgba.r} ${list[i].color.rgba.g} ${list[i].color.rgba.b}`:
'')
if(detailData.currentDetailType == 'sketch' && newData){
color = detailData.designDetail.clothes[0].color?.rgba?.r?`${detailData.designDetail.clothes[0].color.rgba.r} ${detailData.designDetail.clothes[0].color.rgba.g} ${detailData.designDetail.clothes[0].color.rgba.b}`:''
color = detailData.designDetail.clothes?.[0]?.color?.rgba?.r?`${detailData.designDetail.clothes?.[0].color.rgba.r} ${detailData.designDetail.clothes[0].color.rgba.g} ${detailData.designDetail.clothes[0].color.rgba.b}`:''
detailData.selectDetail.maskUrl = ''
detailData.selectDetail.maskMinioUrl = ''
}

View File

@@ -914,7 +914,7 @@ export default defineComponent({
> img{
width: 100%;
height: 100%;
object-fit: cover;
object-fit: contain;
}
> i{
position: absolute;

View File

@@ -23,7 +23,7 @@
<i class="fi fi-rr-copy" :title="$t('DesignDetail.compareTitle')" @mousedown="mousedownDesignImg" @mouseup="mousedownDesignImg" @touchstart="mousedownDesignImg" @touchend="mousedownDesignImg"></i>
</div>
<position ref="position" @canvasReload="()=>$emit('canvasReload')" :imgDesignImg=imgDesignImg></position>
<position ref="position" @canvasReload="()=>$emit('canvasReload')" @addSketch="()=>$emit('addSketch')" :imgDesignImg=imgDesignImg></position>
</div>
</div>

View File

@@ -49,7 +49,7 @@ export default defineComponent({
type:Boolean,
}
},
emits:['canvasReload'],
emits:['canvasReload','addSketch'],
setup(props,{emit}) {
const {t} = useI18n()
const store = useStore();
@@ -82,6 +82,11 @@ export default defineComponent({
let dom = document.querySelector('.molepositon .perview_img') as any
if(!detailData.frontBack?.body?.path || !dom)return
img.onload = () => {
if(detailData.designDetail.clothes.length == 0){
store.commit('DesignDetail/addDesignColthes')
emit('addSketch')
return
}
if(!detailData.selectDetail?.id){
store.commit('DesignDetail/setDesignColthes',detailData.designDetail.clothes[0].id)
}