Commit 74fe79e3 by 杨明

fixed

1 parent c1990310
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-19 13:46:20
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-20 16:55:50
* @LastEditTime: 2023-07-20 17:40:13
* @FilePath: \scrm-micro-home\src\mixins\gpt.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -32,11 +32,11 @@ export default {
async createBig(info, logoInfo, titleStyle, subTitleStyle) {
console.log(info)
this.loading = true
const { backgroundImage, detailImage, merchantLogo, marketingTitle, marketingSubtitle } = info
const { backgroundImage, merchantLogo, marketingTitle, marketingSubtitle } = info
if (!backgroundImage) return
try {
const res = await Promise.all([this.getImgInfo(backgroundImage), this.getImgInfo(detailImage), this.getImgInfo(merchantLogo)])
const h = (res[0].dh / res[0].dw) * WIDTH + (res[1].dh / res[1].dw) * WIDTH
const res = await Promise.all([this.getImgInfo(backgroundImage), this.getImgInfo(merchantLogo)])
const h = (res[0].dh / res[0].dw) * WIDTH
this.logoInfo = { url: merchantLogo, ...logoInfo }
const drawfun = new Drawing(document.getElementById('canvasId'), {
width: WIDTH,
......@@ -48,17 +48,12 @@ export default {
x: 0,
y: 0,
width: WIDTH,
height: (res[0].dh / res[0].dw) * WIDTH
},
{
url: detailImage,
x: 0,
y: (res[0].dh / res[0].dw) * WIDTH,
width: WIDTH,
height: (res[1].dh / res[1].dw) * WIDTH
},
{ ...this.logoInfo }
].filter(item => item.url)
height: h
}
]
if (info.merchantLogo) {
imageList.push({ ...logoInfo, url: info.merchantLogo })
}
const styles = [titleStyle, subTitleStyle]
for (const style of styles) {
style.x = parseInt(style.x * RATIO)
......@@ -92,7 +87,7 @@ export default {
})
})
}
console.log(title, textList)
console.log(imageList, 'imageList')
const canvasBase64 = await drawfun.begin({
imageList,
textList
......
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-15 15:08:32
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-20 16:56:29
* @LastEditTime: 2023-07-20 17:47:39
* @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
-->
......@@ -525,6 +525,7 @@ export default {
this.isFestival = true
}
if (this.detail.merchantLogo) this.logoInfo = await this.getImgWH(this.detail.merchantLogo)
console.log(this.detail)
})
},
getPropSize(dom, prop) {
......
......@@ -156,8 +156,8 @@ export default {
params.titleStyle = JSON.stringify(Object.assign(titleStyle, { x: style1.x, y: style1.y, size: style1.size, width: style1.width }))
params.subTitleStyle = JSON.stringify(Object.assign(subTitleStyle, { x: style2.x, y: style2.y, size: style2.size, width: style2.width }))
}
if (FESTIVAL.includes(params.codeId) && this.routerInfo.addOrEdit != 'edit') {
url = await this.createBig(this.$refs.viewForm.detail, this.logoInfo, JSON.parse(titleStyle), JSON.parse(subTitleStyle)) //合并主图、背景图、logo、文字
if (FESTIVAL.includes(params.codeId)) {
url = await this.createBig(this.$refs.viewForm.detail, logoInfo, JSON.parse(titleStyle), JSON.parse(subTitleStyle)) //合并主图、背景图、logo、文字
}
let origin = 'createSuperMarketing'
if (params.id && this.routerInfo.addOrEdit == 'edit') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!