diff --git a/src/utils/appBridge.js b/src/utils/appBridge.js index 22c6ec9..344904b 100644 --- a/src/utils/appBridge.js +++ b/src/utils/appBridge.js @@ -60,7 +60,8 @@ export function closePage() { */ export function gotoPrivateChat(userId) { try { - window.FlutterPageControl.postMessage(`private_chat:${userId}`) + // 使用注入的方法 + window.app.gotoPrivateChat(userId) } catch (error) { console.error('前往私聊失败:', error) } @@ -71,7 +72,8 @@ export function gotoPrivateChat(userId) { */ export function viewUserInfo(userId) { try { - window.FlutterPageControl.postMessage(`view_user_info:${userId}`) + // 使用注入的方法 + window.app.viewUserInfo(userId) } catch (error) { console.error('查看个人页面失败:', error) } @@ -82,7 +84,8 @@ export function viewUserInfo(userId) { */ export function gotoRoom(roomId) { try { - window.FlutterPageControl.postMessage(`go_to_room:${roomId}`) + // 使用注入的方法 + window.app.gotoRoom(roomId) } catch (error) { console.error('前往房间失败:', error) }