Commit 8a0f6459 by 杨明

fixed

1 parent efd45068
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-15 15:08:32
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-22 18:31:40
* @LastEditTime: 2023-05-31 17:18:14
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\MarketingRight.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -12,14 +12,17 @@
<div class="review-title_top">{{ detail.title }}</div>
<div class="review-content">
<div class="review-main">
<div class="main-title" :style="{ top: item.y + 'px', 'font-size': item.fontSize + 'px', color: item.color }" v-for="(item, index) in textList" :key="index">{{ item.text }}</div>
<div class="review-bg-img">
<img :src="detail.backgroundImg" v-if="detail.backgroundImg" />
</div>
<div class="review-main-img">
<img :src="detail.captionImg" v-if="detail.captionImg" />
</div>
</div>
<div class="review-package">
<div class="review-goods" v-if="selectedGoodsList && selectedGoodsList.length">
<div class="goods-item" v-for="(item, index) in selectedGoodsList" :key="index">
<div class="service-logo"></div>
<div class="service-desc">
<div class="title">{{ item.brandName }}{{ item.goodsName }}</div>
<div class="content">x{{ item.couponAmount }} 抵扣券</div>
......@@ -39,6 +42,36 @@ export default {
data() {
return {
detail: {},
cavansObj: {
1: {
titleStyle: {
x: 82,
y: 224,
fontSize: 52,
color: '#AD604C'
},
subTitleStyle: {
x: 66,
y: 292,
fontSize: 28,
color: '#AD604C'
}
},
2: {
titleStyle: {
x: 10,
y: 168,
fontSize: 36,
color: '#185D5E'
},
subTitleStyle: {
x: 10,
y: 212,
fontSize: 16,
color: '#185D5E'
}
}
},
discount: {
2: '折扣券',
3: '代金券',
......@@ -60,6 +93,30 @@ export default {
watch: {
editForm: {
handler(val) {
const mainTitle = this.cavansObj[val.id],
{ title, subTitle } = val,
textList = []
if (mainTitle) {
title.split(' ').forEach((item, index) => {
textList.push({
x: mainTitle.titleStyle.x * 0.7,
y: (mainTitle.titleStyle.y + index * mainTitle.titleStyle.fontSize * 1.1) * 0.7,
fontSize: mainTitle.titleStyle.fontSize * 0.7,
color: mainTitle.titleStyle.color,
text: item
})
})
new Array(subTitle).forEach((item, index) => {
textList.push({
x: mainTitle.subTitleStyle.x * 0.7,
y: (mainTitle.subTitleStyle.y + mainTitle.titleStyle.fontSize * 1.1 * (textList.length - 1)) * 0.7,
fontSize: mainTitle.subTitleStyle.fontSize * 0.7,
color: mainTitle.subTitleStyle.color,
text: item
})
})
}
this.textList = textList
this.detail = val
},
deep: true,
......@@ -104,6 +161,11 @@ export default {
left: 13px;
.review-main {
position: relative;
.main-title {
width: 100%;
position: absolute;
text-align: center;
}
img {
width: 275px;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!