getPage: function(touserid) {
console.log("getPage")
var that = this;
that.app.get({
url: that.app.apiHost + "/module.php?m=im_pm&touserid=" + touserid,
success: function(res) {
var it=setTimeout(function(){
query.select('#main').boundingClientRect(function(rs) {
uni.pageScrollTo({
scrollTop:rs.height,
duration:1
})
oldHeight=rs.height;
console.log(oldHeight);
}).exec();
},30)
}
})
},
getList: function() {
if (this.per_page == 0) return false;
var that = this;
that.loadIng = true;
that.app.get({
url: that.app.apiHost + "/module.php?m=im_pm&touserid=" + that.touser.userid,
data: {
per_page: that.per_page
},
success: function(res) {
setTimeout(function(){
query.select('#main').boundingClientRect(rs => {
uni.pageScrollTo({
scrollTop:rs.height-oldHeight,
duration:1
})
console.log(rs.height+" "+oldHeight)
// that.oldsch=rs.height;
}).exec();
},30)
that.loadIng = false;
}
})
},
在getlist中调用boundingClientRect, 会影响getPage中的boundingClientRect,但是没有调用getPage。这样没法获取两个不同时间的元素高度。
0 个回复