Commit e12ac8fb by 杨明

fixed

1 parent 946aac4d
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-15 15:08:32 * @Date: 2023-05-15 15:08:32
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-08-30 18:10:31 * @LastEditTime: 2023-08-31 11:00:31
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\MarketingRight.vue * @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 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -474,16 +474,15 @@ export default { ...@@ -474,16 +474,15 @@ export default {
} }
Object.assign(this.draggableList[0], { content: this.detail.marketingTitle, ...style1, width: this.detail.marketingTitle.length * (style1.size * fontObj[style1.font]), color: style1.style.color, font: style1.font, height: 'auto', shadow: style1.style['text-shadow'] }) Object.assign(this.draggableList[0], { content: this.detail.marketingTitle, ...style1, width: this.detail.marketingTitle.length * (style1.size * fontObj[style1.font]), color: style1.style.color, font: style1.font, height: 'auto', shadow: style1.style['text-shadow'] })
Object.assign(this.draggableList[1], { content: this.detail.marketingSubtitle, ...style2, width: this.detail.marketingSubtitle.length * (style2.size * fontObj[style2.font]), color: style2.style.color, font: style2.font, height: 'auto', shadow: style2.style['text-shadow'] }) Object.assign(this.draggableList[1], { content: this.detail.marketingSubtitle, ...style2, width: this.detail.marketingSubtitle.length * (style2.size * fontObj[style2.font]), color: style2.style.color, font: style2.font, height: 'auto', shadow: style2.style['text-shadow'] })
console.log(this.draggableList[0])
setTimeout(() => { setTimeout(() => {
const textDom = document.querySelectorAll('.img_cl') const textDom = document.querySelectorAll('.img_cl')
textDom.forEach(item => { textDom.forEach(async item => {
const reduceSize = () => {
let fontSize = this.getPropSize(item, 'font-size') let fontSize = this.getPropSize(item, 'font-size')
let height = this.getPropSize(item, 'height') let height = this.getPropSize(item, 'height')
let content = item.textContent.trim() let content = item.textContent.trim()
let len = parseInt(content.length)
if (height > fontSize + 5) { if (height > fontSize + 5) {
fontSize -= len fontSize -= 3
} }
if (content == this.detail.marketingTitle) { if (content == this.detail.marketingTitle) {
Object.assign(this.draggableList[0], { size: fontSize, height: 'auto', width: content.length * (fontSize * fontObj[this.draggableList[0].font]) }) Object.assign(this.draggableList[0], { size: fontSize, height: 'auto', width: content.length * (fontSize * fontObj[this.draggableList[0].font]) })
...@@ -491,6 +490,13 @@ export default { ...@@ -491,6 +490,13 @@ export default {
if (content == this.detail.marketingSubtitle) { if (content == this.detail.marketingSubtitle) {
Object.assign(this.draggableList[1], { size: fontSize, height: 'auto', width: content.length * (fontSize * fontObj[this.draggableList[1].font]) }) Object.assign(this.draggableList[1], { size: fontSize, height: 'auto', width: content.length * (fontSize * fontObj[this.draggableList[1].font]) })
} }
setTimeout(() => {
if (this.getPropSize(item, 'height') > this.getPropSize(item, 'font-size') + 5) {
reduceSize()
}
}, 300)
}
reduceSize()
}) })
}, 300) }, 300)
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!