Commit 0fc6a91f by chenwq

sop

1 parent 5309bd48
<template> <template>
<div> <div class="sop-container">
<div class="sop-box">
<div class="sop-title">{{ pushChannelTitle }}</div>
<!-- 朋友圈模板 -->
<div class="sop-content" v-if="editForm.additionalType == '4'">
<div>{{ editForm.wwMomentContent.text }}</div>
<div ref="wechatMutiImg" v-if="['1', '2'].includes(editForm.wwMomentContent.contentType)" class="wechat-muti-img">
<img ref="mutiImgItem" class="muti-img-item" v-for="(item, index) in editForm.wwMomentContent.imgUrls" :key="index" :src="item" />
</div>
</div>
<!-- 短链(素材,活动,优惠券) -->
<div class="sop-content" v-else>
<div>{{ editForm.eventContent }}</div>
<div v-show="editForm.urlContent.title" class="flex sop-url">
<img class="url-img" :src="editForm.urlContent.imgUrl" />
<p class="url-txt txt-ellipsis">{{ editForm.urlContent.title }}</p>
</div>
</div>
<!-- 用户 -->
<div class="sop-avatar">
<div>可见用户:{{ editForm.customers[0].customerName }}{{ editForm.customerCount > 1 ? '等' + editForm.customerCount : editForm.customerCount }}名用户</div>
<div class="arrow" @click="handleCustomerList">
<img class="avatar-img" v-for="(item, index) in editForm.customers.slice(0, 3)" :key="index" :src="item.avatar" />
</div>
</div>
</div>
</div> </div>
</template> </template>
...@@ -8,14 +33,177 @@ export default { ...@@ -8,14 +33,177 @@ export default {
name: '', name: '',
data() { data() {
return { return {
pushChannelTitle: '',
editForm: {
sopId: '',
eventId: '',
// 任务状态(1待处理,2已处理)
taskStatus: '1',
// 附加对象类型(1素材,2活动,3优惠券,4朋友圈模板)
additionalType: '1',
// 营销渠道(1:企业微信,3:微信朋友圈)
pushChannelType: '1',
userId: '',
userName: '',
customerCount: '3',
customers: [{
customerId: '',
customerName: 'xxx',
avatar: 'https://img1.baidu.com/it/u=4105462482,2122378712&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=846',
corpName: ''
}, {
customerId: '',
customerName: 'xxx',
avatar: 'https://img1.baidu.com/it/u=4105462482,2122378712&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=846',
corpName: ''
}, {
customerId: '',
customerName: 'xxx',
avatar: 'https://img1.baidu.com/it/u=4105462482,2122378712&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=846',
corpName: ''
}, {
customerId: '',
customerName: 'xxx',
avatar: 'https://img1.baidu.com/it/u=4105462482,2122378712&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=846',
corpName: ''
}],
// 链接内容
urlContent: {
url: '',
imgUrl: 'https://img1.baidu.com/it/u=4105462482,2122378712&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=846',
title: '链接的标题333333333333333333333322222222222'
},
eventContent: '新车发布会,冬季最惠,今晚八点直播,扫码查看详情!扫码查看详情!',
// 朋友圈内容
wwMomentContent: {
text: '新车发布会,冬季最惠,今晚八点直播,扫码查看详情!扫码查看详情!',
// 0-纯文字,1-单图+文,2-多图+文,3-视频+文,4-链接+文
contentType: '2',
imgUrls: [
'https://img1.baidu.com/it/u=4105462482,2122378712&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=846',
'https://img2.baidu.com/it/u=1864225125,776123786&fm=253&fmt=auto&app=138&f=JPEG?w=350&h=350',
'https://img2.baidu.com/it/u=288087432,301955349&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=889',
'https://img2.baidu.com/it/u=1864225125,776123786&fm=253&fmt=auto&app=138&f=JPEG?w=350&h=350',
'https://img2.baidu.com/it/u=1279417617,2011354595&fm=253&fmt=auto&app=138&f=JPEG?w=375&h=500',
'https://img2.baidu.com/it/u=637228177,297876597&fm=253&fmt=auto&app=138&f=JPEG?w=400&h=357',
'https://img1.baidu.com/it/u=1942928812,1521681685&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500'
],
videoContent: {
videoUrl: '',
imgUrl: ''
},
// 朋友圈内容-Url
urlContent: {
title: '',
imgUrl: '',
url: ''
}
}
},
channelToTitle: {
'1': '企业微信群发',
'3': '发送客户朋友圈'
},
baseDate: {
}
} }
}, },
created() {
this.pushChannelTitle = this.channelToTitle[this.editForm.pushChannelType]
},
mounted() { mounted() {
// 朋友圈模板,单/多图
if (this.editForm.additionalType === '4' && ['1', '2'].includes(this.editForm.wwMomentContent.contentType)) {
this.setMutiHeight()
}
}, },
methods: { methods: {
setMutiHeight() {
var mutiImgDom = this.$refs.mutiImgItem
var imgWidth = mutiImgDom[0].clientWidth
mutiImgDom.forEach((item, idx) => {
this.$refs.mutiImgItem[idx].style.height = imgWidth + 'px'
})
},
handleCustomerList() { }
} }
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.sop-container {
.flex {
display: flex;
align-items: center;
}
.txt-ellipsis {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all;
}
.sop-box {
padding: 0 10px;
margin: 16px;
box-shadow: 0px 2px 4px 0px rgba(206, 209, 222, 0.12), 0px 2px 8px 0px rgba(206, 209, 222, 0.4);
border-radius: 4px;
.sop-title {
height: 48px;
line-height: 48px;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.sop-content {
font-size: 12px;
color: #666666;
padding: 16px 0;
.wechat-muti-img {
display: flex;
flex-wrap: wrap;
.muti-img-item {
width: calc((100% - 20px) / 3);
margin: 10px 10px 0 0;
}
.muti-img-item:nth-child(3n + 0) {
margin-right: 0;
}
}
.sop-url {
height: 68px;
line-height: 68px;
background-color: #eeeeee;
margin-top: 16px;
.url-img {
width: 44px;
height: 44px;
margin: 0 12px;
}
.url-txt {
width: calc(100% - 68px);
}
}
}
.sop-avatar {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
font-size: 14px;
padding: 14px 0;
border-top: 1px solid rgba(0, 0, 0, 0.1);
.avatar-img {
width: 24px;
height: 24px;
border-radius: 24px;
}
}
.arrow::after {
content: '>';
display: inline-block;
height: 24px;
line-height: 24px;
margin-left: 18px;
}
}
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!