2023-11-13-dist
This commit is contained in:
@@ -771,22 +771,27 @@ export default defineComponent({
|
||||
return
|
||||
}
|
||||
let DesignDetailEnd = this.$refs.DesignDetailEnd
|
||||
|
||||
Https.axiosGet(Https.httpUrls.getRgbByTcx + '?tcx=' + this.tcxColor).then((rv) =>{
|
||||
if(rv && rv.name){
|
||||
// let hex = this.rgbaToHex([color.r,color.g,color.b])
|
||||
let hex = this.rgbaToHex([rv.r,rv.g,rv.b,rv.a? rv.a :1])
|
||||
this.reviewColor = rv?.r + ''? {rgba:{r:rv.r,g:rv.g,b:rv.b,a:1},hex:hex} : {hex:''}
|
||||
this.selectColor = this.reviewColor
|
||||
DesignDetailEnd.colorList[DesignDetailEnd.selectIndex] = {r:rv.r, g:rv.g, b:rv.b}
|
||||
this.pantongName = rv.name
|
||||
let colorList =DesignDetailEnd.colorList.filter((v) => Object.keys(v).length)
|
||||
this.setColorboardList(colorList)
|
||||
this.getColorBg = true
|
||||
}else{
|
||||
message.warning(this.t('DesignDetailAlter.jsContent6'))
|
||||
}
|
||||
})
|
||||
let pattern = /^\d{2}-\d{4}$/;
|
||||
if(pattern.test(this.tcxColor)){
|
||||
Https.axiosGet(Https.httpUrls.getRgbByTcx + '?tcx=' + this.tcxColor).then((rv) =>{
|
||||
if(rv && rv.name){
|
||||
// let hex = this.rgbaToHex([color.r,color.g,color.b])
|
||||
let hex = this.rgbaToHex([rv.r,rv.g,rv.b,rv.a? rv.a :1])
|
||||
this.reviewColor = rv?.r + ''? {rgba:{r:rv.r,g:rv.g,b:rv.b,a:1},hex:hex} : {hex:''}
|
||||
this.selectColor = this.reviewColor
|
||||
DesignDetailEnd.colorList[DesignDetailEnd.selectIndex] = {r:rv.r, g:rv.g, b:rv.b}
|
||||
this.pantongName = rv.name
|
||||
let colorList =DesignDetailEnd.colorList.filter((v) => Object.keys(v).length)
|
||||
this.setColorboardList(colorList)
|
||||
this.getColorBg = true
|
||||
}else{
|
||||
message.warning(this.t('DesignDetailAlter.jsContent6'))
|
||||
}
|
||||
})
|
||||
}else{
|
||||
message.warning(this.t('ColorboardUpload.jsContent5'))
|
||||
}
|
||||
|
||||
},
|
||||
//查询颜色的潘通值和txc
|
||||
getPantongName(v) {
|
||||
|
||||
@@ -272,21 +272,27 @@ export default defineComponent({
|
||||
if(!this.tcxColor){
|
||||
return
|
||||
}
|
||||
Https.axiosGet(Https.httpUrls.getRgbByTcx + '?tcx=' + this.tcxColor).then((rv) =>{
|
||||
if(rv && rv.name){
|
||||
// let hex = this.rgbaToHex([color.r,color.g,color.b])
|
||||
let hex = this.rgbaToHex([rv.r,rv.g,rv.b,rv.a?rv.a:1])
|
||||
this.reviewColor = rv?.r + ''? {rgba:{r:rv.r,g:rv.g,b:rv.b,a:1},hex:hex} : {hex:''}
|
||||
this.selectColor = this.reviewColor
|
||||
this.colorList[this.selectIndex] = {r:rv.r, g:rv.g, b:rv.b}
|
||||
this.pantongName = rv.name
|
||||
let colorList =this.colorList.filter((v) => Object.keys(v).length)
|
||||
this.setColorboardList(colorList)
|
||||
this.getColorBg = true
|
||||
}else{
|
||||
message.warning(this.t('ColorboardUpload.jsContent2'))
|
||||
}
|
||||
})
|
||||
let pattern = /^\d{2}-\d{4}$/;
|
||||
if(pattern.test(this.tcxColor)){
|
||||
Https.axiosGet(Https.httpUrls.getRgbByTcx + '?tcx=' + this.tcxColor).then((rv) =>{
|
||||
if(rv && rv.name){
|
||||
// let hex = this.rgbaToHex([color.r,color.g,color.b])
|
||||
let hex = this.rgbaToHex([rv.r,rv.g,rv.b,rv.a?rv.a:1])
|
||||
this.reviewColor = rv?.r + ''? {rgba:{r:rv.r,g:rv.g,b:rv.b,a:1},hex:hex} : {hex:''}
|
||||
this.selectColor = this.reviewColor
|
||||
this.colorList[this.selectIndex] = {r:rv.r, g:rv.g, b:rv.b}
|
||||
this.pantongName = rv.name
|
||||
let colorList =this.colorList.filter((v) => Object.keys(v).length)
|
||||
this.setColorboardList(colorList)
|
||||
this.getColorBg = true
|
||||
}else{
|
||||
message.warning(this.t('ColorboardUpload.jsContent2'))
|
||||
}
|
||||
})
|
||||
}else{
|
||||
message.warning(this.t('ColorboardUpload.jsContent5'))
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
//清除当前的颜色
|
||||
@@ -334,6 +340,7 @@ export default defineComponent({
|
||||
(rv) => {
|
||||
if(rv){
|
||||
colorSort = rv.ratio
|
||||
console.log(rv);
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
@@ -188,15 +188,15 @@ export default defineComponent({
|
||||
modalWarning: null,
|
||||
isLanguage: false,
|
||||
language:[
|
||||
{name:'English',value:'en'},
|
||||
{name:'中文',value:'zh'},
|
||||
{name:'한국인',value:'ko'},
|
||||
{name:'にほんご',value:'ja'},
|
||||
{name:'Русский',value:'ru'},
|
||||
{name:'Français',value:'fr'},
|
||||
{name:'แบบไทย',value:'th'},
|
||||
{name:'Tiếng Việt',value:'vi'},
|
||||
{name:'Italiano',value:'it'},
|
||||
{name:'English',value:'ENGLISH'},
|
||||
{name:'中文',value:'CHINESE_SIMPLIFIED'},
|
||||
{name:'한국인',value:'KOREAN'},
|
||||
{name:'にほんご',value:'JAPANESE'},
|
||||
{name:'Русский',value:'RUSSIAN'},
|
||||
{name:'Français',value:'FRENCH'},
|
||||
{name:'แบบไทย',value:'THAI'},
|
||||
{name:'Tiếng Việt',value:'VIETNAMESE'},
|
||||
{name:'Italiano',value:'ITALIAN'},
|
||||
]
|
||||
};
|
||||
},
|
||||
@@ -208,7 +208,6 @@ export default defineComponent({
|
||||
this.accountIsLogin(this.userInfo);
|
||||
}
|
||||
this.isHaveBindEmail = this.userInfo?.email ? true : false;
|
||||
this.getLang()
|
||||
this.operateClick();
|
||||
document.addEventListener("click", this.operateClick);
|
||||
},
|
||||
@@ -374,27 +373,29 @@ export default defineComponent({
|
||||
},
|
||||
//获取当前语言
|
||||
getLang(){
|
||||
let data = {}
|
||||
// Https.axiosPost(Https.httpUrls.getUserLanguage, data).then(
|
||||
// (rv) => {
|
||||
// if (rv) {
|
||||
// this.locale = rv
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
let data
|
||||
Https.axiosPost(Https.httpUrls.getUserLanguage, data).then(
|
||||
(rv) => {
|
||||
if (rv) {
|
||||
this.locale = v
|
||||
console.log(rv);
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
setLang(v){
|
||||
let data = {
|
||||
language:v
|
||||
}
|
||||
// Https.axiosPost(Https.httpUrls.changeUserLanguage, data).then(
|
||||
// (rv) => {
|
||||
// if (rv) {
|
||||
// console.log(rv);
|
||||
// this.getLang()
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
Https.axiosPost(Https.httpUrls.changeUserLanguage, data).then(
|
||||
(rv) => {
|
||||
if (rv) {
|
||||
let token = rv;
|
||||
setCookie("token", token);
|
||||
this.getLang(v)
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
setLocale(v){
|
||||
|
||||
@@ -547,28 +547,27 @@ export default defineComponent({
|
||||
return
|
||||
}
|
||||
}
|
||||
// this.loadingShow = true
|
||||
// Https.axiosPost(Https.httpUrls.sketchAndPrintGenerate, data).then(
|
||||
// (rv) => {
|
||||
// if(rv){
|
||||
// this.generateList = []
|
||||
// let arr
|
||||
// rv.generatedCollectionItems.forEach((v:any,index:number)=>{
|
||||
// arr = {
|
||||
// id:v.generateItemId,
|
||||
// imgUrl:v.generateItemUrl,
|
||||
// id_:GO.id++,
|
||||
// like:rv.generatedCollectionItems[index].isLiked
|
||||
|
||||
// }
|
||||
// this.generateList.push(arr)
|
||||
// this.loadingShow = false
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// ).catch(res=>{
|
||||
// this.loadingShow = false
|
||||
// });
|
||||
this.loadingShow = true
|
||||
Https.axiosPost(Https.httpUrls.sketchAndPrintGenerate, data).then(
|
||||
(rv) => {
|
||||
if(rv){
|
||||
this.generateList = []
|
||||
let arr
|
||||
rv.generatedCollectionItems.forEach((v:any,index:number)=>{
|
||||
arr = {
|
||||
id:v.generateItemId,
|
||||
imgUrl:v.generateItemUrl,
|
||||
id_:GO.id++,
|
||||
like:rv.generatedCollectionItems[index].isLiked
|
||||
}
|
||||
this.generateList.push(arr)
|
||||
this.loadingShow = false
|
||||
})
|
||||
}
|
||||
}
|
||||
).catch(res=>{
|
||||
this.loadingShow = false
|
||||
});
|
||||
},
|
||||
randomRange(min:any, max:any, num:any) { // min最小值,max最大值 num排除的值
|
||||
let index = Math.floor(Math.random() * (max - min)) + min;
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent,ref,createVNode} from 'vue'
|
||||
import { defineComponent,ref,createVNode,nextTick} from 'vue'
|
||||
import { Https } from "@/tool/https";
|
||||
import {dataURLtoFile,base64toFile} from "@/tool/util"
|
||||
import { getCookie } from "@/tool/cookie";
|
||||
@@ -255,44 +255,49 @@ export default defineComponent({
|
||||
this.option.img = this.printObject.url
|
||||
|
||||
setTimeout(()=>{
|
||||
let imgbox:any = this.$refs.imgbox
|
||||
nextTick().then(()=>{
|
||||
let image:any = new Image()
|
||||
image.src = this.option.img
|
||||
let imgbox:any = this.$refs.imgbox
|
||||
console.log(imgbox);
|
||||
let imgBoxSize = imgbox.getElementsByClassName('cropper-crop-box')[0]
|
||||
let imgBoxSizeBG = imgbox.getElementsByClassName('cropper-view-box')[0]
|
||||
let divTop:any = document.createElement('div');
|
||||
let divBottom:any = document.createElement('div');
|
||||
let divCenter:any = document.createElement('div');
|
||||
if(imgbox.getElementsByClassName('cropper-view-box-Bg').length >= 1){
|
||||
}else{
|
||||
divTop.classList.add('cropper-view-box-Bg')
|
||||
divBottom.classList.add('cropper-view-box-Bg')
|
||||
divCenter.classList.add('cropper-view-box-Bg')
|
||||
divTop.classList.add('cropper-view-box-Top')
|
||||
divBottom.classList.add('cropper-view-box-Bottom')
|
||||
divCenter.classList.add('cropper-view-box-Center')
|
||||
|
||||
let imgBoxSize = imgbox.getElementsByClassName('cropper-crop-box')[0]
|
||||
let imgBoxSizeBG = imgbox.getElementsByClassName('cropper-view-box')[0]
|
||||
let divTop:any = document.createElement('div');
|
||||
let divBottom:any = document.createElement('div');
|
||||
let divCenter:any = document.createElement('div');
|
||||
if(imgbox.getElementsByClassName('cropper-view-box-Bg').length >= 1){
|
||||
}else{
|
||||
divTop.classList.add('cropper-view-box-Bg')
|
||||
divBottom.classList.add('cropper-view-box-Bg')
|
||||
divCenter.classList.add('cropper-view-box-Bg')
|
||||
divTop.classList.add('cropper-view-box-Top')
|
||||
divBottom.classList.add('cropper-view-box-Bottom')
|
||||
divCenter.classList.add('cropper-view-box-Center')
|
||||
imgBoxSizeBG.appendChild(divTop)
|
||||
imgBoxSizeBG.appendChild(divBottom)
|
||||
imgBoxSizeBG.appendChild(divCenter)
|
||||
// imgBoxSizeBG.appendChild(div)
|
||||
|
||||
imgBoxSizeBG.appendChild(divTop)
|
||||
imgBoxSizeBG.appendChild(divBottom)
|
||||
imgBoxSizeBG.appendChild(divCenter)
|
||||
// imgBoxSizeBG.appendChild(div)
|
||||
}
|
||||
// imgBoxSize.style.backgroundImage = 'url('+require('@assets/images/library/lemaleBG.png')')'
|
||||
|
||||
}
|
||||
// imgBoxSize.style.backgroundImage = 'url('+require('@assets/images/library/lemaleBG.png')')'
|
||||
|
||||
let cropper:any = this.$refs.cropper
|
||||
cropper.cropH = cropper.scale*cropper.trueHeight
|
||||
cropper.cropW = cropper.cropH/2.125
|
||||
cropper.cropOffsertX = cropper.getImgAxis().x1+(cropper.scale*cropper.trueWidth/2-cropper.cropW/2)
|
||||
cropper.cropOffsertY = cropper.getImgAxis().y1
|
||||
imgBoxSize.addEventListener('mousemove',this.startMove)
|
||||
this.setImageSize()
|
||||
this.getDefaultPointList(this.imgBox,' ')
|
||||
let cropper:any = this.$refs.cropper
|
||||
cropper.cropH = cropper.scale*cropper.trueHeight
|
||||
cropper.cropW = cropper.cropH/2.125
|
||||
cropper.cropOffsertX = cropper.getImgAxis().x1+(cropper.scale*cropper.trueWidth/2-cropper.cropW/2)
|
||||
cropper.cropOffsertY = cropper.getImgAxis().y1
|
||||
imgBoxSize.addEventListener('mousemove',this.startMove)
|
||||
this.setImageSize()
|
||||
this.getDefaultPointList(this.imgBox,' ')
|
||||
|
||||
})
|
||||
|
||||
},300)
|
||||
},
|
||||
realTime(data:any) {
|
||||
clearTimeout(this.cropperTime)
|
||||
this.cropperTime = setTimeout(()=>{
|
||||
|
||||
this.setImageSize()
|
||||
},1000)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user