Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

移除log #17

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/components/ImageContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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) { // 双指操作结束
Expand Down Expand Up @@ -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,
Expand All @@ -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();
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ListContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/WrapViewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class WrapViewer extends Component {
}

changeIndex = (index) => {
console.info('changeIndex index = ', index);
// console.info('changeIndex index = ', index);
this.setState({
index,
});
Expand Down