feat(排行榜): 对接跳转app页面功能
This commit is contained in:
parent
33fc99af0f
commit
10ec5c4322
@ -69,7 +69,7 @@ export function gotoPrivateChat(userId) {
|
||||
/**
|
||||
* 查看个人页面
|
||||
*/
|
||||
export function gotoUserInfo(userId) {
|
||||
export function viewUserInfo(userId) {
|
||||
try {
|
||||
window.FlutterPageControl.postMessage(`view_user_info:${userId}`)
|
||||
} catch (error) {
|
||||
|
||||
@ -115,6 +115,7 @@
|
||||
:name="RankingTop3[0].nickname || ''"
|
||||
:distributionValue="RankingTop3[0].quantityFormat || ''"
|
||||
style="width: 40%"
|
||||
@click="gotoAppPage(RankingTop3[0].id)"
|
||||
/>
|
||||
</div>
|
||||
<!-- 第二三 -->
|
||||
@ -126,6 +127,7 @@
|
||||
:name="RankingTop3[1].nickname || ''"
|
||||
:distributionValue="RankingTop3[1].quantityFormat || ''"
|
||||
style="width: 30%"
|
||||
@click="gotoAppPage(RankingTop3[1].id)"
|
||||
/>
|
||||
<TopUser
|
||||
:isRoom="rankingType === 'Room'"
|
||||
@ -134,6 +136,7 @@
|
||||
:name="RankingTop3[2].nickname || ''"
|
||||
:distributionValue="RankingTop3[2].quantityFormat || ''"
|
||||
style="width: 30%"
|
||||
@click="gotoAppPage(RankingTop3[2].id)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -153,6 +156,7 @@
|
||||
align-items: center;
|
||||
"
|
||||
:style="{ background: rankItemBackground, border: '1px ' + rankItemBorder }"
|
||||
@click="gotoAppPage(userInfo.id)"
|
||||
>
|
||||
<div style="display: flex; align-items: center; width: 70%">
|
||||
<div style="font-weight: 700">{{ index + 4 }}</div>
|
||||
@ -269,7 +273,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { isInApp, closePage } from '@/utils/appBridge.js'
|
||||
import { isInApp, closePage, viewUserInfo, gotoRoom } from '@/utils/appBridge.js'
|
||||
import { computed, onMounted, ref, watch, watchEffect } from 'vue'
|
||||
import TopUser from '@/components/Ranking/topUser.vue'
|
||||
import { getWealthRanking, getCharmRanking, getRoomRanking, getMyRanking } from '@/api/ranking'
|
||||
@ -454,6 +458,17 @@ const observer = new IntersectionObserver((entries) => {
|
||||
})
|
||||
})
|
||||
|
||||
// 跳转app
|
||||
const gotoAppPage = (item) => {
|
||||
if (isInAppEnvironment.value) {
|
||||
if (rankingType.value == 'Room') {
|
||||
gotoRoom(item.id)
|
||||
} else {
|
||||
viewUserInfo(item.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获取榜单
|
||||
const getRanking = async () => {
|
||||
console.log('获取榜单')
|
||||
|
||||
@ -193,6 +193,7 @@
|
||||
style="margin: -2px 0; position: relative"
|
||||
v-for="(listItem, index) in topList"
|
||||
:key="index"
|
||||
@click="viewUserInfo(listItem.userId)"
|
||||
>
|
||||
<img :src="images['border-item-user']" alt="" style="width: 100%; display: block" />
|
||||
<div
|
||||
@ -617,6 +618,7 @@ import {
|
||||
parseHeader,
|
||||
setHttpHeaders,
|
||||
isInApp,
|
||||
viewUserInfo,
|
||||
} from '@/utils/appBridge.js'
|
||||
import {
|
||||
appConnectionManager,
|
||||
|
||||
@ -115,6 +115,7 @@
|
||||
:name="RankingHasTop3[0].userNickname"
|
||||
:distributionValue="RankingHasTop3[0].quantity"
|
||||
style="width: 70%"
|
||||
@click="viewUserInfo(RankingHasTop3[0].userId)"
|
||||
/>
|
||||
</div>
|
||||
<!-- 第二三 -->
|
||||
@ -126,6 +127,7 @@
|
||||
:name="RankingHasTop3[1].userNickname"
|
||||
:distributionValue="RankingHasTop3[1].quantity"
|
||||
style="width: 35%"
|
||||
@click="viewUserInfo(RankingHasTop3[1].userId)"
|
||||
/>
|
||||
<TopUser
|
||||
:isTopOne="false"
|
||||
@ -134,12 +136,17 @@
|
||||
:name="RankingHasTop3[2].userNickname"
|
||||
:distributionValue="RankingHasTop3[2].quantity"
|
||||
style="width: 35%"
|
||||
@click="viewUserInfo(RankingHasTop3[2].userId)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 第四名开始 -->
|
||||
<div v-for="listItem in showRanking" style="margin-top: 3%; position: relative">
|
||||
<div
|
||||
v-for="listItem in showRanking"
|
||||
style="margin-top: 3%; position: relative"
|
||||
@click="viewUserInfo(listItem.userId)"
|
||||
>
|
||||
<img :src="images.itemUser" alt="" width="100%;" style="display: block" />
|
||||
<div
|
||||
style="
|
||||
@ -753,6 +760,7 @@ import {
|
||||
parseHeader,
|
||||
setHttpHeaders,
|
||||
isInApp,
|
||||
viewUserInfo,
|
||||
} from '@/utils/appBridge.js'
|
||||
import {
|
||||
appConnectionManager,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user