Authored by 邱骏

Merge branch 'feature/magazine' of http://git.yoho.cn/fe/yohobuywap-node into feature/magazine

... ... @@ -30,6 +30,7 @@ function DragableElm(elm) {
let _endY = 0;
let _open = false;
let _startTime = 0;
let _canDrag = true;
const moveElm = (y) => {
_moveY = Math.min(Math.max(y, _maxY), 0);
... ... @@ -52,16 +53,32 @@ function DragableElm(elm) {
});
};
elm.find('.detail-container').scroll(e => {
_canDrag = !!(_open && e.target.scrollTop < 10);
});
elm.on('touchstart', e => {
if (!_canDrag && open) {
return;
}
let point = get(e, 'originalEvent.targetTouches[0]') || {};
_startY = point.pageY;
_startTime = new Date();
}).on('touchmove', e => {
if (!_startTime) {
return;
}
let point = get(e, 'originalEvent.targetTouches[0]') || {};
moveElm(point.pageY - _startY + _endY);
}).on('touchend', e => {
if (!_startTime) {
return;
}
let time = new Date() - _startTime;
let movedY = Math.abs(_moveY - _endY);
let moveOption = {};
... ... @@ -92,6 +109,7 @@ function DragableElm(elm) {
_open = !_open;
}
}, moveOption.time);
_startTime = 0;
});
}
... ...
... ... @@ -127,7 +127,7 @@ body {
height: 100%;
background-color: #fff;
margin-top: -160px;
padding-bottom: 90px;
padding-bottom: 100PX;
border-radius: 20px;
position: fixed;
top: 100%;
... ... @@ -169,6 +169,7 @@ body {
.detail-container {
flex-grow: 1;
overflow-y: scroll;
}
.content {
... ...