@dolphinweex/weex-harmony-transform 0.1.17 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/adapter.js +28 -2
- package/src/weexExtModules.js +1 -0
package/package.json
CHANGED
package/src/adapter.js
CHANGED
|
@@ -3,8 +3,14 @@ let weexModule = {
|
|
|
3
3
|
callNative: function (name, paramObj, callback, successCb = undefined, failCb = undefined) {
|
|
4
4
|
// @ts-ignore
|
|
5
5
|
try {
|
|
6
|
+
if (window !== window.top) {
|
|
7
|
+
window.addEventListener('message', function (event) {
|
|
8
|
+
console.log('event🥳', '----->👉', event);
|
|
9
|
+
event.currentTarget.$midea_harmony_native.run(name, paramObj, callback, successCb, failCb);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
6
12
|
$midea_harmony_native.run(name, paramObj, callback, successCb, failCb);
|
|
7
|
-
} catch(e) {}
|
|
13
|
+
} catch (e) { }
|
|
8
14
|
}
|
|
9
15
|
}
|
|
10
16
|
|
|
@@ -332,6 +338,25 @@ let aiSpeechModule = {
|
|
|
332
338
|
},
|
|
333
339
|
}
|
|
334
340
|
|
|
341
|
+
let MallModule = {
|
|
342
|
+
name: 'MallModule',
|
|
343
|
+
isLogin: function (callback) {
|
|
344
|
+
weexModule.callNative('MallModule.isLogin', {}, callback);
|
|
345
|
+
},
|
|
346
|
+
getCookie: function (name, callback) {
|
|
347
|
+
weexModule.callNative('MallModule.getCookie', { 'name': name }, callback);
|
|
348
|
+
},
|
|
349
|
+
openWxPageTranslucent: function (finalUrl, options) {
|
|
350
|
+
weexModule.callNative('MallModule.openWxPageTranslucent', { 'finalUrl': finalUrl, 'options': options }, undefined);
|
|
351
|
+
},
|
|
352
|
+
openURL: function (url) {
|
|
353
|
+
weexModule.callNative('MallModule.openURL', { 'url': url }, undefined);
|
|
354
|
+
},
|
|
355
|
+
getWXPayInfo: function (param, callback) {
|
|
356
|
+
weexModule.callNative('MallModule.getWXPayInfo', { 'param': param }, callback);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
335
360
|
let deviceInfo = {
|
|
336
361
|
name: "weex获取全屏高度",
|
|
337
362
|
enableFullScreenHeight: function (callback) {
|
|
@@ -673,5 +698,6 @@ export {
|
|
|
673
698
|
nfcModule,
|
|
674
699
|
router,
|
|
675
700
|
aiSpeechModule,
|
|
676
|
-
modal
|
|
701
|
+
modal,
|
|
702
|
+
MallModule
|
|
677
703
|
}
|