feat(mini): v4.0.8 客服卡片主包落地、定位误报修复,合伙人微信内预览保存海报
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -116,6 +116,7 @@ export default function OrderDetailPage() {
|
||||
const orderId = router.params.id ?? '';
|
||||
usePageView('order_detail_view', orderId ? { orderId } : undefined);
|
||||
const [order, setOrder] = useState<OrderDetail | null>(null);
|
||||
const [loadError, setLoadError] = useState('');
|
||||
const [confirming, setConfirming] = useState(false);
|
||||
const [latestTrack, setLatestTrack] = useState<OrderTrackNode | null>(null);
|
||||
const [estimatedArrival, setEstimatedArrival] = useState<OrderTrackEstimatedArrival | null>(null);
|
||||
@@ -147,14 +148,18 @@ export default function OrderDetailPage() {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!orderId) return;
|
||||
if (!orderId) {
|
||||
setLoadError('订单信息缺失');
|
||||
return;
|
||||
}
|
||||
request<OrderDetail>(`/trade/orders/${orderId}`)
|
||||
.then((data) => {
|
||||
setOrder(data);
|
||||
setLoadError('');
|
||||
void loadOrderTrack(data.delivery, data.status);
|
||||
applyLocalDeliveryHint(data, setLocalHintHtml);
|
||||
})
|
||||
.catch((e) => toast(e instanceof Error ? e.message : '加载失败'));
|
||||
.catch((e) => setLoadError(e instanceof Error ? e.message : '加载失败'));
|
||||
}, [orderId]);
|
||||
|
||||
useDidShow(() => {
|
||||
@@ -293,7 +298,9 @@ export default function OrderDetailPage() {
|
||||
/>
|
||||
<View className="sub-page-body">
|
||||
{!order ? (
|
||||
<View className="u-empty">加载中…</View>
|
||||
<View className="u-empty" onClick={loadError ? () => Taro.switchTab({ url: '/pages/home/index' }) : undefined}>
|
||||
<Text>{loadError || '加载中…'}</Text>
|
||||
</View>
|
||||
) : (
|
||||
<>
|
||||
<View className="order-card">
|
||||
|
||||
Reference in New Issue
Block a user