This commit is contained in:
X1627315083
2023-12-11 14:30:16 +08:00
parent d851f5e87c
commit 3a4d122af0
6 changed files with 110 additions and 27 deletions

View File

@@ -32,7 +32,7 @@
<div v-for="item,index in designItemDetail?.clothes" :class="{active:item.clothesOpen}" @click="clothesOpen(index)"> <div v-for="item,index in designItemDetail?.clothes" :class="{active:item.clothesOpen}" @click="clothesOpen(index)">
<img :src="item?.path" alt=""> <img :src="item?.path" alt="">
</div> </div>
<div> <div class="detail_modal_body_Set" @click="setClothesOpen()">
+ +
</div> </div>
</div> </div>
@@ -197,6 +197,8 @@ export default defineComponent({
let moible:any = isMoible() let moible:any = isMoible()
provide('moible',moible) provide('moible',moible)
let {t} = useI18n() let {t} = useI18n()
//创建单件衣服
let setClothes:any = ref()
return{ return{
designItemDetail, designItemDetail,
store, store,
@@ -217,6 +219,7 @@ export default defineComponent({
driver__, driver__,
moible, moible,
t, t,
setClothes,
} }
}, },
data(){ data(){
@@ -442,8 +445,6 @@ export default defineComponent({
})() })()
} }
// console.log(this.frontBack);
this.frontBack = { this.frontBack = {
front:front, front:front,
back:back, back:back,
@@ -602,11 +603,14 @@ export default defineComponent({
//按比设置单件衣服宽高位置 //按比设置单件衣服宽高位置
async setPostition(url:any){ async setPostition(url:any){
let img:any = await loadImage(url) let img:any = await loadImage(url)
let modal_body = <HTMLImageElement>document.getElementsByClassName('detail_modal_model')[0] let modal_body:any
await nextTick().then(()=>{
modal_body = document.getElementsByClassName('detail_modal_model')[0]
})
console.log(modal_body);
const num = modal_body?.offsetWidth / img.width; const num = modal_body?.offsetWidth / img.width;
function loadImage(url:any) { function loadImage(url:any) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const img = new Image(); const img = new Image();
img.onload = () => { img.onload = () => {
resolve(img) resolve(img)
@@ -674,7 +678,7 @@ export default defineComponent({
}, },
clothesOpen(index:any){ clothesOpen(index:any){
this.clothesDetail('',index) this.clothesDetail('',index)
this.clothesOpenActive(index)
}, },
clothesOpenActive(index:any){ clothesOpenActive(index:any){
this.designItemDetail.clothes.forEach((item:any)=>{ this.designItemDetail.clothes.forEach((item:any)=>{
@@ -682,13 +686,47 @@ export default defineComponent({
}) })
this.designItemDetail.clothes[index].clothesOpen = true this.designItemDetail.clothes[index].clothesOpen = true
}, },
setClothesOpen(){
this.designItemDetail.clothes.forEach((item:any)=>{
item.clothesOpen = false
})
// console.log(designItemDetail);
// this.current = {
// "id": '',
// "type": "Bottoms",
// "level1Type": null,
// "path": "",
// "minIOPath": "",
// "color": {
// "id": 1921,
// "name": "",
// "tcx": "#FFFFFF",
// "r": 255,
// "g": 255,
// "b": 255,
// "h": '',
// "s": '',
// "v": ''
// },
// "printObject": {
// "ifSingle": null,
// "prints": [
// {}
// ]
// },
// "layersObject": [
// ]
// }
// this.currentIndex = 3
},
//元素替换 //元素替换
clothesDetail(clothes:any, index:number){ clothesDetail(clothes:any, index:number){
let designItemDetail = JSON.parse(JSON.stringify(this.store.state.DesignDetailModule.designItemDetail)) let designItemDetail = JSON.parse(JSON.stringify(this.store.state.DesignDetailModule.designItemDetail))
this.currentIndex = index this.currentIndex = index
this.designOrder = true this.designOrder = true
this.current = designItemDetail.clothes[this.currentIndex] this.current = designItemDetail.clothes[this.currentIndex]
this.clothesOpenActive(index) console.log(this.current);
let data:any = this.setSubmitItem('preview') let data:any = this.setSubmitItem('preview')
data.designSingleItemDTOList[this.currentIndex] = { data.designSingleItemDTOList[this.currentIndex] = {
color:`${this.current.color.r} ${this.current.color.g} ${this.current.color.b}`, color:`${this.current.color.r} ${this.current.color.g} ${this.current.color.b}`,
@@ -837,6 +875,12 @@ export default defineComponent({
// max-width: 245px; // max-width: 245px;
width: 100%; width: 100%;
height: 100%; height: 100%;
.detail_modal_body_Set{
display: flex;
align-items: center;
justify-content: center;
font-size: 3.4rem;
}
.detail_modal_body_nav{ .detail_modal_body_nav{
display: flex; display: flex;
position: absolute; position: absolute;

View File

@@ -355,7 +355,7 @@ export default defineComponent({
async getSex(){ async getSex(){
await Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:'Sex'}}).then((rv: any) => { await Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:'Sex'}}).then((rv: any) => {
if (rv) { if (rv) {
this.store.commit("setWorkspaceSex", rv);
this.sex = rv this.sex = rv
} }
}) })
@@ -370,6 +370,7 @@ export default defineComponent({
await Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:params}}).then((rv: any) => { await Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:params}}).then((rv: any) => {
if (rv) { if (rv) {
this.singleTypeList = rv this.singleTypeList = rv
this.store.commit("setWorkspacePosition", rv);
if(str == 'sex'){ if(str == 'sex'){
this.workspaceItem.position = this.singleTypeList[0].name this.workspaceItem.position = this.singleTypeList[0].name
this.workspaceItem.positionEnum = this.singleTypeList[0] this.workspaceItem.positionEnum = this.singleTypeList[0]

View File

@@ -281,13 +281,14 @@ export default defineComponent({
let generateCheckbox:any = ref() let generateCheckbox:any = ref()
let loadingShow = ref(false) let loadingShow = ref(false)
let sketchCatecoryList:any = ref({}) let sketchCatecoryList:any = computed(()=>{
return store.state.Workspace.workspacePosition
})
let workspace:any = ref({}) let workspace:any = ref({})
let inputShow = ref(false) let inputShow = ref(false)
let inputTime = ref() let inputTime = ref()
let sketchboardList:any = computed(()=>{ let sketchboardList:any = computed(()=>{
return store.state.UploadFilesModule.sketchboard return store.state.UploadFilesModule.sketchboard
}) })
let {t} = useI18n() let {t} = useI18n()
let driver__:any = inject('driver__') let driver__:any = inject('driver__')
@@ -321,6 +322,7 @@ export default defineComponent({
upload: { upload: {
isPin: 0, isPin: 0,
level1Type: "Sketchboard", level1Type: "Sketchboard",
gender:'',
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone, timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
}, },
token: "", token: "",
@@ -375,7 +377,10 @@ export default defineComponent({
watch:{ watch:{
workspaceCom(newVal,oldVal){ workspaceCom(newVal,oldVal){
this.workspace = newVal this.workspace = newVal
this.getPosition() this.upload.gender = newVal.sexEnum.name
console.log(this.workspace);
// this.getPosition()
}, },
sketchboardList:{ sketchboardList:{
handler(newVal:any,oldVal:any){ handler(newVal:any,oldVal:any){
@@ -427,20 +432,6 @@ export default defineComponent({
}) })
} }
}, },
getPosition(){
let params
if(this.workspace?.sexEnum?.name == 'Female'){
params = 'FemalePosition'
}else{
params = 'MalePosition'
}
Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:params}}).then((rv: any) => {
if (rv) {
this.sketchCatecoryList = rv
}
})
},
getgenerateCheckbox(value:any){ getgenerateCheckbox(value:any){
this.generateCheckbox = value this.generateCheckbox = value
}, },
@@ -451,6 +442,7 @@ export default defineComponent({
file.imgUrl = res.data.url; file.imgUrl = res.data.url;
file.resData = res.data; file.resData = res.data;
// file.pin = false; // file.pin = false;
//category用来数据处理
file.categoryValue = this.sketchCatecoryList?.[0]?.value; file.categoryValue = this.sketchCatecoryList?.[0]?.value;
file.category = this.sketchCatecoryList?.[0]?.name; file.category = this.sketchCatecoryList?.[0]?.name;
file.categoryShow = false; file.categoryShow = false;

View File

@@ -88,10 +88,14 @@ export default defineComponent({
let driver__:any = computed(()=>{ let driver__:any = computed(()=>{
return store.state.Guide.guide return store.state.Guide.guide
}) })
let workspace:any = computed(()=>{
return store.state.Workspace.workspace
})
provide('driver__',driver__) provide('driver__',driver__)
let isShowMark = ref(false) let isShowMark = ref(false)
return { return {
driver__, driver__,
workspace,
t, t,
isShowMark, isShowMark,
} }
@@ -171,7 +175,37 @@ export default defineComponent({
} }
}); });
}, },
isPin(list:any){
this.workspace
let numTop = 0
let numBottom = 0
let top:any
let bottom:any
if(this.workspace.sexEnum.name == "Female"){
top = ['Outwear','Blouse']
bottom = ['Dress','Trousers','Skirt']
}else{
top = ['Outwear','Tops']
bottom = ['Bottoms']
}
console.log(this.workspace);
list.forEach((item:any,index:number) => {
console.log(item);
top.forEach((positionItem:any) => {
if(item.category == positionItem && item.pin){
numTop++
}else{
numBottom++
}
});
});
if(numTop >= 8 || numBottom >= 8){
// message.warning(this.t('SketchboardUpload.jsContent1'));
return
}
},
//完成 //完成
finishCollection(){ finishCollection(){
this.isShowMark = true this.isShowMark = true
@@ -187,6 +221,8 @@ export default defineComponent({
arr.push(obj) arr.push(obj)
}); });
let data = {sketchBoards:arr} let data = {sketchBoards:arr}
// console.log(this.position);
this.isPin(sketchList)
let elList = document.querySelectorAll('.img_block_item_sketch img') let elList = document.querySelectorAll('.img_block_item_sketch img')
Https.axiosPost(Https.httpUrls.sketchBoardsBoundingBox, data) Https.axiosPost(Https.httpUrls.sketchBoardsBoundingBox, data)
.then((rv: any) => { .then((rv: any) => {

View File

@@ -272,6 +272,7 @@ export default {
jsContent1:"Since you have selected multiple images, please click 'Layout' to proceed.", jsContent1:"Since you have selected multiple images, please click 'Layout' to proceed.",
jsContent2:'The uploaded files will not be saved, being sure to continue? ', jsContent2:'The uploaded files will not be saved, being sure to continue? ',
jsContent3:'You must choose one or more colors for further process.', jsContent3:'You must choose one or more colors for further process.',
jsContent4:'You must choose one or more colors for further process.',
}, },
DesignDetail:{ DesignDetail:{
Details:'Details', Details:'Details',

View File

@@ -3,18 +3,27 @@ import {RootState} from '../index'
interface DesignDetail{ interface DesignDetail{
workspace:any, workspace:any,
workspaceSex:any,
workspacePosition:any,
} }
const Workspace : Module<DesignDetail,RootState> = { const Workspace : Module<DesignDetail,RootState> = {
state:{ state:{
workspace:{} workspace:{},
workspaceSex:{},
workspacePosition:{},
}, },
mutations:{ mutations:{
setWorkspace(state,files){ setWorkspace(state,files){
state.workspace = files state.workspace = files
}, },
setWorkspaceSex(state,files){
state.workspaceSex = files
},
setWorkspacePosition(state,files){
state.workspacePosition = files
},
}, },
actions:{ actions:{