Commit 25c46a16 by 前端

Merge branch 'zq_dev_3.0' into 'v3.0'

画头部

See merge request !76
2 parents ef4d55e1 d624bdde
...@@ -73,7 +73,7 @@ Page({ ...@@ -73,7 +73,7 @@ Page({
}, },
createImg(){ createImg(){
if(this.data.isShow && this.data.fromLocal==1){ if(this.data.isShow && this.data.fromLocal==1){
let { actNum,activeNavIdx } = this.data; let { actNum,activeNavIdx,senceData } = this.data;
let img = `${IMGURL}scene/longpic${actNum + 1}.png` let img = `${IMGURL}scene/longpic${actNum + 1}.png`
wx.showLoading({ wx.showLoading({
title: '海报生成中...', title: '海报生成中...',
...@@ -83,8 +83,8 @@ Page({ ...@@ -83,8 +83,8 @@ Page({
success:(res)=> { success:(res)=> {
let imgW = res.width/4, imgH =res.height/4; let imgW = res.width/4, imgH =res.height/4;
let drawFun = new Draw({ let drawFun = new Draw({
width: imgW, width: imgW ,
height: imgH height: imgH + imgW/4+22
}); });
// let scene = { // let scene = {
// actNum, // actNum,
...@@ -96,23 +96,62 @@ Page({ ...@@ -96,23 +96,62 @@ Page({
} }
let qrcodeH = actNum==3? 68: 100 let qrcodeH = actNum==3? 68: 100
commonApi.createQrcode(params).then(response => { commonApi.createQrcode(params).then(response => {
wx.showLoading({
title: '海报生成中...',
})
if(response?.data){ if(response?.data){
let qrcode = response?.data let qrcode = response?.data
this.setData({ this.setData({
imgH: (imgH/imgW)*450 imgH: (imgH/imgW)*450
}) })
let arr = [0,0,0,0] console.log( actNum,activeNavIdx,senceData)
let textList = [
{
x: imgW/4+22,
y: 15,
text: senceData[actNum].productList[activeNavIdx].proName,
textBaseline: 'top'
},
{
x: imgW/4+22,
y: (imgW/4+12)/2,
color: '#7A8299',
text: `${senceData[actNum].productList[activeNavIdx].varType==1?'三年售后存量数':'新车销量'} ${senceData[actNum].productList[activeNavIdx].sale}`,
},
{
x: imgW/4+22,
y: imgW/4,
text: '预估收益',
maxWidth: 50,
color: '#7A8299'
},
{
x: imgW/4+77,
y: imgW/4,
text: `¥${senceData[actNum].productList[activeNavIdx].profit}`,
color: '#F35251',
fontSize: 14,
fontWeight: 500
}
]
let imgList = [ let imgList = [
{ {
x: 10,
y: 10,
width: imgW/4,
height: imgW/4+2,
url: `${IMGURL}prod/${senceData[actNum].productList[activeNavIdx].img}.png`,
},
{
x: 0, x: 0,
y: 0, y: imgW/4+22,
width: imgW, width: imgW,
height: imgH, height: imgH,
url: img, url: img,
}, },
{ {
x:imgW-qrcodeH, x:imgW-qrcodeH-5,
y: imgH-arr[actNum]-qrcodeH, y: imgH + imgW/4+17-qrcodeH,
width: qrcodeH, width: qrcodeH,
height: qrcodeH, height: qrcodeH,
url: qrcode, //二维码 url: qrcode, //二维码
...@@ -120,6 +159,7 @@ Page({ ...@@ -120,6 +159,7 @@ Page({
]; ];
drawFun.begin({ drawFun.begin({
imageList: imgList, imageList: imgList,
textList
}).then(resp => { }).then(resp => {
this.setData({ this.setData({
posterUrl: resp.path, posterUrl: resp.path,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!