Commit e94e838b by 杨北旺

sop分析-朋友圈模板

1 parent 77026969
......@@ -53,7 +53,18 @@
<p class="m-r-20 txt-blue">{{ baseData.channelTypeList.find(k => k.confId == item.pushChannelType).confName }}</p>
</div>
<div class="event-content">{{ item.eventContent }}</div>
<div class="event-link" v-if="item.object">{{ item.object.objectName }}</div>
<div class="event-link" v-if="item.object">
<img class="m-r-10" :src="require(`@/assets/sop/icon-${imgIcon[item.object.additionalType]}.png`)" alt />
<div v-if="item.object.additionalType == 4">
<div v-if="item.object.showVideoContent.length">
<video class="model-item-img" :src="item.object.showVideoContent[0].attContent" controls="controls" />
</div>
<div v-if="!item.object.showVideoContent.length && item.object.showImgContent.length">
<img class="model-item-img" :src="item.object.showImgContent[0].attContent" />
</div>
</div>
<span v-else>{{ item.object.objectName }}</span>
</div>
<div v-if="new Date(item.eventStartDate) > new Date()" class="event-btns">
<el-button class="default" :size="size" @click="handleEventDelete(index)">删除</el-button>
<el-button class="default-blue-btn" :size="size" @click="handleEventEdit('edit', item, index)">编辑</el-button>
......@@ -91,6 +102,12 @@ export default {
editDisabled: false,
deleteIdList: [],
labelWidth: '144px',
imgIcon: {
1: 'material',
2: 'activity',
3: 'coupon',
4: 'nickname'
},
condLimitObj: {
// 1-有;0-无
hasPhone: 0,
......@@ -207,6 +224,27 @@ export default {
item.id = item.customerId
})
this.editForm.customerInfoList.length && this.recoveryCondLimit()
this.editForm.eventList.forEach(item => {
if (item.object) {
item.object.objectId = item.objectId
item.object.objectType = item.objectType
item.object.objectName = item.object.packageName
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 && this.judgeDisable()
this.$nextTick(() => {
......@@ -242,7 +280,7 @@ export default {
this.taggingList = arr
// console.log(this.taggingList)
// this.taggingList = obj
console.log(obj, '1')
// console.log(obj, '1')
this.key = new Date()
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
// console.log(this.tagging, '2')
......@@ -472,8 +510,15 @@ export default {
line-height: 32px;
margin-bottom: 12px;
}
.model-item-img {
width: 20px;
height: 20px;
margin-right: 5px;
}
.event-link {
margin-top: 12px;
display: flex;
align-items: center;
}
.event-content {
line-height: 24px;
......
......@@ -22,50 +22,6 @@
<img class="model-item-img" :src="item.showImgContent[0].attContent"/>
</div>
<div class="model-item-content" :title="item.showTxtContent">{{ item.showTxtContent }}</div>
<!-- <div class="model-item-title" :title="item.equityName" v-show="activeName == 3">{{ item.equityName }}</div>
<div class="model-item-title" :title="item.couponName" v-show="activeName == 2">{{ item.couponName }}</div>
<div class="model-item-title" :title="item.couponName" v-show="activeName == 6">{{ item.equityName }}</div>
<div class="model-item-title" :title="item.packageName" v-show="activeName == 4">{{ item.packageName }}</div>
<div class="model-item-title" :title="item.activityName" v-show="activeName == 5">{{ item.activityName }}</div>
<div class="model-item-content" v-show="activeName == 3">领取方式:免费领用</div>
<div class="model-item-content" v-show="activeName == 4">领取方式:付费购买</div>
<div class="model-item-content" v-show="activeName == 2 && item.effectiveType == 6">有效期:{{ item.effectiveDays }}天</div>
<div class="model-item-content" v-show="activeName == 2 && item.effectiveType == 3">有效期:无限制</div>
<div class="model-item-content" v-show="activeName == 2 && item.effectiveType == 2">有效期:{{ item.effectiveStartTime ? item.effectiveStartTime.split(' ')[0] : '' }}~{{ item.effectiveEndTime ? item.effectiveEndTime.split(' ')[0] : '' }}</div>
<div class="model-item-content" v-show="activeName == 6">获取方式:需先购买无忧服务套餐</div>
<div class="model-item-content" v-show="activeName == 6">获取限制:每个服务套餐限领一次</div>
<div class="model-item-content" v-show="activeName == 3"></div>
<div class="model-item-content model-item-contents" v-show="activeName == 3">
试用天数:
<span>{{ item.freeDay }}天</span>
</div>
<div class="model-item-content" v-show="activeName == 2">
使用途径:
{{ item.useChannel == 1 ? '线上商品' : '到店核销' }}
</div>
<div class="model-item-content model-item-weight" v-show="activeName == 6">
赠送天数:
<span>{{ item.effectiveType == 2 ? item.effectivedDay + '天' : '永久有效' }}</span>
</div>
<div class="model-item-content" v-show="activeName == 4 || activeName == 5"></div>
<div class="model-item-content model-item-contents" v-show="activeName == 4">
销售价格:
<span>{{ item.packagePrice }}元</span>
</div>
<div class="model-item-content" v-if="activeName == 5">
开始时间:
{{ item.startTime }}
</div>
<div class="model-item-content" v-if="activeName == 5">
结束时间:
{{ item.endTime }}
</div>
<div class="model-item-content model-item-contents" v-show="activeName == 2">
数量:
<span>{{ item.residueAmount }}</span>
</div> -->
</div>
</div>
<div class="model-item-empty" v-else v-loading="loading">
......@@ -199,53 +155,6 @@ export default {
this.pageNum = val
this.getModelList()
},
// selectable(row, index) {
// var isSelect = row.hasOwnProperty('beServed') ? !row.beServed : true
// return isSelect
// },
// recoverySelection() {
// var exitIds = this.selectedData.map(item => item.merchantNo + '')
// this.selectingData.forEach(item => {
// if (exitIds.includes(item.merchantNo + '')) {
// this.$refs.seletingTable.toggleRowSelection(item, true)
// } else {
// this.$refs.seletingTable.toggleRowSelection(item, false)
// }
// })
// },
// getSelectingList() {
// this.storeApi({
// ...this.storeSearchForm,
// pageNum: this.pageNum,
// currentPage: this.pageNum,
// pageSize: this.pageSize
// }).then(res => {
// this.selectingData = res.list
// this.total = res.total
// this.$nextTick(() => {
// this.recoverySelection()
// })
// })
// },
// handleChange(selection, row) {
// var addOrDelete = !!selection.find(item => item.merchantNo === row.merchantNo)
// addOrDelete ? this.selectedData.push(row) : (this.selectedData = this.selectedData.filter(item => item.merchantNo !== row.merchantNo))
// },
// handleAll(selection) {
// this.selectingData.forEach(item => {
// var isExit = this.selectedData.findIndex(subItem => subItem.merchantNo === item.merchantNo)
// var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
// if (selection.length && isExit === -1 && !isServed) {
// this.selectedData.push(item)
// } else if (!selection.length && isExit !== -1) {
// this.selectedData.splice(isExit, 1)
// }
// })
// },
// handleDelete(row) {
// this.selectedData = this.selectedData.filter(item => item.merchantNo !== row.merchantNo)
// this.recoverySelection()
// },
handleNicknameConfirm() {
console.log(this.selectItem)
// activeName 0-纯文字,1-单图+文,2-多图+文,3-视频+文,4-链接+文
......@@ -261,6 +170,8 @@ export default {
objectType: valToType[this.activeName],
objectName: '',
showTxtContent: this.selectItem.showTxtContent,
showImgContent: this.selectItem.showImgContent,
showVideoContent: this.selectItem.showVideoContent,
additionalType: 4
})
},
......
......@@ -48,7 +48,15 @@
<div class="welcome-file">
<template>
<img :src="require(`@/assets/sop/icon-${btnList.find(k => k.id == itm.additionalType).type}.png`)" alt />
<span :title="itm.attContent.objectName">{{ itm.attContent.objectName }}</span>
<div v-if="itm.additionalType == 4">
<div v-if="itm.attContent.showVideoContent.length">
<video class="model-item-img" :src="itm.attContent.showVideoContent[0].attContent" controls="controls" />
</div>
<div v-if="!itm.attContent.showVideoContent.length && itm.attContent.showImgContent.length">
<img class="model-item-img" :src="itm.attContent.showImgContent[0].attContent" />
</div>
</div>
<span v-else :title="itm.attContent.objectName">{{ itm.attContent.objectName }}</span>
</template>
<i class="el-icon-circle-close" @click="close(index)"></i>
</div>
......@@ -383,7 +391,9 @@ export default {
},
'editForm.object.additionalType'(val) {
var idx = this.editFormDataChannel.findIndex(item => item.name == 'pushChannelType')
this.editFormDataChannel[idx].optionList[2].isDisabled = [1, 2, 3].includes(val)
if (this.condLimitObj.hasQw) {
this.editFormDataChannel[idx].optionList[2].isDisabled = [1, 2, 3].includes(val)
}
}
},
......@@ -453,6 +463,12 @@ export default {
getInfo() {
this.editForm.eventStartDate = moment(this.editForm.eventStartDate).format('YYYY-MM-DD')
this.editForm.eventEndDate = moment(this.editForm.eventEndDate).format('YYYY-MM-DD')
this.previewList = [
{
attContent: JSON.parse(JSON.stringify(this.editForm.object)),
additionalType: this.editForm.object.additionalType
}
]
this.recoveryRepeat()
this.recoveryEndTime()
},
......@@ -463,6 +479,7 @@ export default {
// objectType 对象类型(1朋友圈模板-单图文,2朋友圈模板-多图文,3朋友圈模板-文字+视频,4朋友圈模板-文字,5优惠券-商城券,6活动-权益卡使用,7活动-权益套餐,8活动-秒杀活动,10-素材)
this.editForm.object = JSON.parse(JSON.stringify(val))
this.editRule.eventContent[0].required = true
this.editForm.pushChannelType = ''
this.previewList = [
{
attContent: val,
......@@ -482,7 +499,7 @@ export default {
// additionalType 附加对象类型(1素材,2活动,3优惠券,4朋友券模板)
// objectType 对象类型(1朋友圈模板-单图文,2朋友圈模板-多图文,3朋友圈模板-文字+视频,4朋友圈模板-文字,5优惠券-商城券,6活动-权益卡使用,7活动-权益套餐,8活动-秒杀活动,10-素材)
this.editForm.object = JSON.parse(JSON.stringify(val))
if(val.showTxtContent) {
if (val.showTxtContent) {
this.editForm.eventContent = val.showTxtContent
}
this.editRule.eventContent[0].required = false
......@@ -520,7 +537,7 @@ export default {
close(index) {
this.previewList.splice(index, 1)
if(this.editForm.object.additionalType == 4) {
if (this.editForm.object.additionalType == 4) {
this.editForm.eventContent = ''
this.editRule.eventContent[0].required = true
}
......@@ -531,6 +548,7 @@ export default {
selectActivity(val) {
this.editForm.object = JSON.parse(JSON.stringify(val))
this.editRule.eventContent[0].required = true
this.editForm.pushChannelType = ''
this.previewList = [
{
attContent: val,
......@@ -545,25 +563,6 @@ export default {
document.getElementById(id).scrollIntoView()
},
// 计算事件重复次数
// dealRepeatEventTotal() {
// console.log(moment(this.editForm.eventStartDate).weeksInYear())
// if (this.editForm.repeatFlag == 'Y') {
// switch (this.editForm.repeatMode) {
// // 按天
// case '1':
// this.editForm.eventCount = (new Date(this.editForm.eventEndDate) - new Date(this.editForm.eventStartDate)) / (24 * 60 * 60 * 1000) + 1
// break
// // 按周
// case '2':
// break
// case '3':
// break
// }
// }
// console.log(this.editForm.eventCount)
// },
handleConfirm() {
console.log(this.editForm)
// this.dealRepeatEventTotal()
......@@ -648,6 +647,7 @@ export default {
margin-bottom: 10px;
border-left: 1px solid #dcdfe6;
border-right: 1px solid #dcdfe6;
.model-item-img,
img {
width: 20px;
height: 20px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!