feat(platform-web): keep protocol when opening vehicle rows

This commit is contained in:
lingniu
2026-07-04 01:22:41 +08:00
parent 5f84139c00
commit 55834a4651
5 changed files with 98 additions and 16 deletions

View File

@@ -82,8 +82,9 @@ export default function App() {
replaceHash(page);
};
const openVehicle = async (keyword: string) => {
const openVehicle = async (keyword: string, protocol?: string) => {
const lookupKey = keyword.trim();
const nextProtocol = protocol?.trim() ?? '';
if (!lookupKey) {
return;
}
@@ -91,9 +92,9 @@ export default function App() {
const resolved = await api.vehicleResolve(new URLSearchParams({ keyword: lookupKey }));
const nextKey = resolved.resolved && resolved.vin ? resolved.vin : lookupKey;
setActiveVin(nextKey);
setActiveProtocol('');
setActiveProtocol(nextProtocol);
setActivePage('detail');
replaceHash('detail', nextKey);
replaceHash('detail', nextKey, nextProtocol);
if (!resolved.resolved) {
Toast.warning('未匹配到车辆身份,已打开问题排查视图');
}