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({
},
createImg(){
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`
wx.showLoading({
title: '海报生成中...',
......@@ -83,8 +83,8 @@ Page({
success:(res)=> {
let imgW = res.width/4, imgH =res.height/4;
let drawFun = new Draw({
width: imgW,
height: imgH
width: imgW ,
height: imgH + imgW/4+22
});
// let scene = {
// actNum,
......@@ -96,23 +96,62 @@ Page({
}
let qrcodeH = actNum==3? 68: 100
commonApi.createQrcode(params).then(response => {
wx.showLoading({
title: '海报生成中...',
})
if(response?.data){
let qrcode = response?.data
this.setData({
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 = [
{
x: 10,
y: 10,
width: imgW/4,
height: imgW/4+2,
url: `${IMGURL}prod/${senceData[actNum].productList[activeNavIdx].img}.png`,
},
{
x: 0,
y: 0,
y: imgW/4+22,
width: imgW,
height: imgH,
url: img,
},
{
x:imgW-qrcodeH,
y: imgH-arr[actNum]-qrcodeH,
x:imgW-qrcodeH-5,
y: imgH + imgW/4+17-qrcodeH,
width: qrcodeH,
height: qrcodeH,
url: qrcode, //二维码
......@@ -120,6 +159,7 @@ Page({
];
drawFun.begin({
imageList: imgList,
textList
}).then(resp => {
this.setData({
posterUrl: resp.path,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!