@dolphinweex/weex-vue-render 0.2.90 → 0.2.91
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/dist/index.common.js +63 -38
- package/package.json +1 -1
package/dist/index.common.js
CHANGED
|
@@ -8183,7 +8183,6 @@ var slideMixin = {
|
|
|
8183
8183
|
lastNode.style.position = 'absolute';
|
|
8184
8184
|
this._setPosition(lastNode, -this._wrapperWidth);
|
|
8185
8185
|
lastNode.style.opacity = '1';
|
|
8186
|
-
lastNode.style.zIndex = '10';
|
|
8187
8186
|
|
|
8188
8187
|
// 执行向左滑动动画
|
|
8189
8188
|
inner.style.transition = slideTranstionTime;
|
|
@@ -8211,7 +8210,6 @@ var slideMixin = {
|
|
|
8211
8210
|
cloneNode.style.position = 'absolute';
|
|
8212
8211
|
this._setPosition(cloneNode, this.frameCount * this._wrapperWidth);
|
|
8213
8212
|
cloneNode.style.width = `${this._wrapperWidth}px`;
|
|
8214
|
-
cloneNode.style.zIndex = '10';
|
|
8215
8213
|
if (!cloneNode.parentNode) {
|
|
8216
8214
|
inner.appendChild(cloneNode);
|
|
8217
8215
|
}
|
|
@@ -8476,11 +8474,11 @@ var slideMixin = {
|
|
|
8476
8474
|
// clone 中的 embed 需要保留以维持布局,但必须修改 id 防止触发同层渲染 CREATE 生命周期
|
|
8477
8475
|
// (CREATE 会替换原始 embed 的 controller,导致原视频失去 rootNode)
|
|
8478
8476
|
// 约定:id 以 "clone_" 开头的 embed 在 SameLayerManager 里会被直接忽略
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
|
|
8477
|
+
var cloneEmbeds = clone.querySelectorAll('embed');
|
|
8478
|
+
for (var ci = 0; ci < cloneEmbeds.length; ci++) {
|
|
8479
|
+
var origId = cloneEmbeds[ci].getAttribute('id') || '';
|
|
8480
|
+
cloneEmbeds[ci].setAttribute('id', 'native_disabled_' + origId);
|
|
8481
|
+
}
|
|
8484
8482
|
this.$refs.inner.appendChild(clone);
|
|
8485
8483
|
arr.push(clone);
|
|
8486
8484
|
return clone
|
|
@@ -8523,11 +8521,11 @@ var slideMixin = {
|
|
|
8523
8521
|
|
|
8524
8522
|
// clone 中的 embed 需要保留以维持布局,但必须修改 id 防止触发同层渲染 CREATE 生命周期
|
|
8525
8523
|
// 约定:id 以 "clone_" 开头的 embed 在 SameLayerManager 里会被直接忽略
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8524
|
+
var cloneEmbeds = cloneNode.querySelectorAll('embed');
|
|
8525
|
+
for (var ci = 0; ci < cloneEmbeds.length; ci++) {
|
|
8526
|
+
var origId = cloneEmbeds[ci].getAttribute('id') || '';
|
|
8527
|
+
cloneEmbeds[ci].setAttribute('id', 'native_disabled_' + origId);
|
|
8528
|
+
}
|
|
8531
8529
|
|
|
8532
8530
|
// 预设所有图片元素的背景图片,避免重新加载
|
|
8533
8531
|
var originalImages = originalNode.querySelectorAll('[style*="background-image"]');
|
|
@@ -8900,16 +8898,21 @@ var slideMixin = {
|
|
|
8900
8898
|
this._setPosition(lastNode, -this._wrapperWidth);
|
|
8901
8899
|
lastNode.style.opacity = '1';
|
|
8902
8900
|
} else if (atLast && isLeftSwipe) {
|
|
8903
|
-
//
|
|
8901
|
+
// 从最后一张向左滑到第一张:
|
|
8902
|
+
// 第一张在列表开头,不能脱离文档流,否则会导致当前最后一张区域出现黑块。
|
|
8903
|
+
// 这里保留其布局位置,只做视觉位移到最右侧。
|
|
8904
8904
|
var firstNode = this._cells[0].elm;
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
this._setPosition(
|
|
8908
|
-
|
|
8909
|
-
|
|
8910
|
-
|
|
8905
|
+
console.log('cdj-touchmove-last-to-first', { currentIndex: this.currentIndex, preIndex: this._preIndex, frameCount: this.frameCount });
|
|
8906
|
+
firstNode.style.position = this.isTransform ? '' : 'relative';
|
|
8907
|
+
this._setPosition(firstNode, this.frameCount * this._wrapperWidth);
|
|
8908
|
+
firstNode.style.opacity = '1';
|
|
8909
|
+
var firstInner = firstNode.firstElementChild;
|
|
8910
|
+
if (firstInner) {
|
|
8911
|
+
firstInner.style.opacity = '1';
|
|
8912
|
+
firstInner.style.transition = 'none';
|
|
8913
|
+
firstInner.style.transform = '';
|
|
8911
8914
|
}
|
|
8912
|
-
tp.
|
|
8915
|
+
tp.boundaryFirstNode = firstNode;
|
|
8913
8916
|
}
|
|
8914
8917
|
}
|
|
8915
8918
|
}
|
|
@@ -8998,6 +9001,7 @@ var slideMixin = {
|
|
|
8998
9001
|
}
|
|
8999
9002
|
|
|
9000
9003
|
var newIndex = shouldSwitch ? (this.currentIndex - direction) : this.currentIndex;
|
|
9004
|
+
console.log('cdj-touchend-decision', { currentIndex: this.currentIndex, preIndex: this._preIndex, newIndex: newIndex, moveRatio: moveRatio, velocity: this.velocity, shouldSwitch: shouldSwitch, duration: animationDuration });
|
|
9001
9005
|
|
|
9002
9006
|
// 边界检查
|
|
9003
9007
|
if (!this.infinite || this.infinite === 'false') {
|
|
@@ -9007,6 +9011,15 @@ var slideMixin = {
|
|
|
9007
9011
|
|
|
9008
9012
|
// 如果是复位操作(没有切换页面),使用更平滑的动画
|
|
9009
9013
|
if (newIndex === this.currentIndex) {
|
|
9014
|
+
if (tp.boundaryFirstNode) {
|
|
9015
|
+
tp.boundaryFirstNode.style.position = '';
|
|
9016
|
+
tp.boundaryFirstNode.style.zIndex = '';
|
|
9017
|
+
var rollbackInner = tp.boundaryFirstNode.firstElementChild;
|
|
9018
|
+
if (rollbackInner) {
|
|
9019
|
+
rollbackInner.style.transition = '';
|
|
9020
|
+
}
|
|
9021
|
+
this._setPosition(tp.boundaryFirstNode, 0);
|
|
9022
|
+
}
|
|
9010
9023
|
this._smoothResetPosition(inner, animationDuration);
|
|
9011
9024
|
} else {
|
|
9012
9025
|
this._smoothSlideTo(newIndex, animationDuration, moveRatio);
|
|
@@ -9074,8 +9087,9 @@ var slideMixin = {
|
|
|
9074
9087
|
var currentOffset = this._getPosition(inner);
|
|
9075
9088
|
var targetOffset;
|
|
9076
9089
|
var needsReset = false;
|
|
9077
|
-
|
|
9078
|
-
|
|
9090
|
+
var cloneNode = null;
|
|
9091
|
+
var lastNode = null;
|
|
9092
|
+
var firstNode = null;
|
|
9079
9093
|
|
|
9080
9094
|
// 使用更自然的缓动函数
|
|
9081
9095
|
var easing = Math.abs(moveRatio) > 0.4 ?
|
|
@@ -9091,11 +9105,11 @@ var slideMixin = {
|
|
|
9091
9105
|
if (newIndex < 0) {
|
|
9092
9106
|
// 从第一张向右滑到最后一张
|
|
9093
9107
|
newIndex = this.frameCount - 1;
|
|
9108
|
+
console.log('cdj-smooth-boundary-first-to-last', { targetIndex: newIndex, innerOffset: this.innerOffset, wrapperWidth: this._wrapperWidth });
|
|
9094
9109
|
lastNode = this._cells[newIndex].elm;
|
|
9095
9110
|
lastNode.style.position = 'absolute';
|
|
9096
9111
|
this._setPosition(lastNode, -this._wrapperWidth);
|
|
9097
9112
|
lastNode.style.opacity = '1';
|
|
9098
|
-
lastNode.style.zIndex = '10';
|
|
9099
9113
|
|
|
9100
9114
|
// 目标是向右滑动到左侧的最后一张图片
|
|
9101
9115
|
targetOffset = this.innerOffset + this._wrapperWidth;
|
|
@@ -9103,17 +9117,18 @@ var slideMixin = {
|
|
|
9103
9117
|
} else if (newIndex >= this.frameCount) {
|
|
9104
9118
|
// 从最后一张向左滑到第一张
|
|
9105
9119
|
newIndex = 0;
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9120
|
+
firstNode = this._cells[0].elm;
|
|
9121
|
+
firstNode.style.position = this.isTransform ? '' : 'relative';
|
|
9122
|
+
this._setPosition(firstNode, this.frameCount * this._wrapperWidth);
|
|
9123
|
+
firstNode.style.opacity = '1';
|
|
9124
|
+
var smoothFirstInner = firstNode.firstElementChild;
|
|
9125
|
+
if (smoothFirstInner) {
|
|
9126
|
+
smoothFirstInner.style.opacity = '1';
|
|
9127
|
+
smoothFirstInner.style.transition = 'none';
|
|
9128
|
+
smoothFirstInner.style.transform = '';
|
|
9129
|
+
}
|
|
9115
9130
|
|
|
9116
|
-
|
|
9131
|
+
// 目标是向左滑动到右侧的第一张图片
|
|
9117
9132
|
targetOffset = this.innerOffset - this._wrapperWidth;
|
|
9118
9133
|
needsReset = true;
|
|
9119
9134
|
} else {
|
|
@@ -9153,10 +9168,20 @@ var slideMixin = {
|
|
|
9153
9168
|
this$1._setPosition(lastNode, 0);
|
|
9154
9169
|
}
|
|
9155
9170
|
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9171
|
+
if (cloneNode && cloneNode.parentNode) {
|
|
9172
|
+
// 兼容旧逻辑,兜底移除clone
|
|
9173
|
+
inner.removeChild(cloneNode);
|
|
9174
|
+
}
|
|
9175
|
+
if (firstNode) {
|
|
9176
|
+
// 重置第一张图片位置
|
|
9177
|
+
firstNode.style.position = '';
|
|
9178
|
+
firstNode.style.zIndex = '';
|
|
9179
|
+
var resetFirstInner = firstNode.firstElementChild;
|
|
9180
|
+
if (resetFirstInner) {
|
|
9181
|
+
resetFirstInner.style.transition = '';
|
|
9182
|
+
}
|
|
9183
|
+
this$1._setPosition(firstNode, 0);
|
|
9184
|
+
}
|
|
9160
9185
|
|
|
9161
9186
|
// 重置到正确的最终位置
|
|
9162
9187
|
this$1.innerOffset = -newIndex * this$1._wrapperWidth;
|
|
@@ -9182,7 +9207,7 @@ var slideMixin = {
|
|
|
9182
9207
|
this$1.currentIndex = newIndex;
|
|
9183
9208
|
this$1._preIndex = newIndex;
|
|
9184
9209
|
this$1._emitScrollEvent('scrollend');
|
|
9185
|
-
|
|
9210
|
+
}, duration * 1000);
|
|
9186
9211
|
},
|
|
9187
9212
|
|
|
9188
9213
|
_handleTouchCancel: function _handleTouchCancel (event) {
|
package/package.json
CHANGED