From 4d3f82c38a1388a0e7659fe116e5881300ed54c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E7=9A=87?= <236220500@qq.com> Date: Sun, 31 May 2020 16:45:37 +0800 Subject: [PATCH] 1 --- src/pages/shop/IncreaseWelcomeEdit.vue | 22 +++++++++++++++++++--- src/pages/shop/IncreaseWelcomeList.vue | 9 +++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/pages/shop/IncreaseWelcomeEdit.vue b/src/pages/shop/IncreaseWelcomeEdit.vue index 0527a13..e066f0b 100644 --- a/src/pages/shop/IncreaseWelcomeEdit.vue +++ b/src/pages/shop/IncreaseWelcomeEdit.vue @@ -44,9 +44,15 @@ {{ welcome.stores[0].name }}等{{ welcome.stores.length }}家店铺 - + @@ -63,6 +69,7 @@ :on-success="uploadImgSuccess" :format="['jpg', 'jpeg', 'png']" :max-size="2048" + :on-exceeded-size="onExceededSize" :before-upload="handleBeforeUpload" multiple type="drag" @@ -70,7 +77,7 @@ style="width: 100%;" >
- +
@@ -133,6 +140,7 @@ export default { showMini: false, id: 0, showMessageTypes: false, + imageUploading: false, welcome: { content: "", params: [], @@ -194,6 +202,9 @@ export default { this.showStoreCheck = false; this.welcome = store.getters.useData; }, + onExceededSize() { + console.log("失败"); + }, getDetail(instanceId) { let _this = this; ActivityManager.instanceDetail( @@ -283,6 +294,8 @@ export default { const me = this; let data = new FormData(); data.append("file", res); + console.log(data); + this.imageUploading = true; axios({ method: "post", url: "/upload", @@ -291,6 +304,7 @@ export default { "Content-Type": "multipart/form-data" } }).then(function(res) { + me.imageUploading = false; if (res.data.success) { // me.formValidate.logo = res.data.results; me.welcome.params.push({ @@ -312,10 +326,12 @@ export default { submit() { let _this = this; if (this.welcome.params.length <= 0) { - _this.$Message.error("请添加图片/网页/小程序消息"); + _this.$Message.error("图片/网页/小程序消息至少添加一个"); + return false; } if (this.welcome.stores.length <= 0) { _this.$Message.error("请至少选择一个店铺"); + return false; } this.$refs["welcomeForm"].validate(valid => { if (valid) { diff --git a/src/pages/shop/IncreaseWelcomeList.vue b/src/pages/shop/IncreaseWelcomeList.vue index 526c06d..28ece5e 100644 --- a/src/pages/shop/IncreaseWelcomeList.vue +++ b/src/pages/shop/IncreaseWelcomeList.vue @@ -76,15 +76,12 @@ export default { title: "配置范围", key: "shop", render(h, params) { - if (params.row.storeName == null) { - return h("span", "店铺插入中..."); - } return h( "span", - params.row.storeName + - "等" + + (params.row.companyCount || 0) + + "家零售公司, " + (params.row.storeCount || 0) + - "家公司" + "家店铺" ); } },