feature_0521
郑皇 5 years ago
parent 716713daad
commit 4d3f82c38a

@ -44,9 +44,15 @@
</FormItem>
<FormItem label="配置范围: ">
<span
@click="showStores"
v-if="welcome.stores.length > 0"
>{{ welcome.stores[0].name }}{{ welcome.stores.length }}家店铺</span>
<Button type="text" @click="showStores" icon="md-add">全部店铺</Button>
<Button
type="text"
v-if="welcome.stores.length <= 0"
@click="showStores"
icon="md-add"
>全部店铺</Button>
</FormItem>
<FormItem>
<Button type="primary" long @click="submit"></Button>
@ -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%;"
>
<div style="width: 100%;">
<Button long type="primary">图片</Button>
<Button long type="primary">{{imageUploading ? "上传中..." : "图片"}}</Button>
</div>
</Upload>
</i-col>
@ -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) {

@ -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) +
"家公司"
"家店铺"
);
}
},

Loading…
Cancel
Save