diff --git a/components.d.ts b/components.d.ts index b52c3e62..b2d38451 100644 --- a/components.d.ts +++ b/components.d.ts @@ -9,29 +9,18 @@ export {} declare module 'vue' { export interface GlobalComponents { ABadge: typeof import('ant-design-vue/es')['Badge'] - ABreadcrumb: typeof import('ant-design-vue/es')['Breadcrumb'] ACheckbox: typeof import('ant-design-vue/es')['Checkbox'] - AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider'] - ADatePicker: typeof import('ant-design-vue/es')['DatePicker'] ADrawer: typeof import('ant-design-vue/es')['Drawer'] - ADropdown: typeof import('ant-design-vue/es')['Dropdown'] - AImage: typeof import('ant-design-vue/es')['Image'] AInputNumber: typeof import('ant-design-vue/es')['InputNumber'] - AMenu: typeof import('ant-design-vue/es')['Menu'] - AMenuItem: typeof import('ant-design-vue/es')['MenuItem'] AModal: typeof import('ant-design-vue/es')['Modal'] APopover: typeof import('ant-design-vue/es')['Popover'] ARangePicker: typeof import('ant-design-vue/es')['RangePicker'] ASelect: typeof import('ant-design-vue/es')['Select'] ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] ASlider: typeof import('ant-design-vue/es')['Slider'] - ASpace: typeof import('ant-design-vue/es')['Space'] ASpin: typeof import('ant-design-vue/es')['Spin'] - ASubMenu: typeof import('ant-design-vue/es')['SubMenu'] ASwitch: typeof import('ant-design-vue/es')['Switch'] ATable: typeof import('ant-design-vue/es')['Table'] - ATabPane: typeof import('ant-design-vue/es')['TabPane'] - ATabs: typeof import('ant-design-vue/es')['Tabs'] AUpload: typeof import('ant-design-vue/es')['Upload'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] diff --git a/src/component/Account/frontPage/bindPage.vue b/src/component/Account/frontPage/bindPage.vue index 61e81949..7ec33f51 100644 --- a/src/component/Account/frontPage/bindPage.vue +++ b/src/component/Account/frontPage/bindPage.vue @@ -28,7 +28,7 @@ -->
- +
@@ -276,7 +276,7 @@ export default defineComponent({ > .gallery_btn{ position: relative; z-index: 2; - pointer-events: none; + } #g_id_bind{ position: absolute; diff --git a/src/component/Canvas/CanvasEditor/index.vue b/src/component/Canvas/CanvasEditor/index.vue index 6cee3221..0937e2d1 100644 --- a/src/component/Canvas/CanvasEditor/index.vue +++ b/src/component/Canvas/CanvasEditor/index.vue @@ -468,7 +468,6 @@ onMounted(async () => { // 使用window的resize事件代替ResizeObserver // 只有当窗口大小变化时才更新画布尺寸 // window.addEventListener("resize", handleWindowResize); - if(props.config.initZoom) { const width = canvasManager.width; const height = canvasManager.height; @@ -547,6 +546,10 @@ function setZoom(zoom) { if (!canvasManager) return; const newZoom = Math.max(zoom, 0.1); // 最小0.1倍 +function setZoom(zoom) { + setTimeout(()=>{ + if (!canvasManager) return; + const newZoom = Math.max(zoom, 0.1); // 减少10%,最小0.1倍 // 使用画布中心作为缩放点 const centerPoint = { x: canvasManager.canvas.width / 2, @@ -556,6 +559,7 @@ function setZoom(zoom) { canvasManager.animateZoom(centerPoint, newZoom); }) } + function zoomIn() { if (!canvasManager) return; diff --git a/src/component/Canvas/CanvasEditor/managers/CanvasManager.js b/src/component/Canvas/CanvasEditor/managers/CanvasManager.js index 0070d03a..a0abed05 100644 --- a/src/component/Canvas/CanvasEditor/managers/CanvasManager.js +++ b/src/component/Canvas/CanvasEditor/managers/CanvasManager.js @@ -811,7 +811,7 @@ export class CanvasManager { * @param {Array} options.layerIdArray 导出多个图层ID数组 * @param {String} options.expPicType 导出图片类型 (png/jpg/svg) * @param {Boolean} options.restoreOpacityInRedGreen 红绿图模式下是否恢复透明度为1 - * @param {Boolean} options.isEnhanceImg 是否是增强图片 + * @param {Boolean} options.isEnhanceImg 是否是增强图片 * @returns {String} 导出的图片数据URL */ async exportImage(options = {}) { diff --git a/src/component/Canvas/CanvasEditor/managers/ExportManager.js b/src/component/Canvas/CanvasEditor/managers/ExportManager.js index d9107e26..14bca2bd 100644 --- a/src/component/Canvas/CanvasEditor/managers/ExportManager.js +++ b/src/component/Canvas/CanvasEditor/managers/ExportManager.js @@ -18,12 +18,12 @@ export class ExportManager { * @param {Object} options 导出选项 * @param {Boolean} options.isContainBg 是否包含背景图层 * @param {Boolean} options.isContainFixed 是否包含固定图层 - * @param {Boolean} options.isCropByBg 是否使用背景大小裁剪 + * @param {Boolean} options.isCropByBg 是否使用背景大小裁剪 * @param {String} options.layerId 导出具体图层ID * @param {Array} options.layerIdArray 导出多个图层ID数组 * @param {String} options.expPicType 导出图片类型 (png/jpg/svg) * @param {Boolean} options.restoreOpacityInRedGreen 红绿图模式下是否恢复透明度为1 - * @param {Boolean} options.isEnhanceImg 是否是增强图片 + * @param {Boolean} options.isEnhanceImg 是否是增强图片 * @returns {String} 导出的图片数据URL */ exportImage(options = {}) { @@ -48,7 +48,7 @@ export class ExportManager { isRedGreenMode, restoreOpacityInRedGreen, isCropByBg, - isEnhanceImg, + isEnhanceImg, // 是否是增强图片 ); } @@ -62,7 +62,7 @@ export class ExportManager { isRedGreenMode, restoreOpacityInRedGreen, isCropByBg, - isEnhanceImg + isEnhanceImg, // 是否是增强图片 ); } @@ -74,7 +74,7 @@ export class ExportManager { isRedGreenMode, restoreOpacityInRedGreen, isCropByBg, - isEnhanceImg + isEnhanceImg, // 是否是增强图片 ); } catch (error) { console.error("导出图片失败:", error); @@ -98,7 +98,7 @@ export class ExportManager { expPicType, isRedGreenMode, restoreOpacityInRedGreen, - isCropByBg, + isCropByBg, // 是否使用背景大小裁剪 isEnhanceImg, // 是否是增强图片 ) { if (!this.layerManager) { @@ -127,7 +127,9 @@ export class ExportManager { return this._exportWithRedGreenMode( objectsToExport, expPicType, - restoreOpacityInRedGreen + restoreOpacityInRedGreen, + isCropByBg, // 是否使用背景大小裁剪 + isEnhanceImg, // 是否是增强图片 ); } @@ -149,7 +151,7 @@ export class ExportManager { * @param {Boolean} isContainFixed 是否包含固定图层 * @param {Boolean} isRedGreenMode 是否为红绿图模式 * @param {Boolean} restoreOpacityInRedGreen 红绿图模式下是否恢复透明度为1 - * @param {Boolean} isCropByBg 是否根据背景裁剪 + * @param {Boolean} isCropByBg 是否使用背景大小裁剪 * @param {Boolean} isEnhanceImg 是否是增强图片 * @returns {String} 图片数据URL * @private @@ -161,7 +163,7 @@ export class ExportManager { isContainFixed, isRedGreenMode, restoreOpacityInRedGreen, - isCropByBg, // 是否根据背景裁剪 + isCropByBg, // 是否使用背景大小裁剪 isEnhanceImg, // 是否是增强图片 ) { if (!this.layerManager) { @@ -194,7 +196,7 @@ export class ExportManager { objectsToExport, expPicType, restoreOpacityInRedGreen, - isCropByBg, // 是否根据背景裁剪 + isCropByBg, // 是否使用背景大小裁剪 isEnhanceImg, // 是否是增强图片 ); } @@ -206,7 +208,7 @@ export class ExportManager { * @param {Boolean} isContainFixed 是否包含固定图层 * @param {Boolean} isRedGreenMode 是否为红绿图模式 * @param {Boolean} restoreOpacityInRedGreen 红绿图模式下是否恢复透明度为1 - * @param {Boolean} isCropByBg 是否根据背景裁剪 + * @param {Boolean} isCropByBg 是否使用背景大小裁剪 * @param {Boolean} isEnhanceImg 是否是增强图片 * @returns {String} 图片数据URL * @private @@ -217,8 +219,8 @@ export class ExportManager { isContainFixed, isRedGreenMode, restoreOpacityInRedGreen, - isCropByBg, - isEnhanceImg + isCropByBg, // 是否使用背景大小裁剪 + isEnhanceImg, // 是否是增强图片 ) { // 按图层顺序收集对象(从底到顶) const objectsToExport = this._collectObjectsByLayerOrder( @@ -272,7 +274,7 @@ export class ExportManager { expPicType, restoreOpacityInRedGreen, canvasClipPath, - isCropByBg, // 是否根据背景裁剪 + isCropByBg, // 是否使用背景大小裁剪 isEnhanceImg, // 是否是增强图片 ); } @@ -635,7 +637,7 @@ export class ExportManager { objectsToExport, expPicType, restoreOpacityInRedGreen, - maskObject, + maskObject, // 裁剪对象 isCropByBg, // 是否使用背景大小裁剪 isEnhanceImg, // 是否是增强图片 ) { @@ -656,7 +658,7 @@ export class ExportManager { trimWhitespace: true, // 裁剪空白 trimPadding: 0, // 裁剪边距 restoreOpacityInRedGreen, - isCropByBg, // 是否根据背景裁剪 + isCropByBg, // 是否使用背景大小裁剪 isEnhanceImg, // 是否是增强图片 }); diff --git a/src/component/Canvas/CanvasEditor/utils/selectionToImage.js b/src/component/Canvas/CanvasEditor/utils/selectionToImage.js index 70c6920f..2f518624 100644 --- a/src/component/Canvas/CanvasEditor/utils/selectionToImage.js +++ b/src/component/Canvas/CanvasEditor/utils/selectionToImage.js @@ -42,7 +42,7 @@ export const createRasterizedImage = async ({ clippingObject, isReturenDataURL, selectionManager, // 传递选区管理器 - isEnhanceImg, // 是否是增强图片 + isEnhanceImg, // 是否是增强图片 }); } @@ -83,7 +83,7 @@ const createClippedObjects = async ({ clippingObject, isReturenDataURL, selectionManager = null, // 新增选区管理器参数 - isEnhanceImg, // 是否是增强图片 + isEnhanceImg, // 是否是增强图片 }) => { try { console.log("🎯 使用新的图像遮罩裁剪方法创建对象"); @@ -113,7 +113,7 @@ const createClippedObjects = async ({ clippingObject, selectionBounds: optimizedBounds, // 使用优化后的边界框 featherAmount, - isEnhanceImg, // 是否是增强图片 + isEnhanceImg, // 是否是增强图片 }); } @@ -124,7 +124,7 @@ const createClippedObjects = async ({ clippingObject, selectionBounds: optimizedBounds, // 使用优化后的边界框 featherAmount, - isEnhanceImg, // 是否是增强图片 + isEnhanceImg, // 是否是增强图片 }); // 将DataURL转换为fabric.Image对象 @@ -178,7 +178,7 @@ const createClippedDataURLByCanvas = async ({ clippingObject, selectionBounds, featherAmount = 0, - isEnhanceImg = false, // 是否是增强图片 + isEnhanceImg = false, // 是否是增强图片 }) => { try { console.log("🖼️ 使用图像遮罩裁剪方法生成DataURL"); @@ -192,7 +192,7 @@ const createClippedDataURLByCanvas = async ({ // 使用高分辨率以保证质量 const pixelRatio = window.devicePixelRatio || 1; const qualityMultiplier = !!isEnhanceImg ? Math.max(2, pixelRatio) : 1; - + console.log("使用高分辨率以保证质量:" + isEnhanceImg, optimizedBounds); const canvasWidth = Math.ceil(optimizedBounds.width * qualityMultiplier); @@ -463,7 +463,7 @@ const createLegacyRasterization = async ({ quality, format, isReturenDataURL, - isCropByBg, // 是否根据背景裁剪 + isCropByBg, // 是否根据背景裁剪 isEnhanceImg, // 是否是增强图片 }) => { console.log("⚠️ 使用兼容的离屏渲染方法"); @@ -491,7 +491,7 @@ const createLegacyRasterization = async ({ format, currentZoom, isReturenDataURL, - isCropByBg, // 是否根据背景裁剪 + isCropByBg, // 是否根据背景裁剪 isEnhanceImg, // 是否是增强图片 }); }; diff --git a/src/component/Detail/DesignDetail.vue b/src/component/Detail/DesignDetail.vue index a91eb2e8..0da7011a 100644 --- a/src/component/Detail/DesignDetail.vue +++ b/src/component/Detail/DesignDetail.vue @@ -167,61 +167,64 @@ export default defineComponent({ } const showDesignDetailModal = (data:any,str:any)=>{ - // let url = Https.httpUrls.getDesignDetail + `?designItemId=${77770}&designPythonOutfitId=${77423}` - let url = Https.httpUrls.getDesignDetail + `?designItemId=${data.design.designItemId}&designPythonOutfitId=${data.design.designOutfitId}` - detailData.loadingShow = true - Https.axiosGet(url).then( - async (rv: any) => { - store.commit('DesignDetail/setDesignDetail',rv) - rv.clothes.forEach((item:any)=>{ - let a - item.designType='Library' - if(item.layersObject[0].imageCategory.indexOf("back") == -1){ - a = item.layersObject[0] - item.layersObject[0] = item.layersObject[1] - item.layersObject[1] = a - } - if(item.color){ - item.color.rgba = { - r:item.color.r, - g:item.color.g, - b:item.color.b, + return new Promise((resolve, reject) => { + store.commit('DesignDetail/clearDetailData') + // let url = Https.httpUrls.getDesignDetail + `?designItemId=${77770}&designPythonOutfitId=${77423}` + let url = Https.httpUrls.getDesignDetail + `?designItemId=${data.design.designItemId}&designPythonOutfitId=${data.design.designOutfitId}` + detailData.loadingShow = true + Https.axiosGet(url).then( + async (rv: any) => { + store.commit('DesignDetail/setDesignDetail',rv) + rv.clothes.forEach((item:any)=>{ + let a + item.designType='Library' + if(item.layersObject[0].imageCategory.indexOf("back") == -1){ + a = item.layersObject[0] + item.layersObject[0] = item.layersObject[1] + item.layersObject[1] = a } - }else{ - item.color = { - // rgba:{ - // r:undefined, - // g:undefined, - // b:undefined, - // } + if(item.color){ + item.color.rgba = { + r:item.color.r, + g:item.color.g, + b:item.color.b, + } + }else{ + item.color = { + // rgba:{ + // r:undefined, + // g:undefined, + // b:undefined, + // } + } } - } - if(item.gradient){ - item.color.gradient = item.gradient - } - if(item.printObject.prints == null)item.printObject.prints = [] - item.printObject.prints.forEach((element:any) => { - if(!element.designType){ - element.designType = 'Library' + if(item.gradient){ + item.color.gradient = item.gradient } - }); - }) - detailData.singleOveral.value = rv.singleOverall - detailData.designDetailShow = true - // this.deleteShow = false - initialize() - setRevocation() - detailData.loadingShow = false - if(rv.singleOverall == "single"){ - console.log(rv.clothes) - store.commit('DesignDetail/setDesignColthes',rv.clothes[0].id) + if(item.printObject.prints == null)item.printObject.prints = [] + item.printObject.prints.forEach((element:any) => { + if(!element.designType){ + element.designType = 'Library' + } + }); + }) + detailData.singleOveral.value = rv.singleOverall + detailData.designDetailShow = true + // this.deleteShow = false + initialize() + setRevocation() + detailData.loadingShow = false + if(rv.singleOverall == "single"){ + store.commit('DesignDetail/setDesignColthes',rv.clothes[0].id) + } + resolve(rv) } - - } - - ).catch(rv=>{ - detailData.loadingShow = false - }) + ).catch(rv=>{ + detailData.loadingShow = false + resolve(rv) + }) + }) + } const initialize = ()=>{//design后初始化 diff --git a/src/component/Detail/model/modelPosition.vue b/src/component/Detail/model/modelPosition.vue index 7f69a63b..c3ad850a 100644 --- a/src/component/Detail/model/modelPosition.vue +++ b/src/component/Detail/model/modelPosition.vue @@ -4,7 +4,7 @@
- +
diff --git a/src/component/home/design/collection/MoodboardUpload.vue b/src/component/home/design/collection/MoodboardUpload.vue index 0b04d394..93d3ad27 100644 --- a/src/component/home/design/collection/MoodboardUpload.vue +++ b/src/component/home/design/collection/MoodboardUpload.vue @@ -339,7 +339,7 @@ export default defineComponent({ }, deleteFile(item: any) { - if(item.type_.type1 == 'generate' || item.type_.type1 == 'material'){ + if(item?.type_?.type1 == 'generate' || item?.type_?.type1 == 'material'){ item.jsContent1 = this.t('uploadFile.jsContent1',{maxImg:8}) item.state = 'delete' this.store.commit("addGenerateMaterialFils", item); diff --git a/src/component/home/design/collection/PrintboardUpload.vue b/src/component/home/design/collection/PrintboardUpload.vue index e92add64..d1d37d96 100644 --- a/src/component/home/design/collection/PrintboardUpload.vue +++ b/src/component/home/design/collection/PrintboardUpload.vue @@ -385,7 +385,7 @@ export default defineComponent({ deleteFile(item:any){ // this.fileList.splice(item, 1) // this.store.commit('setPrintboardFile',this.fileList) - if(item.type_.type1 == 'generate' || item.type_.type1 == 'material'){ + if(item?.type_?.type1 == 'generate' || item?.type_?.type1 == 'material'){ item.jsContent1 = this.t('uploadFile.jsContent1',{maxImg:16}) item.state = 'delete' this.store.commit("addGenerateMaterialFils", item); @@ -610,7 +610,6 @@ export default defineComponent({ } this.fileList.push(data) } - console.log(this.fileList) this.store.commit('setPrintboardFile',this.fileList) }, diff --git a/src/component/home/design/collection/more.vue b/src/component/home/design/collection/more.vue index a912c326..1c77c9ce 100644 --- a/src/component/home/design/collection/more.vue +++ b/src/component/home/design/collection/more.vue @@ -124,6 +124,14 @@ export default defineComponent({ designType:props.item.resData.designType, } }else{ + rv.imgUrl = rv.url + rv.category = props.item.category + rv.categoryValue = props.item.categoryValue + rv.resData = { + id:rv.id, + url:rv.url, + designType:props.item.resData.designType, + } props.list.unshift(rv) } } diff --git a/src/component/home/design/index.vue b/src/component/home/design/index.vue index afbb8946..7999a1ef 100644 --- a/src/component/home/design/index.vue +++ b/src/component/home/design/index.vue @@ -2129,13 +2129,14 @@ export default defineComponent({ type: string ) { // if() - if(this.isMove)return + if(this.isMove || this.isShowMark)return this.store.commit('setOpenChatStatus',false) if(design.resultType != "Design"){ this.selectEditBtn = design this.setEditDesignType(collectionList,index,design.resultType,'edit',type) return } + this.isShowMark = true design.designOutfitId = design.designPythonOutfitId?design.designPythonOutfitId:design.designOutfitId let data = { design: design, @@ -2146,7 +2147,9 @@ export default defineComponent({ this.detailDestroy = true nextTick(()=>{ let designDetail: any = this.$refs.designDetail; - designDetail.showDesignDetailModal(data); + designDetail.showDesignDetailModal(data).then(()=>{ + this.isShowMark = false + }) }) }, diff --git a/src/store/Detail/designDetail.ts b/src/store/Detail/designDetail.ts index 2cad4b89..23c265e2 100644 --- a/src/store/Detail/designDetail.ts +++ b/src/store/Detail/designDetail.ts @@ -28,7 +28,21 @@ const DesignDetail : Module = { currentPrintElement:null, }, mutations:{ + clearDetailData(state){ + state.designDetail = null + state.designPreviewData = {} + state.frontBack = { + front:[], + back:[], + body:{}, + } + state.selectDetail = null + state.printZIndex = -1 + state.currentDetailType = '' + state.currentPrintElement = null + }, setDesignDetail(state,data){ + console.log(data) if(data.others.length > 0 && data.others[0].type == "Body"){ state.frontBack.body = data.others[0] } @@ -74,7 +88,6 @@ const DesignDetail : Module = { state.frontBack.back = back }, updataDetailItem(state,data){ - console.log(data) state.designDetail.clothes.forEach((item:any) => { if(item.id == state.selectDetail.id){ for (const key in data) {