@dolphinweex/weex-harmony 0.1.59 → 0.1.60

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",
3
- "version": "0.1.59",
3
+ "version": "0.1.60",
4
4
  "description": "weex harmony adapter",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -4,23 +4,35 @@
4
4
  <iframe
5
5
  class="common-view-iframe"
6
6
  :id="embedId"
7
- v-if="url.length > 0"
7
+ v-if="url.length > 0 && pluginType != 'old-h5'"
8
8
  :src="url"
9
9
  :style="{ backgroundColor: backgroundColor, height: height }"
10
10
  ref="iframe"
11
11
  @load="onPageFinish"
12
12
  ></iframe>
13
+
14
+ <BaseSameLayer
15
+ class="common-view-iframe"
16
+ v-if="pluginType == 'old-h5'"
17
+ :hosSameLayerArgs="hosSameLayerArgs"
18
+ embedType="native/midea-common-weex-view"
19
+ :defaultWidth="300"
20
+ :defaultHeight="300"
21
+ ></BaseSameLayer>
13
22
  <!-- <image v-if="progressText.length > 0" /> -->
14
23
  </div>
15
24
  </template>
16
25
 
17
26
  <script>
27
+ import BaseSameLayer from "./baseSameLayer.vue";
28
+
18
29
  const weexModule = weex.requireModule("weexModule");
19
30
 
20
31
  export default {
21
32
  data() {
22
33
  return {
23
34
  url: "",
35
+ pluginType: "weex",
24
36
  backgroundColor: "transparent",
25
37
  progressText: "",
26
38
  embedId: `embedId_iframe_${
@@ -29,6 +41,9 @@ export default {
29
41
  height: "100%",
30
42
  };
31
43
  },
44
+ components: {
45
+ BaseSameLayer,
46
+ },
32
47
  name: "MideaCommonWeexView",
33
48
  props: {
34
49
  hosUniqueProps: {
@@ -50,11 +65,6 @@ export default {
50
65
  type: Object,
51
66
  },
52
67
  },
53
- // watch:{
54
- // backgroundColor(oldColor, newColor){
55
- // this.$refs["iframe"].contentWindow.document.style.backgroundColor = newColor
56
- // }
57
- // },
58
68
  created() {
59
69
  weexModule.callNative(
60
70
  `webview.webHandle`,
@@ -69,12 +79,28 @@ export default {
69
79
  if (args.progressText) {
70
80
  this.progressText = args.progressText;
71
81
  } else if (args.url) {
72
- this.url = args.url;
82
+ this.url = args.url;
73
83
  this.backgroundColor = args.pageBackgroundColor;
84
+ this.pluginType = args.pluginType
74
85
  }
75
86
  }
76
87
  );
77
88
  },
89
+ computed: {
90
+ hosSameLayerArgs() {
91
+ return {
92
+ ...this.hosUniqueProps, // 鸿蒙原生组件独有属性
93
+ width: this.$el.clientWidth,
94
+ height: this.$el.clientHeight,
95
+ data: {
96
+ router: this.router,
97
+ src: this.url,
98
+ backgroundColor: this.backgroundColor,
99
+ pluginData: this.pluginData,
100
+ }
101
+ };
102
+ },
103
+ },
78
104
  mounted() {
79
105
  // this.$refs["iframe"].addEventListener('load', this.onPageFinish);
80
106
  const iframeEl = this.$refs.iframe;