commit
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
<!-- 全屏 -->
|
||||
<i class="fi fi-bs-expand-arrows-alt" @click="showDesignImgDetail(2)"></i>
|
||||
<!-- 编辑 -->
|
||||
<!-- <i class="fi fi-rr-edit" @click="showDesignImgDetail(3)"></i> -->
|
||||
<i class="fi fi-rr-edit" @click="showDesignImgDetail(3)"></i>
|
||||
<!-- 层 -->
|
||||
<i class="fi fi-rr-copy" @mousedown="mousedownDesignImg" @mouseup="mouseupDesignImg"></i>
|
||||
</div>
|
||||
@@ -107,7 +107,7 @@
|
||||
<div class="design_detail_perview" v-show="designShowPrview == 3">
|
||||
<div class="design_detail_perview_content" >
|
||||
<!-- <div class="generate_button" v-show="designItemDetail.singleOverall == 'overall'" @click="generateHighDesign()">Generate Product lmage</div> -->
|
||||
<setDesignItem ref="setDesignItem"></setDesignItem>
|
||||
<setDesignItem ref="setDesignItem" :frontBack="frontBack"></setDesignItem>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -309,7 +309,7 @@ export default defineComponent({
|
||||
let clothes:any = []
|
||||
designItemDetail.clothes.forEach((item:any) => {
|
||||
let clothesItem = {
|
||||
// color: `${item.color.r} ${item.color.g} ${item.color.b}`,
|
||||
color: `${item.color.r} ${item.color.g} ${item.color.b}`,
|
||||
id:item.id,
|
||||
path:item.path,
|
||||
printObject:{
|
||||
@@ -427,6 +427,8 @@ export default defineComponent({
|
||||
this.currentIndex = index
|
||||
this.designOrder = true
|
||||
this.current = designItemDetail.clothes[this.currentIndex]
|
||||
console.log(this.current);
|
||||
|
||||
let data = {
|
||||
designItemId:designItemDetail.designItemId,
|
||||
// designItemId:designItemDetail.designItemId,
|
||||
@@ -437,8 +439,9 @@ export default defineComponent({
|
||||
path:this.current.path?this.current.path:'',
|
||||
printObject:{
|
||||
ifSingle:this.current.printObject.ifSingle,
|
||||
path:this.current.printObject.path?this.current.printObject.path :'',
|
||||
prints:[],
|
||||
prints:[{
|
||||
path:this.current.printObject.path?this.current.printObject.path :'',
|
||||
}],
|
||||
},
|
||||
type:this.current.type,
|
||||
}
|
||||
@@ -672,6 +675,7 @@ export default defineComponent({
|
||||
&.clothes_detail_item_apparel{
|
||||
img{
|
||||
max-height: 100%;
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
.color_item{
|
||||
|
||||
@@ -379,7 +379,7 @@ export default defineComponent({
|
||||
this.token = getCookie("token") || "";
|
||||
this.uploadUrl = getUploadUrl();
|
||||
|
||||
let dropperDom = document.getElementsByClassName('vc-sketch-color-wrap')[0]
|
||||
let dropperDom = document.getElementsByClassName("detail_modal_body_select")[0].getElementsByClassName('vc-sketch-color-wrap')[0]
|
||||
dropperDom.addEventListener('click',async ()=>{
|
||||
try {
|
||||
const dropper = new EyeDropper();
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
</div>
|
||||
<!-- <img v-if="overallSingle" :src="current?.layersObject?.[1]?.maskUrl" alt="" class="designOpenrtion_sketch"> -->
|
||||
<img :src="current?.layersObject?.[1]?.imageUrl" alt="" class="designOpenrtion_sketch">
|
||||
<img v-show="overallSingle" :src="current?.layersObject?.[1]?.maskUrl" alt="" class="designOpenrtion_sketch_mask">
|
||||
<div class="designOpenrtion_btn">
|
||||
<ul v-if="overallSingle" v-for="item,index in printStyleList" :key="item" :class="{active:item.designOpenrtionBtn}" class="designOpenrtion_Mousingle" :style="item.style" @mousedown.stop="itemMoveMousedown(index,$event)">
|
||||
<li class="designOpenrtion_btn_top" @mousedown.stop="itemSizeMousedown('top',$event)"></li>
|
||||
@@ -254,15 +255,20 @@ export default defineComponent({
|
||||
this.designOpenrtionList.push(this.current.printObject)
|
||||
this.overallSingle = DesignPrintOperationParent.overallSingle
|
||||
this.systemDesignerPercentage = DesignPrintOperationParent.systemDesignerPercentage
|
||||
let skecth = new Image
|
||||
if(!this.overallSingle){
|
||||
skecth.src = this.current.layersObject[1].imageUrl
|
||||
}else{
|
||||
skecth.src = this.current.layersObject[1].maskUrl
|
||||
}
|
||||
skecth.onload=()=>{
|
||||
this.sketch.width = skecth.width/10+'rem'
|
||||
this.sketch.height = skecth.height/10+'rem'
|
||||
// let skecth = new Image
|
||||
// if(!this.overallSingle){
|
||||
// skecth.src = this.current.layersObject[1].imageUrl
|
||||
// }else{
|
||||
// skecth.src = this.current.layersObject[1].maskUrl
|
||||
// }
|
||||
// skecth.onload=()=>{
|
||||
// this.sketch.width = skecth.width/10+'rem'
|
||||
// this.sketch.height = skecth.height/10+'rem'
|
||||
// }
|
||||
|
||||
this.sketch = {
|
||||
width:this.current.layersObject[1].imageSize[0]/10+'rem',
|
||||
height:this.current.layersObject[1].imageSize[1]/10+'rem'
|
||||
}
|
||||
let print = new Image
|
||||
print.src = this.current.printObject.path
|
||||
@@ -272,6 +278,9 @@ export default defineComponent({
|
||||
this.printStyleList[0].style.width = print.width+'px'
|
||||
this.printStyleList[0].style.height = print.height+'px'
|
||||
}
|
||||
if(this.overallSingle){
|
||||
this.refetchTemplate(0)
|
||||
}
|
||||
},
|
||||
systemDesigner(num) {
|
||||
let DesignPrintOperationParent = this.$parent
|
||||
@@ -484,12 +493,12 @@ export default defineComponent({
|
||||
//随机重置图片顺序
|
||||
refetchTemplate(index) {
|
||||
// let scale = (Math.trunc(Math.random()*15)+1)*.1
|
||||
|
||||
let rotateZ1 = Math.trunc(Math.random()*360)+1
|
||||
let rotateZ2 = Math.trunc(Math.random()*360)+1
|
||||
let sketch = document.getElementsByClassName('designOpenrtion_sketch')[0]
|
||||
let width = Math.trunc(Math.random()*(sketch.width-sketch.width/3))+1+sketch.width/3
|
||||
let scale = width / this.print.width.replace(/px/g,'')
|
||||
console.log(scale,width,this.print.width);
|
||||
// let x = sketch.width-Number(this.print.width.replace(/px/g,''))
|
||||
// let y = sketch.height-Number(this.print.height.replace(/px/g,''))
|
||||
let x = sketch.width-20
|
||||
@@ -540,6 +549,7 @@ export default defineComponent({
|
||||
scale = this.systemDesignerPercentage*3/100
|
||||
location = [arr[index].style.left.replace(/px/g,'')*sketchNum+this.print.width.replace(/px/g,'')/2-7,arr[index].style.top.replace(/px/g,'')*sketchNum+this.print.height.replace(/px/g,'')/2-7]
|
||||
}else{
|
||||
console.log(arr[index].style.width.replace(/px/g,''),this.print.width.replace(/px/g,''));
|
||||
scale = (arr[index].style.width.replace(/px/g,'')/this.print.width.replace(/px/g,''))
|
||||
location = [arr[index].style.left.replace(/px/g,'')*sketchNum,arr[index].style.top.replace(/px/g,'')*sketchNum]
|
||||
}
|
||||
@@ -821,6 +831,12 @@ export default defineComponent({
|
||||
position: relative;
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.designOpenrtion_sketch_mask{
|
||||
z-index: 3;
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
}
|
||||
>div{
|
||||
position: absolute;
|
||||
@@ -830,7 +846,7 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
.designOpenrtion_print{
|
||||
z-index: 1;
|
||||
z-index: 3;
|
||||
.modal_imgItem{
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -36,7 +36,7 @@ import { LoadingOutlined } from "@ant-design/icons-vue";
|
||||
import { useStore } from "vuex";
|
||||
import { Modal,message } from 'ant-design-vue';
|
||||
export default defineComponent({
|
||||
|
||||
props: ["frontBack"],
|
||||
setup(prop) {
|
||||
const store = useStore();
|
||||
|
||||
@@ -83,88 +83,15 @@ export default defineComponent({
|
||||
store: useStore(),
|
||||
};
|
||||
},
|
||||
|
||||
// directives:{
|
||||
// //操作旋转
|
||||
// rotote:{
|
||||
// mounted(el,value){
|
||||
// let mouse = true;
|
||||
// let angle = 0
|
||||
// let num = 1
|
||||
// let x = 0
|
||||
// let y = 0
|
||||
// num = value.value[1].scale
|
||||
// angle = value.value[1].rotateZ
|
||||
// let elParent = document.getElementsByClassName('design_compile_content')[0].getElementsByClassName('modal_imgItem')[value.value[0]]
|
||||
// // 添加鼠标按下事件监听器
|
||||
// el.style.transform = "rotateZ("+ angle + "deg)"
|
||||
// el.addEventListener('mousedown', (e) => {
|
||||
// // let scale = Number(elParent.firstElementChild.style.transform?.split('scale(')[1]?.split(')')[0])
|
||||
// // let rotateZ = Number(elParent.firstElementChild.style.transform?.split('rotateZ(')[1]?.split('deg')[0])
|
||||
// e.stopPropagation()
|
||||
// mouse = true;
|
||||
// var info = el.getBoundingClientRect();
|
||||
// let eX = info.x + info.width / 2;
|
||||
// let eY = info.y + info.height / 2;
|
||||
|
||||
// document.addEventListener('mousemove', (e) => {
|
||||
// if (mouse) {
|
||||
// let X = eX
|
||||
// let Y = eY
|
||||
// let x = e.clientX - X
|
||||
// let y = Y - e.clientY
|
||||
// angle = Math.atan2(x,y)*(180 / Math.PI)
|
||||
// elParent.firstElementChild.style.transform = "scale("+ num + ") rotateZ("+ angle + "deg)"
|
||||
// el.style.transform = "rotateZ("+ angle + "deg)"
|
||||
// }
|
||||
// });
|
||||
// // 添加鼠标松开事件监听器
|
||||
// document.addEventListener('mouseup', () => {
|
||||
// mouse = false;
|
||||
// });
|
||||
// });
|
||||
// //缩放
|
||||
// let timeSwitch = true
|
||||
// el.parentNode.addEventListener('mousemove', (e) => {
|
||||
// el.parentNode.addEventListener('mousewheel',(e) => {
|
||||
// if(timeSwitch){
|
||||
// timeSwitch = false
|
||||
// if(e.deltaY > 0){
|
||||
// if(num <= 1){
|
||||
// num -= 0.05
|
||||
// }else{
|
||||
// num -= 0.1
|
||||
// }
|
||||
// }else{
|
||||
// //放大
|
||||
// if(num <= 1){
|
||||
// num += 0.05
|
||||
// }else{
|
||||
// num += 0.1
|
||||
// }
|
||||
// }
|
||||
// if(num >= 3){
|
||||
// num = 3
|
||||
// }else if (num < .2){
|
||||
// num = .2
|
||||
// }
|
||||
// setTimeout(() => {
|
||||
// timeSwitch = true
|
||||
// }, 100);
|
||||
// elParent.firstElementChild.style.transform = "scale("+ num + ") rotateZ("+ angle + "deg)"
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
|
||||
// },
|
||||
// },
|
||||
methods: {
|
||||
init(){
|
||||
let DesignParent = this.$parent
|
||||
let designItemDetail = JSON.parse(JSON.stringify(this.store.state.DesignDetailModule.designItemDetail))
|
||||
this.designItemDetail = designItemDetail
|
||||
// this.clearModal()
|
||||
console.log(this.frontBack);
|
||||
// console.log(this.current,DesignParent.frontBack);
|
||||
console.log(DesignParent);
|
||||
this.printStyleList.push({
|
||||
centers:{
|
||||
left:0,
|
||||
|
||||
Reference in New Issue
Block a user