Commit f50dabef by 前端

更新二月版本sop代码

1 parent f1ae8a5e
...@@ -66,6 +66,7 @@ export default { ...@@ -66,6 +66,7 @@ export default {
}, },
jumpEvent(obj) { jumpEvent(obj) {
console.log(obj)
this.$set(this.eventObj, 'addOrEdit', obj.addOrEdit) this.$set(this.eventObj, 'addOrEdit', obj.addOrEdit)
this.$set(this.eventObj, 'info', obj.info) this.$set(this.eventObj, 'info', obj.info)
this.parentCustomerObj = obj.parentCustomerObj this.parentCustomerObj = obj.parentCustomerObj
......
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
content="请先完善sop名称和营销对象" placement="top"> content="请先完善sop名称和营销对象" placement="top">
<div> <div>
<el-button class="default-blue-btn newBtnSty" <el-button class="default-blue-btn newBtnSty"
v-if="new Date(item.eventStartDate) > new Date()" v-if="new Date(item.eventStartDate) > new Date() || !item.eventStartDate"
:disabled="!editForm.customerInfoList.length || !editForm.sopName" :disabled="!editForm.customerInfoList.length || !editForm.sopName"
:size="size" @click="handleEventEdit('edit', item, index)">编辑 :size="size" @click="handleEventEdit('edit', item, index)">编辑
</el-button> </el-button>
...@@ -567,62 +567,16 @@ export default { ...@@ -567,62 +567,16 @@ export default {
getInfo() { getInfo() {
this.$apis.sop.getSopInfoDetailApi({sopId: this.routeInfo.id}).then(res => { this.$apis.sop.getSopInfoDetailApi({sopId: this.routeInfo.id}).then(res => {
if (this.routeInfo.addOrEdit == 'copy') { if (this.routeInfo.addOrEdit == 'copy') {
this.copyForm = res res.eventList && res.eventList.map(item => {
this.copyForm.eventList.forEach(item => {
item.eventStartDate = '' item.eventStartDate = ''
item.eventTime = '' item.eventTime = ''
if (item.object) {
item.object.objectId = item.objectId
item.object.objectType = item.objectType
item.object.objectName = item.objectName
item.object.additionalType = item.additionalType
}
// if (item.additionalType == 4) {
// // attType (1文本,2图片,3视频,4链接,5小程序,6附件,7活动)
// // attContent 附件内容
// // 文字
// let txtObj = item.object.attachmentList.find(k => k.attType == 1)
// item.object.showTxtContent = txtObj ? txtObj.attContent : ''
// // 图片
// let imgList = item.object.attachmentList.filter(k => k.attType == 2)
// item.object.showImgContent = imgList || []
// // 视频
// let videoList = item.object.attachmentList.filter(k => k.attType == 3)
// item.object.showVideoContent = videoList || []
// }
})
this.editForm.eventList = this.copyForm.eventList
this.$nextTick(() => {
this.editStatus = false
}) })
this.editForm.eventList = res.eventList
} else { } else {
this.editForm = res this.editForm = res
this.currentCustomerIdx = this.customerDataList.findIndex(item => item.confId == this.editForm.customerOptType) this.currentCustomerIdx = this.customerDataList.findIndex(item => item.confId == this.editForm.customerOptType)
this.recoverCustomerList() this.recoverCustomerList()
this.editForm.customerOptUpdate = this.editForm.customerOptUpdate + '' this.editForm.customerOptUpdate = this.editForm.customerOptUpdate + ''
//
// this.editForm.eventList.forEach(item => {
// console.log(item.object)
// if (item.object) {
// item.object.objectId = item.objectId
// item.object.objectType = item.objectType
// item.object.objectName = item.objectName
// item.object.additionalType = item.additionalType
// }
// if (item.additionalType == 4) {
// // attType (1文本,2图片,3视频,4链接,5小程序,6附件,7活动)
// // attContent 附件内容
// // 文字
// let txtObj = item.object.attachmentList.find(k => k.attType == 1)
// item.object.showTxtContent = txtObj ? txtObj.attContent : ''
// // // 图片
// let imgList = item.object.attachmentList.filter(k => k.attType == 2)
// item.object.showImgContent = imgList || []
// // // 视频
// let videoList = item.object.attachmentList.filter(k => k.attType == 3)
// item.object.showVideoContent = videoList || []
// }
// })
this.editDisabled = new Date(this.editForm.startDate) < new Date() this.editDisabled = new Date(this.editForm.startDate) < new Date()
this.editDisabled && this.judgeDisable() this.editDisabled && this.judgeDisable()
this.$nextTick(() => { this.$nextTick(() => {
...@@ -1045,6 +999,13 @@ export default { ...@@ -1045,6 +999,13 @@ export default {
// 这边走的是新增 // 这边走的是新增
params.eventList = [] params.eventList = []
this.editForm.eventList.forEach((item, index) => { this.editForm.eventList.forEach((item, index) => {
if (!item.eventStartDate || !item.eventTime){
this.$message({
message:'请选择营销事件的营销时间',
type: 'error'
})
return
}
params.eventList.push(JSON.parse(JSON.stringify(item))) params.eventList.push(JSON.parse(JSON.stringify(item)))
params.eventList[index].resourceList = [] params.eventList[index].resourceList = []
if (item.object && item.object.length <= 2) { if (item.object && item.object.length <= 2) {
......
...@@ -2,8 +2,11 @@ ...@@ -2,8 +2,11 @@
<div class="img-bg"> <div class="img-bg">
<div class="preview-content"> <div class="preview-content">
<div class="preview-time">{{ currentTime }}</div> <div class="preview-time">{{ currentTime }}</div>
<div :class="{'preview-info':true,'isMargin':previewList && previewList[2] && previewList[2].attType == 6 && item.attType ==6}" v-for="item in previewList" :key="item.id"> <div
<img class="avatar" src="@/assets/guestCustom/default-customer.png" v-if="!(hasSixType && hasSevenType) || item.attType !== 7" alt/> :class="{'preview-info':true,'isMargin':(previewList && previewList[2] && previewList[2].attType == 6 && item.attType ==6) || previewList && previewList[1] && previewList[0].attType == 7 && previewList[1].attType ==6 &&item.attType ==6}"
v-for="item in previewList" :key="item.id">
<img class="avatar" src="@/assets/guestCustom/default-customer.png"
v-if="!(hasSixType && hasSevenType) || item.attType !== 7" alt/>
<template v-if="item.attType == 1"> <template v-if="item.attType == 1">
<div class="preview-text text" v-html="item.attContent"></div> <div class="preview-text text" v-html="item.attContent"></div>
</template> </template>
...@@ -156,9 +159,10 @@ export default { ...@@ -156,9 +159,10 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.isMargin{ .isMargin {
margin-top: -20px; margin-top: -20px;
} }
.img-bg { .img-bg {
position: relative; position: relative;
width: 290px; width: 290px;
......
...@@ -2,73 +2,48 @@ ...@@ -2,73 +2,48 @@
<div class="img-bg"> <div class="img-bg">
<div class="preview-content"> <div class="preview-content">
<div class="preview-info" v-show="previewListFilter.length"> <div class="preview-info" v-show="previewListFilter.length">
<img class="avatar" src="@/assets/guestCustom/default-customer.png" alt /> <img class="avatar" src="@/assets/guestCustom/default-customer.png" alt/>
<template v-if="previewListFilter && previewListFilter.length <= 3"> <template>
<div class="preview-box" v-for="item in previewListFilter" :key="item.id"> <div class="preview-box" v-for="item in previewListFilter" :key="item.id">
<div class="preview-box-desc"> <div class="preview-box-desc">
<template v-if="item.attType == 1"> <template v-if="item.attType == 1">
<div class="preview-text text" v-html="item.attContent"></div> <div class="preview-text text" v-html="item.attContent"></div>
</template> </template>
<template v-else-if="item.attType == 7"> <template v-else-if="hasSixType || hasSevenType">
<template v-if="hasSixType && hasSevenType">
<template v-if="item.attType == 6">
<div class="preview-text preview-link"> <div class="preview-text preview-link">
<img src="@/assets/guestCustom/preview-link.png" alt /> <img src="@/assets/guestCustom/preview-link.png" alt/>
<div>{{item.attContent.marketingName }}</div> <div>{{ JSON.parse(item.attContent).fileName }}</div>
</div> </div>
</template> </template>
<template v-else-if="item.attType == 6">
<div class="preview-text preview-link">
<img src="@/assets/guestCustom/preview-link.png" alt />
<div>{{JSON.parse(item.attContent).fileName}}</div>
</div>
</template>
<template v-else-if="item.attType == 2" v-for="(imgItem, index) in item.attContent">
<el-image style="width: 52px; height: 52px" class="img-list" :src="imgItem" fit="fit" :key="index" :preview-src-list="item.attContent"></el-image>
</template> </template>
<template v-else-if="item.attType == 3"> <template v-else>
<!-- <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> --> <template v-if="item.attType == 7">
<div class="video-panel"> <div class="preview-text preview-link">
<video id="video" width="100%" height="100%" preload loop muted> <img src="@/assets/guestCustom/preview-link.png" alt/>
<source :src="item.attContent" type="video/mp4" /> <div>{{ item.attContent.marketingName }}</div>
</video>
<i
class="el-icon-video-play"
@click="
videoShow = true
videoUrl = item.attContent
"
></i>
</div> </div>
</template> </template>
</div> <template v-if="item.attType == 6">
<div class="preview-text preview-link">
<img src="@/assets/guestCustom/preview-link.png" alt/>
<div>{{ JSON.parse(item.attContent).fileName }}</div>
</div> </div>
</template> </template>
<template v-else>
<div class="preview-box" v-for="item in previewListFilter" :key="item.id">
<div class="preview-box-desc">
<template v-if="item.attType == 1">
<div class="preview-text text" v-html="item.attContent"></div>
</template> </template>
<!-- <template v-else-if="item.attType == 7">-->
<!-- <div class="preview-text preview-link">-->
<!-- <img src="@/assets/guestCustom/preview-link.png" alt />-->
<!-- <div>{{item.attContent.marketingName }}</div>-->
<!-- </div>-->
<!-- </template>-->
<template v-else-if="item.attType == 6">
<div class="preview-text preview-link">
<img src="@/assets/guestCustom/preview-link.png" alt />
<div>{{JSON.parse(item.attContent).fileName}}</div>
</div>
</template> </template>
<template v-else-if="item.attType == 2" v-for="(imgItem, index) in item.attContent"> <template v-else-if="item.attType == 2" v-for="(imgItem, index) in item.attContent">
<el-image style="width: 52px; height: 52px" class="img-list" :src="imgItem" fit="fit" :key="index" :preview-src-list="item.attContent"></el-image> <el-image style="width: 52px; height: 52px" class="img-list" :src="imgItem" fit="fit" :key="index"
:preview-src-list="item.attContent"></el-image>
</template> </template>
<template v-else-if="item.attType == 3"> <template v-else-if="item.attType == 3">
<!-- <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> --> <!-- <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> -->
<div class="video-panel"> <div class="video-panel">
<video id="video" width="100%" height="100%" preload loop muted> <video id="video" width="100%" height="100%" preload loop muted>
<source :src="item.attContent" type="video/mp4" /> <source :src="item.attContent" type="video/mp4"/>
</video> </video>
<i <i
class="el-icon-video-play" class="el-icon-video-play"
...@@ -105,27 +80,31 @@ const ATT_TYPE = { ...@@ -105,27 +80,31 @@ const ATT_TYPE = {
ACTIVITY: 7 ACTIVITY: 7
} }
import emoji from '@/utils/emo' import emoji from '@/utils/emo'
export default { export default {
name: 'Preview', name: 'Preview',
props: { previewView: Array }, props: {previewView: Array},
data() { data() {
return { return {
videoShow: false, videoShow: false,
previewList: [], previewList: [],
previewListFilter: [], previewListFilter: [],
videoUrl: '' videoUrl: '',
hasSixType: false,
hasSevenType: false
} }
}, },
watch: { watch: {
previewView: { previewView: {
handler(val) { handler(val) {
const previewVal = this.$common.utils.deepClone(val).filter(item => item) const previewVal = this.$common.utils.deepClone(val).filter(item => item)
console.log(previewVal) this.hasSixType = previewVal.some(item => item.attType == 6)
this.hasSevenType = previewVal.some(item => item.attType == 7)
this.previewListFilter = [] this.previewListFilter = []
for (let i in previewVal) { for (let i in previewVal) {
if (previewVal[i].attType == 1) { if (previewVal[i].attType == 1) {
const attContent = previewVal[i].attContent const attContent = previewVal[i].attContent
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) { const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function (res) {
let word = res.replace(/\[|\]/gi, '') let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity) const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1 let index = parseInt(list.indexOf(word)) + 1
...@@ -171,12 +150,14 @@ export default { ...@@ -171,12 +150,14 @@ export default {
.img-list { .img-list {
margin-right: 3px; margin-right: 3px;
} }
.img-bg { .img-bg {
position: relative; position: relative;
width: 290px; width: 290px;
height: 566px; height: 566px;
background-image: url(../../../../../assets/guestCustom/friend-bg.png); background-image: url(../../../../../assets/guestCustom/friend-bg.png);
background-size: 100%; background-size: 100%;
.preview-content { .preview-content {
position: absolute; position: absolute;
width: 250px; width: 250px;
...@@ -191,9 +172,11 @@ export default { ...@@ -191,9 +172,11 @@ export default {
text-align: center; text-align: center;
margin-bottom: 15px; margin-bottom: 15px;
} }
.preview-info { .preview-info {
padding: 0 0px 20px 9px; padding: 0 0px 20px 9px;
position: relative; position: relative;
.avatar { .avatar {
position: absolute; position: absolute;
top: 0px; top: 0px;
...@@ -202,10 +185,12 @@ export default { ...@@ -202,10 +185,12 @@ export default {
height: 26px; height: 26px;
margin-right: 8px; margin-right: 8px;
} }
.preview-box { .preview-box {
margin-left: 30px; margin-left: 30px;
width: 180px; width: 180px;
} }
.preview-operation { .preview-operation {
float: right; float: right;
margin-right: 30px; margin-right: 30px;
...@@ -219,6 +204,7 @@ export default { ...@@ -219,6 +204,7 @@ export default {
font-weight: 400; font-weight: 400;
color: #556993; color: #556993;
} }
.video-panel { .video-panel {
width: 100%; width: 100%;
height: 102px; height: 102px;
...@@ -226,9 +212,11 @@ export default { ...@@ -226,9 +212,11 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: relative; position: relative;
video { video {
position: absolute; position: absolute;
} }
i { i {
z-index: 10; z-index: 10;
font-size: 20px; font-size: 20px;
...@@ -236,6 +224,7 @@ export default { ...@@ -236,6 +224,7 @@ export default {
cursor: pointer; cursor: pointer;
} }
} }
.preview-text { .preview-text {
font-size: 14px; font-size: 14px;
position: relative; position: relative;
...@@ -245,29 +234,34 @@ export default { ...@@ -245,29 +234,34 @@ export default {
word-wrap: break-word; word-wrap: break-word;
word-break: break-all; word-break: break-all;
line-height: 20px; line-height: 20px;
/deep/ img { /deep/ img {
width: 20px; width: 20px;
height: 20px; height: 20px;
vertical-align: middle; vertical-align: middle;
} }
} }
.text { .text {
width: 100%; width: 100%;
font-size: 12px; font-size: 12px;
padding: 0px; padding: 0px;
margin-bottom: 6px; margin-bottom: 6px;
} }
.preview-link { .preview-link {
padding: 6px 0px; padding: 6px 0px;
font-size: 12px; font-size: 12px;
background: #f7f7f7; background: #f7f7f7;
display: flex; display: flex;
align-items: center; align-items: center;
img { img {
margin: 0px 12px 0px 5px; margin: 0px 12px 0px 5px;
width: 24px; width: 24px;
height: 24px; height: 24px;
} }
div { div {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -277,6 +271,7 @@ export default { ...@@ -277,6 +271,7 @@ export default {
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
} }
.preview-text::before { .preview-text::before {
content: ''; content: '';
position: absolute; position: absolute;
...@@ -287,12 +282,14 @@ export default { ...@@ -287,12 +282,14 @@ export default {
border-color: transparent #fff transparent transparent; border-color: transparent #fff transparent transparent;
// background-color: cornflowerblue; // background-color: cornflowerblue;
} }
.preview-applet { .preview-applet {
img { img {
width: 20px; width: 20px;
height: 20px; height: 20px;
margin-right: 4px; margin-right: 4px;
} }
&-title { &-title {
display: flex; display: flex;
align-self: center; align-self: center;
...@@ -300,6 +297,7 @@ export default { ...@@ -300,6 +297,7 @@ export default {
margin-bottom: 5px; margin-bottom: 5px;
} }
} }
.preview-activity { .preview-activity {
width: 160px; width: 160px;
// height: 184px; // height: 184px;
...@@ -307,6 +305,7 @@ export default { ...@@ -307,6 +305,7 @@ export default {
border-radius: 4px; border-radius: 4px;
border: 1px solid #dce1e5; border: 1px solid #dce1e5;
padding: 7px 7px 0; padding: 7px 7px 0;
.activity-name { .activity-name {
font-size: 12px; font-size: 12px;
color: #333; color: #333;
...@@ -316,10 +315,12 @@ export default { ...@@ -316,10 +315,12 @@ export default {
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
.applet-logo { .applet-logo {
width: 95px; width: 95px;
height: 24px; height: 24px;
} }
.activity-footer { .activity-footer {
margin-top: 4px; margin-top: 4px;
border-top: 1px solid #edeff3; border-top: 1px solid #edeff3;
...@@ -328,6 +329,7 @@ export default { ...@@ -328,6 +329,7 @@ export default {
} }
} }
} }
.video-dialog { .video-dialog {
z-index: 2001; z-index: 2001;
position: fixed; position: fixed;
...@@ -337,6 +339,7 @@ export default { ...@@ -337,6 +339,7 @@ export default {
left: 0; left: 0;
overflow: auto; overflow: auto;
background: rgba($color: #000000, $alpha: 0.5); background: rgba($color: #000000, $alpha: 0.5);
&-panel { &-panel {
background: #000000; background: #000000;
position: absolute; position: absolute;
...@@ -348,10 +351,12 @@ export default { ...@@ -348,10 +351,12 @@ export default {
box-sizing: border-box; box-sizing: border-box;
padding: 10px 20px 20px; padding: 10px 20px 20px;
overflow: hidden; overflow: hidden;
.video-close { .video-close {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
height: 40px; height: 40px;
i { i {
cursor: pointer; cursor: pointer;
font-size: 25px; font-size: 25px;
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
</div> </div>
<div class="preview"> <div class="preview">
<Preview :previewVal="previewList" v-if="editForm.pushChannelType == 1"></Preview> <Preview :previewVal="previewList" v-if="editForm.pushChannelType == 1"></Preview>
<!-- <MessagePreview :previewView="previewList" v-if="editForm.pushChannelType == 2"></MessagePreview>--> <!-- <MessagePreview :previewView="previewList" v-if="editForm.pushChannelType == 2"></MessagePreview>-->
<FriendGroupPreview :previewView="previewList" v-if="editForm.pushChannelType == 3"></FriendGroupPreview> <FriendGroupPreview :previewView="previewList" v-if="editForm.pushChannelType == 3"></FriendGroupPreview>
</div> </div>
</div> </div>
...@@ -722,13 +722,14 @@ export default { ...@@ -722,13 +722,14 @@ export default {
let backupContent = typeof (this.editForm.backupContent) == 'string' ? JSON.parse(this.editForm.backupContent) : this.editForm.backupContent let backupContent = typeof (this.editForm.backupContent) == 'string' ? JSON.parse(this.editForm.backupContent) : this.editForm.backupContent
if (backupContent) { if (backupContent) {
const previewList = backupContent.map(item => { const previewList = backupContent.map(item => {
if (item.attType == 7) item.attContent = JSON.parse(item.attContent) // JSON.parse(item.attContent)
if (item.attType == 7) item.attContent = typeof (item.attContent) == 'string' ? JSON.parse(item.attContent) : item.attContent
return item return item
}) })
this.$refs.welcome.updateList(previewList) this.$refs.welcome.updateList(previewList)
} else if (this.editForm.object && this.editForm.object.length != 0) { } else if (this.editForm.object && this.editForm.object.length != 0) {
const previewList = JSON.parse(this.editForm.backupContent).map(item => { const previewList = JSON.parse(this.editForm.backupContent).map(item => {
if (item.attType == 7) item.attContent = JSON.parse(item.attContent) if (item.attType == 7) item.attContent = typeof (item.attContent) == 'string' ? JSON.parse(item.attContent) : item.attContent
return item return item
}) })
this.$refs.welcome.updateList(previewList) this.$refs.welcome.updateList(previewList)
...@@ -744,7 +745,7 @@ export default { ...@@ -744,7 +745,7 @@ export default {
handleMarketingContent() { handleMarketingContent() {
let params = {} let params = {}
const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList
if ((previewList[0] && previewList[0].attType == 1 && previewList[0].attContent == '') || !previewList.length ||(previewList[0] && previewList[0].attType !== 1)) { if ((previewList[0] && previewList[0].attType == 1 && previewList[0].attContent == '') || !previewList.length || (previewList[0] && previewList[0].attType !== 1)) {
this.hasEventContentDisplaySpecial = true this.hasEventContentDisplaySpecial = true
} else { } else {
this.hasEventContentDisplaySpecial = false this.hasEventContentDisplaySpecial = false
......
...@@ -92,16 +92,16 @@ export default { ...@@ -92,16 +92,16 @@ export default {
// click: row => this.handleEdit('look', row) // click: row => this.handleEdit('look', row)
// } // }
// }, // },
// { {
// type: 'el-button', type: 'el-button',
// name: '复制', name: '复制',
// attrs: { attrs: {
// type: 'text' type: 'text'
// }, },
// listeners: { listeners: {
// click: row => this.handleEdit('copy', row) click: row => this.handleEdit('copy', row)
// } }
// }, },
{ {
type: 'el-button', type: 'el-button',
name: '编辑', name: '编辑',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!