|
@@ -151,7 +151,7 @@
|
|
</el-popover>
|
|
</el-popover>
|
|
</template>
|
|
</template>
|
|
<el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'推广图')})">
|
|
<el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'推广图')})">
|
|
- <img v-if="form.promotePhoto!==''" :src="imgUrl+form.promotePhoto" class="avatar" />
|
|
|
|
|
|
+ <img v-if="form.promotePhoto!==''" :src="form.promotePhoto" class="avatar" />
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
</el-upload>
|
|
</el-upload>
|
|
<span v-if="form.promotePhoto!==''" style="color: #F56C6C; cursor: pointer" @click="form.promotePhoto=''">删除</span>
|
|
<span v-if="form.promotePhoto!==''" style="color: #F56C6C; cursor: pointer" @click="form.promotePhoto=''">删除</span>
|
|
@@ -282,9 +282,11 @@
|
|
<span>动态文件</span>
|
|
<span>动态文件</span>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
</template>
|
|
</template>
|
|
- <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'主jsonImg')})">
|
|
|
|
- <img v-if="productJson.jsonImg!==''" :src="imgUrl+productJson.jsonImg" class="avatar" />
|
|
|
|
- <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
|
|
|
+ <div v-if="productJson.jsonImg!==''" class="svgImg">
|
|
|
|
+ <div id="lottie_box"></div>
|
|
|
|
+ </div>
|
|
|
|
+ <el-upload v-if="productJson.jsonImg===''" class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'主jsonImg')})">
|
|
|
|
+ <i class="el-icon-plus avatar-uploader-icon"></i>
|
|
</el-upload>
|
|
</el-upload>
|
|
<span v-if="productJson.jsonImg!==''" @click="productJson.jsonImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
|
|
<span v-if="productJson.jsonImg!==''" @click="productJson.jsonImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -408,9 +410,11 @@
|
|
<template slot="label">
|
|
<template slot="label">
|
|
<span>动态文件</span>
|
|
<span>动态文件</span>
|
|
</template>
|
|
</template>
|
|
- <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'副jsonImg')})">
|
|
|
|
- <img v-if="viceJson.jsonImg" :src="imgUrl+viceJson.jsonImg" class="avatar" />
|
|
|
|
- <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
|
|
|
+ <div v-if="viceJson.jsonImg!==''" class="svgImg">
|
|
|
|
+ <div id="lottieVice"></div>
|
|
|
|
+ </div>
|
|
|
|
+ <el-upload v-if="viceJson.jsonImg===''" class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'副jsonImg')})">
|
|
|
|
+ <i class="el-icon-plus avatar-uploader-icon"></i>
|
|
</el-upload>
|
|
</el-upload>
|
|
<span v-if="viceJson.jsonImg!==''" @click="viceJson.jsonImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
|
|
<span v-if="viceJson.jsonImg!==''" @click="viceJson.jsonImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -573,6 +577,16 @@
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item v-if="form.viceProductIds.length>0" label="遮罩文案(副产品)">
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
+ <el-col :span="10">
|
|
|
|
+ <el-input v-model="extJson.fitText" type="textarea" :rows="2" placeholder="首行文案"></el-input>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="10">
|
|
|
|
+ <el-input v-model="extJson.fitText2" type="textarea" :rows="2" placeholder="配合文案"></el-input>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<template slot="label">
|
|
<template slot="label">
|
|
<el-tooltip content="用于控制订购按钮的显示隐藏" placement="top">
|
|
<el-tooltip content="用于控制订购按钮的显示隐藏" placement="top">
|
|
@@ -719,7 +733,7 @@
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
</template>
|
|
</template>
|
|
<el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'活动logo')})">
|
|
<el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'活动logo')})">
|
|
- <img v-if="form.activityLogo !==''" :src="imgUrl+form.activityLogo" class="avatar" />
|
|
|
|
|
|
+ <img v-if="form.activityLogo !==''" :src="form.activityLogo" class="avatar" />
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
</el-upload>
|
|
</el-upload>
|
|
<span v-if="form.activityLogo!==''" @click="form.activityLogo=''" style="color: #F56C6C; cursor: pointer">删除</span>
|
|
<span v-if="form.activityLogo!==''" @click="form.activityLogo=''" style="color: #F56C6C; cursor: pointer">删除</span>
|
|
@@ -731,7 +745,7 @@
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
</template>
|
|
</template>
|
|
<el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'活动海报')})">
|
|
<el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'活动海报')})">
|
|
- <img v-if="form.posterPhoto!==''" :src="imgUrl+form.posterPhoto" class="avatar" />
|
|
|
|
|
|
+ <img v-if="form.posterPhoto!==''" :src="form.posterPhoto" class="avatar" />
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
</el-upload>
|
|
</el-upload>
|
|
<span v-if="form.posterPhoto!==''" @click="form.posterPhoto=''" style="color: #F56C6C; cursor: pointer">删除</span>
|
|
<span v-if="form.posterPhoto!==''" @click="form.posterPhoto=''" style="color: #F56C6C; cursor: pointer">删除</span>
|
|
@@ -750,10 +764,12 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import lottie from 'lottie-web';
|
|
import { post, get } from "@/api/common";
|
|
import { post, get } from "@/api/common";
|
|
export default {
|
|
export default {
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
|
|
+ lottie: {},
|
|
imgUrl: process.env.VUE_APP_BASE_IMG_URL,
|
|
imgUrl: process.env.VUE_APP_BASE_IMG_URL,
|
|
ifreamSrc: "",
|
|
ifreamSrc: "",
|
|
imgapi: process.env.VUE_APP_BASE_IMG_API, //上传图片地址
|
|
imgapi: process.env.VUE_APP_BASE_IMG_API, //上传图片地址
|
|
@@ -936,9 +952,13 @@ export default {
|
|
this.objVal(this.viceJson, JSON.parse(this.form.productJson).viceProduct)
|
|
this.objVal(this.viceJson, JSON.parse(this.form.productJson).viceProduct)
|
|
this.objVal(this.otherJson, JSON.parse(this.form.otherJson))
|
|
this.objVal(this.otherJson, JSON.parse(this.form.otherJson))
|
|
this.viceProductId = this.form.viceProductIds[0]
|
|
this.viceProductId = this.form.viceProductIds[0]
|
|
|
|
+ this.svgClick('all')
|
|
if (this.$route.query.copy) {
|
|
if (this.$route.query.copy) {
|
|
this.form.strategyName = this.form.strategyName + '-复制'
|
|
this.form.strategyName = this.form.strategyName + '-复制'
|
|
}
|
|
}
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.preview()
|
|
|
|
+ }, 1000)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 获取新策略列表
|
|
// 获取新策略列表
|
|
@@ -1064,13 +1084,14 @@ export default {
|
|
fileSuccess (file, fileList, name) {
|
|
fileSuccess (file, fileList, name) {
|
|
if (file.code === 10000) {
|
|
if (file.code === 10000) {
|
|
if (name === '推广图') {
|
|
if (name === '推广图') {
|
|
- this.form.promotePhoto = file.data
|
|
|
|
|
|
+ this.form.promotePhoto = this.imgUrl + file.data
|
|
} else if (name === 'logo') {
|
|
} else if (name === 'logo') {
|
|
- this.productJson.logoPic = file.data
|
|
|
|
|
|
+ this.productJson.logoPic = file.data
|
|
} else if (name === '主banner') {
|
|
} else if (name === '主banner') {
|
|
this.productJson.bannerImg = file.data
|
|
this.productJson.bannerImg = file.data
|
|
} else if (name === '主jsonImg') {
|
|
} else if (name === '主jsonImg') {
|
|
this.productJson.jsonImg = file.data
|
|
this.productJson.jsonImg = file.data
|
|
|
|
+ this.svgClick('主', file.data)
|
|
} else if (name === '主upImg') {
|
|
} else if (name === '主upImg') {
|
|
this.productJson.upImg = file.data
|
|
this.productJson.upImg = file.data
|
|
} else if (name === '主topImg') {
|
|
} else if (name === '主topImg') {
|
|
@@ -1083,6 +1104,7 @@ export default {
|
|
this.viceJson.bannerImg = file.data
|
|
this.viceJson.bannerImg = file.data
|
|
} else if (name === '副jsonImg') {
|
|
} else if (name === '副jsonImg') {
|
|
this.viceJson.jsonImg = file.data
|
|
this.viceJson.jsonImg = file.data
|
|
|
|
+ this.svgClick('副', file.data)
|
|
} else if (name === '副upImg') {
|
|
} else if (name === '副upImg') {
|
|
this.viceJson.upImg = file.data
|
|
this.viceJson.upImg = file.data
|
|
} else if (name === '副topImg') {
|
|
} else if (name === '副topImg') {
|
|
@@ -1092,9 +1114,9 @@ export default {
|
|
} else if (name === '副explainImg') {
|
|
} else if (name === '副explainImg') {
|
|
this.viceJson.explainImg = file.data
|
|
this.viceJson.explainImg = file.data
|
|
} else if (name === '活动logo') {
|
|
} else if (name === '活动logo') {
|
|
- this.form.activityLogo = file.data
|
|
|
|
|
|
+ this.form.activityLogo = this.imgUrl + file.data
|
|
} else if (name === '活动海报') {
|
|
} else if (name === '活动海报') {
|
|
- this.form.posterPhoto = file.data
|
|
|
|
|
|
+ this.form.posterPhoto = this.imgUrl + file.data
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1108,6 +1130,41 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+ svgClick (name, path) {
|
|
|
|
+ if (name === '主') {
|
|
|
|
+ this.lottie = lottie.loadAnimation({
|
|
|
|
+ container: document.getElementById('lottie_box'),
|
|
|
|
+ renderer: 'svg',
|
|
|
|
+ loop: true,
|
|
|
|
+ autoplay: true,
|
|
|
|
+ path: this.imgUrl + path
|
|
|
|
+ })
|
|
|
|
+ } else if (name === '副') {
|
|
|
|
+ this.lottie = lottie.loadAnimation({
|
|
|
|
+ container: document.getElementById('lottieVice'),
|
|
|
|
+ renderer: 'svg',
|
|
|
|
+ loop: true,
|
|
|
|
+ autoplay: true,
|
|
|
|
+ path: this.imgUrl + path
|
|
|
|
+ })
|
|
|
|
+ } else if (name === 'all') {
|
|
|
|
+ this.lottie = lottie.loadAnimation({
|
|
|
|
+ container: document.getElementById('lottieVice'),
|
|
|
|
+ renderer: 'svg',
|
|
|
|
+ loop: true,
|
|
|
|
+ autoplay: true,
|
|
|
|
+ path: this.imgUrl + this.viceJson.jsonImg
|
|
|
|
+ })
|
|
|
|
+ this.lottie = lottie.loadAnimation({
|
|
|
|
+ container: document.getElementById('lottie_box'),
|
|
|
|
+ renderer: 'svg',
|
|
|
|
+ loop: true,
|
|
|
|
+ autoplay: true,
|
|
|
|
+ path: this.imgUrl + this.productJson.jsonImg
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
},
|
|
},
|
|
}
|
|
}
|
|
@@ -1168,6 +1225,11 @@ export default {
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .svgImg {
|
|
|
|
+ max-width: 260px;
|
|
|
|
+ margin-right: 10px;
|
|
|
|
+ display: inline-block;
|
|
|
|
+ }
|
|
|
|
|
|
.avatar-uploader-icon {
|
|
.avatar-uploader-icon {
|
|
background-color: #fbfdff;
|
|
background-color: #fbfdff;
|