feat(mini): v4.0.8 客服卡片主包落地、定位误报修复,合伙人微信内预览保存海报
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { View, Text } from '@tarojs/components';
|
||||
import Taro, { useLoad } from '@tarojs/taro';
|
||||
import PageShell from '../../components/PageShell';
|
||||
import { goLogin } from '../../lib/auth-nav';
|
||||
import { isLoggedIn } from '../../lib/api';
|
||||
|
||||
function goHome() {
|
||||
Taro.switchTab({ url: '/pages/home/index' }).catch(() => {
|
||||
Taro.reLaunch({ url: '/pages/home/index' });
|
||||
});
|
||||
}
|
||||
|
||||
function openOrder(orderId: string) {
|
||||
const detail = `/pages/order-detail/index?id=${encodeURIComponent(orderId)}`;
|
||||
if (!isLoggedIn()) {
|
||||
goLogin(detail);
|
||||
return;
|
||||
}
|
||||
Taro.redirectTo({ url: detail }).catch(() => {
|
||||
Taro.reLaunch({ url: detail });
|
||||
});
|
||||
}
|
||||
|
||||
/** 主包落地:客服卡片 / 外链打开分包页(订单详情)前先落到这里,避免白屏 */
|
||||
export default function OpenPage() {
|
||||
useLoad((query?: Record<string, string | undefined>) => {
|
||||
const orderId = String(query?.id || query?.orderId || '').trim();
|
||||
if (!orderId) {
|
||||
goHome();
|
||||
return;
|
||||
}
|
||||
openOrder(orderId);
|
||||
});
|
||||
|
||||
return (
|
||||
<PageShell variant="plain">
|
||||
<View className="u-empty">
|
||||
<Text>正在打开…</Text>
|
||||
</View>
|
||||
</PageShell>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user