Fix:5693 【商城小程序】【我的订单-订单列表】删除已完成订单后,页面跳转至“购物”Tab
This commit is contained in:
@@ -864,14 +864,7 @@ export default {
|
|||||||
} else if (needRefreshOrderList) {
|
} else if (needRefreshOrderList) {
|
||||||
uni.removeStorageSync('needRefreshMyOrderList')
|
uni.removeStorageSync('needRefreshMyOrderList')
|
||||||
this.getOrderData()
|
this.getOrderData()
|
||||||
if (this.savedScrollTop > 0) {
|
this.refreshOrderListKeepPosition()
|
||||||
this.$nextTick(() => {
|
|
||||||
uni.pageScrollTo({
|
|
||||||
scrollTop: this.savedScrollTop,
|
|
||||||
duration: 0
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@@ -1866,7 +1859,7 @@ export default {
|
|||||||
keyword,
|
keyword,
|
||||||
orderType
|
orderType
|
||||||
} = this
|
} = this
|
||||||
getOrderList({
|
return getOrderList({
|
||||||
page,
|
page,
|
||||||
limit,
|
limit,
|
||||||
type,
|
type,
|
||||||
@@ -1889,6 +1882,24 @@ export default {
|
|||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 保持当前主/子tab及滚动位置刷新列表(从订单详情页返回后同步删除等状态变更)
|
||||||
|
refreshOrderListKeepPosition() {
|
||||||
|
this.orderListRequestId += 1
|
||||||
|
this.page = 1
|
||||||
|
this.loaded = false
|
||||||
|
this.loading = false
|
||||||
|
const restoreScrollTop = this.savedScrollTop
|
||||||
|
this.getOrderListReq().then(() => {
|
||||||
|
if (restoreScrollTop > 0) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
uni.pageScrollTo({
|
||||||
|
scrollTop: restoreScrollTop,
|
||||||
|
duration: 0
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
tapShowMore(index) {
|
tapShowMore(index) {
|
||||||
const order = this.getOrderByIndex(index)
|
const order = this.getOrderByIndex(index)
|
||||||
if (!order) {
|
if (!order) {
|
||||||
|
|||||||
@@ -1251,16 +1251,17 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
goBack() {
|
goBack() {
|
||||||
if (this.name === "MyOrder") {
|
// 从订单列表进入时直接返回原页面,保留列表页主/子tab及滚动位置
|
||||||
|
const pages = getCurrentPages()
|
||||||
|
const prevPage = pages && pages[pages.length - 2]
|
||||||
|
const prevRoute = prevPage && prevPage.route
|
||||||
|
if (prevRoute && prevRoute.indexOf('order/MyOrder') > -1) {
|
||||||
this.$yrouter.back();
|
this.$yrouter.back();
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
console.log(this);
|
|
||||||
this.$yrouter.replace({
|
|
||||||
path: "/pages/order/MyOrder/index"
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
this.$yrouter.replace({
|
||||||
|
path: "/pages/order/MyOrder/index"
|
||||||
|
});
|
||||||
},
|
},
|
||||||
cancelOrder() {
|
cancelOrder() {
|
||||||
cancelOrderHandle(this.orderInfo.orderId)
|
cancelOrderHandle(this.orderInfo.orderId)
|
||||||
|
|||||||
Reference in New Issue
Block a user