修复移动端bug

This commit is contained in:
X1627315083
2024-08-12 17:14:59 +08:00
parent ec24805e99
commit 3eb8754e0c
2 changed files with 65 additions and 6 deletions

View File

@@ -98,7 +98,7 @@
<img crossOrigin="anonymous" :src="item?.path" :style="{transform:`rotateZ(${printStyleList[index]?.transform?.rotateZ}deg)`}" class="designOpenrtionMobile_imgItme" draggable="false">
</div>
</div>
<img :src="operationCurrent?.undividedLayer?operationCurrent.undividedLayer:operationCurrent.path" alt="" class="designOpenrtion_sketch">
<img :src="operationCurrent?.undividedLayer?operationCurrent.undividedLayer:operationCurrent.path" alt="" class="designOpenrtionMobile_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>
@@ -309,7 +309,7 @@ export default defineComponent({
if(this.$parent.elementsList)this.designList = JSON.parse(JSON.stringify(this.$parent.printsList))
if(this.overallSingle == false && this.designOpenrtionList.length > 0){
this.designOpenrtionList[0].checked = true
}else{
}else if(this.overallSingle == false && this.designOpenrtionList.length == 0){
this.setpitch(this.designList[0],0)
}
let skecth = new Image
@@ -319,13 +319,16 @@ export default defineComponent({
this.sketch.height = skecth.height/10+'rem'
skecth.remove()
}
if(this.exhibitionOpenrtionList.overall.length > 0){
if(this.exhibitionOpenrtionList.overall.length > 0 && !this.overallSingle){
let str = 'overall'
this.exhibitionOpenrtionList[str].forEach((item,index)=>{
this.setTemplate(item,index,str)
})
}else if(!this.overallSingle){
let str = 'overall'
this.setOverallPosition(0,str)
}
if(this.exhibitionOpenrtionList.single.length > 0){
if(this.exhibitionOpenrtionList.single.length > 0 && this.overallSingle){
let str = 'single'
this.exhibitionOpenrtionList[str].forEach((item,index)=>{
this.setTemplate(item,index,str)
@@ -668,7 +671,34 @@ export default defineComponent({
},
designOpenrtionBtn:false
}
},
setOverallPosition(index,str){
nextTick(()=>{
let sketch = document.getElementsByClassName("designOpenrtionMobile_modal")[0]?.getElementsByClassName('designOpenrtionMobile_sketch')[0]
this.printStyleList[str][index]={
centers:{
left:0,
top:0,
},
style:{
left:sketch.offsetWidth / 2 +'px',
top:sketch.offsetHeight / 2 +'px',
right:"auto",
bottom:"auto",
width:'auto',
height:'auto',
zIndex:1
},
transform:{
// scale:scale<.2?.2:scale,//0.2-3
rotateZ:0,
},
designOpenrtionBtn:false
}
})
},
computeZindex(resolve,prints){
prints.sort((a, b) => {
var a_num = a.priority;