Commit 86c5a72b by 胡悦

一键营销回显

1 parent e91e28c1
...@@ -5,16 +5,28 @@ ...@@ -5,16 +5,28 @@
<template v-if="marketingDetails.attachmentList.length > 0"> <template v-if="marketingDetails.attachmentList.length > 0">
<div v-for="(item, index) in marketingDetails.attachmentList" :key="index"> <div v-for="(item, index) in marketingDetails.attachmentList" :key="index">
<template v-if="item.attType == 1"> <template v-if="item.attType == 1">
<div class="font-14 color-3" v-html="item.attContent"></div> <div class="font-14 color-3 m-b-12" v-html="item.attContent"></div>
</template> </template>
<template v-else-if="item.attType == 2"> <template v-else-if="item.attType == 2">
<div class="marking-image"> <div class="marking-image m-b-12">
<img :src="item.attContent" /> <img :src="item.attContent" />
</div> </div>
</template> </template>
<template v-else-if="item.attType == 7"> <template v-else-if="item.attType == 7">
<div class="marking-image"> <div class="preview-activity">
<img :src="item.attContent" /> <img class="applet-logo" src="@/assets/images/solicit/icon-applet.png" alt /><span
style="color: #999;">小程序</span>
<div class="activity-name">{{ activityContent[item.attContent.marketingType] }}</div>
<img v-if="item.attContent.marketingType == 1 || item.attContent.marketingType == 2" class="activity-logo"
src="@/assets/images/solicit/activity-logo.png" alt />
<img v-if="item.attContent.marketingType == 3 || item.attContent.marketingType == 4" class="activity-logo"
src="@/assets/images/solicit/activity-equity.png" alt />
<img v-if="item.attContent.marketingType == 5" class="activity-logo"
src="@/assets/images/solicit/activity-spike.png" alt />
<div class="activity-footer">
<img src="@/assets/images/solicit/applet-footer.png" alt />
<span>小程序</span>
</div>
</div> </div>
</template> </template>
</div> </div>
...@@ -39,13 +51,20 @@ ...@@ -39,13 +51,20 @@
</div> </div>
</template> </template>
<script> <script>
const activityContent = {
2: '送您一张商城优惠券',
3: '送您一张专属权益服务卡',
4: '专属权益服务套餐',
5: '您有一个秒杀活动可参加'
}
import { solicitApi } from '@/api' import { solicitApi } from '@/api'
import { Toast,Notify} from 'vant' import { Toast, Notify } from 'vant'
import { mapState, mapMutations } from 'vuex' import { mapState, mapMutations } from 'vuex'
import emoji from '@/utils/emo' import emoji from '@/utils/emo'
export default { export default {
data() { data() {
return { return {
activityContent,
isEmpty: true, isEmpty: true,
marketingDetails: { marketingDetails: {
customerInfoList: [], customerInfoList: [],
...@@ -73,7 +92,7 @@ export default { ...@@ -73,7 +92,7 @@ export default {
}, },
{ {
attType: 7, attType: 7,
attContent: '{"marketingId":1,"marketingType":"3","marketingName":"招商银行信用卡"}' attContent: '{"marketingId":586,"marketingType":"2","marketingName":"弹窗领券代金券"}'
} }
] ]
} }
...@@ -106,7 +125,16 @@ export default { ...@@ -106,7 +125,16 @@ export default {
if (code == '0') { if (code == '0') {
// this.marketingDetails = data // this.marketingDetails = data
// this.$set(this, 'marketingDetails', data) // this.$set(this, 'marketingDetails', data)
if (this.marketingDetails.attachmentList && this.marketingDetails.attachmentList[0].attType == 1) this.getEmoImg() const attachmentList = this.marketingDetails.attachmentList.map(item => {
if (item.attType == 1) {
this.getEmoImg()
} else if (item.attType == 7) {
item.attContent = JSON.parse(item.attContent)
}
return item
})
console.log(attachmentList)
this.$set(this, 'marketingDetails', attachmentList)
this.SET_COUSTOMER_LIST({ customerInfoList: data.customerInfoList }) this.SET_COUSTOMER_LIST({ customerInfoList: data.customerInfoList })
} else { } else {
Notify(message) Notify(message)
...@@ -176,9 +204,9 @@ export default { ...@@ -176,9 +204,9 @@ export default {
padding: 16px; padding: 16px;
.marking-image { .marking-image {
width: 248px; width: 152px;
height: 198px; height: auto;
margin: 12px 32px 16px 32px; // margin: 12px 32px 16px 32px;
img { img {
width: 100%; width: 100%;
...@@ -230,5 +258,53 @@ export default { ...@@ -230,5 +258,53 @@ export default {
.disabled { .disabled {
background: #d5d8db !important; background: #d5d8db !important;
} }
.preview-activity {
width: 232px;
// height: 184px;
background-color: #fff;
border-radius: 4px;
border: 1px solid #E8E8EA;
padding: 12px 12px 0;
font-size: 11px;
box-sizing: border-box;
.applet-logo {
width: 18px;
height: 18px;
margin-right: 4px;
}
.activity-logo {
width: 208px;
height: 166px;
margin-bottom: 8px;
}
.activity-name {
font-size: 12px;
color: #333;
margin: 7px 0 4px;
width: 160px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.activity-footer {
display: flex;
align-items: center;
padding: 3px 0;
img {
width: 10px;
height: 10px;
margin-right: 3px;
}
margin-top: 4px;
border-top: 1px solid #DFE4EA;
}
}
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!