@dolphinweex/weex-harmony-transform 0.1.20 → 0.1.22

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.20",
3
+ "version": "0.1.22",
4
4
  "description": "weex harmony adapter",
5
5
  "main": "index.js",
6
6
  "files": [
package/src/adapter.js CHANGED
@@ -204,7 +204,15 @@ let bridgeModule = {
204
204
  weexModule.callNative('bridgeModule.getTimeZoneSync',{ 'options': options }, callback)
205
205
  },
206
206
  getWeexPath:function(callback){
207
- weexModule.callNative('bridgeModule.getWeexPath',{ 'options': {} }, callback)
207
+ const isIframe = window.isIframe
208
+ if (isIframe) {
209
+ const path = window.location.pathname
210
+ const lastIndex = path.lastIndexOf('/');
211
+ const newPath = path.substring(0, lastIndex + 1);
212
+ callback(JSON.stringify({ weexPath: newPath }))
213
+ } else {
214
+ weexModule.callNative('bridgeModule.getWeexPath', { 'options': {} }, callback)
215
+ }
208
216
  },
209
217
  getWeexFunctionPath:function(options, callback){
210
218
  weexModule.callNative('bridgeModule.getWeexFunctionPath', { 'options': options }, callback)
@@ -679,6 +687,30 @@ let modal = {
679
687
  weexModule.callNative('modal.prompt', { 'options': param }, callback, undefined, failCallback)
680
688
  },
681
689
  }
690
+ let mideaAudio = {
691
+ name: 'midea-audio',
692
+ play: function (param, callback, failCallback) {
693
+ weexModule.callNative('midea-audio.play', { 'options': param }, callback, undefined, failCallback)
694
+ },
695
+ pause: function (param, callback, failCallback) {
696
+ weexModule.callNative('midea-audio.pause', { 'options': param }, callback, undefined, failCallback)
697
+ },
698
+ stop: function (param, callback, failCallback) {
699
+ weexModule.callNative('midea-audio.stop', { 'options': param }, callback, undefined, failCallback)
700
+ },
701
+ seek: function (param, callback, failCallback) {
702
+ weexModule.callNative('midea-audio.seek', { 'options': param }, callback, undefined, failCallback)
703
+ },
704
+ loop: function (param, callback, failCallback) {
705
+ weexModule.callNative('midea-audio.loop', { 'options': param }, callback, undefined, failCallback)
706
+ },
707
+ setCallback: function (param, callback, failCallback) {
708
+ weexModule.callNative('midea-audio.setCallback', { 'options': param }, callback, undefined, failCallback)
709
+ },
710
+ getDuration: function (param, callback, failCallback) {
711
+ weexModule.callNative('midea-audio.getDuration', { 'options': param }, callback, undefined, failCallback)
712
+ },
713
+ }
682
714
  export {
683
715
  clipboard,
684
716
  weexModule,
@@ -699,5 +731,6 @@ export {
699
731
  router,
700
732
  aiSpeechModule,
701
733
  modal,
702
- MallModule
734
+ MallModule,
735
+ mideaAudio
703
736
  }
@@ -17,7 +17,8 @@ const weexExtModules = [
17
17
  "router",
18
18
  'modal',
19
19
  "aiSpeechModule",
20
- "MallModule"
20
+ "MallModule",
21
+ "midea-audio"
21
22
  ]
22
23
 
23
24
  module.exports = weexExtModules