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