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

Merge pull request !167 from wuKong/fix(order)-防止订单详情页重复加载或未加载
develop
芋道源码 2025-11-25 06:24:53 +00:00 committed by Gitee
commit 9c1fddb7b7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 6 additions and 1 deletions

View File

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