From 85fa33eb6c31b9344cf9bc651974a306f3ad05a0 Mon Sep 17 00:00:00 2001 From: dengbw Date: Fri, 30 Sep 2022 09:45:19 +0800 Subject: [PATCH] market_api_930 --- .../activity/components/activity-edit.vue | 45 ++++++++++++++++--- src/views/sylive/activity/index.vue | 2 +- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/src/views/sylive/activity/components/activity-edit.vue b/src/views/sylive/activity/components/activity-edit.vue index cdf2402..e609007 100644 --- a/src/views/sylive/activity/components/activity-edit.vue +++ b/src/views/sylive/activity/components/activity-edit.vue @@ -84,7 +84,18 @@ type="textarea" /> - + + +
建议尺寸200X200
+
+ - +
- 新增分享描述 + 新增分享文案
@@ -155,7 +166,8 @@ shareTitle: [''], shareImg: [], bgImg: [], - channelImg: [] + channelImg: [], + sharePhoto: [] }; return { defaultForm, @@ -219,7 +231,7 @@ } }, methods: { - /* 添加分享描述 */ + /* 添加海报描述 */ addShareTitle() { this.form.shareTitle.push(''); }, @@ -299,6 +311,27 @@ this.form.channelImg.push(item); this.onUpload(item); }, + sharePhotoHandler(file) { + const item = { + file, + uid: file.uid, + name: file.name, + progress: 0, + status: null + }; + if (!file.type.startsWith('image')) { + this.$message.error('只能选择图片'); + return; + } + if (file.size / 1024 / 1024 > 2) { + this.$message.error('大小不能超过 2MB'); + return; + } + item.url = window.URL.createObjectURL(file); + // 关键就是这里要自己 push 添加数据而不是靠 v-modal 自动更新 + this.form.sharePhoto.push(item); + this.onUpload(item); + }, /* 上传事件 */ shareImgHandler(file) { const item = { diff --git a/src/views/sylive/activity/index.vue b/src/views/sylive/activity/index.vue index 958cd87..e90ce0b 100644 --- a/src/views/sylive/activity/index.vue +++ b/src/views/sylive/activity/index.vue @@ -49,7 +49,7 @@ icon="el-icon-data-analysis" @click="openStatistics(row.activityId)" > - 统计 + 数据