feat(app跳转方法文件): 更新2种页面跳转方法
This commit is contained in:
parent
c3d537ed2f
commit
14eeb193fe
@ -60,8 +60,13 @@ export function closePage() {
|
||||
*/
|
||||
export function gotoPrivateChat(userId) {
|
||||
try {
|
||||
// 使用注入的方法
|
||||
window.app.gotoPrivateChat(userId)
|
||||
if (window.app && window.app.gotoPrivateChat) {
|
||||
// 使用注入的方法
|
||||
window.app.gotoPrivateChat(userId)
|
||||
} else if (window.FlutterPageControl) {
|
||||
// 直接使用Flutter通道
|
||||
window.FlutterPageControl.postMessage(`private_chat:${userId}`)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('前往私聊失败:', error)
|
||||
}
|
||||
@ -72,8 +77,13 @@ export function gotoPrivateChat(userId) {
|
||||
*/
|
||||
export function viewUserInfo(userId) {
|
||||
try {
|
||||
// 使用注入的方法
|
||||
window.app.viewUserInfo(userId)
|
||||
if (window.app && window.app.viewUserInfo) {
|
||||
// 使用注入的方法
|
||||
window.app.viewUserInfo(userId)
|
||||
} else if (window.FlutterPageControl) {
|
||||
// 直接使用Flutter通道
|
||||
window.FlutterPageControl.postMessage(`view_user_info:${userId}`)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('查看个人页面失败:', error)
|
||||
}
|
||||
@ -84,8 +94,13 @@ export function viewUserInfo(userId) {
|
||||
*/
|
||||
export function gotoRoom(roomId) {
|
||||
try {
|
||||
// 使用注入的方法
|
||||
window.app.gotoRoom(roomId)
|
||||
if (window.app && window.app.gotoRoom) {
|
||||
// 使用注入的方法
|
||||
window.app.gotoRoom(roomId)
|
||||
} else if (window.FlutterPageControl) {
|
||||
// 直接使用Flutter通道
|
||||
window.FlutterPageControl.postMessage(`go_to_room:${roomId}`)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('前往房间失败:', error)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user