|
@@ -179,6 +179,19 @@
|
|
|
<template slot="append">月</template>
|
|
<template slot="append">月</template>
|
|
|
</el-input>
|
|
</el-input>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <header>活动时间:</header>
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ :disabled="statusPop === 2"
|
|
|
|
|
+ v-model="releaseTime"
|
|
|
|
|
+ type="datetimerange"
|
|
|
|
|
+ range-separator="~"
|
|
|
|
|
+ start-placeholder="开始日期"
|
|
|
|
|
+ end-placeholder="结束日期"
|
|
|
|
|
+ value-format="timestamp"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-date-picker>
|
|
|
|
|
+ </el-col>
|
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
|
<header>备注:</header>
|
|
<header>备注:</header>
|
|
|
<el-input
|
|
<el-input
|
|
@@ -190,7 +203,7 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
|
- <header>活动图标:</header>
|
|
|
|
|
|
|
+ <header>活动封面:</header>
|
|
|
<div class="imgBox">
|
|
<div class="imgBox">
|
|
|
<label class="imgLabel" for="inputs">
|
|
<label class="imgLabel" for="inputs">
|
|
|
<div class="msPhoto" v-if="formLabelAlign.activityLogo">
|
|
<div class="msPhoto" v-if="formLabelAlign.activityLogo">
|
|
@@ -221,17 +234,35 @@
|
|
|
</div>
|
|
</div>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
|
- <header>活动时间:</header>
|
|
|
|
|
- <el-date-picker
|
|
|
|
|
- :disabled="statusPop === 2"
|
|
|
|
|
- v-model="releaseTime"
|
|
|
|
|
- type="datetimerange"
|
|
|
|
|
- range-separator="~"
|
|
|
|
|
- start-placeholder="开始日期"
|
|
|
|
|
- end-placeholder="结束日期"
|
|
|
|
|
- value-format="timestamp"
|
|
|
|
|
- >
|
|
|
|
|
- </el-date-picker>
|
|
|
|
|
|
|
+ <header>活动详情图:</header>
|
|
|
|
|
+ <div class="imgBox">
|
|
|
|
|
+ <label class="imgLabel" for="inputsimg">
|
|
|
|
|
+ <div class="msPhoto" v-if="formLabelAlign.activityContentUrl">
|
|
|
|
|
+ <img
|
|
|
|
|
+ :src="
|
|
|
|
|
+ $methodsTools.splitImgHost(formLabelAlign.activityContentUrl)
|
|
|
|
|
+ "
|
|
|
|
|
+ alt="图片加载失败"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="imgbbx" v-else>
|
|
|
|
|
+ <p style="margin-top: 49px">点击添加或将文件拖拽到这里上传</p>
|
|
|
|
|
+ <i class="el-icon-plus"></i>
|
|
|
|
|
+ <p style="margin-bottom: 37px">
|
|
|
|
|
+ 图片格式:.jpg/.png/jpeg/bmp
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <input
|
|
|
|
|
+ id="inputsimg"
|
|
|
|
|
+ type="file"
|
|
|
|
|
+ ref="fileimg"
|
|
|
|
|
+ :disabled="statusPop === 2"
|
|
|
|
|
+ style="display: none"
|
|
|
|
|
+ @change="getImgFileImg"
|
|
|
|
|
+ />
|
|
|
|
|
+ </label>
|
|
|
|
|
+ <p>请上传活动详情图</p>
|
|
|
|
|
+ </div>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="24" v-if="formLabelAlign.activityType === 2">
|
|
<el-col :span="24" v-if="formLabelAlign.activityType === 2">
|
|
|
<header>直播内容:</header>
|
|
<header>直播内容:</header>
|
|
@@ -491,6 +522,34 @@ export default {
|
|
|
self.$set(self.formLabelAlign, "activityLogo", ev.target.result);
|
|
self.$set(self.formLabelAlign, "activityLogo", ev.target.result);
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
+ getImgFileImg(){
|
|
|
|
|
+ var self = this;
|
|
|
|
|
+ var file = this.$refs.fileimg.files[0];
|
|
|
|
|
+ if (file === undefined) {
|
|
|
|
|
+ self.$set(self.formLabelAlign, "activityContentUrl", "");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (file.size > 5 * 1024 * 1024) {
|
|
|
|
|
+ this.$message.error("图片不得大于5MB");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ var type = this.$refs.fileimg.value.toLowerCase().split(".").splice(-1);
|
|
|
|
|
+ if (
|
|
|
|
|
+ type[0] != "jpg" &&
|
|
|
|
|
+ type[0] != "png" &&
|
|
|
|
|
+ type[0] != "jpeg" &&
|
|
|
|
|
+ type[0] != "bmp"
|
|
|
|
|
+ ) {
|
|
|
|
|
+ this.$message.error("上传格式需为:.jpg/.png/.jpeg/bmp");
|
|
|
|
|
+ this.$refs.fileimg.value = "";
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ var reader = new FileReader();
|
|
|
|
|
+ reader.readAsDataURL(file);
|
|
|
|
|
+ reader.onload = function (ev) {
|
|
|
|
|
+ self.$set(self.formLabelAlign, "activityContentUrl", ev.target.result);
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
search(v) {
|
|
search(v) {
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
if (v === undefined) {
|
|
if (v === undefined) {
|
|
@@ -563,6 +622,13 @@ export default {
|
|
|
this.$message.error("请上传活动图标");
|
|
this.$message.error("请上传活动图标");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (
|
|
|
|
|
+ this.formLabelAlign.activityContentUrl === "" ||
|
|
|
|
|
+ this.formLabelAlign.activityContentUrl === undefined
|
|
|
|
|
+ ) {
|
|
|
|
|
+ this.$message.error("请上传活动详情图");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
if (!this.formLabelAlign.activityUrl) {
|
|
if (!this.formLabelAlign.activityUrl) {
|
|
|
this.$message.error("请输入跳转链接");
|
|
this.$message.error("请输入跳转链接");
|
|
|
return;
|
|
return;
|
|
@@ -601,10 +667,14 @@ export default {
|
|
|
if (this.statusPop === 0) {
|
|
if (this.statusPop === 0) {
|
|
|
var objNew = JSON.parse(this.beif);
|
|
var objNew = JSON.parse(this.beif);
|
|
|
if (this.formLabelAlign.activityLogo !== objNew.activityLogo) {
|
|
if (this.formLabelAlign.activityLogo !== objNew.activityLogo) {
|
|
|
- const awtimg = await this.imgUpload(0);
|
|
|
|
|
|
|
+ const awtimg01 = await this.imgUpload(0);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.formLabelAlign.activityContentUrl !== objNew.activityContentUrl) {
|
|
|
|
|
+ const awtimg02 = await this.imgUploadimg(0);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- const awtimg = await this.imgUpload(0);
|
|
|
|
|
|
|
+ const awtimg1 = await this.imgUpload(0);
|
|
|
|
|
+ const awtimg2 = await this.imgUploadimg(0);
|
|
|
}
|
|
}
|
|
|
var data = {
|
|
var data = {
|
|
|
activityName: this.formLabelAlign.activityName,
|
|
activityName: this.formLabelAlign.activityName,
|
|
@@ -614,6 +684,7 @@ export default {
|
|
|
endTime: Number(this.releaseTime[1]) / 1000,
|
|
endTime: Number(this.releaseTime[1]) / 1000,
|
|
|
description: this.formLabelAlign.description,
|
|
description: this.formLabelAlign.description,
|
|
|
activityLogo: this.formLabelAlign.activityLogo,
|
|
activityLogo: this.formLabelAlign.activityLogo,
|
|
|
|
|
+ activityContentUrl:this.formLabelAlign.activityContentUrl
|
|
|
};
|
|
};
|
|
|
if (this.formLabelAlign.activityType !== 2) {
|
|
if (this.formLabelAlign.activityType !== 2) {
|
|
|
if (
|
|
if (
|
|
@@ -676,7 +747,21 @@ export default {
|
|
|
resolve();
|
|
resolve();
|
|
|
})
|
|
})
|
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
|
- this.$message.error("图片上传错误");
|
|
|
|
|
|
|
+ this.$message.error("活动封面图上传错误");
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ imgUploadimg(int) {
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
|
+ this.$upload
|
|
|
|
|
+ .upload(this.$refs.fileimg.files[0], int)
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ this.$set(this.formLabelAlign, "activityContentUrl", res);
|
|
|
|
|
+ resolve();
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ this.$message.error("活动详情图上传错误");
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|