Commit 74fe79e3 by 杨明

fixed

1 parent c1990310
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-19 13:46:20 * @Date: 2023-05-19 13:46:20
* @LastEditors: yangming yangming@didihu.com.cn * @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 * @FilePath: \scrm-micro-home\src\mixins\gpt.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
*/ */
...@@ -32,11 +32,11 @@ export default { ...@@ -32,11 +32,11 @@ export default {
async createBig(info, logoInfo, titleStyle, subTitleStyle) { async createBig(info, logoInfo, titleStyle, subTitleStyle) {
console.log(info) console.log(info)
this.loading = true this.loading = true
const { backgroundImage, detailImage, merchantLogo, marketingTitle, marketingSubtitle } = info const { backgroundImage, merchantLogo, marketingTitle, marketingSubtitle } = info
if (!backgroundImage) return if (!backgroundImage) return
try { try {
const res = await Promise.all([this.getImgInfo(backgroundImage), this.getImgInfo(detailImage), this.getImgInfo(merchantLogo)]) const res = await Promise.all([this.getImgInfo(backgroundImage), this.getImgInfo(merchantLogo)])
const h = (res[0].dh / res[0].dw) * WIDTH + (res[1].dh / res[1].dw) * WIDTH const h = (res[0].dh / res[0].dw) * WIDTH
this.logoInfo = { url: merchantLogo, ...logoInfo } this.logoInfo = { url: merchantLogo, ...logoInfo }
const drawfun = new Drawing(document.getElementById('canvasId'), { const drawfun = new Drawing(document.getElementById('canvasId'), {
width: WIDTH, width: WIDTH,
...@@ -48,17 +48,12 @@ export default { ...@@ -48,17 +48,12 @@ export default {
x: 0, x: 0,
y: 0, y: 0,
width: WIDTH, width: WIDTH,
height: (res[0].dh / res[0].dw) * WIDTH height: h
}, }
{ ]
url: detailImage, if (info.merchantLogo) {
x: 0, imageList.push({ ...logoInfo, url: info.merchantLogo })
y: (res[0].dh / res[0].dw) * WIDTH, }
width: WIDTH,
height: (res[1].dh / res[1].dw) * WIDTH
},
{ ...this.logoInfo }
].filter(item => item.url)
const styles = [titleStyle, subTitleStyle] const styles = [titleStyle, subTitleStyle]
for (const style of styles) { for (const style of styles) {
style.x = parseInt(style.x * RATIO) style.x = parseInt(style.x * RATIO)
...@@ -92,7 +87,7 @@ export default { ...@@ -92,7 +87,7 @@ export default {
}) })
}) })
} }
console.log(title, textList) console.log(imageList, 'imageList')
const canvasBase64 = await drawfun.begin({ const canvasBase64 = await drawfun.begin({
imageList, imageList,
textList textList
......
...@@ -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-20 16:56:29 * @LastEditTime: 2023-07-20 17:47:39
* @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
--> -->
...@@ -525,6 +525,7 @@ export default { ...@@ -525,6 +525,7 @@ export default {
this.isFestival = true this.isFestival = true
} }
if (this.detail.merchantLogo) this.logoInfo = await this.getImgWH(this.detail.merchantLogo) if (this.detail.merchantLogo) this.logoInfo = await this.getImgWH(this.detail.merchantLogo)
console.log(this.detail)
}) })
}, },
getPropSize(dom, prop) { getPropSize(dom, prop) {
......
...@@ -156,8 +156,8 @@ export default { ...@@ -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.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 })) 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') { if (FESTIVAL.includes(params.codeId)) {
url = await this.createBig(this.$refs.viewForm.detail, this.logoInfo, JSON.parse(titleStyle), JSON.parse(subTitleStyle)) //合并主图、背景图、logo、文字 url = await this.createBig(this.$refs.viewForm.detail, logoInfo, JSON.parse(titleStyle), JSON.parse(subTitleStyle)) //合并主图、背景图、logo、文字
} }
let origin = 'createSuperMarketing' let origin = 'createSuperMarketing'
if (params.id && this.routerInfo.addOrEdit == 'edit') { 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!