@dolphinweex/weex-harmony 0.1.22 → 0.1.24

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.22",
3
+ "version": "0.1.24",
4
4
  "description": "weex harmony adapter",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -72,7 +72,10 @@ export default {
72
72
  },
73
73
  methods: {
74
74
  postMessage(message){
75
- this.$refs["iframe"].contentWindow.postMessage(message, this.src)
75
+ const iframe = this.$refs["iframe"]
76
+ const target = new URL(iframe.src).origin
77
+ iframe.contentWindow.postMessage(message, target)
78
+ //this.$refs["iframe"].contentWindow.postMessage(message, this.src)
76
79
  },
77
80
  // 自定义拓展其它逻辑
78
81
  onPageFinish(res) {
@@ -42,6 +42,7 @@ export default {
42
42
  width: this.width,
43
43
  height: this.height,
44
44
  data: this.data,
45
+ handleBarClicked: this.handleBarClicked
45
46
  };
46
47
  },
47
48
  },
@@ -51,6 +52,9 @@ export default {
51
52
  },
52
53
 
53
54
  methods: {
55
+ handleBarClicked(res) {
56
+ this.$emit('barClicked', res);
57
+ },
54
58
  },
55
59
  };
56
60
  </script>
@@ -61,6 +61,7 @@ export default {
61
61
  onPageFinish() {
62
62
  console.log('加载完毕🥳','----->👉');
63
63
  this.$refs["iframe"].contentWindow.$midea_harmony_native = window.$midea_harmony_native;
64
+ this.$refs["iframe"].contentWindow.isIframe = true;
64
65
  this.$refs["iframe"].contentWindow.postMessage(JSON.stringify(window.$midea_harmony_native), '*');
65
66
  },
66
67
  }
@@ -21,7 +21,7 @@
21
21
  }"
22
22
  :data-index="index"
23
23
  @touchstart="(event) => startLongPress(event, index)"
24
- @touchmove.stop="checkLongPressMove"
24
+ @touchmove="checkLongPressMove"
25
25
  @touchend="endTouch"
26
26
  @touchcancel="endTouch"
27
27
  >
@@ -361,7 +361,14 @@ export default {
361
361
  }
362
362
  },
363
363
  getListData(callback) {
364
- const data = Array.from(this.processedList);
364
+ let data = Array.from(this.processedList);
365
+ data = data.map((item)=>({
366
+ ...item,
367
+ itemView: {
368
+ ...item.itemView,
369
+ id:String(item.itemView.id)
370
+ }
371
+ }))
365
372
  callback({ listData: data });
366
373
  },
367
374
  rightIconClick(e) {
@@ -374,7 +381,7 @@ export default {
374
381
  onSelectItems() {
375
382
  const selectedIds = this.data.list
376
383
  .filter((item) => item.itemView.isSelected)
377
- .map((item) => item.itemView.id);
384
+ .map((item) => String(item.itemView.id));
378
385
  return selectedIds;
379
386
  },
380
387
  selectIconClick(e, item, index) {
@@ -388,6 +395,7 @@ export default {
388
395
  ...e,
389
396
  };
390
397
  this.$emit('onClickSelectIcon', target);
398
+ this.$emit('onSelectItems',target)
391
399
  return false;
392
400
  },
393
401
 
@@ -396,16 +404,16 @@ export default {
396
404
  if (e.defaultPrevented) {
397
405
  return;
398
406
  }
399
-
407
+ e.preventDefault();
408
+ e.stopPropagation();
400
409
  console.log('itemViewClick');
401
410
  // 确保取消任何长按计时器
402
411
  this.cancelLongPress();
403
412
  if (this.data.isEditing) {
404
413
  item.itemView.isSelected = !item.itemView.isSelected;
414
+ this.$emit('onSelectItems',target)
405
415
  return;
406
416
  }
407
- e.preventDefault();
408
- e.stopPropagation();
409
417
  const target = {
410
418
  ...item.itemView,
411
419
  id: String(item.itemView.id),
@@ -624,6 +632,7 @@ export default {
624
632
 
625
633
  // 检查长按过程中的移动
626
634
  checkLongPressMove(e) {
635
+ this.data.isEditing && e.oriEvent.stopPropagation()
627
636
  if (!this.data.isEditable) {
628
637
  return;
629
638
  }
@@ -717,12 +726,6 @@ export default {
717
726
  onTouchMove(e) {
718
727
  if (!this.isTouchDragging) return;
719
728
 
720
- // 只有在进入拖拽模式后才阻止默认滚动行为
721
- if (this.isTouchDragging) {
722
- e.preventDefault(); // 阻止页面滚动
723
- e.stopPropagation();
724
- }
725
-
726
729
  const touch = e.changedTouches[0];
727
730
 
728
731
  // 更新目标位置而非直接设置