fix:好友约战,我的战绩按钮跳转完成
This commit is contained in:
@@ -73,10 +73,10 @@ const onSignin = () => {
|
|||||||
showSignin.value = false;
|
showSignin.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 跳转到我的战绩页面 */
|
/** 跳转到我的战绩页面,默认展示「好友约战」tab */
|
||||||
const goMyRecord = () => {
|
const goMyRecord = () => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/my-growth',
|
url: '/pages/my-growth?tab=1',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
onShow(async () => {
|
onShow(async () => {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted } from "vue";
|
import { onMounted } from "vue";
|
||||||
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
import Container from "@/components/Container.vue";
|
import Container from "@/components/Container.vue";
|
||||||
import Avatar from "@/components/Avatar.vue";
|
import Avatar from "@/components/Avatar.vue";
|
||||||
import BowData from "@/components/BowData.vue";
|
import BowData from "@/components/BowData.vue";
|
||||||
@@ -56,6 +57,17 @@ const getName = (battle) => {
|
|||||||
if (battle.mode <= 3) return `${battle.mode}V${battle.mode}`;
|
if (battle.mode <= 3) return `${battle.mode}V${battle.mode}`;
|
||||||
return battle.mode + "人大乱斗";
|
return battle.mode + "人大乱斗";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支持通过 URL 参数指定初始 tab
|
||||||
|
* @example /pages/my-growth?tab=1 跳转到「好友约战」tab
|
||||||
|
*/
|
||||||
|
onLoad((options) => {
|
||||||
|
if (options && options.tab !== undefined) {
|
||||||
|
const tabIndex = parseInt(options.tab, 10);
|
||||||
|
if (!isNaN(tabIndex)) selectedIndex.value = tabIndex;
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
Reference in New Issue
Block a user