码迷,mamicode.com
首页 > 其他好文 > 详细

mark

时间:2017-09-15 16:38:20      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:oca   lock   结果   str   header   doc   amp   error   star   

ListenerScoller () {

var startX, startY;
document.addEventListener(‘touchstart‘,function (ev) {
startX = ev.touches[0].pageX;
startY = ev.touches[0].pageY;

}, false);
document.addEventListener(‘touchend‘,function (ev) {
var endX, endY;
endX = ev.changedTouches[0].pageX;
endY = ev.changedTouches[0].pageY;
var dy = startY - endY;
var reach = Boolean;
var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
console.log(scrollTop);
document.documentElement.scrollHeight == document.documentElement.clientHeight + scrollTop ? reach = true : reach = false
console.log(reach)
if(dy>30 && reach){
console.log(dy);
document.getElementById(‘load‘).style.display = ‘block‘;
fetch(‘/distributor/level?page=‘,{
headers:{
‘Authorization‘:localStorage.getItem(‘token‘)
}
}).then(response => {
return response.json(); // 先将结果转换为 JSON 对象
})
.then(data => {
let original = this.state.useLists;
let arr = original.concat(data.data.list);
this.setState({
useLists:arr
});
}).catch(function(error){
console.log(error);
});
}

}, false);
}

mark

标签:oca   lock   结果   str   header   doc   amp   error   star   

原文地址:http://www.cnblogs.com/winyh/p/7526630.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!