'!'
This commit is contained in:
@@ -429,7 +429,7 @@ export default {
|
||||
canvasCompress(canvas,callback,quality = 0.9){
|
||||
let that = this
|
||||
canvas.toBlob(function (blob) {
|
||||
if (blob.size > 1024 * 1024) { // 如果大于1MB,尝试降低质量或尺寸
|
||||
if (blob.size > this.imgSize * 1024 * 1024) { // 如果大于1MB,尝试降低质量或尺寸
|
||||
quality -= 0.1; // 降低质量
|
||||
if(quality<0.3){
|
||||
// // maxWidth /= 2; // 减小尺寸的一半
|
||||
|
||||
@@ -131,6 +131,16 @@
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<br />
|
||||
<el-form-item label="门店id:">
|
||||
<!-- <el-input
|
||||
style="width: 500px;"
|
||||
v-model="form.nameIDs"
|
||||
placeholder="请输入门店ids,空格分隔,支持直接从excel中粘贴一列"
|
||||
></el-input>
|
||||
:vendorIDs="searchForm7.vendorIDs" :isInit="'noInit'" -->
|
||||
<StoresPick ref="jxStorePicke7" :vendorIDs="form.vendorID" @updateStoreIDs="updateStoreIDs7"></StoresPick>
|
||||
</el-form-item>
|
||||
<br />
|
||||
<el-form-item label="同步设置:">
|
||||
<el-checkbox
|
||||
border
|
||||
@@ -183,10 +193,12 @@ import { json2query } from "@/utils";
|
||||
import { mapGetters } from "vuex";
|
||||
import { getBrands } from "@/apis/controls/brand.js";
|
||||
import jxUploadFile from '@/components/cmp/uploadFile';
|
||||
import StoresPick from "@/components/cmp/storePickNew/storePickContent.vue";
|
||||
export default {
|
||||
name: "GoodsWatermarkprev",
|
||||
components: {
|
||||
jxUploadFile
|
||||
jxUploadFile,
|
||||
StoresPick
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -195,6 +207,7 @@ export default {
|
||||
exPrefix: "",
|
||||
imgWaterMark: "",
|
||||
nameIDs: "",
|
||||
storeId:"", // 门店id
|
||||
fromDate: "",
|
||||
toDate: "",
|
||||
isAsync: true,
|
||||
@@ -234,6 +247,9 @@ export default {
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
updateStoreIDs7(storeIDs){
|
||||
this.form.storeId = storeIDs
|
||||
},
|
||||
// imgChange(e) {
|
||||
// this.form.imgWaterMark = e[0]?e[0].url:''
|
||||
// },
|
||||
@@ -342,6 +358,8 @@ export default {
|
||||
)
|
||||
)
|
||||
);
|
||||
json.storeId = JSON.stringify(json.storeId)
|
||||
|
||||
try {
|
||||
showLoad();
|
||||
const res = await this.apiUpdateGoodsPrefixImg(json);
|
||||
@@ -361,48 +379,48 @@ export default {
|
||||
// },
|
||||
|
||||
|
||||
// 添加水印的方法
|
||||
addTextToImage(imageSrc, text, font, color, callback){
|
||||
const img = new Image();
|
||||
img.src = imageSrc;
|
||||
img.crossOrigin = 'Anonymous'
|
||||
img.onload = function() {
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
// // 添加水印的方法
|
||||
// addTextToImage(imageSrc, text, font, color, callback){
|
||||
// const img = new Image();
|
||||
// img.src = imageSrc;
|
||||
// img.crossOrigin = 'Anonymous'
|
||||
// img.onload = function() {
|
||||
// const canvas = document.createElement('canvas');
|
||||
// const ctx = canvas.getContext('2d');
|
||||
|
||||
canvas.width = img.width;
|
||||
canvas.height = img.height;
|
||||
// canvas.width = img.width;
|
||||
// canvas.height = img.height;
|
||||
|
||||
ctx.drawImage(img, 0, 0);
|
||||
ctx.font = font || '20px Arial';
|
||||
ctx.fillStyle = color || 'white';
|
||||
// ctx.drawImage(img, 0, 0);
|
||||
// ctx.font = font || '20px Arial';
|
||||
// ctx.fillStyle = color || 'white';
|
||||
|
||||
ctx.shadowColor = 'rgba(255, 255, 255, 0.3)'; // 阴影颜色
|
||||
ctx.shadowBlur = 1; // 阴影模糊程度
|
||||
ctx.shadowOffsetX = 20; // 水平阴影偏移
|
||||
ctx.shadowOffsetY = 20; // 垂直阴影偏移
|
||||
// ctx.shadowColor = 'rgba(255, 255, 255, 0.3)'; // 阴影颜色
|
||||
// ctx.shadowBlur = 1; // 阴影模糊程度
|
||||
// ctx.shadowOffsetX = 20; // 水平阴影偏移
|
||||
// ctx.shadowOffsetY = 20; // 垂直阴影偏移
|
||||
|
||||
// 将坐标系原点移到指定的位置
|
||||
ctx.translate(img.width/2, img.height/2);
|
||||
// // 将坐标系原点移到指定的位置
|
||||
// ctx.translate(img.width/2, img.height/2);
|
||||
|
||||
// 旋转坐标系
|
||||
ctx.rotate(-Math.PI/4 ); // 旋转45度(弧度计算)
|
||||
// // 旋转坐标系
|
||||
// ctx.rotate(-Math.PI/4 ); // 旋转45度(弧度计算)
|
||||
|
||||
let width = img.width
|
||||
let height = img.height
|
||||
// x , y 轴长度
|
||||
let xLength = Math.sqrt(Math.pow(width/2, 2) + Math.pow(height/2, 2))
|
||||
for(let i = -xLength; i < width; ) {
|
||||
for(let j=-xLength;j < height;){
|
||||
ctx.fillText(text, i, j);
|
||||
// console.log('坐标点位',i,j)
|
||||
j = j+200 // 行间距
|
||||
}
|
||||
i=i+200 // 列间距
|
||||
}
|
||||
callback(canvas.toDataURL());
|
||||
}
|
||||
}
|
||||
// let width = img.width
|
||||
// let height = img.height
|
||||
// // x , y 轴长度
|
||||
// let xLength = Math.sqrt(Math.pow(width/2, 2) + Math.pow(height/2, 2))
|
||||
// for(let i = -xLength; i < width; ) {
|
||||
// for(let j=-xLength;j < height;){
|
||||
// ctx.fillText(text, i, j);
|
||||
// // console.log('坐标点位',i,j)
|
||||
// j = j+200 // 行间距
|
||||
// }
|
||||
// i=i+200 // 列间距
|
||||
// }
|
||||
// callback(canvas.toDataURL());
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<span>
|
||||
<icon name="orderlist-order" class="icon"></icon>
|
||||
订单号: {{ order.vendorOrderID }}
|
||||
<el-tag type="danger" size="medium" class="blink" v-if="order.couponIDs.includes('11002') || order.couponIDs.includes('11003')">急送</el-tag>
|
||||
<div style="font-style: normal" v-if="order.vendorOrderID2">订单号2: {{ order.vendorOrderID2 }}</div>
|
||||
<div style="font-style: normal" v-if="order.eclpOutID">出库单号: {{ order.eclpOutID }}</div>
|
||||
</span>
|
||||
@@ -2163,4 +2164,18 @@ export default {
|
||||
border-top: 10px solid rgba(251, 207, 83, 0.9);
|
||||
}
|
||||
}
|
||||
|
||||
/* 使用动画 */
|
||||
.blink {
|
||||
width: 20% !important;
|
||||
margin-top: 10px;
|
||||
animation: blink 1.8s infinite; /* 1秒循环,无限播放 */
|
||||
}
|
||||
|
||||
/* 定义动画 */
|
||||
@keyframes blink {
|
||||
0% { opacity: 1; }
|
||||
50% { opacity: 0; }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -180,6 +180,7 @@
|
||||
<router-link :to="'/ordermanager/' + scope.row.vendorOrderID" target="_blank" style="color: #606266;">
|
||||
<div class="hover-click"
|
||||
:class="{ 'colorred': (scope.row.lockStatus === -5) && (scope.row.flag & 6) === 0, 'allowBrushing': scope.row.phoneAscription.includes('No') }">
|
||||
<el-tag type="danger" size="mini" v-if="scope.row.couponIDs.includes('11002') || scope.row.couponIDs.includes('11003')">急</el-tag>
|
||||
<el-tag v-if='scope.row.businessType === 2' size="mini" type="success">预</el-tag>
|
||||
<span>{{ scope.row.vendorID | switchVendoID }}</span>
|
||||
<span v-if="scope.row.vendorID === 9 && scope.row.vendorPayType === 'W06'">(微信)</span>
|
||||
@@ -190,7 +191,6 @@
|
||||
</div>
|
||||
</router-link>
|
||||
<div style="margin-left:10px;">
|
||||
<!-- :type="scope.row.activeStatus ? 'info' : 'primary' " -->
|
||||
<el-button
|
||||
:type="scope.row.jxIncome <= 0 ? 'danger' : 'primary' "
|
||||
:plain="scope.row.activeStatus ? true : false "
|
||||
|
||||
@@ -333,7 +333,7 @@ export default {
|
||||
'用户类型',
|
||||
'生效活动周期'
|
||||
])
|
||||
fileName =`${this.storeList[0].name}-折扣(爆品)${+new Date()}.xlsx`
|
||||
fileName =`${this.storeList.name}-折扣(爆品)${+new Date()}.xlsx`
|
||||
this.tableDataGoods.forEach(item => {
|
||||
excelData.push([
|
||||
item.name,
|
||||
|
||||
Reference in New Issue
Block a user