|
|
|
@ -1,27 +1,25 @@
|
|
|
|
|
<template>
|
|
|
|
|
<Modal
|
|
|
|
|
v-model="dispalyModal"
|
|
|
|
|
<Modal v-model="dispalyModal"
|
|
|
|
|
width="1000"
|
|
|
|
|
:loading="loading"
|
|
|
|
|
:mask-closable="false"
|
|
|
|
|
@on-cancel="cancel"
|
|
|
|
|
@on-ok="save"
|
|
|
|
|
>
|
|
|
|
|
<p slot="header" style="color:#f60;text-align:left">
|
|
|
|
|
@on-ok="save">
|
|
|
|
|
<p slot="header"
|
|
|
|
|
style="color:#f60;text-align:left">
|
|
|
|
|
<span>配置活动</span>
|
|
|
|
|
</p>
|
|
|
|
|
<div>基本配置</div>
|
|
|
|
|
<Form
|
|
|
|
|
ref="formValidate"
|
|
|
|
|
<Form ref="formValidate"
|
|
|
|
|
:model="formValidate"
|
|
|
|
|
:rules="ruleValidate"
|
|
|
|
|
:label-width="80"
|
|
|
|
|
>
|
|
|
|
|
:label-width="80">
|
|
|
|
|
<Row>
|
|
|
|
|
<i-col style="text-align: left;" span="8">
|
|
|
|
|
<FormItem label="" prop="logo">
|
|
|
|
|
<Upload
|
|
|
|
|
ref="upload"
|
|
|
|
|
<i-col style="text-align: left;"
|
|
|
|
|
span="8">
|
|
|
|
|
<FormItem label=""
|
|
|
|
|
prop="logo">
|
|
|
|
|
<Upload ref="upload"
|
|
|
|
|
:show-upload-list="false"
|
|
|
|
|
:on-success="uploadImgSuccess"
|
|
|
|
|
:format="['jpg', 'jpeg', 'png']"
|
|
|
|
@ -30,90 +28,75 @@
|
|
|
|
|
multiple
|
|
|
|
|
type="drag"
|
|
|
|
|
action=""
|
|
|
|
|
style="display: inline-block;"
|
|
|
|
|
>
|
|
|
|
|
style="display: inline-block;">
|
|
|
|
|
<div style="width: 200px;height:200px;line-height: 200px;">
|
|
|
|
|
<span v-if="!formValidate.logo">请上传图片</span>
|
|
|
|
|
<img
|
|
|
|
|
v-if="formValidate.logo"
|
|
|
|
|
<img v-if="formValidate.logo"
|
|
|
|
|
:src="`/kiisoo-ic` + formValidate.logo"
|
|
|
|
|
alt=""
|
|
|
|
|
style="width: 100%; height: auto"
|
|
|
|
|
/>
|
|
|
|
|
style="width: 100%; height: auto" />
|
|
|
|
|
</div>
|
|
|
|
|
</Upload>
|
|
|
|
|
</FormItem>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="15" offset="1">
|
|
|
|
|
<FormItem label="活动名称" prop="name">
|
|
|
|
|
<i-input
|
|
|
|
|
type="text"
|
|
|
|
|
<i-col span="15"
|
|
|
|
|
offset="1">
|
|
|
|
|
<FormItem label="活动名称"
|
|
|
|
|
prop="name">
|
|
|
|
|
<i-input type="text"
|
|
|
|
|
v-model="formValidate.name"
|
|
|
|
|
placeholder="请输入活动名称"
|
|
|
|
|
></i-input>
|
|
|
|
|
placeholder="请输入活动名称"></i-input>
|
|
|
|
|
</FormItem>
|
|
|
|
|
<Form-item label="活动描述" prop="description">
|
|
|
|
|
<i-input
|
|
|
|
|
v-model="formValidate.description"
|
|
|
|
|
<Form-item label="活动描述"
|
|
|
|
|
prop="description">
|
|
|
|
|
<i-input v-model="formValidate.description"
|
|
|
|
|
type="textarea"
|
|
|
|
|
:autosize="{ minRows: 3 }"
|
|
|
|
|
placeholder="请输入活动描述"
|
|
|
|
|
></i-input>
|
|
|
|
|
placeholder="请输入活动描述"></i-input>
|
|
|
|
|
</Form-item>
|
|
|
|
|
<FormItem label="APPID" prop="appId">
|
|
|
|
|
<i-input
|
|
|
|
|
type="text"
|
|
|
|
|
<FormItem label="APPID"
|
|
|
|
|
prop="appId">
|
|
|
|
|
<i-input type="text"
|
|
|
|
|
v-model="formValidate.appId"
|
|
|
|
|
placeholder="请输入appid"
|
|
|
|
|
></i-input>
|
|
|
|
|
placeholder="请输入appid"></i-input>
|
|
|
|
|
</FormItem>
|
|
|
|
|
<FormItem label="URI" prop="uri">
|
|
|
|
|
<i-input
|
|
|
|
|
type="text"
|
|
|
|
|
<FormItem label="URI"
|
|
|
|
|
prop="uri">
|
|
|
|
|
<i-input type="text"
|
|
|
|
|
v-model="formValidate.uri"
|
|
|
|
|
placeholder="请输入URI"
|
|
|
|
|
></i-input>
|
|
|
|
|
placeholder="请输入URI"></i-input>
|
|
|
|
|
</FormItem>
|
|
|
|
|
</i-col>
|
|
|
|
|
</Row>
|
|
|
|
|
</Form>
|
|
|
|
|
<div class="topic">活动类型</div>
|
|
|
|
|
<Row
|
|
|
|
|
:gutter="10"
|
|
|
|
|
<Row :gutter="10"
|
|
|
|
|
class="inputItem"
|
|
|
|
|
v-for="(item, index) in formValidate.params"
|
|
|
|
|
:key="index"
|
|
|
|
|
>
|
|
|
|
|
:key="index">
|
|
|
|
|
<i-col :span="2"> 类型{{ index + 1 }} </i-col>
|
|
|
|
|
<i-col :span="9">
|
|
|
|
|
<i-input
|
|
|
|
|
class="inputClass"
|
|
|
|
|
<i-input class="inputClass"
|
|
|
|
|
type="text"
|
|
|
|
|
v-model="item.name"
|
|
|
|
|
placeholder="请输入活动类型名称"
|
|
|
|
|
></i-input>
|
|
|
|
|
placeholder="请输入活动类型名称"></i-input>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col :span="9">
|
|
|
|
|
<i-input
|
|
|
|
|
class="inputClass"
|
|
|
|
|
<i-input class="inputClass"
|
|
|
|
|
type="text"
|
|
|
|
|
style="margin-left: 20px"
|
|
|
|
|
v-model="item.defaultVal"
|
|
|
|
|
placeholder="请输入参数"
|
|
|
|
|
></i-input>
|
|
|
|
|
placeholder="请输入参数"></i-input>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col :span="4">
|
|
|
|
|
<Button
|
|
|
|
|
style="margin-left: 20px"
|
|
|
|
|
<Button style="margin-left: 20px"
|
|
|
|
|
type="error"
|
|
|
|
|
@click="delActivityInput(index)"
|
|
|
|
|
>删除</Button
|
|
|
|
|
>
|
|
|
|
|
@click="delActivityInput(index)">删除</Button>
|
|
|
|
|
</i-col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Button style="margin-top: 10px" type="primary" @click="addActivityInput"
|
|
|
|
|
>+添加活动类型</Button
|
|
|
|
|
>
|
|
|
|
|
<Button style="margin-top: 10px"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="addActivityInput">+添加活动类型</Button>
|
|
|
|
|
</Modal>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
@ -121,7 +104,7 @@ import ActivityManager from "../../services/ActivityManager/ActivityManager";
|
|
|
|
|
import axios from "axios";
|
|
|
|
|
export default {
|
|
|
|
|
name: "addActivity",
|
|
|
|
|
data() {
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
dispalyModal: false,
|
|
|
|
|
currentStep: 0,
|
|
|
|
@ -149,7 +132,7 @@ export default {
|
|
|
|
|
id: String,
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
addActivityModal(val) {
|
|
|
|
|
addActivityModal (val) {
|
|
|
|
|
console.log(111, val);
|
|
|
|
|
this.dispalyModal = val;
|
|
|
|
|
if (val === true && this.id) {
|
|
|
|
@ -178,9 +161,9 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
mounted() {},
|
|
|
|
|
mounted () { },
|
|
|
|
|
methods: {
|
|
|
|
|
addActivityInput() {
|
|
|
|
|
addActivityInput () {
|
|
|
|
|
let params = [...this.formValidate.params];
|
|
|
|
|
params.push({
|
|
|
|
|
defaultVal: "",
|
|
|
|
@ -196,7 +179,7 @@ export default {
|
|
|
|
|
this.$set(this.formValidate, "params", params);
|
|
|
|
|
this.$forceUpdate();
|
|
|
|
|
},
|
|
|
|
|
delActivityInput(index) {
|
|
|
|
|
delActivityInput (index) {
|
|
|
|
|
if (this.formValidate.params.length <= 1) {
|
|
|
|
|
this.$Message.error("至少需要填写一个活动类型!");
|
|
|
|
|
return;
|
|
|
|
@ -204,22 +187,22 @@ export default {
|
|
|
|
|
this.formValidate.params.splice(index, 1);
|
|
|
|
|
this.$forceUpdate();
|
|
|
|
|
},
|
|
|
|
|
cancel() {
|
|
|
|
|
cancel () {
|
|
|
|
|
this.$emit("dispalyAddActivityModal", false, false);
|
|
|
|
|
},
|
|
|
|
|
getActivityData() {
|
|
|
|
|
getActivityData () {
|
|
|
|
|
let that = this;
|
|
|
|
|
let data = {
|
|
|
|
|
id: that.id,
|
|
|
|
|
};
|
|
|
|
|
ActivityManager.getActivityInfo(data, function(data) {
|
|
|
|
|
ActivityManager.getActivityInfo(data, function (data) {
|
|
|
|
|
that.formValidate = data.data.results;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
uploadImgSuccess(res, file) {
|
|
|
|
|
uploadImgSuccess (res, file) {
|
|
|
|
|
this.imageName = file.name;
|
|
|
|
|
},
|
|
|
|
|
handleBeforeUpload(res) {
|
|
|
|
|
handleBeforeUpload (res) {
|
|
|
|
|
const me = this;
|
|
|
|
|
let data = new FormData();
|
|
|
|
|
data.append("file", res);
|
|
|
|
@ -230,7 +213,7 @@ export default {
|
|
|
|
|
headers: {
|
|
|
|
|
"Content-Type": "multipart/form-data",
|
|
|
|
|
},
|
|
|
|
|
}).then(function(res) {
|
|
|
|
|
}).then(function (res) {
|
|
|
|
|
if (res.data.success) {
|
|
|
|
|
// me.formValidate.logo = res.data.results;
|
|
|
|
|
me.$set(me.formValidate, "logo", res.data.results);
|
|
|
|
@ -239,9 +222,10 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
save() {
|
|
|
|
|
save () {
|
|
|
|
|
let that = this;
|
|
|
|
|
let i = 0;
|
|
|
|
|
this.loading = true;
|
|
|
|
|
if (
|
|
|
|
|
typeof that.formValidate.logo == "undefined" ||
|
|
|
|
|
that.formValidate.logo == "" ||
|
|
|
|
@ -276,7 +260,7 @@ export default {
|
|
|
|
|
if (valid) {
|
|
|
|
|
// param = JSON.stringify(param)
|
|
|
|
|
let data = { ...that.formValidate, isGetActivityInfo: true };
|
|
|
|
|
ActivityManager.addOreditActivity(data, function(data) {
|
|
|
|
|
ActivityManager.addOreditActivity(data, function (data) {
|
|
|
|
|
that.addActivityModal = false;
|
|
|
|
|
that.formValidate = {};
|
|
|
|
|
that.$emit("dispalyAddActivityModal", false, true);
|
|
|
|
|