fix
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
NODE_ENV = 'production'
|
NODE_ENV = 'production'
|
||||||
# VUE_APP_BASE_URL = 'https://aida.com.hk/test'
|
# VUE_APP_BASE_URL = 'https://aida.com.hk/test'
|
||||||
# VUE_APP_BASE_URL = 'http://18.167.251.121:10088'
|
# VUE_APP_BASE_URL = 'http://18.167.251.121:10088'
|
||||||
VUE_APP_BASE_URL = 'https://api.aida.com.hk'
|
# VUE_APP_BASE_URL = 'https://api.aida.com.hk'
|
||||||
|
VUE_APP_BASE_URL = 'https://develop.api.aida.com.hk'
|
||||||
|
|
||||||
|
|||||||
@@ -453,15 +453,12 @@ export default defineComponent({
|
|||||||
let frontIndex = 6
|
let frontIndex = 6
|
||||||
let backIndex = 3
|
let backIndex = 3
|
||||||
designItemDetail.clothes.forEach((v:any,index:any)=>{
|
designItemDetail.clothes.forEach((v:any,index:any)=>{
|
||||||
console.log(v);
|
|
||||||
|
|
||||||
for (let i = v.layersObject.length-1; i >= 0; i--) {
|
for (let i = v.layersObject.length-1; i >= 0; i--) {
|
||||||
v.layersObject[i].style = {
|
v.layersObject[i].style = {
|
||||||
top:v.layersObject[i].position?.[0]*ratio+'px',
|
top:v.layersObject[i].position?.[0]*ratio+'px',
|
||||||
left:v.layersObject[i].position?.[1]*ratio+'px',
|
left:v.layersObject[i].position?.[1]*ratio+'px',
|
||||||
width:v.layersObject[i].imageSize?.[0]*ratio+'px',
|
width:v.layersObject[i].imageSize?.[0]*ratio+'px',
|
||||||
height:v.layersObject[i].imageSize?.[1]*ratio+'px',
|
height:v.layersObject[i].imageSize?.[1]*ratio+'px',
|
||||||
// zIndex:zIndex-=1
|
|
||||||
}
|
}
|
||||||
v.layersObject[i].centers={
|
v.layersObject[i].centers={
|
||||||
left:0,
|
left:0,
|
||||||
|
|||||||
@@ -237,7 +237,26 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
hasDuplicateId(arr) {
|
||||||
|
const set = new Set();
|
||||||
|
for (let i = 0; i < arr.length; i++) {
|
||||||
|
const id = arr[i].id;
|
||||||
|
if (set.has(id)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
set.add(id);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
soleId(arr,index){
|
||||||
|
let randomNum = Math.floor(100 + Math.random() * 900);
|
||||||
|
arr[index].id = this.sketchImg.id_? Number(this.sketchImg.id_+(randomNum+"")):this.current.id_
|
||||||
|
if(this.hasDuplicateId(arr)){
|
||||||
|
this.soleId(arr,index)
|
||||||
|
}else{
|
||||||
|
return arr
|
||||||
|
}
|
||||||
|
},
|
||||||
//提交
|
//提交
|
||||||
setPreview(){
|
setPreview(){
|
||||||
let designItemDetail = JSON.parse(JSON.stringify(this.store.state.DesignDetailModule.designItemDetail))
|
let designItemDetail = JSON.parse(JSON.stringify(this.store.state.DesignDetailModule.designItemDetail))
|
||||||
@@ -265,7 +284,8 @@ export default defineComponent({
|
|||||||
data.designSingleItemDTOList[index].offset = [0,0]
|
data.designSingleItemDTOList[index].offset = [0,0]
|
||||||
data.designSingleItemDTOList[index].scale = 1
|
data.designSingleItemDTOList[index].scale = 1
|
||||||
}
|
}
|
||||||
data.designSingleItemDTOList[index].id = this.sketchImg.id_? this.sketchImg.id_:this.current.id_
|
data.designSingleItemDTOList = this.soleId(data.designSingleItemDTOList,index)
|
||||||
|
this.sketchImg.id_ = data.designSingleItemDTOList[index].id
|
||||||
data.designSingleItemDTOList[index].path =this.sketchImg.minIOPath? this.sketchImg.minIOPath: this.current.minIOPath
|
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
|
data.designSingleItemDTOList[index].type =this.sketchImg.type? this.sketchImg.type: this.current.type
|
||||||
}else if(this.type_ == 2){
|
}else if(this.type_ == 2){
|
||||||
|
|||||||
@@ -424,24 +424,34 @@ export default defineComponent({
|
|||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
// })
|
// })
|
||||||
console.log();
|
|
||||||
this.$parent.loadingShow = false
|
this.$parent.loadingShow = false
|
||||||
let designItemDetail = JSON.parse(JSON.stringify(this.store.state.DesignDetailModule.designItemDetail))
|
let designItemDetail = JSON.parse(JSON.stringify(this.store.state.DesignDetailModule.designItemDetail))
|
||||||
designItemDetail.clothes.forEach((i)=>{
|
rv.clothes.forEach((i)=>{
|
||||||
item.similarity = false//新增衣服传的是衣服id会存在两件衣服id相同所以设置为false让每次赋值都是不一样的
|
i.similarity = false//新增衣服传的是衣服id会存在两件衣服id相同所以设置为false让每次赋值都是不一样的
|
||||||
})
|
})
|
||||||
designItemDetail.designItemUrl = rv.designItemUrl
|
designItemDetail.designItemUrl = rv.designItemUrl
|
||||||
designItemDetail.ifSubmit = true
|
designItemDetail.ifSubmit = true
|
||||||
designItemDetail.currentFullBodyView = rv.currentFullBodyView
|
designItemDetail.currentFullBodyView = rv.currentFullBodyView
|
||||||
rv.clothes.forEach((item)=>{
|
designItemDetail.clothes.forEach((item)=>{
|
||||||
for (let index = 0; index < designItemDetail.clothes.length; index++) {
|
for (let index = 0; index < rv.clothes.length; index++) {
|
||||||
if(item.id === designItemDetail.clothes[index].id && !designItemDetail.clothes[index].similarity){
|
if(rv.clothes[index].id === item.id && !rv.clothes[index].similarity){
|
||||||
designItemDetail.clothes[index].layersObject = item.layersObject
|
item.layersObject = rv.clothes[index].layersObject
|
||||||
designItemDetail.clothes[index].priority = item.layersObject[0].priority
|
item.priority = rv.clothes[index].layersObject[0].priority
|
||||||
|
rv.clothes[index].similarity = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// rv.clothes.forEach((item)=>{
|
||||||
|
// for (let index = 0; index < designItemDetail.clothes.length; index++) {
|
||||||
|
// if(item.id === designItemDetail.clothes[index].id && !designItemDetail.clothes[index].similarity){
|
||||||
|
// designItemDetail.clothes[index].layersObject = item.layersObject
|
||||||
|
// designItemDetail.clothes[index].priority = item.layersObject[0].priority
|
||||||
|
// break
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
this.$emit('setDesignCoverage');
|
this.$emit('setDesignCoverage');
|
||||||
this.store.commit("setDesignItemDetail", designItemDetail);
|
this.store.commit("setDesignItemDetail", designItemDetail);
|
||||||
this.setRevocation(designItemDetail,data)
|
this.setRevocation(designItemDetail,data)
|
||||||
|
|||||||
@@ -100,8 +100,16 @@ export default defineComponent({
|
|||||||
// this.sketchList = []
|
// this.sketchList = []
|
||||||
// this.sketch = [[],[],[]]
|
// this.sketch = [[],[],[]]
|
||||||
// this.sketchList = this.allBoardData.sketchboardFiles
|
// this.sketchList = this.allBoardData.sketchboardFiles
|
||||||
if(oldVal){
|
console.log(oldVal,newVal);
|
||||||
if(JSON.stringify(newVal)!=JSON.stringify(oldVal)){
|
|
||||||
|
if(oldVal && oldVal?.length != 0){
|
||||||
|
let oldArr:any = []
|
||||||
|
let newArr:any = []
|
||||||
|
oldVal.forEach((item:any,index:any) => {
|
||||||
|
oldArr.push(item.id?item.id:item.sketchBoardId)
|
||||||
|
newArr.push(newVal[index].id?newVal[index].id:newVal[index].sketchBoardIdd)
|
||||||
|
});
|
||||||
|
if(JSON.stringify(newArr)!=JSON.stringify(oldArr)){
|
||||||
this.setSketch()
|
this.setSketch()
|
||||||
this.imgOpen = true
|
this.imgOpen = true
|
||||||
}
|
}
|
||||||
@@ -121,6 +129,8 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setSketch(){
|
setSketch(){
|
||||||
|
console.log(123123);
|
||||||
|
|
||||||
if(!this.imgOpen){
|
if(!this.imgOpen){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -145,22 +155,26 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
// console.log(arr);
|
// console.log(arr);
|
||||||
this.sketch[arr[0].num]?.push(this.sketchList[i])
|
this.sketch[arr[0].num]?.push(this.sketchList[i])
|
||||||
|
let dom = document.getElementsByClassName('collection_review')[0]?.getElementsByClassName('lager_img_item'+arr[0].num)[0]
|
||||||
|
let img = dom.querySelector('.element:last-child')
|
||||||
|
console.log(img);
|
||||||
|
|
||||||
// console.log([sketch1.height,sketch2.height,sketch3.height]);
|
// console.log([sketch1.height,sketch2.height,sketch3.height]);
|
||||||
await new Promise((resolve:any)=>{
|
await new Promise((resolve:any)=>{
|
||||||
|
|
||||||
image.onload = ()=>{
|
image.onload = ()=>{
|
||||||
nextTick().then(()=>{
|
|
||||||
sketch1 = document.getElementsByClassName('collection_review')[0]?.getElementsByClassName('lager_img_item0')[0]?.getBoundingClientRect()
|
sketch1 = document.getElementsByClassName('collection_review')[0]?.getElementsByClassName('lager_img_item0')[0]?.getBoundingClientRect()
|
||||||
sketch2 = document.getElementsByClassName('collection_review')[0]?.getElementsByClassName('lager_img_item1')[0]?.getBoundingClientRect()
|
sketch2 = document.getElementsByClassName('collection_review')[0]?.getElementsByClassName('lager_img_item1')[0]?.getBoundingClientRect()
|
||||||
sketch3 = document.getElementsByClassName('collection_review')[0]?.getElementsByClassName('lager_img_item2')[0]?.getBoundingClientRect()
|
sketch3 = document.getElementsByClassName('collection_review')[0]?.getElementsByClassName('lager_img_item2')[0]?.getBoundingClientRect()
|
||||||
|
|
||||||
sketch1.num = 0
|
sketch1.num = 0
|
||||||
sketch2.num = 1
|
sketch2.num = 1
|
||||||
sketch3.num = 2
|
sketch3.num = 2
|
||||||
})
|
nextTick().then(()=>{
|
||||||
setTimeout(()=>{
|
|
||||||
resolve()
|
resolve()
|
||||||
},200)
|
|
||||||
|
setTimeout(()=>{
|
||||||
|
},500)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user