| | |
| | | let incId = 1; |
| | | |
| | | import GBridge from '../bridge/bridge-weex.js' |
| | | const noop = function () { }; |
| | | |
| | | class GImage { |
| | |
| | | } |
| | | |
| | | this._src = v; |
| | | |
| | | GImage.GBridge.perloadImage([this._src, this._id], (data) => { |
| | | try { |
| | | GBridge.perloadImage([this._src, this._id], (data) => { |
| | | if (process.env.NODE_ENV === 'development') { |
| | | console.log('****GBridge.perloadImage****') |
| | | } |
| | | if (typeof data === 'string') { |
| | | data = JSON.parse(data); |
| | | } |
| | | |
| | | if (data.error) { |
| | | var evt = { type: 'error', target: this }; |
| | | this.onerror(evt); |
| | |
| | | this.onload(evt); |
| | | } |
| | | }); |
| | | } catch (error) { |
| | | console.log('perloadImage fail', error) |
| | | } |
| | | } |
| | | |
| | | addEventListener(name, listener) { |