detail调整
This commit is contained in:
@@ -127,9 +127,6 @@
|
||||
<i class="fi fi-rr-edit" @click.stop="openCurrent(4)"></i>
|
||||
</div>
|
||||
<div class="Guide_1_20 clothes_item_icon" :class="[driver__.driver?'showEvents':'']">
|
||||
<!-- <div class="centent_div" v-if="current?.printObject?.prints?.[0]?.path" @click="openCurrent(2)">
|
||||
<img :src="current?.printObject?.prints[0]?.path" alt="">
|
||||
</div> -->
|
||||
<div class="centent_div centent_print" v-if="exhibitionList.elements && exhibitionList.elements.length > 1" @click="openCurrent(4)">
|
||||
<img v-for="item in exhibitionList.elements" :key="item.id" :src="item.path" alt="">
|
||||
</div>
|
||||
@@ -744,7 +741,6 @@ export default defineComponent({
|
||||
offset:item.layersObject?.[1]?.offset == null?[0,0]:item.layersObject[1].offset,
|
||||
scale:item.layersObject?.[1]?.scale?item.layersObject[1].scale:[1,1],
|
||||
printObject:{
|
||||
ifSingle:item.printObject.ifSingle == null ? false : item.printObject.ifSingle,
|
||||
// path:item.printObject.path?item.printObject.path :'',
|
||||
prints:item?.printObject?.prints[0]?.minIOPath?item?.printObject?.prints:[]
|
||||
},
|
||||
@@ -1022,7 +1018,6 @@ export default defineComponent({
|
||||
"prints":null,
|
||||
},
|
||||
"printObject": {
|
||||
"ifSingle": null,
|
||||
"prints": [
|
||||
]
|
||||
},
|
||||
@@ -1094,7 +1089,6 @@ export default defineComponent({
|
||||
scale:this.current.layersObject?.[1]?.scale?this.current.layersObject[1].scale:[1,1],
|
||||
sketchString:'',
|
||||
printObject:{
|
||||
ifSingle:this.current?.printObject?.ifSingle == null ? false : this.current?.printObject?.ifSingle,
|
||||
// prints:this.current?.printObject[0]?.path == null ? [] : [{
|
||||
// location:[0,0],
|
||||
// angle:0,
|
||||
|
||||
@@ -605,7 +605,7 @@ export default defineComponent({
|
||||
this.clothesList = []
|
||||
this.getLibraryList()
|
||||
}
|
||||
this.store.state.UploadFilesModule.allBoardData.colorBoards.forEach((item,index) => {
|
||||
this.store.state.UploadFilesModule.allBoardData?.colorBoards?.forEach((item,index) => {
|
||||
this.colorList[index+1] = {
|
||||
gradient:item.gradient,
|
||||
rgba:item.rgbValue,
|
||||
@@ -732,7 +732,6 @@ export default defineComponent({
|
||||
},
|
||||
selectImgItem(imgData){
|
||||
let DesignDetailEnd = this.$refs.DesignDetailEnd
|
||||
console.log(imgData);
|
||||
imgData.categoryValue = imgData.categoryValue?imgData.categoryValue:imgData.level2TypeEnum.name
|
||||
imgData.category = imgData.category?imgData.category:imgData.level2TypeEnum.value
|
||||
if(this.selectCode == 'Sketchboard'){
|
||||
|
||||
@@ -24,13 +24,12 @@
|
||||
<!-- <div class="modal_img_item" v-for="item,index in current.printObject.prints" :key="item" > -->
|
||||
<img v-lazy="item.path" alt="">
|
||||
<sketchCategory :disignTypeList="designTypeList" :generateList="exhibitionList.print" :item="item" :isSpread="true" :isSetSketchCategory="true"></sketchCategory>
|
||||
<div
|
||||
<!-- <div
|
||||
class="delete_file_block"
|
||||
v-if="current.printObject.ifSingle"
|
||||
@click="deleteSelectptints(item,index)"
|
||||
>
|
||||
<span class="icon iconfont icon-shanchu"></span>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="modal_img_item" v-for="item,index in printsList" :key="item" >
|
||||
<img v-lazy="item.path" alt="">
|
||||
@@ -388,7 +387,6 @@ export default defineComponent({
|
||||
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){
|
||||
data.designSingleItemDTOList[index].printObject.ifSingle = false
|
||||
data.designSingleItemDTOList[index].printObject.prints = []
|
||||
}else if(this.type_ == 3){
|
||||
if(this.colorList[this.selectIndex]?.rgba?.r == undefined){
|
||||
|
||||
@@ -96,10 +96,7 @@
|
||||
<img crossOrigin="anonymous" :src="item?.path" :style="{transform:`rotateZ(${printStyleList[stateOverallSingle][index]?.transform?.rotateZ}deg)`}" class="designOpenrtion_imgItme" draggable="false">
|
||||
</div>
|
||||
</div>
|
||||
<!-- <img v-if="overallSingle" :src="current?.layersObject?.[1]?.maskUrl" alt="" class="designOpenrtion_sketch"> -->
|
||||
<!-- {{printStyleList[stateOverallSingle][0]}} -->
|
||||
<img :src="current?.path" alt="" class="designOpenrtion_sketch">
|
||||
<img v-show="overallSingle" :src="current?.layersObject?.[1]?.maskUrl" alt="" class="designOpenrtion_sketch_mask">
|
||||
<img v-lazy="operationCurrent.undividedLayer || operationCurrent.path" alt="" class="designOpenrtion_sketch">
|
||||
<div class="designOpenrtion_btn">
|
||||
<ul v-if="overallSingle" v-for="item,index in printStyleList[stateOverallSingle]" :key="item" :class="{active:item?.designOpenrtionBtn?item?.designOpenrtionBtn:false}" class="designOpenrtion_Mousingle" :style="item.style" @mousedown.stop="itemMoveMousedown(index,$event)">
|
||||
<li class="designOpenrtion_btn_top" @mousedown.stop="itemSizeMousedown('top',$event)"></li>
|
||||
@@ -199,6 +196,9 @@ export default defineComponent({
|
||||
let sketch = ref({
|
||||
width:'',
|
||||
height:''
|
||||
})
|
||||
let operationCurrent = ref({
|
||||
|
||||
})
|
||||
let loadingShow = ref(false)
|
||||
let currentFullBodyView = ref('')
|
||||
@@ -224,6 +224,7 @@ export default defineComponent({
|
||||
imgDomIndex,
|
||||
print,
|
||||
sketch,
|
||||
operationCurrent,
|
||||
loadingShow,
|
||||
setRevocation,
|
||||
t,
|
||||
@@ -295,11 +296,14 @@ export default defineComponent({
|
||||
if(designItemDetail.others.length == 0){
|
||||
this.body = true
|
||||
}
|
||||
//设置前片后片
|
||||
this.operationCurrent = Object.assign({},this.current)
|
||||
this.designOpenrtion = true
|
||||
this.clearModal()
|
||||
this.overallSingle = this.current.printObject.ifSingle?true:false
|
||||
this.ifListOver()
|
||||
if(this.current.printObject.prints)this.exhibitionOpenrtionList[this.stateOverallSingle] = JSON.parse(JSON.stringify(this.current.printObject.prints))
|
||||
let printList = JSON.parse(JSON.stringify(this.current.printObject.prints))
|
||||
this.setprintList(printList)
|
||||
if(this.$parent.exhibitionList.print)this.designOpenrtionList = JSON.parse(JSON.stringify(this.$parent.exhibitionList.print))
|
||||
if(this.$parent.elementsList)this.designList = JSON.parse(JSON.stringify(this.$parent.printsList))
|
||||
if(this.overallSingle == false && this.designOpenrtionList.length > 0){
|
||||
@@ -307,7 +311,6 @@ export default defineComponent({
|
||||
}else if(this.overallSingle == false && this.designOpenrtionList.length == 0){
|
||||
this.setpitch(this.designList[0],0)
|
||||
}
|
||||
// this.overallSingle = this.current.ifSingle?false:this.current.ifSingle
|
||||
let skecth = new Image
|
||||
skecth.src = this.current.path
|
||||
skecth.onload=()=>{
|
||||
@@ -315,14 +318,29 @@ export default defineComponent({
|
||||
this.sketch.height = skecth.height/10+'rem'
|
||||
skecth.remove()
|
||||
}
|
||||
if(this.exhibitionOpenrtionList[this.stateOverallSingle].length > 0){
|
||||
this.exhibitionOpenrtionList[this.stateOverallSingle].forEach((item,index)=>{
|
||||
this.setTemplate(item,index)
|
||||
if(this.exhibitionOpenrtionList.overall.length > 0){
|
||||
let str = 'overall'
|
||||
this.exhibitionOpenrtionList[str].forEach((item,index)=>{
|
||||
this.setTemplate(item,index,str)
|
||||
})
|
||||
}
|
||||
if(this.exhibitionOpenrtionList.single.length > 0){
|
||||
let str = 'single'
|
||||
this.exhibitionOpenrtionList[str].forEach((item,index)=>{
|
||||
this.setTemplate(item,index,str)
|
||||
})
|
||||
}else{
|
||||
}
|
||||
|
||||
},
|
||||
setprintList(arr){
|
||||
arr.forEach(item=>{
|
||||
if(item.ifSingle){
|
||||
this.exhibitionOpenrtionList.single.push(item)
|
||||
}else{
|
||||
this.exhibitionOpenrtionList.overall.push(item)
|
||||
}
|
||||
})
|
||||
},
|
||||
ifListOver(){
|
||||
if(!this.overallSingle){
|
||||
// this.designOpenrtionList = this.designOpenrtionList.filter((item)=>item.level2Type == "Pattern")
|
||||
@@ -367,6 +385,7 @@ export default defineComponent({
|
||||
})
|
||||
if(!this.overallSingle){
|
||||
if(item.checked){
|
||||
this.imgDomIndex = 0
|
||||
this.deletePrint()
|
||||
item.checked = false
|
||||
return
|
||||
@@ -389,7 +408,8 @@ export default defineComponent({
|
||||
path:item.path,
|
||||
priority:1,
|
||||
scale:.3,
|
||||
location:[0,0]
|
||||
location:[0,0],
|
||||
ifSingle:false,
|
||||
}
|
||||
this.systemDesignerPercentage = item.scale?item.scale*100:30
|
||||
}else{
|
||||
@@ -403,9 +423,10 @@ export default defineComponent({
|
||||
path:item.path,
|
||||
priority:1,
|
||||
scale:1,
|
||||
location:[0,0]
|
||||
location:[0,0],
|
||||
ifSingle:true,
|
||||
})
|
||||
this.refetchTemplate(currentIndex,false)
|
||||
this.refetchTemplate(currentIndex,true)
|
||||
}
|
||||
},
|
||||
//设置移动
|
||||
@@ -555,34 +576,41 @@ export default defineComponent({
|
||||
},
|
||||
//随机重置图片顺序
|
||||
refetchTemplate(index,boor) {
|
||||
// let scale = (Math.trunc(Math.random()*15)+1)*.1
|
||||
let rotateZ1 = Math.trunc(Math.random()*360)+1
|
||||
let rotateZ2 = Math.trunc(Math.random()*360)+1
|
||||
let sketch = document.getElementsByClassName("designOpenrtion_modal")[0]?.getElementsByClassName('designOpenrtion_sketch')[0]
|
||||
let width
|
||||
let scale
|
||||
if(sketch.width<sketch.height){
|
||||
width = Math.trunc(Math.random()*(sketch?.width-sketch?.width/2))+sketch?.width/4
|
||||
if(boor){
|
||||
width = Math.trunc((sketch?.width-sketch?.width/2))+sketch?.width/4
|
||||
}
|
||||
scale = width / this.print.width.replace(/px/g,'')
|
||||
}else{
|
||||
width = Math.trunc(Math.random()*(sketch?.height-sketch?.height/2))+sketch?.height/4
|
||||
if(boor){
|
||||
width = Math.trunc((sketch?.height-sketch?.height/2))+sketch?.height/4
|
||||
}
|
||||
scale = width / this.print.height.replace(/px/g,'')
|
||||
}
|
||||
// let x = sketch.width-Number(this.print.width.replace(/px/g,''))
|
||||
// let y = sketch.height-Number(this.print.height.replace(/px/g,''))
|
||||
let x = sketch?.width - this.print.width.replace(/px/g,'')*scale
|
||||
if(!this.overallSingle){
|
||||
x = sketch?.width - this.print.width.replace(/px/g,'')*scale/2
|
||||
}
|
||||
let y = sketch?.height-this.print.height.replace(/px/g,'')*scale
|
||||
let left = sketch.offsetWidth/2-this.print.width.replace(/px/g,'')*scale/2
|
||||
let top = sketch.offsetHeight/2-this.print.height.replace(/px/g,'')*scale/2
|
||||
if(this.stateOverallSingle == 'overall'){
|
||||
left = sketch.offsetWidth/2-5
|
||||
top = sketch.offsetHeight/2-5
|
||||
}
|
||||
this.printStyleList[this.stateOverallSingle][index]={
|
||||
centers:{
|
||||
left:0,
|
||||
top:0,
|
||||
},
|
||||
style:{
|
||||
left:(boor?sketch.offsetWidth/2:Math.trunc(Math.random()*x)+1)+"px",
|
||||
top:(boor?sketch.offsetHeight/2:Math.trunc(Math.random()*y)+1)+"px",
|
||||
left:(boor?left:Math.trunc(Math.random()*x)+1)+"px",
|
||||
top:(boor?top:Math.trunc(Math.random()*y)+1)+"px",
|
||||
right:"auto",
|
||||
bottom:"auto",
|
||||
width:this.print.width.replace(/px/g,'')*scale+'px',
|
||||
@@ -598,7 +626,7 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
//设置图片
|
||||
async setTemplate(item,index) {
|
||||
async setTemplate(item,index,str) {
|
||||
await this.setPrintWH(item.path)
|
||||
this.designOpenrtionList
|
||||
let sketch = document.getElementsByClassName("designOpenrtion_modal")[0]?.getElementsByClassName('designOpenrtion_sketch')[0]
|
||||
@@ -614,7 +642,8 @@ export default defineComponent({
|
||||
if(sketch.offsetHeight < item.location[1]/sketchNum){
|
||||
top = sketch.offsetHeight +'px'
|
||||
}
|
||||
this.printStyleList[this.stateOverallSingle][index]={
|
||||
this.systemDesignerPercentage = item.scale?item.scale*100:30
|
||||
this.printStyleList[str][index]={
|
||||
centers:{
|
||||
left:0,
|
||||
top:0,
|
||||
@@ -635,25 +664,34 @@ export default defineComponent({
|
||||
designOpenrtionBtn:false
|
||||
}
|
||||
},
|
||||
computeZindex(){
|
||||
let arr = JSON.parse(JSON.stringify(this.printStyleList[this.stateOverallSingle]))
|
||||
arr.sort((a, b) => {
|
||||
var a_num = a["style"].zIndex;
|
||||
var b_num = b["style"].zIndex;
|
||||
computeZindex(resolve,prints){
|
||||
prints.sort((a, b) => {
|
||||
var a_num = a.priority;
|
||||
var b_num = b.priority;
|
||||
return a_num - b_num;
|
||||
});
|
||||
|
||||
|
||||
let num = 1
|
||||
arr.forEach((v)=>{
|
||||
v.style.zIndex = num++
|
||||
|
||||
prints.forEach((v)=>{
|
||||
v.priority = num++
|
||||
})
|
||||
return this.computeSize(arr)//计算单件衣服初始大小到目前大小的缩放比
|
||||
resolve(prints)
|
||||
},
|
||||
computeSize(arr){
|
||||
computeSize(){
|
||||
return new Promise(async (resolve, reject) => {
|
||||
let arr = JSON.parse(JSON.stringify(this.printStyleList[this.stateOverallSingle]))
|
||||
// let num = this.sketch/
|
||||
let sketch = document.getElementsByClassName("designOpenrtion_sketch")[0]
|
||||
let sketchNum = this.sketch.width.replace(/rem/g,'')*10/sketch.offsetWidth
|
||||
let prints = []
|
||||
prints = this.operationCurrent.printObject.prints.filter(item=>!!!item.ifSingle)
|
||||
if(this.stateOverallSingle == 'overall'){
|
||||
prints = this.operationCurrent.printObject.prints.filter(item=>!!item.ifSingle)
|
||||
}else{
|
||||
prints = this.operationCurrent.printObject.prints.filter(item=>!!!item.ifSingle)
|
||||
}
|
||||
let scale
|
||||
let location
|
||||
for (let index = 0; index < arr.length; index++) {
|
||||
@@ -676,10 +714,11 @@ export default defineComponent({
|
||||
level2Type:this.exhibitionOpenrtionList[this.stateOverallSingle][index].level2Type,
|
||||
path:this.exhibitionOpenrtionList[this.stateOverallSingle][index].path,
|
||||
minIOPath:this.exhibitionOpenrtionList[this.stateOverallSingle][index].minIOPath,
|
||||
ifSingle:!!this.exhibitionOpenrtionList[this.stateOverallSingle][index].ifSingle,
|
||||
}
|
||||
prints.push(obj)
|
||||
}
|
||||
resolve(prints)
|
||||
this.computeZindex(resolve,prints)
|
||||
})
|
||||
},
|
||||
async setPreview(){
|
||||
@@ -699,7 +738,7 @@ export default defineComponent({
|
||||
// timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||
// }
|
||||
let data = JSON.parse(JSON.stringify(this.store.state.DesignDetailModule.designPreviewData))
|
||||
await this.computeZindex().then((rv)=>{
|
||||
await this.computeSize().then((rv)=>{
|
||||
this.setOkData = rv
|
||||
})
|
||||
data.designSingleItemDTOList[index].printObject={
|
||||
@@ -710,6 +749,8 @@ export default defineComponent({
|
||||
this.loadingShow = true
|
||||
Https.axiosPost(Https.httpUrls.designSingle, data).then(
|
||||
(rv) => {
|
||||
this.operationCurrent = Object.assign({},rv.clothes[index])
|
||||
|
||||
// designItemDetail.clothes[index].printObject.path = rv.clothes[0].printObject.path
|
||||
this.currentFullBodyView = rv.currentFullBodyView
|
||||
this.designItemDetailTS.rv = rv
|
||||
@@ -1003,7 +1044,8 @@ export default defineComponent({
|
||||
max-width: calc(60rem*1.2);
|
||||
}
|
||||
.designOpenrtion_sketch_mask{
|
||||
z-index: 3;
|
||||
z-index: 2;
|
||||
// z-index: 3;
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
@@ -1058,10 +1100,12 @@ export default defineComponent({
|
||||
border: none;
|
||||
width: calc(1.4rem*1.2);
|
||||
height: calc(1.4rem*1.2);
|
||||
z-index: 2;
|
||||
i{
|
||||
display: flex;
|
||||
color: #14bcff;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
.animtion1{
|
||||
animation: anim 4s 2s linear infinite;
|
||||
|
||||
@@ -98,9 +98,7 @@
|
||||
<img crossOrigin="anonymous" :src="item?.path" :style="{transform:`rotateZ(${printStyleList[index]?.transform?.rotateZ}deg)`}" class="designOpenrtionMobile_imgItme" draggable="false">
|
||||
</div>
|
||||
</div>
|
||||
<!-- <img v-if="overallSingle" :src="current?.layersObject?.[1]?.maskUrl" alt="" class="designOpenrtionMobile_sketch"> -->
|
||||
<img :src="current?.path" alt="" class="designOpenrtionMobile_sketch">
|
||||
<img v-show="overallSingle" :src="current?.layersObject?.[1]?.maskUrl" alt="" class="designOpenrtionMobile_sketch_mask">
|
||||
<img v-lazy="operationCurrent.undividedLayer || operationCurrent.path" alt="" class="designOpenrtion_sketch">
|
||||
<div class="designOpenrtionMobile_btn">
|
||||
<ul v-if="overallSingle" v-for="item,index in printStyleList[stateOverallSingle]" :key="item" :class="{active:item?.designOpenrtionBtn?item?.designOpenrtionBtn:false}" class="designOpenrtionMobile_Mousingle" :style="item.style" @touchstart.stop="itemMoveMousedown(index,$event)">
|
||||
<li class="designOpenrtionMobile_btn_top" @touchstart.stop="itemSizeMousedown('top',$event)"></li>
|
||||
@@ -199,6 +197,9 @@ export default defineComponent({
|
||||
let sketch = ref({
|
||||
width:'',
|
||||
height:''
|
||||
})
|
||||
let operationCurrent = ref({
|
||||
|
||||
})
|
||||
let loadingShow = ref(false)
|
||||
let currentFullBodyView = ref('')
|
||||
@@ -223,6 +224,7 @@ export default defineComponent({
|
||||
imgDomIndex,
|
||||
print,
|
||||
sketch,
|
||||
operationCurrent,
|
||||
loadingShow,
|
||||
setRevocation,
|
||||
t,
|
||||
@@ -295,11 +297,14 @@ export default defineComponent({
|
||||
if(designItemDetail.others.length == 0){
|
||||
this.body = true
|
||||
}
|
||||
//设置前片后片
|
||||
this.operationCurrent = Object.assign({},this.current)
|
||||
this.designOpenrtion = true
|
||||
this.clearModal()
|
||||
this.overallSingle = this.current.printObject.ifSingle?true:false
|
||||
this.ifListOver()
|
||||
if(this.current.printObject.prints)this.exhibitionOpenrtionList[this.stateOverallSingle] = JSON.parse(JSON.stringify(this.current.printObject.prints))
|
||||
let printList = JSON.parse(JSON.stringify(this.current.printObject.prints))
|
||||
this.setprintList(printList)
|
||||
if(this.$parent.exhibitionList.print)this.designOpenrtionList = JSON.parse(JSON.stringify(this.$parent.exhibitionList.print))
|
||||
if(this.$parent.elementsList)this.designList = JSON.parse(JSON.stringify(this.$parent.printsList))
|
||||
if(this.overallSingle == false && this.designOpenrtionList.length > 0){
|
||||
@@ -314,12 +319,27 @@ export default defineComponent({
|
||||
this.sketch.height = skecth.height/10+'rem'
|
||||
skecth.remove()
|
||||
}
|
||||
if(this.exhibitionOpenrtionList[this.stateOverallSingle].length > 0){
|
||||
this.exhibitionOpenrtionList[this.stateOverallSingle].forEach((item,index)=>{
|
||||
this.setTemplate(item,index)
|
||||
if(this.exhibitionOpenrtionList.overall.length > 0){
|
||||
let str = 'overall'
|
||||
this.exhibitionOpenrtionList[str].forEach((item,index)=>{
|
||||
this.setTemplate(item,index,str)
|
||||
})
|
||||
}else{
|
||||
}
|
||||
if(this.exhibitionOpenrtionList.single.length > 0){
|
||||
let str = 'single'
|
||||
this.exhibitionOpenrtionList[str].forEach((item,index)=>{
|
||||
this.setTemplate(item,index,str)
|
||||
})
|
||||
}
|
||||
},
|
||||
setprintList(arr){
|
||||
arr.forEach(item=>{
|
||||
if(item.ifSingle){
|
||||
this.exhibitionOpenrtionList.single.push(item)
|
||||
}else{
|
||||
this.exhibitionOpenrtionList.overall.push(item)
|
||||
}
|
||||
})
|
||||
},
|
||||
ifListOver(){
|
||||
if(!this.overallSingle){
|
||||
@@ -366,6 +386,7 @@ export default defineComponent({
|
||||
})
|
||||
if(!this.overallSingle){
|
||||
if(item.checked){
|
||||
this.imgDomIndex = 0
|
||||
this.deletePrint()
|
||||
item.checked = false
|
||||
return
|
||||
@@ -388,7 +409,8 @@ export default defineComponent({
|
||||
path:item.path,
|
||||
priority:1,
|
||||
scale:.3,
|
||||
location:[0,0]
|
||||
location:[0,0],
|
||||
ifSingle:false,
|
||||
}
|
||||
this.systemDesignerPercentage = item.scale?item.scale*100:30
|
||||
}else{
|
||||
@@ -402,7 +424,8 @@ export default defineComponent({
|
||||
path:item.path,
|
||||
priority:1,
|
||||
scale:1,
|
||||
location:[0,0]
|
||||
location:[0,0],
|
||||
ifSingle:true,
|
||||
})
|
||||
this.refetchTemplate(currentIndex,false)
|
||||
}
|
||||
@@ -563,26 +586,36 @@ export default defineComponent({
|
||||
let scale
|
||||
if(sketch.width<sketch.height){
|
||||
width = Math.trunc(Math.random()*(sketch?.width-sketch?.width/2))+sketch?.width/4
|
||||
if(boor){
|
||||
width = Math.trunc((sketch?.width-sketch?.width/2))+sketch?.width/4
|
||||
}
|
||||
scale = width / this.print.width.replace(/px/g,'')
|
||||
}else{
|
||||
width = Math.trunc(Math.random()*(sketch?.height-sketch?.height/2))+sketch?.height/4
|
||||
if(boor){
|
||||
width = Math.trunc((sketch?.height-sketch?.height/2))+sketch?.height/4
|
||||
}
|
||||
scale = width / this.print.height.replace(/px/g,'')
|
||||
}
|
||||
// let x = sketch.width-Number(this.print.width.replace(/px/g,''))
|
||||
// let y = sketch.height-Number(this.print.height.replace(/px/g,''))
|
||||
let x = sketch?.width - this.print.width.replace(/px/g,'')*scale
|
||||
if(!this.overallSingle){
|
||||
x = sketch?.width - this.print.width.replace(/px/g,'')*scale/2
|
||||
}
|
||||
let y = sketch?.height-this.print.height.replace(/px/g,'')*scale
|
||||
let left = sketch.offsetWidth/2-this.print.width.replace(/px/g,'')*scale/2
|
||||
let top = sketch.offsetHeight/2-this.print.height.replace(/px/g,'')*scale/2
|
||||
if(this.stateOverallSingle == 'overall'){
|
||||
left = sketch.offsetWidth/2-5
|
||||
top = sketch.offsetHeight/2-5
|
||||
}
|
||||
this.printStyleList[this.stateOverallSingle][index]={
|
||||
centers:{
|
||||
left:0,
|
||||
top:0,
|
||||
},
|
||||
style:{
|
||||
left:(boor?sketch.offsetWidth/2:Math.trunc(Math.random()*x)+1)+"px",
|
||||
top:(boor?sketch.offsetHeight/2:Math.trunc(Math.random()*y)+1)+"px",
|
||||
left:(boor?left:Math.trunc(Math.random()*x)+1)+"px",
|
||||
top:(boor?top:Math.trunc(Math.random()*y)+1)+"px",
|
||||
right:"auto",
|
||||
bottom:"auto",
|
||||
width:this.print.width.replace(/px/g,'')*scale+'px',
|
||||
@@ -598,7 +631,7 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
//设置图片
|
||||
async setTemplate(item,index) {
|
||||
async setTemplate(item,index,str) {
|
||||
await this.setPrintWH(item.path)
|
||||
this.designOpenrtionList
|
||||
let sketch = document.getElementsByClassName("designOpenrtionMobile_modal")[0]?.getElementsByClassName('designOpenrtionMobile_sketch')[0]
|
||||
@@ -614,7 +647,8 @@ export default defineComponent({
|
||||
if(sketch.offsetHeight < item.location[1]/sketchNum){
|
||||
top = sketch.offsetHeight +'px'
|
||||
}
|
||||
this.printStyleList[this.stateOverallSingle][index]={
|
||||
this.systemDesignerPercentage = item.scale?item.scale*100:30
|
||||
this.printStyleList[str][index]={
|
||||
centers:{
|
||||
left:0,
|
||||
top:0,
|
||||
@@ -635,26 +669,34 @@ export default defineComponent({
|
||||
designOpenrtionBtn:false
|
||||
}
|
||||
},
|
||||
computeZindex(){
|
||||
let arr = JSON.parse(JSON.stringify(this.printStyleList[this.stateOverallSingle]))
|
||||
arr.sort((a, b) => {
|
||||
var a_num = a["style"].zIndex;
|
||||
var b_num = b["style"].zIndex;
|
||||
computeZindex(resolve,prints){
|
||||
prints.sort((a, b) => {
|
||||
var a_num = a.priority;
|
||||
var b_num = b.priority;
|
||||
return a_num - b_num;
|
||||
});
|
||||
|
||||
|
||||
let num = 1
|
||||
arr.forEach((v)=>{
|
||||
v.style.zIndex = num++
|
||||
|
||||
prints.forEach((v)=>{
|
||||
v.priority = num++
|
||||
})
|
||||
return this.computeSize(arr)//计算单件衣服初始大小到目前大小的缩放比
|
||||
resolve(prints)
|
||||
},
|
||||
computeSize(arr){
|
||||
// let num = this.sketch/
|
||||
return new Promise(async (resolve, reject) => {
|
||||
let arr = JSON.parse(JSON.stringify(this.printStyleList[this.stateOverallSingle]))
|
||||
let sketch = document.getElementsByClassName("designOpenrtionMobile_sketch")[0]
|
||||
let sketchNum = this.sketch.width.replace(/rem/g,'')*10/sketch.offsetWidth
|
||||
let scale
|
||||
let prints = []
|
||||
prints = this.operationCurrent.printObject.prints.filter(item=>!!!item.ifSingle)
|
||||
if(this.stateOverallSingle == 'overall'){
|
||||
prints = this.operationCurrent.printObject.prints.filter(item=>!!item.ifSingle)
|
||||
}else{
|
||||
prints = this.operationCurrent.printObject.prints.filter(item=>!!!item.ifSingle)
|
||||
}
|
||||
let scale
|
||||
let location
|
||||
for (let index = 0; index < arr.length; index++) {
|
||||
if(!this.overallSingle){
|
||||
@@ -676,10 +718,11 @@ export default defineComponent({
|
||||
level2Type:this.exhibitionOpenrtionList[this.stateOverallSingle][index].level2Type,
|
||||
path:this.exhibitionOpenrtionList[this.stateOverallSingle][index].path,
|
||||
minIOPath:this.exhibitionOpenrtionList[this.stateOverallSingle][index].minIOPath,
|
||||
ifSingle:!!this.exhibitionOpenrtionList[this.stateOverallSingle][index].ifSingle,
|
||||
}
|
||||
prints.push(obj)
|
||||
}
|
||||
resolve(prints)
|
||||
this.computeZindex(resolve,prints)
|
||||
})
|
||||
},
|
||||
async setPreview(){
|
||||
@@ -699,7 +742,7 @@ export default defineComponent({
|
||||
// timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||
// }
|
||||
let data = this.store.state.DesignDetailModule.designPreviewData
|
||||
await this.computeZindex().then((rv)=>{
|
||||
await this.computeSize().then((rv)=>{
|
||||
this.setOkData = rv
|
||||
})
|
||||
data.designSingleItemDTOList[index].printObject={
|
||||
@@ -710,6 +753,7 @@ export default defineComponent({
|
||||
this.loadingShow = true
|
||||
Https.axiosPost(Https.httpUrls.designSingle, data).then(
|
||||
(rv) => {
|
||||
this.operationCurrent = Object.assign({},rv.clothes[index])
|
||||
// designItemDetail.clothes[index].printObject.path = rv.clothes[0].printObject.path
|
||||
this.currentFullBodyView = rv.currentFullBodyView
|
||||
this.designItemDetailTS.rv = rv
|
||||
|
||||
@@ -207,7 +207,6 @@ export default defineComponent({
|
||||
var pointer = canvas.getPointer(event.e);
|
||||
if(canvas.isDrawingMode){
|
||||
canvas.setCursor('none');
|
||||
console.log(12,canvas.contains(brushIndicator));
|
||||
if(!canvas.contains(brushIndicator)){
|
||||
canvas.add(brushIndicator)
|
||||
brushIndicator.set({// left:0,
|
||||
|
||||
Reference in New Issue
Block a user