@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dolphinweex/weex-harmony-transform",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "weex harmony adapter",
5
5
  "main": "index.js",
6
6
  "files": [
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
  }
@@ -17,6 +17,7 @@ const weexExtModules = [
17
17
  "router",
18
18
  'modal',
19
19
  "aiSpeechModule",
20
+ "MallModule"
20
21
  ]
21
22
 
22
23
  module.exports = weexExtModules