Component({ properties: { obj: { type: Object, value: {} }, barcodeImgUrl: { type: String, value: 'https://discuz.hoolihome.com/defaults/barcode2.jpg' } }, data: { dataArr: [], logoImgUrl: 'https://static.hoolihome.com/weapp/hoolihome/slogan.png?v=1' }, methods: { getElementInfo: function () { const query = wx.createSelectorQuery().in(this); //fields query.selectAll('.canvas-part').fields({ dataset: true, rect: true, id: true, size: true, computedStyle: ['color', 'backgroundColor', 'fontSize', 'fontWeight', 'borderRadius'], context: true, }, function (res) { let pages = getCurrentPages(); let curPage = pages[pages.length - 1]; if (res && curPage && curPage.posterCallack) { curPage.posterCallack(res); } else { curPage.posterCallack(null); } }).exec() }, photoLoaded: function (e) { this.getElementInfo(); } }, lifetimes: { ready: function () { // this.getElementInfo(); } } })