!167 fix(order): 防止订单详情页重复加载或未加载

Merge pull request !167 from wuKong/fix(order)-防止订单详情页重复加载或未加载
This commit is contained in:
芋道源码
2025-11-25 06:24:53 +00:00
committed by Gitee

View File

@@ -428,7 +428,10 @@
onShow(async () => {
// onShow中获取订单列表,保证跳转后页面为最新状态
await getOrderDetail(state.orderInfo.id);
// 有几率在onLoad完成state.orderInfo.id赋值前进入onShow
if (state.orderInfo.id) {
await getOrderDetail(state.orderInfo.id);
}
});
onLoad(async (options) => {
@@ -447,6 +450,8 @@
}
}
state.orderInfo.id = id;
// 完成state.orderInfo.id赋值后加载一次detail但有几率与onShow重复可能导致detail会加载两次。
await getOrderDetail(state.orderInfo.id);
});
</script>