Fix:查看订单详情后返回订单列表,应停留在用户进入详情页前的位置
This commit is contained in:
@@ -804,7 +804,8 @@ export default {
|
||||
dateRange: [],
|
||||
userLatitude: null,
|
||||
userLongitude: null,
|
||||
orderListRequestId: 0
|
||||
orderListRequestId: 0,
|
||||
savedScrollTop: 0
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -862,7 +863,15 @@ export default {
|
||||
})
|
||||
} else if (needRefreshOrderList) {
|
||||
uni.removeStorageSync('needRefreshMyOrderList')
|
||||
this.changeType()
|
||||
this.getOrderData()
|
||||
if (this.savedScrollTop > 0) {
|
||||
this.$nextTick(() => {
|
||||
uni.pageScrollTo({
|
||||
scrollTop: this.savedScrollTop,
|
||||
duration: 0
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
@@ -1990,6 +1999,9 @@ export default {
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loading && this.getOrderListReq()
|
||||
},
|
||||
onPageScroll(e) {
|
||||
this.savedScrollTop = e.scrollTop
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user