更新用户指引

This commit is contained in:
X1627315083
2023-12-12 11:53:02 +08:00
parent ee56d95086
commit 64deaa0805
5 changed files with 192 additions and 106 deletions

View File

@@ -171,6 +171,7 @@ export default defineComponent({
this.sketchImg.id_ = v.id
this.sketchImg.path = v.url
this.sketchImg.minIOPath = v.minIOPath
this.sketchImg.type = v.level2Type
},
//印花
systemDesigner(num) {
@@ -235,65 +236,80 @@ 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
designItemDetail.clothes.forEach((v,ind)=>{
if(v.id == this.current.id){
index = ind
bor = true
}
})
if(this.type_ == 1){
console.log(this.current);
if(this.type_ == 1 && bor){
if(data.designSingleItemDTOList[index].path != this.sketchImg.minIOPath && this.sketchImg.id_){
data.designSingleItemDTOList[index].offset = [0,0]
data.designSingleItemDTOList[index].scale = 1
}
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].printObject.prints = []
// this.current?.printObject?.path == null ? [] : [{
// location:[0,0],
// angle:0,
// priority:1,
// path:this.current?.printObject?.path?this.current.printObject.path :'',
// minIOPath:this.current?.printObject?.minIOPath?this.current.printObject.minIOPath :'',
// }],
// data.designSingleItemDTOList[index].printObject.ifSingle = false
}else if(this.type_ == 2){
data.designSingleItemDTOList[index].type =this.sketchImg.type? this.sketchImg.type: this.current.type
}else if(this.type_ == 2 && bor){
data.designSingleItemDTOList[index].printObject.ifSingle = false
data.designSingleItemDTOList[index].printObject.prints = []
}else if(this.type_ == 3){
}else if(this.type_ == 3 && bor){
let color = `${this.$parent.selectColor.rgba.r} ${this.$parent.selectColor.rgba.g} ${this.$parent.selectColor.rgba.b}`
// if(this.$parent.selectColor.rgba.r == undefined){
// return
// }
// console.log(this.$parent.selectColor.rgba);
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)
}
// 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,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.currentFullBodyView = rv.currentFullBodyView
designItemDetail.clothes[index].color = rv.clothes[index].color
designItemDetail.clothes[index].printObject = rv.clothes[index].printObject
designItemDetail.clothes[index].layersObject = rv.clothes[index].layersObject
designItemDetail.clothes[index].minIOPath = rv.clothes[index].minIOPath
designItemDetail.clothes[index].path = rv.clothes[index].path
designItemDetail.ifSubmit = true
// rv.clothes[0].layersObject.forEach((v)=>{
// designItemDetail.clothes[index].layersObject[0].imageUrl = rv.clothes[0].layersObject[0].imageUrl
// designItemDetail.clothes[index].layersObject[0].maskUrl = rv.clothes[0].layersObject[0].maskUrl
// designItemDetail.clothes[index].layersObject[1].imageUrl = rv.clothes[0].layersObject[1].imageUrl
// designItemDetail.clothes[index].layersObject[1].maskUrl = rv.clothes[0].layersObject[1].maskUrl
// })
designItemDetail.clothes.forEach((item,index)=>{
let a
// console.log(this.store.state.DesignDetailModule.designItemDetail.clothes[index].layersObject[0].id);
if(item.layersObject[0].imageCategory.indexOf("back") == -1){
a = item.layersObject[0]
item.layersObject[0] = item.layersObject[1]
item.layersObject[1] = a
}
item.layersObject[0].id = this.store.state.DesignDetailModule.designItemDetail.clothes[index].layersObject[0].id
item.layersObject[1].id = this.store.state.DesignDetailModule.designItemDetail.clothes[index].layersObject[1].id
item.layersObject[0].id = designItemDetail.clothes[index].layersObject[0].id
item.layersObject[1].id = designItemDetail.clothes[index].layersObject[1].id
})
this.loadingShow = false
this.store.commit("setDesignItemDetail", designItemDetail);