@dolphinweex/weex-vue-render 0.2.37 → 0.2.39

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.
@@ -3367,7 +3367,14 @@ function watchAppear (context, fireNow) {
3367
3367
  var el = watchAppearList[i];
3368
3368
  var appearOffset = getAppearOffset(el);
3369
3369
  var visibleData = isElementVisible(el, container, dir, appearOffset);
3370
- detectAppear(el, visibleData, dir);
3370
+ /**
3371
+ * BUG2025052771230
3372
+ * triggerAppearEvent 执行过快可能会导致AI对话聊天窗口重叠问题
3373
+ * 此处延时执行是临时规避措施,后续需要优化
3374
+ */
3375
+ setTimeout(() => {
3376
+ detectAppear(el, visibleData, dir);
3377
+ }, i);
3371
3378
  }
3372
3379
  };
3373
3380
  container.addEventListener('scroll', throttle(scrollHandler, 100, true));
@@ -5803,6 +5810,11 @@ function getThrottledScroll (context) {
5803
5810
 
5804
5811
  var scrollable$1 = {
5805
5812
  props: {
5813
+ scrollable: {
5814
+ type: [Boolean],
5815
+ default: true
5816
+ },
5817
+
5806
5818
  loadmoreoffset: {
5807
5819
  type: [String, Number],
5808
5820
  default: DEFAULT_LOADMORE_OFFSET,
@@ -5836,6 +5848,55 @@ var scrollable$1 = {
5836
5848
  },
5837
5849
 
5838
5850
  methods: {
5851
+ /**
5852
+ * 给虚拟节点数组添加作用域ID
5853
+ * @param {Array} vnodes - 虚拟节点数组
5854
+ * @param {Object} context - Vue组件实例上下文
5855
+ * @returns {Array} 添加了作用域ID的虚拟节点数组
5856
+ */
5857
+ applyScopeIdsToVNodes: function applyScopeIdsToVNodes (vnodes, context) {
5858
+ const scopeIds = this.getScopeIds(context);
5859
+ const attrs = {};
5860
+ for (let i = 0, l = scopeIds.length; i < l; i++) {
5861
+ attrs[scopeIds[i]] = '';
5862
+ }
5863
+ // 给每个子级节点添加作用域ID
5864
+ return vnodes.map(function (vnode) {
5865
+ if (vnode && vnode.data) {
5866
+ // 如果vnode已有attrs,则合并作用域ID
5867
+ if (!vnode.data.attrs) {
5868
+ vnode.data.attrs = {};
5869
+ }
5870
+ Object.assign(vnode.data.attrs, attrs);
5871
+ } else if (vnode) {
5872
+ // 如果vnode没有data,则创建data和attrs
5873
+ vnode.data = vnode.data || {};
5874
+ vnode.data.attrs = Object.assign({}, attrs);
5875
+ }
5876
+ return vnode;
5877
+ });
5878
+ },
5879
+ getScopeIds: function getScopeIds (context) {
5880
+ // 获取父级作用域ID
5881
+ var scopeIds = context._scopeIds;
5882
+ if (scopeIds) {
5883
+ return scopeIds
5884
+ }
5885
+ else {
5886
+ scopeIds = [];
5887
+ }
5888
+ var parent = context.$parent;
5889
+ //一般绝不可能没父级
5890
+ while (parent) {
5891
+ var i = (void 0);
5892
+ if ((i = parent.$options) && (i = i._scopeId)) {
5893
+ scopeIds.push(i);
5894
+ }
5895
+ parent = parent.$parent;
5896
+ }
5897
+ context._scopeIds = scopeIds;
5898
+ return scopeIds
5899
+ },
5839
5900
  updateLayout: function updateLayout () {
5840
5901
  var wrapper = this.$refs.wrapper;
5841
5902
  if (wrapper) {
@@ -6038,7 +6099,9 @@ var scrollable$1 = {
6038
6099
  if (!this._touchParams) {
6039
6100
  return
6040
6101
  }
6041
-
6102
+ if (!this.scrollable) {
6103
+ return
6104
+ }
6042
6105
  var tp = this._touchParams;
6043
6106
  if (!tp) { return }
6044
6107
 
@@ -6058,19 +6121,7 @@ var scrollable$1 = {
6058
6121
  // 如果是水平滚动,并且手势是水平方向,则阻止冒泡
6059
6122
  // 如果是垂直滚动,并且手势是垂直方向,则阻止冒泡
6060
6123
  var isScrollHorizontal = this.$el.classList.value.indexOf("weex-scroller-horizontal") > -1 || this.$el.classList.value.indexOf("weex-recycle-horizontal") > -1
6061
- console.log("dom", this.$el.classList.value)
6062
- if (isScrollHorizontal) {
6063
- if (!isV) {
6064
- // 水平
6065
- event.stopPropagation();
6066
- return;
6067
- }
6068
- return;
6069
- }else {
6070
- if (!isV) {
6071
- return;
6072
- }
6073
- }
6124
+
6074
6125
 
6075
6126
  if (!this._refresh && !this._loading) {
6076
6127
  return
@@ -6091,6 +6142,23 @@ var scrollable$1 = {
6091
6142
  }
6092
6143
  else if (this._loading && (dir === 'up') && reachBottom) {
6093
6144
  this._loading.pullingUp(-offsetY);
6145
+ var wrapper = this.$refs.wrapper;
6146
+ if (wrapper) {
6147
+ // 增加 1 像素,强制 scroll 区域“撑开”
6148
+ wrapper.scrollTop = wrapper.scrollTop + 5;
6149
+ }
6150
+ }
6151
+ }
6152
+ if (isScrollHorizontal) {
6153
+ if (!isV) {
6154
+ // 水平
6155
+ event.stopPropagation();
6156
+ return;
6157
+ }
6158
+ return;
6159
+ }else {
6160
+ if (!isV) {
6161
+ return;
6094
6162
  }
6095
6163
  }
6096
6164
  },
@@ -6181,12 +6249,6 @@ function getList (weex) {
6181
6249
 
6182
6250
  return {
6183
6251
  name: 'weex-list',
6184
- props: {
6185
- scrollable: {
6186
- type: [Boolean],
6187
- default: true
6188
- }
6189
- },
6190
6252
  mixins: [scrollable$1],
6191
6253
  computed: {
6192
6254
  wrapperClass: function wrapperClass () {
@@ -6341,11 +6403,13 @@ function getScroller (weex) {
6341
6403
  if (!vnode.tag && !trimmedText) { return false }
6342
6404
  return true
6343
6405
  });
6406
+ const cellsWithScopeIds = this.applyScopeIdsToVNodes(this._cells, this);
6407
+
6344
6408
  return [
6345
6409
  h('article', {
6346
6410
  ref: 'inner',
6347
6411
  staticClass: 'weex-scroller-inner weex-ct'
6348
- }, this._cells)
6412
+ }, cellsWithScopeIds)
6349
6413
  ]
6350
6414
  }
6351
6415
  },
@@ -6743,7 +6807,7 @@ function getWaterfall (weex) {
6743
6807
  },
6744
6808
  staticClass: 'weex-ct',
6745
6809
  staticStyle: {
6746
- width: this$1._columnWidth + 'px',
6810
+ // width: this$1._columnWidth + 'px',
6747
6811
  marginLeft: i$1 === 0 ? 0 : this$1._columnGap + 'px'
6748
6812
  }
6749
6813
  }, columnCells[i$1]));
@@ -6991,7 +7055,6 @@ function getLoading () {
6991
7055
  methods: {
6992
7056
  pulling: function pulling (offsetY) {
6993
7057
  if ( offsetY === void 0 ) offsetY = 0;
6994
-
6995
7058
  this.height = offsetY;
6996
7059
  },
6997
7060
  pullingUp: function pullingUp (offsetY) {
@@ -7000,7 +7063,7 @@ function getLoading () {
7000
7063
  },
7001
7064
  pullingEnd: function pullingEnd () {
7002
7065
  this.$el && (this.$el.style.transition = "height .2s");
7003
- if (this.height >= this.viewHeight) {
7066
+ if ( this.height >= Math.max(this.viewHeight, 150)) {
7004
7067
  this.pulling(this.viewHeight);
7005
7068
  if (this.$el) {
7006
7069
  dispatchNativeEvent(this.$el, 'loading');
@@ -7092,6 +7155,7 @@ function getRefresh (weex) {
7092
7155
  },
7093
7156
  watch: {
7094
7157
  height: function height (val) {
7158
+ if(val >150) val = 150
7095
7159
  this.$el.style.height = val + "px";
7096
7160
  },
7097
7161
  display: function display (val) {
@@ -10384,6 +10448,13 @@ var dom = {
10384
10448
  var offset = (isWindow ? 0 : ct[("scroll" + dSuffix)]) + elRect[dir] - ctRect[dir];
10385
10449
  if (options) {
10386
10450
  offset += options.offset && options.offset * weex.config.env.scale || 0;
10451
+ /**
10452
+ * 计算出的 offset 不适配 小美 AI 聊天框消息滑到底部; 通过传入的标志, 把计算出的 offset 重置为 0
10453
+ * 此为临时方案,后续需要优化
10454
+ */
10455
+ if(options.isReset){
10456
+ offset = 0
10457
+ }
10387
10458
  }
10388
10459
  else {}
10389
10460
  if (options && options.animated === false) {
package/package.json CHANGED
@@ -49,5 +49,5 @@
49
49
  "type": "git",
50
50
  "url": "git+ssh://git@github.com/weexteam/weex-vue-render.git"
51
51
  },
52
- "version": "0.2.37"
52
+ "version": "0.2.39"
53
53
  }