广告增加建议尺寸

This commit is contained in:
SjS 2025-04-17 10:57:25 +08:00
parent fdb9cad723
commit 852e1733f8
2 changed files with 17 additions and 12 deletions

View File

@ -1,6 +1,6 @@
<template>
<div
class="component-upload-image"
<div
class="component-upload-image"
@mouseenter="handleMouseEnter"
@mouseleave="handleMouseLeave"
>
@ -26,7 +26,7 @@
drag
>
<!-- 粘贴区域隐藏 -->
<textarea
<textarea
ref="pasteArea"
class="paste-area"
@paste="handlePaste"
@ -66,6 +66,9 @@
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip">
<div style="color: #909399; margin-bottom: 8px;">
建议尺寸700×286
</div>
请上传
<template v-if="fileSize">大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
<template v-if="fileType">格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
@ -175,7 +178,7 @@ export default {
//
this.fileList = list.map(item => {
if (typeof item === "string") {
return {
return {
name: item, //
url: this.getRealUrl(item)
};
@ -246,7 +249,7 @@ export default {
return {
Authorization: "Bearer " + getToken(),
};
}
}
return {};
},
},
@ -290,9 +293,9 @@ export default {
handlePaste(event) {
//
event.preventDefault();
const items = event.clipboardData?.items;
if (!items) {
this.$modal.msgError('当前浏览器不支持粘贴上传');
return;
@ -343,7 +346,7 @@ export default {
'Content-Type': 'multipart/form-data'
}
});
this.handleUploadSuccess(response.data, file);
} catch (error) {
this.handleUploadError();
@ -396,14 +399,14 @@ export default {
handleUploadSuccess(res, file) {
if (this.host === 'qiniu') {
//
this.uploadList.push({
this.uploadList.push({
name: res.key,
url: process.env.VUE_APP_QINIU_DOMAIN + '/' + res.key //
});
this.uploadedSuccessfully();
} else {
if (res.code === 200) {
this.uploadList.push({
this.uploadList.push({
name: file.name, //
url: res.fileName // URL
});
@ -518,7 +521,7 @@ export default {
object-fit: cover;
object-position: center;
}
&.is-file {
.el-upload-list__item-thumbnail {
padding: 20px;
@ -549,7 +552,7 @@ export default {
cursor: default;
text-align: center;
transition: opacity .3s;
.el-upload-list__item-delete {
position: static;
font-size: inherit;

View File

@ -118,7 +118,9 @@
</el-select>
</el-form-item>
<el-form-item label="广告图片" prop="picture">
<div class="upload-wrapper">
<image-upload v-model="form.picture" :limit="1"/>
</div>
</el-form-item>
<el-form-item label="跳转类型" prop="urlType">
<el-select v-model="form.urlType" placeholder="请选择跳转类型">