wxa-plugin-canvas报错Cannot read property?
发布于 6 年前 作者 yang11 10514 次浏览 来自 官方Issues

onCreatePoster(e) {

console.log(e)

var title = “sssss”;//标题

var username = “wx.getStorageSync(‘webUserInfo’).realName”;//

var mingpianma = “sssssss”;

var picurll = “sss”;

var configstr = {

jdConfig: {

width: 750,

height: 1334,

backgroundColor: ‘#fff’,

debug: false,

blocks: [{

width: 750,

height: 1334,

x: 30,

y: 183,

borderWidth: 2,

borderColor: ‘#fff’,

borderRadius: 20,

},

],

texts: [{

x: 200,

y: 600,

text: title,

fontSize: 38,

color: ‘#080808’,

width: 750,

lineNum: 1,

zIndex: 190,

textAlign: ‘left’,

},

{

x: 260,

y: 900,

fontSize: 38,

text: username + ’ 向您推荐’,

width: 570,

lineNum: 1,

zIndex: 200,

},

{

x: 300,

y: 1250,

baseLine: ‘top’,

text: ‘名片小程序’,

fontSize: 28,

color: ‘#929292’,

},

{

x: 220,

y: 1400,

baseLine: ‘top’,

text: ‘长按扫码查看详情’,

fontSize: 38,

color: ‘#929292’,

},

],

images: [{

width: 750,

height: 1334,

x: 59,

y: 210,

url: http://qrcardtest.etask.com.cn/image/share.png, //大背景

},

{

width: 750,

height: 500,

x: 0,

y: 0,

borderRadius: 0,

url: picurll, //推广内容

},

{

width: 150,

height: 150,

x: 300,

y: 650,

borderRadius: 75,

url: https://qrcardtest.etask.com.cn//UploadFiles/WeixinHead/HEAD_100202000000001634.jpg, //微信头像

},

{

width: 220,

height: 220,

x: 270,

y: 1020,

url: mingpianma, //小程序码

}

]

}

}

this.setData({

posterConfig: configstr.jdConfig

}, () => {

Poster.create(true); // 入参:true为抹掉重新生成

});

}

})

为什么会报Cannot read property ‘images’ of null这个错呀  有大哥用过没  给一个建议

回到顶部