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%">
<img
v-if="avatarUrl"
:src="avatarUrl || ''"
alt=""
width="100%"

View File

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

View File

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

View File

@ -26,7 +26,12 @@
<img :src="images.listTitle" alt="" style="width: 90%" />
<!-- 榜首 -->
<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
style="
position: relative;