@dolphinweex/weex-harmony 0.1.91 → 0.1.93

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.91",
3
+ "version": "0.1.93",
4
4
  "description": "weex harmony adapter",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -215,15 +215,18 @@ export default {
215
215
 
216
216
  children.forEach((child, index) => {
217
217
  const rect = child.getBoundingClientRect();
218
- this.debugLog(`子级 ${index}: top=${rect.top}, bottom=${rect.bottom}, height=${rect.height}`);
218
+ // 转换为相对于父元素的坐标,避免视口绝对坐标中负 top 导致高度被持续放大
219
+ const relTop = rect.top - parentRect.top;
220
+ const relBottom = rect.bottom - parentRect.top;
221
+ this.debugLog(`子级 ${index}: top=${relTop}, bottom=${relBottom}, height=${rect.height}`);
219
222
  if (rect.height > 0) {
220
- maxBottom = Math.max(maxBottom, rect.bottom);
221
- minTop = Math.min(minTop, rect.top);
223
+ maxBottom = Math.max(maxBottom, relBottom);
224
+ minTop = Math.min(minTop, Math.max(0, relTop)); // 负偏移从0算起,不向上扩展
222
225
  }
223
226
  totalOffsetHeight += (child.offsetHeight || 0);
224
227
  });
225
228
 
226
- // 优先使用 getBoundingClientRect 计算出的相对高度
229
+ // 优先使用相对坐标计算高度,不受视口滚动或容器偏移影响
227
230
  let height = (maxBottom > minTop) ? (maxBottom - minTop) : 0;
228
231
 
229
232
  this.debugLog(`计算高度详情: rectHeight=${height}, totalOffsetHeight=${totalOffsetHeight}, parentRectTop=${parentRect.top}`);
@@ -24,6 +24,7 @@
24
24
 
25
25
  <script>
26
26
  import BaseSameLayer from './baseSameLayer.vue';
27
+ const weexModule = weex.requireModule('weexModule');
27
28
 
28
29
  export default {
29
30
  data() {
@@ -206,7 +207,14 @@ export default {
206
207
  this.embedHeight = this.windowHeight;
207
208
  this.embedWidth = this.windowWidth;
208
209
  },
210
+ disabledEvent(){
211
+ document.body.style.pointerEvents = 'none'
212
+ setTimeout(()=>{
213
+ document.body.style.pointerEvents = 'auto'
214
+ },1000)
215
+ },
209
216
  onFullscreenChange(isFullScreeen) {
217
+ this.disabledEvent()
210
218
  if (isFullScreeen.flag) {
211
219
  this.embedPosition = 'fixed';
212
220
  this.embedHeight = this.windowWidth;
@@ -265,6 +273,7 @@ export default {
265
273
  this.embedPosition = this.defaultPosition;
266
274
  this.embedHeight = this.defaultHeight;
267
275
  this.embedWidth = this.defaultWidth;
276
+ document.body.style.pointerEvents = 'auto'
268
277
  }
269
278
  };
270
279
  </script>
@@ -207,7 +207,14 @@ export default {
207
207
  this.embedHeight = this.windowHeight;
208
208
  this.embedWidth = this.windowWidth;
209
209
  },
210
+ disabledEvent(){
211
+ document.body.style.pointerEvents = 'none'
212
+ setTimeout(()=>{
213
+ document.body.style.pointerEvents = 'auto'
214
+ },1000)
215
+ },
210
216
  onFullscreenChange(isFullScreeen) {
217
+ this.disabledEvent()
211
218
  if (isFullScreeen.flag) {
212
219
  this.embedPosition = 'fixed';
213
220
  this.embedHeight = this.windowWidth;
@@ -258,7 +265,7 @@ export default {
258
265
  onPreviewImageClick(res) {
259
266
  this.$emit('onPreviewImageClick', res);
260
267
  },
261
- onCaptureCompletion(){
268
+ onCaptureCompletion(res){
262
269
  this.$emit('onCaptureCompletion', res);
263
270
  }
264
271
  },
@@ -266,6 +273,7 @@ export default {
266
273
  this.embedPosition = this.defaultPosition;
267
274
  this.embedHeight = this.defaultHeight;
268
275
  this.embedWidth = this.defaultWidth;
276
+ document.body.style.pointerEvents = 'auto'
269
277
  }
270
278
  };
271
279
  </script>