feat(app跳转方法文件): 更新页面跳转方法

This commit is contained in:
hzj 2025-10-27 11:24:26 +08:00
parent bc2b2c1229
commit fc0285dc02
4 changed files with 13 additions and 9 deletions

View File

@ -23,6 +23,7 @@
> >
<div style="width: 75%"> <div style="width: 75%">
<img <img
v-if="avatarUrl"
:src="avatarUrl || ''" :src="avatarUrl || ''"
alt="" alt=""
width="100%" width="100%"

View File

@ -60,9 +60,9 @@ export function closePage() {
*/ */
export function gotoPrivateChat(userId) { export function gotoPrivateChat(userId) {
try { try {
console.log(`userId:${userId}`)
if (window.app && window.app.gotoPrivateChat) { if (window.app && window.app.gotoPrivateChat) {
console.log('使用gotoPrivateChat') console.log('使用gotoPrivateChat')
console.log(`user:${userId}`)
// 使用注入的方法 // 使用注入的方法
window.app.gotoPrivateChat(userId) window.app.gotoPrivateChat(userId)
} else if (window.FlutterPageControl) { } else if (window.FlutterPageControl) {
@ -79,10 +79,9 @@ export function gotoPrivateChat(userId) {
*/ */
export function viewUserInfo(userId) { export function viewUserInfo(userId) {
try { try {
console.log(`userId:${userId}`)
if (window.app && window.app.viewUserInfo) { if (window.app && window.app.viewUserInfo) {
console.log('使用viewUserInfo') console.log('使用viewUserInfo')
console.log(`user:${userId}`)
// 使用注入的方法 // 使用注入的方法
window.app.viewUserInfo(userId) window.app.viewUserInfo(userId)
} else if (window.FlutterPageControl) { } else if (window.FlutterPageControl) {
@ -99,10 +98,9 @@ export function viewUserInfo(userId) {
*/ */
export function gotoRoom(roomId) { export function gotoRoom(roomId) {
try { try {
console.log(`roomId:${roomId}`)
if (window.app && window.app.gotoRoom) { if (window.app && window.app.gotoRoom) {
console.log('使用gotoRoom') console.log('使用gotoRoom')
console.log(`room:${roomId}`)
// 使用注入的方法 // 使用注入的方法
window.app.gotoRoom(roomId) window.app.gotoRoom(roomId)
} else if (window.FlutterPageControl) { } else if (window.FlutterPageControl) {

View File

@ -459,12 +459,12 @@ const observer = new IntersectionObserver((entries) => {
}) })
// app // app
const gotoAppPage = (item) => { const gotoAppPage = (id) => {
if (isInAppEnvironment.value) { if (isInAppEnvironment.value) {
if (rankingType.value == 'Room') { if (rankingType.value == 'Room') {
gotoRoom(item.id) gotoRoom(id)
} else { } else {
viewUserInfo(item.id) viewUserInfo(id)
} }
} }
} }

View File

@ -26,7 +26,12 @@
<img :src="images.listTitle" alt="" style="width: 90%" /> <img :src="images.listTitle" alt="" style="width: 90%" />
<!-- 榜首 --> <!-- 榜首 -->
<div style="width: 100%; display: flex; justify-content: space-around; margin-top: 16px"> <div style="width: 100%; display: flex; justify-content: space-around; margin-top: 16px">
<div style="width: 40%" v-for="(topUser, index) in listTop" :key="index"> <div
style="width: 40%"
v-for="(topUser, index) in listTop"
:key="index"
@click="viewUserInfo(topUser.userInfo.userId)"
>
<div <div
style=" style="
position: relative; position: relative;