uni.createSelectorQuery().select(".app").boundingClientRect(data=>{//目标节点 uni.createSelectorQuery().select(".al").boundingClientRect((res)=>{//最外层盒子节点 uni.pageScrollTo({ duration:0,//过渡时间必须为0,uniapp bug,否则运行到手机会报错 scrollTop:res.top - data.top,//滚动到实际距离是元素距离顶部的距离减去最外层盒子的滚动距离 }) }).exec() }).exec();