Fix:查看订单详情后返回订单列表,应停留在用户进入详情页前的位置

This commit is contained in:
linxi
2026-08-12 10:23:43 +08:00
parent 238f56ab11
commit 9102c47804
+14 -2
View File
@@ -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>