feat(platform): resolve vehicle identity before navigation

This commit is contained in:
lingniu
2026-07-04 01:06:24 +08:00
parent 3e76210d7d
commit 703a7b112f
9 changed files with 189 additions and 8 deletions

View File

@@ -41,10 +41,11 @@ export function AppShell({
activePage: PageKey;
linkIssueCount: number | null;
onChange: (page: PageKey) => void;
onVehicleSearch: (keyword: string) => void;
onVehicleSearch: (keyword: string) => void | Promise<void>;
children: ReactNode;
}) {
const [keyword, setKeyword] = useState('');
const [searching, setSearching] = useState(false);
const search = () => {
const value = keyword.trim();
@@ -52,7 +53,8 @@ export function AppShell({
Toast.warning('请输入 VIN / 车牌 / 手机号');
return;
}
onVehicleSearch(value);
setSearching(true);
Promise.resolve(onVehicleSearch(value)).finally(() => setSearching(false));
};
return (
@@ -81,7 +83,7 @@ export function AppShell({
onEnterPress={search}
style={{ width: 320 }}
/>
<Button theme="solid" type="primary" onClick={search}></Button>
<Button theme="solid" type="primary" loading={searching} onClick={search}></Button>
</Space>
<Space spacing={12}>
<Tag color="blue"></Tag>