|
|
|
@ -20,14 +20,32 @@
|
|
|
|
|
:key="index"
|
|
|
|
|
>
|
|
|
|
|
<div v-if="item.type == 3">
|
|
|
|
|
<i-col style="line-height: 32px" :span="4">APPID {{ index + 1 }}</i-col>
|
|
|
|
|
<i-col :span="6">
|
|
|
|
|
<i-col style="line-height: 32px" :span="2">标题 {{ index + 1 }}</i-col>
|
|
|
|
|
<i-col :span="3">
|
|
|
|
|
<i-input class="inputClass" type="text" disabled v-model="item.key"></i-input>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col style="line-height: 32px" :span="2">APPID {{ index + 1 }}</i-col>
|
|
|
|
|
<i-col :span="3">
|
|
|
|
|
<i-input class="inputClass" type="text" disabled v-model="item.defaultVal"></i-input>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col style="line-height: 32px" :span="4">URI {{ index + 1 }}</i-col>
|
|
|
|
|
<i-col :span="6">
|
|
|
|
|
<i-col style="line-height: 32px" :span="2">URI {{ index + 1 }}</i-col>
|
|
|
|
|
<i-col :span="3">
|
|
|
|
|
<i-input class="inputClass" type="text" disabled v-model="item.description"></i-input>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col style="line-height: 32px" :span="2">MediaId{{ index + 1 }}</i-col>
|
|
|
|
|
<i-col :span="3">
|
|
|
|
|
<i-input class="inputClass" type="text" disabled v-model="item.limitLower"></i-input>
|
|
|
|
|
</i-col>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else-if="item.type == 2">
|
|
|
|
|
<i-col style="line-height: 32px" :span="4">标题 {{ index + 1 }}</i-col>
|
|
|
|
|
<i-col :span="8">
|
|
|
|
|
<i-input class="inputClass" type="text" disabled v-model="item.description"></i-input>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col style="line-height: 32px" :span="4">URL {{ index + 1 }}</i-col>
|
|
|
|
|
<i-col :span="8">
|
|
|
|
|
<i-input class="inputClass" type="text" disabled v-model="item.defaultVal"></i-input>
|
|
|
|
|
</i-col>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
|
|
|
|
<i-col style="line-height: 32px" :span="4">{{ item.name }}{{ index + 1 }}</i-col>
|
|
|
|
@ -91,6 +109,9 @@
|
|
|
|
|
</Modal>
|
|
|
|
|
<Modal v-model="showWeb" title="添加网页消息" :loading="true">
|
|
|
|
|
<Form ref="webForm" :model="webForm" :rules="webFormRules">
|
|
|
|
|
<FormItem label="标题" prop="url">
|
|
|
|
|
<i-input v-model="webForm.title" type="text" placeholder="请输入网页标题"></i-input>
|
|
|
|
|
</FormItem>
|
|
|
|
|
<FormItem label="添加网页消息" prop="url">
|
|
|
|
|
<i-input v-model="webForm.url" type="text" placeholder="以http或https开头"></i-input>
|
|
|
|
|
</FormItem>
|
|
|
|
@ -102,12 +123,39 @@
|
|
|
|
|
</Modal>
|
|
|
|
|
<Modal v-model="showMini" title="添加小程序消息" :loading="true">
|
|
|
|
|
<Form ref="miniForm" :model="miniForm" :rules="miniFormRules">
|
|
|
|
|
<FormItem label="标题" prop="key">
|
|
|
|
|
<i-input v-model="miniForm.key" type="text" placeholder="请输入标题"></i-input>
|
|
|
|
|
</FormItem>
|
|
|
|
|
<FormItem label="APPID" prop="appid">
|
|
|
|
|
<i-input v-model="miniForm.appid" type="text" placeholder="请输入appid"></i-input>
|
|
|
|
|
</FormItem>
|
|
|
|
|
<FormItem label="URI" prop="uri">
|
|
|
|
|
<i-input v-model="miniForm.uri" type="text" placeholder="请输入URl"></i-input>
|
|
|
|
|
</FormItem>
|
|
|
|
|
<FormItem label="封面图">
|
|
|
|
|
<Upload
|
|
|
|
|
ref="upload"
|
|
|
|
|
:show-upload-list="false"
|
|
|
|
|
:on-success="miniUploadImgSuccess"
|
|
|
|
|
:format="['jpg', 'jpeg', 'png']"
|
|
|
|
|
:max-size="2048"
|
|
|
|
|
:before-upload="handleBeforeUploadMini"
|
|
|
|
|
multiple
|
|
|
|
|
type="drag"
|
|
|
|
|
action
|
|
|
|
|
style="display: inline-block;"
|
|
|
|
|
>
|
|
|
|
|
<div style="width: 200px;height:200px;line-height: 200px;border:1px dashed #dedede">
|
|
|
|
|
<span v-if="!miniForm.limitUpper">请上传图片</span>
|
|
|
|
|
<img
|
|
|
|
|
v-if="miniForm.limitUpper"
|
|
|
|
|
:src="`/kiisoo-ic` + miniForm.limitUpper"
|
|
|
|
|
alt
|
|
|
|
|
style="width: 100%; height: auto"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</Upload>
|
|
|
|
|
</FormItem>
|
|
|
|
|
</Form>
|
|
|
|
|
<div slot="footer">
|
|
|
|
|
<Button type="primary" @click="cancelMini">取消</Button>
|
|
|
|
@ -164,14 +212,16 @@ export default {
|
|
|
|
|
url: [
|
|
|
|
|
{ required: true, message: "请输入url", trigger: "blur" },
|
|
|
|
|
{ validator: validateUrl, trigger: "blur" }
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
title: [{ required: true, message: "请输入标题", trigger: "blur" }]
|
|
|
|
|
},
|
|
|
|
|
webForm: { url: "" },
|
|
|
|
|
webForm: { url: "", title: "" },
|
|
|
|
|
miniFormRules: {
|
|
|
|
|
appid: [{ required: true, message: "请输入url", trigger: "blur" }],
|
|
|
|
|
uri: [{ required: true, message: "请输入url", trigger: "blur" }]
|
|
|
|
|
appid: [{ required: true, message: "请输入appid", trigger: "blur" }],
|
|
|
|
|
uri: [{ required: true, message: "请输入uri", trigger: "blur" }],
|
|
|
|
|
key: [{ required: true, message: "请输入标题", trigger: "blur" }]
|
|
|
|
|
},
|
|
|
|
|
miniForm: { appid: "", uri: "" }
|
|
|
|
|
miniForm: { appid: "", uri: "", limitLower: "", limitUpper: "", key: "" }
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
@ -229,18 +279,22 @@ export default {
|
|
|
|
|
this.showStoreCheck = true;
|
|
|
|
|
},
|
|
|
|
|
uploadImgSuccess(res, file) {},
|
|
|
|
|
miniUploadImgSuccess(res, file) {},
|
|
|
|
|
cancelWeb() {
|
|
|
|
|
this.showWeb = false;
|
|
|
|
|
},
|
|
|
|
|
doShowWeb() {
|
|
|
|
|
this.showWeb = true;
|
|
|
|
|
this.webForm = { url: "" };
|
|
|
|
|
this.webForm = { url: "", title: "" };
|
|
|
|
|
},
|
|
|
|
|
doShowMini() {
|
|
|
|
|
this.showMini = true;
|
|
|
|
|
this.miniForm = {
|
|
|
|
|
appid: "",
|
|
|
|
|
uri: ""
|
|
|
|
|
uri: "",
|
|
|
|
|
limitLower: "",
|
|
|
|
|
limitUpper: "",
|
|
|
|
|
key: ""
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
cancelMini() {
|
|
|
|
@ -253,7 +307,7 @@ export default {
|
|
|
|
|
_this.welcome.params.push({
|
|
|
|
|
attr: 2,
|
|
|
|
|
defaultVal: this.webForm.url,
|
|
|
|
|
description: this.webForm.url,
|
|
|
|
|
description: this.webForm.title,
|
|
|
|
|
isRequired: 1,
|
|
|
|
|
key: "url",
|
|
|
|
|
limitLower: null,
|
|
|
|
@ -275,9 +329,9 @@ export default {
|
|
|
|
|
defaultVal: this.miniForm.appid,
|
|
|
|
|
description: this.miniForm.uri,
|
|
|
|
|
isRequired: 1,
|
|
|
|
|
key: "mini",
|
|
|
|
|
limitLower: null,
|
|
|
|
|
limitUpper: null,
|
|
|
|
|
key: this.miniForm.key,
|
|
|
|
|
limitLower: this.miniForm.limitLower,
|
|
|
|
|
limitUpper: this.miniForm.limitUpper,
|
|
|
|
|
name: "小程序消息",
|
|
|
|
|
type: 3
|
|
|
|
|
});
|
|
|
|
@ -290,10 +344,36 @@ export default {
|
|
|
|
|
this.welcome.params.splice(index, 1);
|
|
|
|
|
this.$forceUpdate();
|
|
|
|
|
},
|
|
|
|
|
handleBeforeUploadMini(res) {
|
|
|
|
|
const me = this;
|
|
|
|
|
let data = new FormData();
|
|
|
|
|
data.append("file", res);
|
|
|
|
|
data.append("needMediaId", "true");
|
|
|
|
|
console.log(data);
|
|
|
|
|
this.imageUploading = true;
|
|
|
|
|
axios({
|
|
|
|
|
method: "post",
|
|
|
|
|
url: "/upload",
|
|
|
|
|
data: data,
|
|
|
|
|
headers: {
|
|
|
|
|
"Content-Type": "multipart/form-data"
|
|
|
|
|
}
|
|
|
|
|
}).then(function(res) {
|
|
|
|
|
me.imageUploading = false;
|
|
|
|
|
if (res.data.success) {
|
|
|
|
|
// me.formValidate.logo = res.data.results;
|
|
|
|
|
me.miniForm.limitLower = res.data.results.mediaId;
|
|
|
|
|
me.miniForm.limitUpper = res.data.results.localPath;
|
|
|
|
|
me.showMessageTypes = false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
handleBeforeUpload(res) {
|
|
|
|
|
const me = this;
|
|
|
|
|
let data = new FormData();
|
|
|
|
|
data.append("file", res);
|
|
|
|
|
data.append("needMediaId", "true");
|
|
|
|
|
console.log(data);
|
|
|
|
|
this.imageUploading = true;
|
|
|
|
|
axios({
|
|
|
|
@ -309,8 +389,8 @@ export default {
|
|
|
|
|
// me.formValidate.logo = res.data.results;
|
|
|
|
|
me.welcome.params.push({
|
|
|
|
|
attr: 2,
|
|
|
|
|
defaultVal: res.data.results,
|
|
|
|
|
description: res.data.results,
|
|
|
|
|
defaultVal: res.data.results.mediaId,
|
|
|
|
|
description: res.data.results.localPath,
|
|
|
|
|
isRequired: 1,
|
|
|
|
|
key: "image",
|
|
|
|
|
limitLower: null,
|
|
|
|
@ -325,10 +405,6 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
submit() {
|
|
|
|
|
let _this = this;
|
|
|
|
|
if (this.welcome.params.length <= 0) {
|
|
|
|
|
_this.$Message.error("图片/网页/小程序消息至少添加一个");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (this.welcome.stores.length <= 0) {
|
|
|
|
|
_this.$Message.error("请至少选择一个店铺");
|
|
|
|
|
return false;
|
|
|
|
|