新增 删除 衣服
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user