From af407bf54be5fff5eedab14e897eb59a866b07d2 Mon Sep 17 00:00:00 2001 From: lujs <327240969@qq.com> Date: Fri, 8 Jan 2021 10:20:01 +0800 Subject: [PATCH 1/3] Comment out the log --- src/components/ImageContainer.jsx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components/ImageContainer.jsx b/src/components/ImageContainer.jsx index b864a1c..412a29b 100644 --- a/src/components/ImageContainer.jsx +++ b/src/components/ImageContainer.jsx @@ -185,7 +185,7 @@ class ImageContainer extends PureComponent { } handleTouchStart = (event) => { - console.info('handleTouchStart'); +// console.info('handleTouchStart'); event.preventDefault(); if (this.animationID) { raf.cancel(this.animationID); @@ -201,7 +201,7 @@ class ImageContainer extends PureComponent { this.startLeft = this.state.left; this.startTop = this.state.top; - console.info('handleTouchStart this.startX = %s, this.startY = %s, this.startLeft = %s, this.startTop = %s', this.startX, this.startY, this.startLeft, this.startTop); +// console.info('handleTouchStart this.startX = %s, this.startY = %s, this.startLeft = %s, this.startTop = %s', this.startX, this.startY, this.startLeft, this.startTop); this.onTouchStartTime = (new Date()).getTime(); this.haveCallMoveFn = false; @@ -243,7 +243,7 @@ class ImageContainer extends PureComponent { this.diffX = diffX; this.diffY = diffY; - console.info('handleTouchMove one diffX=%s, diffY=%s', diffX, diffY); +// console.info('handleTouchMove one diffX=%s, diffY=%s', diffX, diffY); // 判断是否为点击 if (Math.abs(diffX) < minTapMoveValue && Math.abs(diffY) < minTapMoveValue) { return; @@ -259,7 +259,7 @@ class ImageContainer extends PureComponent { return; } - console.info('handleMove one left=%s, this.startLeft=%s,this.originWidth=%s, width=%s', left, this.startLeft, this.originWidth, width); +// console.info('handleMove one left=%s, this.startLeft=%s,this.originWidth=%s, width=%s', left, this.startLeft, this.originWidth, width); if (diffX < 0 && this.startLeft <= this.originWidth - width) { this.haveCallMoveFn = true; this.callHandleMove(diffX); @@ -281,7 +281,7 @@ class ImageContainer extends PureComponent { if (height > screenHeight || this.state.scale === this.originScale) { newTop = this.startTop + diffY; } - console.info('handleTouchMove one newLeft=%s, newTop=%s', newLeft, newTop); +// console.info('handleTouchMove one newLeft=%s, newTop=%s', newLeft, newTop); this.setState({ left: newLeft, top: newTop, @@ -299,7 +299,7 @@ class ImageContainer extends PureComponent { const left = this.startLeft + ((1 - zoom) * this.oldPointLeft); const top = this.startTop + ((1 - zoom) * this.oldPointTop); - console.info('zoom = %s, left = %s, top = %s, scale', zoom, left, top, scale); +// console.info('zoom = %s, left = %s, top = %s, scale', zoom, left, top, scale); return { left, top, @@ -314,7 +314,7 @@ class ImageContainer extends PureComponent { } handleTouchEnd = (event) => { - console.info('handleTouchEnd', event.touches.length); +// console.info('handleTouchEnd', event.touches.length); event.preventDefault(); if (this.isTwoFingerMode) { // 双指操作结束 @@ -347,10 +347,10 @@ class ImageContainer extends PureComponent { this.startLeft = left; this.startTop = top; this.startScale = scale; - console.info('this.startX = %s, this.startY = %s, this.startLeft = %s, this.startTop = %s', this.startX, this.startY, this.startLeft, this.startTop); +// console.info('this.startX = %s, this.startY = %s, this.startLeft = %s, this.startTop = %s', this.startX, this.startY, this.startLeft, this.startTop); } - console.info('zoom = %s, left = %s, top = %s, width=%s, height= %s', zoom, left, top, width, height); +// console.info('zoom = %s, left = %s, top = %s, width=%s, height= %s', zoom, left, top, width, height); return { left, top, @@ -361,7 +361,7 @@ class ImageContainer extends PureComponent { const diffTime = (new Date()).getTime() - this.onTouchStartTime; const { diffX, diffY } = this; - console.info('handleTouchEnd one diffTime = %s, diffX = %s, diffy = %s', diffTime, diffX, diffY); +// console.info('handleTouchEnd one diffTime = %s, diffX = %s, diffy = %s', diffTime, diffX, diffY); // 判断为点击则关闭图片浏览组件 if (diffTime < maxTapTimeValue && Math.abs(diffX) < minTapMoveValue && Math.abs(diffY) < minTapMoveValue) { this.context.onClose(); @@ -448,7 +448,7 @@ class ImageContainer extends PureComponent { } else { top = (props.screenHeight - height) / 2; } - console.info('end animate left= %s, top = %s', left, top); +// console.info('end animate left= %s, top = %s', left, top); return { left, top, @@ -458,7 +458,7 @@ class ImageContainer extends PureComponent { left = tween.easeOutQuart(curTime, this.animateStartValue.x, this.animateFinalValue.x, maxAnimateTime); top = tween.easeOutQuart(curTime, this.animateStartValue.y, this.animateFinalValue.y, maxAnimateTime); - console.info('startAnimate left= %s, top = %s, curTime = %s', left, top, curTime); +// console.info('startAnimate left= %s, top = %s, curTime = %s', left, top, curTime); this.setState({ left, top, From 61f08a7000bd1dc14de4e7a14beee9ccc368704a Mon Sep 17 00:00:00 2001 From: lujs <327240969@qq.com> Date: Fri, 8 Jan 2021 10:20:49 +0800 Subject: [PATCH 2/3] comment out the log --- src/components/ListContainer.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ListContainer.jsx b/src/components/ListContainer.jsx index 3f15b73..97e9676 100644 --- a/src/components/ListContainer.jsx +++ b/src/components/ListContainer.jsx @@ -97,7 +97,7 @@ class ListContainer extends PureComponent { handleEnd = (isAllowChange) => { let index; const diffTime = (new Date()).getTime() - this.startTime; - console.info('handleEnd %s', isAllowChange, diffTime, this.state.left, this.startLeft, this.props.index); +// console.info('handleEnd %s', isAllowChange, diffTime, this.state.left, this.startLeft, this.props.index); // 快速拖动情况下切换图片 if (isAllowChange && diffTime < DEFAULT_TIME_DIFF) { if (this.state.left < this.startLeft) { From e267e229caa000eb55ffc3355307c084469d7889 Mon Sep 17 00:00:00 2001 From: lujs <327240969@qq.com> Date: Fri, 8 Jan 2021 10:21:14 +0800 Subject: [PATCH 3/3] Update WrapViewer.jsx --- src/components/WrapViewer.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/WrapViewer.jsx b/src/components/WrapViewer.jsx index 927f626..2259d4e 100644 --- a/src/components/WrapViewer.jsx +++ b/src/components/WrapViewer.jsx @@ -32,7 +32,7 @@ class WrapViewer extends Component { } changeIndex = (index) => { - console.info('changeIndex index = ', index); +// console.info('changeIndex index = ', index); this.setState({ index, });