新增 删除 衣服
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
<img :src="item?.path" alt="">
|
||||
<i v-show="deleteShow" class="fi fi-br-cross" @click.stop="setDelete(index)"></i>
|
||||
</div>
|
||||
<div class="detail_modal_body_Set" @click="setClothesOpen()">
|
||||
<div v-show="designItemDetailNum < 5" class="detail_modal_body_Set" @click="setClothesOpen()">
|
||||
+
|
||||
</div>
|
||||
</div>
|
||||
@@ -172,7 +172,7 @@ export default defineComponent({
|
||||
// return store.state.DesignDetailModule.designItemDetail
|
||||
// })
|
||||
let designItemDetail :any = computed(()=>{
|
||||
console.log(123);
|
||||
console.log(store.state.DesignDetailModule.designItemDetail,'-=-=--==--==-');
|
||||
|
||||
return store.state.DesignDetailModule.designItemDetail
|
||||
})
|
||||
@@ -211,6 +211,8 @@ export default defineComponent({
|
||||
let setClothes:any = ref()
|
||||
//点击删除按钮
|
||||
let deleteShow:any = ref(false)
|
||||
let designItemDetailNum:any = ref(0)
|
||||
|
||||
return{
|
||||
designItemDetail,
|
||||
store,
|
||||
@@ -233,6 +235,7 @@ export default defineComponent({
|
||||
t,
|
||||
setClothes,
|
||||
deleteShow,
|
||||
designItemDetailNum,
|
||||
}
|
||||
},
|
||||
data(){
|
||||
@@ -248,7 +251,6 @@ export default defineComponent({
|
||||
watch:{
|
||||
designItemDetail:{
|
||||
handler: async function(newVal,oldVal) {
|
||||
console.log(1123);
|
||||
let designItemDetail = JSON.parse(JSON.stringify(this.store.state.DesignDetailModule.designItemDetail))
|
||||
this.ifSubmit = designItemDetail.ifSubmit?designItemDetail.ifSubmit:false
|
||||
this.current = JSON?.parse(JSON?.stringify(designItemDetail?.clothes?.[this?.currentIndex]))
|
||||
@@ -257,12 +259,23 @@ export default defineComponent({
|
||||
}else{
|
||||
this.body = true
|
||||
}
|
||||
let num = 0
|
||||
newVal.clothes.forEach((item:any) => {
|
||||
if(item.id){
|
||||
num++
|
||||
}
|
||||
});
|
||||
this.designItemDetailNum = num
|
||||
await this.setImgSize()
|
||||
this.designItemDetailUrl = designItemDetail.currentFullBodyView?designItemDetail.currentFullBodyView:designItemDetail.designItemUrl
|
||||
}
|
||||
},
|
||||
currentIndex:{
|
||||
handler: function(newval) {
|
||||
let url = ''
|
||||
if(designItemDetail.currentFullBodyView){
|
||||
url = designItemDetail.currentFullBodyView
|
||||
}else{
|
||||
url = designItemDetail.designItemUrl
|
||||
}
|
||||
this.designItemDetailUrl = url
|
||||
// console.log(designItemDetail.currentFullBodyView,designItemDetail.designItemUrl);
|
||||
|
||||
}
|
||||
},
|
||||
designDetailShow:{
|
||||
@@ -346,7 +359,8 @@ export default defineComponent({
|
||||
this.moible = isMoible()
|
||||
this.designItemId = data.design.designItemId
|
||||
this.designOutfitId = data.design.designOutfitId
|
||||
let url = Https.httpUrls.getDesignDetail + `?designItemId=${data.design.designItemId}&designPythonOutfitId=${data.design.designOutfitId}`
|
||||
// let url = Https.httpUrls.getDesignDetail + `?designItemId=${data.design.designItemId}&designPythonOutfitId=${data.design.designOutfitId}`
|
||||
let url = Https.httpUrls.getDesignDetail + `?designItemId=45192&designPythonOutfitId=44898`
|
||||
this.parentData = data
|
||||
this.loadingShow = true
|
||||
Https.axiosGet(url).then(
|
||||
@@ -362,6 +376,7 @@ export default defineComponent({
|
||||
item.printObject.prints = [{}]
|
||||
}
|
||||
})
|
||||
this.currentIndex = 0
|
||||
this.store.commit('setDesignItemDetail',rv)
|
||||
this.removeRevocation()
|
||||
this.setRevocation(rv,'')
|
||||
@@ -418,7 +433,6 @@ export default defineComponent({
|
||||
let frontIndex = 6
|
||||
let backIndex = 3
|
||||
designItemDetail.clothes.forEach((v:any,index:any)=>{
|
||||
|
||||
for (let i = v.layersObject.length-1; i >= 0; i--) {
|
||||
v.layersObject[i].style = {
|
||||
top:v.layersObject[i].position?.[0]*ratio+'px',
|
||||
@@ -434,10 +448,10 @@ export default defineComponent({
|
||||
v.layersObject[i].designOpenrtionBtn = false
|
||||
if(v.layersObject[i].imageCategory.indexOf("back") == -1){
|
||||
front[index] = v.layersObject[i]
|
||||
front[index].style.zIndex = frontIndex-=1
|
||||
front[index].style.zIndex = v.priority
|
||||
}else{
|
||||
back[index] = v.layersObject[i]
|
||||
back[index].style.zIndex = backIndex-=1
|
||||
back[index].style.zIndex = v.priority
|
||||
// back[index].style.zIndex = backIndex==0?v.layersObject[i]:backIndex++
|
||||
}
|
||||
}
|
||||
@@ -537,11 +551,14 @@ export default defineComponent({
|
||||
sessionStorage.setItem('oppositeRevocation', JSON.stringify(oppositeRevocation));
|
||||
sessionStorage.setItem('revocation', JSON.stringify(revocation));
|
||||
},
|
||||
setSubmitItem(str:any){
|
||||
setSubmitItem(str:any,sub:any){
|
||||
//sub判断是不是点击新增图层又直接点击删除
|
||||
let designItemDetail = JSON.parse(JSON.stringify(this.store.state.DesignDetailModule.designItemDetail))
|
||||
let clothes:any = []
|
||||
|
||||
designItemDetail.clothes.forEach((item:any) => {
|
||||
let num = -1
|
||||
// let zIndex = 10
|
||||
designItemDetail.clothes.forEach((item:any,index:number) => {
|
||||
|
||||
let clothesItem = {
|
||||
color: `${item.color.r} ${item.color.g} ${item.color.b}`,
|
||||
id:item.id,
|
||||
@@ -553,11 +570,20 @@ export default defineComponent({
|
||||
// path:item.printObject.path?item.printObject.path :'',
|
||||
prints:item?.printObject?.prints[0]?.minIOPath?item?.printObject?.prints:[]
|
||||
},
|
||||
priority:item.priority,
|
||||
type:item.type,
|
||||
}
|
||||
clothes.push(clothesItem)
|
||||
|
||||
if(!item.id && sub){
|
||||
num = index
|
||||
}else{
|
||||
clothes.push(clothesItem)
|
||||
}
|
||||
});
|
||||
if(num != -1){
|
||||
designItemDetail.clothes.splice(num,1)
|
||||
this.store.commit("setDesignItemDetail", designItemDetail);
|
||||
}
|
||||
this.currentIndex = 0
|
||||
let data = {
|
||||
designItemId:designItemDetail.designItemId,
|
||||
// designItemId:designItemDetail.designItemId,
|
||||
@@ -573,17 +599,17 @@ export default defineComponent({
|
||||
data.isPreview = false
|
||||
delete data.ifSubmit
|
||||
}
|
||||
this.store.commit('setDesignPreviewData',data)
|
||||
// this.store.commit('setDesignPreviewData',data)
|
||||
return data
|
||||
},
|
||||
async setSubmit(str:any){
|
||||
let setDesignItem:any = isMoible() ? this.$refs.setDesignItemMobile : this.$refs.setDesignItem
|
||||
let data = this.setSubmitItem(str)
|
||||
let data = this.setSubmitItem(str,true)
|
||||
this.loadingShow = true
|
||||
await setDesignItem.setPreview(data)
|
||||
},
|
||||
async submit(){
|
||||
let data = this.setSubmitItem('')
|
||||
let data = this.setSubmitItem('',true)
|
||||
this.loadingShow = true
|
||||
Https.axiosPost(Https.httpUrls.designSingle, data).then(
|
||||
(rv: any) => {
|
||||
@@ -625,6 +651,9 @@ export default defineComponent({
|
||||
// nextTick().then(()=>{
|
||||
// })
|
||||
console.log(modal_body);
|
||||
if(modal_body == undefined){
|
||||
this.setPostition(url)
|
||||
}
|
||||
function loadImage(url:any) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const img = new Image();
|
||||
@@ -695,12 +724,13 @@ export default defineComponent({
|
||||
DesignDetailAlter.changePlace()
|
||||
}else{
|
||||
this.deleteShow = false
|
||||
let data = this.setSubmitItem('preview')
|
||||
this.loadingShow = true
|
||||
let data = this.setSubmitItem('preview',true)
|
||||
Https.axiosPost(Https.httpUrls.designSingle, data).then(
|
||||
(rv) => {
|
||||
let designItemDetail = JSON.parse(JSON.stringify(this.designItemDetail))
|
||||
designItemDetail.ifSubmit = true
|
||||
this.loadingShow = false
|
||||
console.log(rv);
|
||||
this.store.commit("setDesignItemDetail", designItemDetail);
|
||||
this.store.commit("setDesignPreviewData", data);
|
||||
this.setRevocation(designItemDetail,data)
|
||||
@@ -757,6 +787,7 @@ export default defineComponent({
|
||||
// this.designOrder = true
|
||||
// let DesignDetailAlter:any = this.$refs.DesignDetailAlter
|
||||
// DesignDetailAlter.changePlace()
|
||||
this.designOrder = true
|
||||
if(this.designItemDetail.clothes[this.designItemDetail.clothes.length-1].id){
|
||||
this.designItemDetail.clothes.push(aa)
|
||||
this.clothesDetail(aa,this.designItemDetail.clothes.length-1)
|
||||
@@ -772,15 +803,21 @@ export default defineComponent({
|
||||
clothesDetail(clothes:any, index:number){
|
||||
|
||||
let designItemDetail = JSON.parse(JSON.stringify(this.store.state.DesignDetailModule.designItemDetail))
|
||||
this.currentIndex = index?index:0
|
||||
this.designOrder = true
|
||||
this.current = designItemDetail.clothes[this.currentIndex]
|
||||
let data:any = this.setSubmitItem('preview')
|
||||
this.current = designItemDetail.clothes[index]
|
||||
if(this.current.id && !designItemDetail.clothes[designItemDetail.clothes.length-1].id){
|
||||
designItemDetail.clothes.splice(designItemDetail.clothes.length-1,1)
|
||||
this.store.commit('setDesignItemDetail',designItemDetail)
|
||||
}
|
||||
let data:any = this.setSubmitItem('preview',false)
|
||||
this.currentIndex = index?index:0
|
||||
|
||||
data.designSingleItemDTOList[this.currentIndex] = {
|
||||
color:`${this.current.color.r} ${this.current.color.g} ${this.current.color.b}`,
|
||||
id:this.current.id?this.current.id:'',
|
||||
path:this.current.minIOPath?this.current.minIOPath:'',
|
||||
offset:this.current.layersObject?.[1]?.offset?this.current.layersObject[1].offset:[0,0],
|
||||
priority:this.current.priority,
|
||||
scale:this.current.layersObject?.[1]?.scale?this.current.layersObject[1].scale:1,
|
||||
printObject:{
|
||||
ifSingle:this.current?.printObject?.ifSingle == null ? false : this.current?.printObject?.ifSingle,
|
||||
@@ -945,6 +982,7 @@ export default defineComponent({
|
||||
height: 4rem;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
margin-left: .3rem;
|
||||
img{
|
||||
// width: 100%;
|
||||
height: 100%;
|
||||
@@ -960,11 +998,11 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
>div:nth-child(1){
|
||||
margin-right: 1rem;
|
||||
margin-left: 0rem;
|
||||
}
|
||||
}
|
||||
.detail_modal_item_front:last-child{
|
||||
z-index: 1 !important;
|
||||
// z-index: 1 !important;
|
||||
}
|
||||
>img{
|
||||
width: 100%;
|
||||
|
||||
@@ -535,31 +535,40 @@ export default defineComponent({
|
||||
},
|
||||
upFileUploadChange(data) {
|
||||
let file = data.file;
|
||||
let bor = true
|
||||
|
||||
if (file.status === "done") {
|
||||
let res = JSON.parse(file.xhr.response);
|
||||
file.id = res.data.id;
|
||||
file.url = res.data.url;
|
||||
file.resData = res.data;
|
||||
file.designType = res.data.designType
|
||||
file.category = this.current;
|
||||
file.minIOPath = file.resData.minIOPath
|
||||
let fileList = this.uploadList.filter(
|
||||
(v) => v.status === "done"
|
||||
);
|
||||
if (this.uploadList.length >= 8) {
|
||||
message.info(this.t('DesignDetailAlter.jsContent2'));
|
||||
} else {
|
||||
// this.store.commit("setSketchboardFile", fileList);
|
||||
this.uploadList = fileList
|
||||
// this.store.commit("clearMoodTemplateId");
|
||||
if(this.selectCode == 'Sketchboard'){
|
||||
this.apparelList = this.uploadList
|
||||
}else{
|
||||
this.printList = this.uploadList
|
||||
if(res.errCode == 0){
|
||||
file.id = res.data.id;
|
||||
file.url = res.data.url;
|
||||
file.resData = res.data;
|
||||
file.designType = res.data.designType
|
||||
file.category = this.current;
|
||||
file.minIOPath = file.resData.minIOPath
|
||||
let fileList = this.uploadList.filter(
|
||||
(v) => v.status === "done"
|
||||
);
|
||||
if (this.uploadList.length >= 8) {
|
||||
message.info(this.t('DesignDetailAlter.jsContent2'));
|
||||
} else {
|
||||
// this.store.commit("setSketchboardFile", fileList);
|
||||
this.uploadList = fileList
|
||||
// this.store.commit("clearMoodTemplateId");
|
||||
if(this.selectCode == 'Sketchboard'){
|
||||
this.apparelList = this.uploadList
|
||||
}else{
|
||||
this.printList = this.uploadList
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
bor = false
|
||||
}
|
||||
} else if (file.status === "error") {
|
||||
let index = -1;
|
||||
bor = false
|
||||
}
|
||||
if(!bor){
|
||||
let index = -1;
|
||||
this.uploadList.forEach((ele, index1) => {
|
||||
if (file.uid === ele.uid) {
|
||||
index = index1;
|
||||
@@ -568,8 +577,9 @@ export default defineComponent({
|
||||
if (index > -1) {
|
||||
this.uploadList.splice(index, 1);
|
||||
}
|
||||
message.warning(file.name + this.t('DesignDetailAlter.jsContent3'));
|
||||
}
|
||||
// message.warning(file.name + this.t('DesignDetailAlter.jsContent3'));
|
||||
message.warning(res.errMsg);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
@@ -236,16 +236,23 @@ export default defineComponent({
|
||||
let designItemDetail = JSON.parse(JSON.stringify(this.store.state.DesignDetailModule.designItemDetail))
|
||||
let index
|
||||
let data = JSON.parse(JSON.stringify(this.store.state.DesignDetailModule.designPreviewData))
|
||||
let bor = false
|
||||
// let bor = false
|
||||
let zIndex = 10
|
||||
designItemDetail.clothes.forEach((v,ind)=>{
|
||||
if(v.id == this.current.id){
|
||||
index = ind
|
||||
bor = true
|
||||
// bor = true
|
||||
}
|
||||
if(v.priority){
|
||||
if(zIndex < v.priority){
|
||||
zIndex = v.priority
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(this.current);
|
||||
|
||||
if(this.type_ == 1 && bor){
|
||||
if(!this.current.id){
|
||||
data.designSingleItemDTOList[index].priority = zIndex+=1
|
||||
}
|
||||
if(this.type_ == 1){
|
||||
if(data.designSingleItemDTOList[index].path != this.sketchImg.minIOPath && this.sketchImg.id_){
|
||||
data.designSingleItemDTOList[index].offset = [0,0]
|
||||
data.designSingleItemDTOList[index].scale = 1
|
||||
@@ -253,50 +260,53 @@ export default defineComponent({
|
||||
data.designSingleItemDTOList[index].id = this.sketchImg.id_? this.sketchImg.id_:this.current.id_
|
||||
data.designSingleItemDTOList[index].path =this.sketchImg.minIOPath? this.sketchImg.minIOPath: this.current.minIOPath
|
||||
data.designSingleItemDTOList[index].type =this.sketchImg.type? this.sketchImg.type: this.current.type
|
||||
}else if(this.type_ == 2 && bor){
|
||||
}else if(this.type_ == 2){
|
||||
data.designSingleItemDTOList[index].printObject.ifSingle = false
|
||||
data.designSingleItemDTOList[index].printObject.prints = []
|
||||
}else if(this.type_ == 3 && bor){
|
||||
}else if(this.type_ == 3){
|
||||
let color = `${this.$parent.selectColor.rgba.r} ${this.$parent.selectColor.rgba.g} ${this.$parent.selectColor.rgba.b}`
|
||||
data.designSingleItemDTOList[index].color = color
|
||||
}
|
||||
if(!bor){
|
||||
index = designItemDetail.clothes.length
|
||||
let color = `${this.$parent.selectColor.rgba.r} ${this.$parent.selectColor.rgba.g} ${this.$parent.selectColor.rgba.b}`
|
||||
let obj = {
|
||||
"color": color,
|
||||
"id": this.sketchImg.id_? this.sketchImg.id_:this.current.id_,
|
||||
"path": this.sketchImg.minIOPath? this.sketchImg.minIOPath: this.current.minIOPath,
|
||||
"offset": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"scale": 1,
|
||||
"printObject": {
|
||||
"ifSingle": false,
|
||||
"prints": [
|
||||
]
|
||||
},
|
||||
"type": this.sketchImg.type
|
||||
}
|
||||
return
|
||||
// data.designSingleItemDTOList.push(obj)
|
||||
// designItemDetail.clothes.push(obj)
|
||||
}
|
||||
// if(!bor){
|
||||
// index = designItemDetail.clothes.length
|
||||
// let color = `${this.$parent.selectColor.rgba.r} ${this.$parent.selectColor.rgba.g} ${this.$parent.selectColor.rgba.b}`
|
||||
// let obj = {
|
||||
// "color": color,
|
||||
// "id": this.sketchImg.id_? this.sketchImg.id_:this.current.id_,
|
||||
// "path": this.sketchImg.minIOPath? this.sketchImg.minIOPath: this.current.minIOPath,
|
||||
// "offset": [
|
||||
// 0,
|
||||
// 0
|
||||
// ],
|
||||
// "scale": 1,
|
||||
// "printObject": {
|
||||
// "ifSingle": false,
|
||||
// "prints": [
|
||||
// ]
|
||||
// },
|
||||
// priority:zIndex,
|
||||
// "type": this.sketchImg.type
|
||||
// }
|
||||
// // data.designSingleItemDTOList.push(obj)
|
||||
// // designItemDetail.clothes.push(obj)
|
||||
// }
|
||||
// return
|
||||
data.timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone
|
||||
this.loadingShow = true
|
||||
Https.axiosPost(Https.httpUrls.designSingle, data).then(
|
||||
(rv) => {
|
||||
rv.clothes.forEach((item)=>{
|
||||
console.log(item.id , designItemDetail.clothes[index].id);
|
||||
if(item.id == this.sketchImg.id_){
|
||||
console.log(item, designItemDetail.clothes[index]);
|
||||
console.log(item,item.id , designItemDetail.clothes[index].id);
|
||||
designItemDetail.clothes[index].color = item.color
|
||||
designItemDetail.clothes[index].printObject = item.printObject
|
||||
designItemDetail.clothes[index].layersObject = item.layersObject
|
||||
designItemDetail.clothes[index].minIOPath = item.minIOPath
|
||||
designItemDetail.clothes[index].path = item.path
|
||||
designItemDetail.clothes[index].id = item.id
|
||||
designItemDetail.clothes[index].type = item.type
|
||||
designItemDetail.clothes[index].priority = zIndex
|
||||
}
|
||||
})
|
||||
designItemDetail.currentFullBodyView = rv.currentFullBodyView
|
||||
|
||||
@@ -30,7 +30,6 @@ export default defineComponent({
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
directives:{
|
||||
mousemove:{
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<div class="design_compile_content" id="design_compile_content">
|
||||
<div class="designOpenrtion_centent" id="designOpenrtionCentent">
|
||||
<div class="detail_modal_body_nav">
|
||||
<div v-for="item,index in designItemDetail?.clothes" v-show="item.id" :class="{active:item.clothesOpen}" @click="clothesOpen(index)">
|
||||
<img :src="item?.path" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="designOpenrtion_imgMask" :style="frontBack?.body?.style">
|
||||
<!-- <div
|
||||
v-for="item,index in frontBack.back"
|
||||
@@ -77,7 +82,7 @@ export default defineComponent({
|
||||
]);
|
||||
let direction = ref('')
|
||||
let imgDom = ref()
|
||||
let imgDomIndex = ref(0)
|
||||
let imgDomIndex = ref(2)
|
||||
let frontBack = ref({})
|
||||
return {
|
||||
designItemDetail,
|
||||
@@ -156,13 +161,20 @@ export default defineComponent({
|
||||
v.layersObject[i].designOpenrtionBtn = false
|
||||
if(v.layersObject[i].imageCategory.indexOf("back") == -1){
|
||||
front[index] = v.layersObject[i]
|
||||
front[index].style.zIndex = frontIndex-=1
|
||||
front[index].style.zIndex = v.priority
|
||||
front[index].id = v.id
|
||||
}else{
|
||||
back[index] = v.layersObject[i]
|
||||
back[index].style.zIndex = backIndex-=1
|
||||
back[index].style.zIndex = v.priority
|
||||
back[index].id = v.id
|
||||
|
||||
// back[index].style.zIndex = backIndex==0?v.layersObject[i]:backIndex++
|
||||
}
|
||||
if(this.printZIndex < v.priority){
|
||||
this.printZIndex = v.priority
|
||||
}
|
||||
}
|
||||
this.printZIndex++
|
||||
})
|
||||
let bodyImgWH = document.getElementsByClassName("design_compile_content")[0].getElementsByClassName("perview_img")[0]
|
||||
|
||||
@@ -200,13 +212,16 @@ export default defineComponent({
|
||||
this.frontBack.front[index].designOpenrtionBtn = true
|
||||
this.frontBack.front[index].style.zIndex = this.printZIndex++
|
||||
this.frontBack.back[index].style.zIndex = this.printZIndex
|
||||
this.clothesOpenActive(index)
|
||||
},
|
||||
// 设置移动
|
||||
itemMoveMousedown(index,event){
|
||||
itemMoveMousedown(index,e){
|
||||
this.imgDomIndex = index
|
||||
this.frontBack.front.forEach((v)=>{
|
||||
v.designOpenrtionBtn = false
|
||||
})
|
||||
this.clothesOpenActive(index)
|
||||
let event = e||window.event
|
||||
this.imgDom = document.getElementsByClassName('design_compile_content')[0].getElementsByClassName("detail_modal_item_front")[this.imgDomIndex]
|
||||
this.frontBack.front[index].designOpenrtionBtn = true
|
||||
this.frontBack.front[index].style.zIndex = this.printZIndex++
|
||||
@@ -337,6 +352,25 @@ export default defineComponent({
|
||||
item.designOpenrtionBtn = false
|
||||
})
|
||||
},
|
||||
clothesOpen(index){
|
||||
this.imgDomIndex = index
|
||||
this.clothesOpenActive(index)
|
||||
this.setpitch('',index)
|
||||
},
|
||||
clothesOpenActive(index){
|
||||
this.designItemDetail.clothes.forEach((item)=>{
|
||||
item.clothesOpen = false
|
||||
})
|
||||
this.designItemDetail.clothes[index].clothesOpen = true
|
||||
},
|
||||
sort(arr){
|
||||
arr.sort((a, b) => {
|
||||
var a_num = a.style.zIndex;
|
||||
var b_num = b.style.zIndex;
|
||||
return a_num - b_num;
|
||||
});
|
||||
return arr
|
||||
},
|
||||
async setPreview(data){
|
||||
let ratio = this.frontBack.body.layersObject[0].imageSize[0]/this.frontBack.body.style.width.replace(/px/g,'')
|
||||
let designItemDetail = this.store.state.DesignDetailModule.designItemDetail
|
||||
@@ -345,17 +379,19 @@ export default defineComponent({
|
||||
// var b_num = b.style.zIndex;
|
||||
// return a_num - b_num;
|
||||
// });
|
||||
// this.frontBack.front.sort((a, b) => {
|
||||
// var a_num = a.style.zIndex;
|
||||
// var b_num = b.style.zIndex;
|
||||
// return a_num - b_num;
|
||||
// });
|
||||
|
||||
let arr = this.sort(JSON.parse(JSON.stringify(this.frontBack.front)))
|
||||
|
||||
let num = 10
|
||||
arr.forEach((item)=>{
|
||||
item.priority = num++
|
||||
})
|
||||
data.designSingleItemDTOList.forEach((item)=>{
|
||||
let front = this.frontBack.front
|
||||
let imageCategory1 = front[1].imageCategory
|
||||
front.forEach((i)=>{
|
||||
let front = arr
|
||||
let imageCategory1 = arr[1].imageCategory
|
||||
arr.forEach((i)=>{
|
||||
let imageCategory = i.imageCategory.split('_')[0]
|
||||
if(item.type == this.capitalizeFirstLetter(imageCategory)){
|
||||
if(item.id == i.id){
|
||||
let y = ((i?.style?.top.replace(/px/g,'')*ratio).toFixed(0) - i?.position[0])
|
||||
let x = ((i?.style?.left.replace(/px/g,'')*ratio).toFixed(0) - i?.position[1])
|
||||
let scale = i?.imageSize?Number(((i?.style?.width.replace(/px/g,'')*ratio)/(i?.imageSize[0]/i.scale)).toFixed(2)):1
|
||||
@@ -363,6 +399,7 @@ export default defineComponent({
|
||||
let top = y == 0 ? item.offset[1]:y+item.offset[1]
|
||||
let left = x == 0 ? item.offset[0]:x+item.offset[0]
|
||||
item.offset = [left,top]
|
||||
item.priority = i.priority
|
||||
// item.offset = [(i?.style?.left.replace(/px/g,'')*ratio).toFixed(0),(i?.style?.top.replace(/px/g,'')*ratio).toFixed(0)]
|
||||
}
|
||||
})
|
||||
@@ -379,11 +416,14 @@ export default defineComponent({
|
||||
designItemDetail.currentFullBodyView = rv.currentFullBodyView
|
||||
rv.clothes.forEach((item)=>{
|
||||
designItemDetail.clothes.forEach((i)=>{
|
||||
if(item.type === i.type){
|
||||
if(item.id === i.id){
|
||||
i.layersObject = item.layersObject
|
||||
i.priority = item.layersObject[0].priority
|
||||
console.log(item,i);
|
||||
}
|
||||
})
|
||||
})
|
||||
console.log(designItemDetail,'============================');
|
||||
this.$emit('setDesignCoverage');
|
||||
this.store.commit("setDesignItemDetail", designItemDetail);
|
||||
this.setRevocation(designItemDetail,data)
|
||||
@@ -451,6 +491,40 @@ export default defineComponent({
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
.detail_modal_body_nav{
|
||||
display: flex;
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
z-index: 999;
|
||||
transform: translate(-50%,-0%);
|
||||
transition: all .3s;
|
||||
justify-content: center;
|
||||
margin-bottom: 1rem;
|
||||
>div{
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
margin-left: .3rem;
|
||||
img{
|
||||
// width: 100%;
|
||||
height: 100%;
|
||||
max-width: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
&.active{
|
||||
border: 2px solid rgba(0,0,0,0.4);
|
||||
img{
|
||||
transform: scale(.8);
|
||||
opacity: .8;
|
||||
}
|
||||
}
|
||||
}
|
||||
>div:nth-child(1){
|
||||
margin-left: 0rem;
|
||||
}
|
||||
}
|
||||
.designOpenrtion_print,.detail_modal_item_front{
|
||||
z-index: 1;
|
||||
img{
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<div class="design_compile_content" id="design_compile_content">
|
||||
<div class="designOpenrtion_centent" id="designOpenrtionCentent">
|
||||
<div class="detail_modal_body_nav">
|
||||
<div v-for="item,index in designItemDetail?.clothes" v-show="item.id" :class="{active:item.clothesOpen}" @click="clothesOpen(index)">
|
||||
<img :src="item?.path" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="designOpenrtion_imgMask" :style="frontBack?.body?.style">
|
||||
<!-- <div
|
||||
v-for="item,index in frontBack.back"
|
||||
@@ -200,6 +205,7 @@ export default defineComponent({
|
||||
this.frontBack.front[index].designOpenrtionBtn = true
|
||||
this.frontBack.front[index].style.zIndex = this.printZIndex++
|
||||
this.frontBack.back[index].style.zIndex = this.printZIndex
|
||||
this.clothesOpenActive(index)
|
||||
},
|
||||
// 设置移动
|
||||
itemMoveMousedown(index,event){
|
||||
@@ -207,6 +213,7 @@ export default defineComponent({
|
||||
this.frontBack.front.forEach((v)=>{
|
||||
v.designOpenrtionBtn = false
|
||||
})
|
||||
this.clothesOpenActive(index)
|
||||
this.imgDom = document.getElementsByClassName('design_compile_content')[0].getElementsByClassName("detail_modal_item_front")[this.imgDomIndex]
|
||||
this.frontBack.front[index].designOpenrtionBtn = true
|
||||
this.frontBack.front[index].style.zIndex = this.printZIndex++
|
||||
@@ -339,6 +346,17 @@ export default defineComponent({
|
||||
item.designOpenrtionBtn = false
|
||||
})
|
||||
},
|
||||
clothesOpen(index){
|
||||
this.imgDomIndex = index
|
||||
this.clothesOpenActive(index)
|
||||
this.setpitch('',index)
|
||||
},
|
||||
clothesOpenActive(index){
|
||||
this.designItemDetail.clothes.forEach((item)=>{
|
||||
item.clothesOpen = false
|
||||
})
|
||||
this.designItemDetail.clothes[index].clothesOpen = true
|
||||
},
|
||||
async setPreview(data){
|
||||
let ratio = this.frontBack.body.layersObject[0].imageSize[0]/this.frontBack.body.style.width.replace(/px/g,'')
|
||||
let designItemDetail = this.store.state.DesignDetailModule.designItemDetail
|
||||
@@ -347,11 +365,16 @@ export default defineComponent({
|
||||
// var b_num = b.style.zIndex;
|
||||
// return a_num - b_num;
|
||||
// });
|
||||
// this.frontBack.front.sort((a, b) => {
|
||||
// var a_num = a.style.zIndex;
|
||||
// var b_num = b.style.zIndex;
|
||||
// return a_num - b_num;
|
||||
// });
|
||||
let arr = JSON.parse(JSON.stringify(this.frontBack.front))
|
||||
arr.sort((a, b) => {
|
||||
var a_num = a.style.zIndex;
|
||||
var b_num = b.style.zIndex;
|
||||
return a_num - b_num;
|
||||
});
|
||||
let num = 10
|
||||
arr.forEach((item)=>{
|
||||
item.priority = num++
|
||||
})
|
||||
data.designSingleItemDTOList.forEach((item)=>{
|
||||
let front = this.frontBack.front
|
||||
let imageCategory1 = front[1].imageCategory
|
||||
@@ -365,6 +388,7 @@ export default defineComponent({
|
||||
let top = y == 0 ? item.offset[1]:y+item.offset[1]
|
||||
let left = x == 0 ? item.offset[0]:x+item.offset[0]
|
||||
item.offset = [left,top]
|
||||
item.priority = i.priority
|
||||
// item.offset = [(i?.style?.left.replace(/px/g,'')*ratio).toFixed(0),(i?.style?.top.replace(/px/g,'')*ratio).toFixed(0)]
|
||||
}
|
||||
})
|
||||
@@ -453,6 +477,40 @@ export default defineComponent({
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
.detail_modal_body_nav{
|
||||
display: flex;
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
z-index: 999;
|
||||
transform: translate(-50%,-0%);
|
||||
transition: all .3s;
|
||||
justify-content: center;
|
||||
margin-bottom: 1rem;
|
||||
>div{
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
margin-left: .3rem;
|
||||
img{
|
||||
// width: 100%;
|
||||
height: 100%;
|
||||
max-width: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
&.active{
|
||||
border: 2px solid rgba(0,0,0,0.4);
|
||||
img{
|
||||
transform: scale(.8);
|
||||
opacity: .8;
|
||||
}
|
||||
}
|
||||
}
|
||||
>div:nth-child(1){
|
||||
margin-left: 0rem;
|
||||
}
|
||||
}
|
||||
.designOpenrtion_print,.detail_modal_item_front{
|
||||
z-index: 1;
|
||||
img{
|
||||
|
||||
Reference in New Issue
Block a user