Commit 70fabf14 by 前端

Merge branch 'v3.13.3' into 'master'

fixed

See merge request !9
2 parents 24c9c0d7 9e0b84ab
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-22 20:12:55 * @Date: 2023-05-22 20:12:55
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-06 13:41:22 * @LastEditTime: 2023-07-17 09:40:20
* @FilePath: \scrm-micro-home\src\utils\color.js * @FilePath: \scrm-micro-home\src\utils\color.js
* @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
*/ */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-10 17:17:31 * @Date: 2023-05-10 17:17:31
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-14 20:40:56 * @LastEditTime: 2023-07-19 15:47:50
* @FilePath: \outbound\src\views\calendar\add.vue * @FilePath: \outbound\src\views\calendar\add.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
--> -->
...@@ -68,7 +68,7 @@ import selectGoodsDialog from './components/SelectGoodsDialog' ...@@ -68,7 +68,7 @@ import selectGoodsDialog from './components/SelectGoodsDialog'
import PhoneView from './components/PhoneView' import PhoneView from './components/PhoneView'
import getUploadImgColor from '@/utils/color' import getUploadImgColor from '@/utils/color'
const RENEWAL = [1, 2, 3, 4, 5, 6, 7, 8] const RENEWAL = [1, 2, 3, 4, 5, 6, 7, 8]
const WIDTH = 285 const WIDTH = 280
const RATIO = 375 / WIDTH const RATIO = 375 / WIDTH
export default { export default {
name: 'addCalendar', name: 'addCalendar',
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
label: '营销标题', label: '营销标题',
name: 'title', name: 'title',
type: 'input', type: 'input',
maxlength: 12 maxlength: 10
}, },
{ {
label: '营销副标题', label: '营销副标题',
...@@ -309,7 +309,7 @@ export default { ...@@ -309,7 +309,7 @@ export default {
width: 400px; width: 400px;
margin-left: auto; margin-left: auto;
.preview-bg { .preview-bg {
width: 285px; width: 280px;
height: 556px; height: 556px;
} }
} }
......
...@@ -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-07-16 10:45:20 * @LastEditTime: 2023-07-19 16:58:30
* @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
--> -->
...@@ -211,8 +211,26 @@ export default { ...@@ -211,8 +211,26 @@ export default {
style.width = parseInt(style.width * RATIO) style.width = parseInt(style.width * RATIO)
} }
if (this.isRenewal) { if (this.isRenewal) {
Object.assign(this.draggableList[0], { content: title, ...style1, color: style1.style.color, font: style1.font, height: style1.size, with: style1.width }) Object.assign(this.draggableList[0], { content: title, ...style1, color: style1.style.color, font: style1.font, height: 'auto', with: style1.width })
Object.assign(this.draggableList[1], { content: subTitle, ...style2, color: style2.style.color, font: style2.font, height: style2.size, with: style2.width }) Object.assign(this.draggableList[1], { content: subTitle, ...style2, color: style2.style.color, font: style2.font, height: 'auto', with: style2.width })
setTimeout(() => {
const textDom = document.querySelectorAll('.img_cl')
textDom.forEach(item => {
let fontSize = this.getPropSize(item, 'font-size')
let height = this.getPropSize(item, 'height')
let content = item.textContent.trim()
let len = parseInt(content.length * 1.4)
if (height > fontSize + 5) {
fontSize -= len
}
if (content == title) {
Object.assign(this.draggableList[0], { content: title, ...style1, color: style1.style.color, size: fontSize, font: style1.font, height: 'auto', with: style1.width })
}
if (content == subTitle) {
Object.assign(this.draggableList[1], { content: subTitle, ...style2, color: style2.style.color, size: fontSize, font: style2.font, height: 'auto', with: style2.width })
}
})
}, 300)
this.backgroundHeight = await this.getImgH(backgroundImg) this.backgroundHeight = await this.getImgH(backgroundImg)
return return
} }
...@@ -251,6 +269,9 @@ export default { ...@@ -251,6 +269,9 @@ export default {
} }
}, },
methods: { methods: {
getPropSize(dom, prop) {
return +window.getComputedStyle(dom)[prop].match(/\d+/)[0]
},
//获取图片宽度高度 //获取图片宽度高度
getImgH(src) { getImgH(src) {
return new Promise(resolve => { return new Promise(resolve => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!