|
|
@@ -38,7 +38,7 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<!-- 评论有礼相关字段 -->
|
|
|
- <template v-if="activityModel.activityType === 1">
|
|
|
+ <template v-if="activityModel.activityType === 2">
|
|
|
<!-- 用户可参与次数 -->
|
|
|
<el-form-item label="用户可参与次数" prop="participationLimit">
|
|
|
<el-input v-model="activityModel.participationLimit" placeholder="请输入" maxlength="4" />
|
|
|
@@ -71,7 +71,7 @@
|
|
|
</template>
|
|
|
|
|
|
<!-- 营销活动相关字段 -->
|
|
|
- <template v-if="activityModel.activityType === 2">
|
|
|
+ <template v-if="activityModel.activityType === 1">
|
|
|
<!-- 报名时间 -->
|
|
|
<el-form-item class="activity-time-item" label="报名时间" prop="signupTimeRange">
|
|
|
<el-date-picker
|
|
|
@@ -89,7 +89,12 @@
|
|
|
|
|
|
<!-- 活动限制人数 -->
|
|
|
<el-form-item label="活动限制人数">
|
|
|
- <el-input v-model="activityModel.activityLimitPeople" placeholder="请输入" maxlength="6" />
|
|
|
+ <el-input
|
|
|
+ v-model="activityModel.activityLimitPeople"
|
|
|
+ placeholder="请输入"
|
|
|
+ maxlength="20"
|
|
|
+ @input="handlePositiveIntegerInput('activityLimitPeople', $event)"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
|
|
|
<!-- 活动详情 -->
|
|
|
@@ -152,30 +157,30 @@
|
|
|
</template>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
- <div class="upload-hint">请上传21:9尺寸图片效果更佳,支持jpg、jpeg、png格式,上传图片不得超过20M</div>
|
|
|
+ <div class="upload-hint">请上传21:9尺寸图片效果更佳,支持jpg、jpeg、png格式,上传图片不得超过5M</div>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
|
|
|
<!-- 活动详情图 -->
|
|
|
<el-form-item v-if="activityModel.uploadImgType === 1" label="活动详情图" prop="activityDetailImage">
|
|
|
<div class="upload-item-wrapper">
|
|
|
- <div class="upload-area upload-area-vertical" :class="{ 'upload-full': detailFileList.length >= 1 }">
|
|
|
+ <div class="upload-area upload-area-vertical" :class="{ 'upload-full': detailFileList.length >= 9 }">
|
|
|
<el-upload
|
|
|
v-model:file-list="detailFileList"
|
|
|
:accept="'.jpg,.jpeg,.png'"
|
|
|
:auto-upload="false"
|
|
|
:before-remove="handleBeforeRemove"
|
|
|
:disabled="hasUnuploadedImages"
|
|
|
- :limit="1"
|
|
|
+ :limit="9"
|
|
|
:on-change="handleDetailUploadChange"
|
|
|
- :on-exceed="handleUploadExceed"
|
|
|
+ :on-exceed="handleDetailUploadExceed"
|
|
|
:on-preview="handlePictureCardPreview"
|
|
|
:on-remove="handleDetailRemove"
|
|
|
:show-file-list="true"
|
|
|
list-type="picture-card"
|
|
|
>
|
|
|
<template #trigger>
|
|
|
- <div v-if="detailFileList.length < 1" class="upload-trigger-card el-upload--picture-card">
|
|
|
+ <div v-if="detailFileList.length < 9" class="upload-trigger-card el-upload--picture-card">
|
|
|
<el-icon>
|
|
|
<Plus />
|
|
|
</el-icon>
|
|
|
@@ -183,7 +188,7 @@
|
|
|
</template>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
- <div class="upload-hint">请上传竖版图片,支持jpg、jpeg、png格式,上传图片不得超过20M</div>
|
|
|
+ <div class="upload-hint">请上传竖版图片,支持jpg、jpeg、png格式,最多上传9张,单张图片不得超过5M</div>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
@@ -316,7 +321,7 @@ const rules = reactive({
|
|
|
{ required: true, message: "请输入用户可参与次数", trigger: "blur" },
|
|
|
{
|
|
|
validator: (rule: any, value: any, callback: any) => {
|
|
|
- if (activityModel.value.activityType === 1) {
|
|
|
+ if (activityModel.value.activityType === 2) {
|
|
|
if (!value) {
|
|
|
callback(new Error("请输入用户可参与次数"));
|
|
|
return;
|
|
|
@@ -340,7 +345,7 @@ const rules = reactive({
|
|
|
{ required: true, message: "请选择活动规则", trigger: "change" },
|
|
|
{
|
|
|
validator: (rule: any, value: any, callback: any) => {
|
|
|
- if (activityModel.value.activityType === 1) {
|
|
|
+ if (activityModel.value.activityType === 2) {
|
|
|
if (!value || !Array.isArray(value) || value.length < 2) {
|
|
|
callback(new Error("请选择完整的活动规则(至少选择角色和行为)"));
|
|
|
return;
|
|
|
@@ -355,7 +360,7 @@ const rules = reactive({
|
|
|
{ required: true, message: "请选择优惠券", trigger: "change" },
|
|
|
{
|
|
|
validator: (rule: any, value: any, callback: any) => {
|
|
|
- if (activityModel.value.activityType === 1) {
|
|
|
+ if (activityModel.value.activityType === 2) {
|
|
|
if (!value) {
|
|
|
callback(new Error("请选择优惠券"));
|
|
|
return;
|
|
|
@@ -370,7 +375,7 @@ const rules = reactive({
|
|
|
{ required: true, message: "请输入优惠券发放数量", trigger: "blur" },
|
|
|
{
|
|
|
validator: (rule: any, value: any, callback: any) => {
|
|
|
- if (activityModel.value.activityType === 1) {
|
|
|
+ if (activityModel.value.activityType === 2) {
|
|
|
if (!value) {
|
|
|
callback(new Error("请输入优惠券发放数量"));
|
|
|
return;
|
|
|
@@ -394,7 +399,7 @@ const rules = reactive({
|
|
|
{ required: true, message: "请选择报名时间", trigger: "change" },
|
|
|
{
|
|
|
validator: (rule: any, value: any, callback: any) => {
|
|
|
- if (activityModel.value.activityType === 2) {
|
|
|
+ if (activityModel.value.activityType === 1) {
|
|
|
if (!value || !Array.isArray(value) || value.length !== 2) {
|
|
|
callback(new Error("请选择报名时间"));
|
|
|
return;
|
|
|
@@ -420,7 +425,7 @@ const rules = reactive({
|
|
|
{ required: true, message: "请输入活动详情", trigger: ["blur", "change"] },
|
|
|
{
|
|
|
validator: (rule: any, value: any, callback: any) => {
|
|
|
- if (activityModel.value.activityType === 2) {
|
|
|
+ if (activityModel.value.activityType === 1) {
|
|
|
if (!value || value.trim() === "") {
|
|
|
callback(new Error("请输入活动详情"));
|
|
|
return;
|
|
|
@@ -467,7 +472,9 @@ const rules = reactive({
|
|
|
required: true,
|
|
|
validator: (rule: any, value: any, callback: any) => {
|
|
|
if (activityModel.value.uploadImgType === 1) {
|
|
|
- if (!detailImageUrl.value) {
|
|
|
+ // 检查是否有成功上传的图片
|
|
|
+ const successFiles = detailFileList.value.filter((f: any) => f.status === "success" && f.url);
|
|
|
+ if (successFiles.length === 0) {
|
|
|
callback(new Error("请上传活动详情图"));
|
|
|
return;
|
|
|
}
|
|
|
@@ -481,8 +488,8 @@ const rules = reactive({
|
|
|
|
|
|
// ==================== 活动信息数据模型 ====================
|
|
|
const activityModel = ref<any>({
|
|
|
- // 活动类型:1-评论有礼,2-营销活动
|
|
|
- activityType: 2,
|
|
|
+ // 活动类型:1-营销活动,2-评论有礼
|
|
|
+ activityType: 1,
|
|
|
// 活动宣传图(包含标题和详情)
|
|
|
promotionImages: null,
|
|
|
// 活动标题图片
|
|
|
@@ -613,15 +620,17 @@ const handleDetailRemove: UploadProps["onRemove"] = (uploadFile, uploadFiles) =>
|
|
|
const file = uploadFile as any;
|
|
|
const imageUrl = file.url;
|
|
|
|
|
|
- if (imageUrl) {
|
|
|
- detailImageUrl.value = "";
|
|
|
- activityModel.value.activityDetailImg = null;
|
|
|
- activityModel.value.activityDetailImage = null;
|
|
|
- // 触发表单验证
|
|
|
- nextTick(() => {
|
|
|
- ruleFormRef.value?.validateField("activityDetailImage");
|
|
|
- });
|
|
|
- }
|
|
|
+ // 更新图片URL列表(移除已删除的图片)
|
|
|
+ const successFiles = uploadFiles.filter((f: any) => f.status === "success" && f.url);
|
|
|
+ const imageUrls = successFiles.map((f: any) => f.url);
|
|
|
+ detailImageUrl.value = imageUrls.length > 0 ? imageUrls.join(",") : "";
|
|
|
+ activityModel.value.activityDetailImg = imageUrls.length > 0 ? { url: imageUrls.join(",") } : null;
|
|
|
+ activityModel.value.activityDetailImage = imageUrls.length > 0 ? imageUrls.join(",") : "";
|
|
|
+
|
|
|
+ // 触发表单验证
|
|
|
+ nextTick(() => {
|
|
|
+ ruleFormRef.value?.validateField("activityDetailImage");
|
|
|
+ });
|
|
|
|
|
|
if (file.url && file.url.startsWith("blob:")) {
|
|
|
URL.revokeObjectURL(file.url);
|
|
|
@@ -631,13 +640,20 @@ const handleDetailRemove: UploadProps["onRemove"] = (uploadFile, uploadFiles) =>
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
- * 上传文件超出限制提示
|
|
|
+ * 上传文件超出限制提示(标题图)
|
|
|
*/
|
|
|
const handleUploadExceed: UploadProps["onExceed"] = () => {
|
|
|
ElMessage.warning("最多只能上传1张图片");
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
+ * 活动详情图上传超出限制提示
|
|
|
+ */
|
|
|
+const handleDetailUploadExceed: UploadProps["onExceed"] = () => {
|
|
|
+ ElMessage.warning("最多只能上传9张图片");
|
|
|
+};
|
|
|
+
|
|
|
+/**
|
|
|
* 活动标题图片上传 - 文件变更
|
|
|
*/
|
|
|
const handleTitleUploadChange: UploadProps["onChange"] = async (uploadFile, uploadFiles) => {
|
|
|
@@ -668,8 +684,8 @@ const handleTitleUploadChange: UploadProps["onChange"] = async (uploadFile, uplo
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // 检查文件大小,不得超过20M
|
|
|
- const maxSize = 20 * 1024 * 1024; // 20MB
|
|
|
+ // 检查文件大小,不得超过5M
|
|
|
+ const maxSize = 5 * 1024 * 1024; // 5MB
|
|
|
if (uploadFile.raw.size > maxSize) {
|
|
|
// 从文件列表中移除超过大小的文件
|
|
|
const index = titleFileList.value.findIndex((f: any) => f.uid === uploadFile.uid);
|
|
|
@@ -685,7 +701,7 @@ const handleTitleUploadChange: UploadProps["onChange"] = async (uploadFile, uplo
|
|
|
if (uploadFile.url && uploadFile.url.startsWith("blob:")) {
|
|
|
URL.revokeObjectURL(uploadFile.url);
|
|
|
}
|
|
|
- ElMessage.warning("上传图片不得超过20M");
|
|
|
+ ElMessage.warning("上传图片不得超过5M");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
@@ -737,8 +753,8 @@ const handleDetailUploadChange: UploadProps["onChange"] = async (uploadFile, upl
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // 检查文件大小,不得超过20M
|
|
|
- const maxSize = 20 * 1024 * 1024; // 20MB
|
|
|
+ // 检查文件大小,不得超过5M
|
|
|
+ const maxSize = 5 * 1024 * 1024; // 5MB
|
|
|
if (uploadFile.raw.size > maxSize) {
|
|
|
// 从文件列表中移除超过大小的文件
|
|
|
const index = detailFileList.value.findIndex((f: any) => f.uid === uploadFile.uid);
|
|
|
@@ -754,7 +770,7 @@ const handleDetailUploadChange: UploadProps["onChange"] = async (uploadFile, upl
|
|
|
if (uploadFile.url && uploadFile.url.startsWith("blob:")) {
|
|
|
URL.revokeObjectURL(uploadFile.url);
|
|
|
}
|
|
|
- ElMessage.warning("上传图片不得超过20M");
|
|
|
+ ElMessage.warning("上传图片不得超过5M");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
@@ -826,9 +842,13 @@ const uploadSingleFile = async (file: UploadFile, uploadType: string) => {
|
|
|
ruleFormRef.value?.validateField("activityTitleImage");
|
|
|
});
|
|
|
} else if (uploadType === "detail") {
|
|
|
- detailImageUrl.value = imageUrl;
|
|
|
- activityModel.value.activityDetailImg = { url: imageUrl };
|
|
|
- activityModel.value.activityDetailImage = imageUrl;
|
|
|
+ // 支持多张图片,将所有成功上传的图片URL组合
|
|
|
+ const successFiles = detailFileList.value.filter((f: any) => f.status === "success" && f.url);
|
|
|
+ const imageUrls = successFiles.map((f: any) => f.url);
|
|
|
+ // 如果有多张图片,用逗号连接;如果只有一张,保持字符串格式
|
|
|
+ detailImageUrl.value = imageUrls.length > 0 ? imageUrls.join(",") : "";
|
|
|
+ activityModel.value.activityDetailImg = imageUrls.length > 0 ? { url: imageUrls.join(",") } : null;
|
|
|
+ activityModel.value.activityDetailImage = imageUrls.length > 0 ? imageUrls.join(",") : "";
|
|
|
// 触发表单验证
|
|
|
nextTick(() => {
|
|
|
ruleFormRef.value?.validateField("activityDetailImage");
|
|
|
@@ -914,13 +934,6 @@ watch(
|
|
|
|
|
|
nextTick(() => {
|
|
|
if (newVal === 1) {
|
|
|
- // 切换到评论有礼:清除营销活动相关字段
|
|
|
- activityModel.value.signupTimeRange = [];
|
|
|
- activityModel.value.activityLimitPeople = "";
|
|
|
- activityModel.value.activityDetails = "";
|
|
|
- // 清除营销活动字段的验证状态
|
|
|
- ruleFormRef.value?.clearValidate(["signupTimeRange", "activityLimitPeople", "activityDetails"]);
|
|
|
- } else if (newVal === 2) {
|
|
|
// 切换到营销活动:清除评论有礼相关字段
|
|
|
activityModel.value.participationLimit = "";
|
|
|
activityModel.value.activityRule = [];
|
|
|
@@ -928,6 +941,13 @@ watch(
|
|
|
activityModel.value.couponQuantity = "";
|
|
|
// 清除评论有礼字段的验证状态
|
|
|
ruleFormRef.value?.clearValidate(["participationLimit", "activityRule", "couponId", "couponQuantity"]);
|
|
|
+ } else if (newVal === 2) {
|
|
|
+ // 切换到评论有礼:清除营销活动相关字段
|
|
|
+ activityModel.value.signupTimeRange = [];
|
|
|
+ activityModel.value.activityLimitPeople = "";
|
|
|
+ activityModel.value.activityDetails = "";
|
|
|
+ // 清除营销活动字段的验证状态
|
|
|
+ ruleFormRef.value?.clearValidate(["signupTimeRange", "activityLimitPeople", "activityDetails"]);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -1013,32 +1033,63 @@ onMounted(async () => {
|
|
|
try {
|
|
|
const res: any = await getActivityDetail({ id: id.value });
|
|
|
if (res && res.code == 200) {
|
|
|
- activityModel.value = { ...activityModel.value, ...res.data };
|
|
|
+ // 先设置 activityType 为数字类型,确保下拉框正确显示
|
|
|
+ if (res.data.activityType !== undefined) {
|
|
|
+ activityModel.value.activityType = Number(res.data.activityType);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 合并其他数据
|
|
|
+ activityModel.value.activityName = res.data.activityName || "";
|
|
|
+
|
|
|
// 处理活动时间范围
|
|
|
if (res.data.startTime && res.data.endTime) {
|
|
|
- activityModel.value.activityTimeRange = [res.data.startTime, res.data.endTime];
|
|
|
+ // 只取日期部分(去掉时分秒)
|
|
|
+ const startDate = res.data.startTime.split(" ")[0];
|
|
|
+ const endDate = res.data.endTime.split(" ")[0];
|
|
|
+ activityModel.value.activityTimeRange = [startDate, endDate];
|
|
|
}
|
|
|
- // 加载活动规则(评论有礼)
|
|
|
- if (res.data.activityRule) {
|
|
|
- activityModel.value.activityRule = res.data.activityRule.split(",");
|
|
|
- } else {
|
|
|
- activityModel.value.activityRule = [];
|
|
|
- }
|
|
|
- // 加载报名开始时间(营销活动)
|
|
|
- if (res.data.signupStartTime) {
|
|
|
- activityModel.value.signupStartTime = res.data.signupStartTime;
|
|
|
- }
|
|
|
- // 加载报名结束时间(营销活动)
|
|
|
- if (res.data.signupEndTime) {
|
|
|
- activityModel.value.signupEndTime = res.data.signupEndTime;
|
|
|
- }
|
|
|
- // 加载活动限制人数(营销活动)
|
|
|
- if (res.data.activityLimitPeople !== undefined) {
|
|
|
- activityModel.value.activityLimitPeople = res.data.activityLimitPeople;
|
|
|
- }
|
|
|
- // 加载活动详情(营销活动)
|
|
|
- if (res.data.activityDetails) {
|
|
|
- activityModel.value.activityDetails = res.data.activityDetails;
|
|
|
+
|
|
|
+ // 根据活动类型加载对应字段
|
|
|
+ if (activityModel.value.activityType === 1) {
|
|
|
+ // 营销活动:加载报名时间、活动限制人数、活动详情
|
|
|
+ if (res.data.signupStartTime && res.data.signupEndTime) {
|
|
|
+ // 只取日期部分(去掉时分秒)
|
|
|
+ const signupStartDate = res.data.signupStartTime.split(" ")[0];
|
|
|
+ const signupEndDate = res.data.signupEndTime.split(" ")[0];
|
|
|
+ activityModel.value.signupTimeRange = [signupStartDate, signupEndDate];
|
|
|
+ } else {
|
|
|
+ activityModel.value.signupTimeRange = [];
|
|
|
+ }
|
|
|
+ // 加载活动限制人数
|
|
|
+ if (res.data.activityLimitPeople !== undefined && res.data.activityLimitPeople !== null) {
|
|
|
+ activityModel.value.activityLimitPeople = String(res.data.activityLimitPeople);
|
|
|
+ } else {
|
|
|
+ activityModel.value.activityLimitPeople = "";
|
|
|
+ }
|
|
|
+ // 加载活动详情
|
|
|
+ activityModel.value.activityDetails = res.data.activityDetails || "";
|
|
|
+ } else if (activityModel.value.activityType === 2) {
|
|
|
+ // 评论有礼:加载活动规则、优惠券、优惠券发放数量、用户可参与次数
|
|
|
+ // 加载活动规则
|
|
|
+ if (res.data.activityRule) {
|
|
|
+ activityModel.value.activityRule = res.data.activityRule.split(",");
|
|
|
+ } else {
|
|
|
+ activityModel.value.activityRule = [];
|
|
|
+ }
|
|
|
+ // 加载优惠券ID
|
|
|
+ activityModel.value.couponId = res.data.couponId || "";
|
|
|
+ // 加载优惠券发放数量
|
|
|
+ if (res.data.couponQuantity !== undefined && res.data.couponQuantity !== null) {
|
|
|
+ activityModel.value.couponQuantity = String(res.data.couponQuantity);
|
|
|
+ } else {
|
|
|
+ activityModel.value.couponQuantity = "";
|
|
|
+ }
|
|
|
+ // 加载用户可参与次数
|
|
|
+ if (res.data.participationLimit !== undefined && res.data.participationLimit !== null) {
|
|
|
+ activityModel.value.participationLimit = String(res.data.participationLimit);
|
|
|
+ } else {
|
|
|
+ activityModel.value.participationLimit = "";
|
|
|
+ }
|
|
|
}
|
|
|
// 加载上传图片方式
|
|
|
if (res.data.uploadImgType !== undefined) {
|
|
|
@@ -1065,15 +1116,22 @@ onMounted(async () => {
|
|
|
titleFileList.value = [titleFile];
|
|
|
}
|
|
|
}
|
|
|
- // 如果有详情图片,添加到文件列表
|
|
|
+ // 如果有详情图片,添加到文件列表(支持多张图片,可能是字符串或数组)
|
|
|
if (res.data.activityDetailImgUrl) {
|
|
|
- const detailImgUrl = res.data.activityDetailImgUrl;
|
|
|
- if (detailImgUrl) {
|
|
|
- detailImageUrl.value = detailImgUrl;
|
|
|
+ let detailImgUrls: string[] = [];
|
|
|
+ // 如果是字符串,可能是逗号分隔的多张图片
|
|
|
+ if (typeof res.data.activityDetailImgUrl === "string") {
|
|
|
+ detailImgUrls = res.data.activityDetailImgUrl.split(",").filter((url: string) => url.trim());
|
|
|
+ } else if (Array.isArray(res.data.activityDetailImgUrl)) {
|
|
|
+ detailImgUrls = res.data.activityDetailImgUrl.filter((url: any) => url);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (detailImgUrls.length > 0) {
|
|
|
+ detailImageUrl.value = detailImgUrls.join(",");
|
|
|
activityModel.value.activityDetailImg = res.data.activityDetailImgUrl;
|
|
|
- activityModel.value.activityDetailImage = detailImgUrl;
|
|
|
- const detailFile = handleImageParam(detailImgUrl);
|
|
|
- detailFileList.value = [detailFile];
|
|
|
+ activityModel.value.activityDetailImage = detailImgUrls.join(",");
|
|
|
+ // 将多张图片添加到文件列表
|
|
|
+ detailFileList.value = detailImgUrls.map((url: string) => handleImageParam(url));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1090,6 +1148,24 @@ onMounted(async () => {
|
|
|
// ==================== 事件处理函数 ====================
|
|
|
|
|
|
/**
|
|
|
+ * 处理正整数输入(只允许输入正整数)
|
|
|
+ */
|
|
|
+const handlePositiveIntegerInput = (field: string, value: string) => {
|
|
|
+ // 移除所有非数字字符
|
|
|
+ let filteredValue = value.replace(/[^\d]/g, "");
|
|
|
+
|
|
|
+ // 限制最大长度为20
|
|
|
+ if (filteredValue.length > 20) {
|
|
|
+ filteredValue = filteredValue.substring(0, 20);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 更新对应字段的值
|
|
|
+ if (field === "activityLimitPeople") {
|
|
|
+ activityModel.value.activityLimitPeople = filteredValue;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+/**
|
|
|
* 返回上一页
|
|
|
*/
|
|
|
const goBack = () => {
|
|
|
@@ -1129,17 +1205,6 @@ const handleSubmit = async () => {
|
|
|
|
|
|
// 根据活动类型添加不同的字段,确保只提交对应类型的字段
|
|
|
if (activityModel.value.activityType === 1) {
|
|
|
- // 评论有礼:只添加评论有礼相关字段
|
|
|
- params.participationLimit = activityModel.value.participationLimit;
|
|
|
- params.activityRule = activityModel.value.activityRule.join(",");
|
|
|
- params.couponId = activityModel.value.couponId;
|
|
|
- params.couponQuantity = activityModel.value.couponQuantity;
|
|
|
- // 确保不包含营销活动的字段
|
|
|
- delete params.signupStartTime;
|
|
|
- delete params.signupEndTime;
|
|
|
- delete params.activityLimitPeople;
|
|
|
- delete params.activityDetails;
|
|
|
- } else if (activityModel.value.activityType === 2) {
|
|
|
// 营销活动:只添加营销活动相关字段
|
|
|
const [signupStartTime, signupEndTime] = activityModel.value.signupTimeRange || [];
|
|
|
params.signupStartTime = signupStartTime;
|
|
|
@@ -1151,6 +1216,17 @@ const handleSubmit = async () => {
|
|
|
delete params.activityRule;
|
|
|
delete params.couponId;
|
|
|
delete params.couponQuantity;
|
|
|
+ } else if (activityModel.value.activityType === 2) {
|
|
|
+ // 评论有礼:只添加评论有礼相关字段
|
|
|
+ params.participationLimit = activityModel.value.participationLimit;
|
|
|
+ params.activityRule = activityModel.value.activityRule.join(",");
|
|
|
+ params.couponId = activityModel.value.couponId;
|
|
|
+ params.couponQuantity = activityModel.value.couponQuantity;
|
|
|
+ // 确保不包含营销活动的字段
|
|
|
+ delete params.signupStartTime;
|
|
|
+ delete params.signupEndTime;
|
|
|
+ delete params.activityLimitPeople;
|
|
|
+ delete params.activityDetails;
|
|
|
}
|
|
|
|
|
|
// 根据上传图片方式设置不同的参数
|
|
|
@@ -1330,18 +1406,14 @@ const handleSubmit = async () => {
|
|
|
|
|
|
// 竖版图片样式
|
|
|
&.upload-area-vertical {
|
|
|
- max-width: 300px;
|
|
|
:deep(.el-upload--picture-card) {
|
|
|
- width: 100%;
|
|
|
- height: 400px;
|
|
|
- aspect-ratio: 3 / 4;
|
|
|
+ width: 150px;
|
|
|
+ height: 150px;
|
|
|
}
|
|
|
:deep(.el-upload-list--picture-card) {
|
|
|
- width: 100%;
|
|
|
.el-upload-list__item {
|
|
|
- width: 100%;
|
|
|
- height: 400px;
|
|
|
- aspect-ratio: 3 / 4;
|
|
|
+ width: 150px;
|
|
|
+ height: 150px;
|
|
|
margin: 0;
|
|
|
}
|
|
|
}
|