123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- 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();
- }
- }
- })
|