| | |
| | | */ |
| | | _checkLinking() { |
| | | // 安卓注入 |
| | | if (window.linking) { |
| | | if (window.aisim && window.aisim.linking) { |
| | | return 'android'; |
| | | } |
| | | // 没有注入 |
| | |
| | | delete this[name]; |
| | | }; |
| | | // 发送 |
| | | window.linking(JSON.stringify({ |
| | | window.aisim.linking(JSON.stringify({ |
| | | method, |
| | | param, |
| | | callback: 'bridge.' + name, |
| | |
| | | if (trans && Object.prototype.toString.call(trans) === '[object Function]') { |
| | | callback = trans; |
| | | param = {}; |
| | | } else { |
| | | callback = null; |
| | | } |
| | | if (this._checkLinking()) { |
| | | this._sendLinking(method, param, callback); |
| | |
| | | if (this._receives[method]) { |
| | | if (marker) { |
| | | this._receives[method](param, (param2) => { |
| | | this._sendTelling(method, param2, marker); |
| | | this._sendTelling(method, param2 || {}, marker); |
| | | }); |
| | | } else { |
| | | this._receives[method](param); |
| | |
| | | return; |
| | | } |
| | | // 发送 |
| | | window.linking(JSON.stringify({ |
| | | window.aisim.linking(JSON.stringify({ |
| | | method, |
| | | param, |
| | | marker, |