细节完善
This commit is contained in:
@@ -69,6 +69,7 @@ const borderColors = {
|
|||||||
:style="{
|
:style="{
|
||||||
width: size + 'px',
|
width: size + 'px',
|
||||||
height: size + 'px',
|
height: size + 'px',
|
||||||
|
minHeight: size + 'px',
|
||||||
borderColor: borderColors[borderColor],
|
borderColor: borderColors[borderColor],
|
||||||
}"
|
}"
|
||||||
class="avatar-image"
|
class="avatar-image"
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ watch(
|
|||||||
>
|
>
|
||||||
<text>{{ player.totalRings }}环</text>
|
<text>{{ player.totalRings }}环</text>
|
||||||
<text v-for="(arrow, index2) in player.arrowHistory" :key="index2">
|
<text v-for="(arrow, index2) in player.arrowHistory" :key="index2">
|
||||||
{{ arrow.ringScore }}环
|
{{ arrow.ring }}环
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ const rowCount = new Array(6).fill(0);
|
|||||||
.container > image:first-child {
|
.container > image:first-child {
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
|
min-height: 30px;
|
||||||
border: 1px solid #fff3;
|
border: 1px solid #fff3;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from "vue";
|
import { ref, onMounted, computed } from "vue";
|
||||||
import Avatar from "@/components/Avatar.vue";
|
import Avatar from "@/components/Avatar.vue";
|
||||||
import useStore from "@/store";
|
import useStore from "@/store";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const { user } = storeToRefs(store);
|
const { user, config } = storeToRefs(store);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
showRank: {
|
showRank: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const lvlName = ref("");
|
||||||
|
const nextLvlPoints = ref("");
|
||||||
const containerWidth = computed(() => (props.showRank ? "72vw" : "100vw"));
|
const containerWidth = computed(() => (props.showRank ? "72vw" : "100vw"));
|
||||||
const toUserPage = () => {
|
const toUserPage = () => {
|
||||||
// 获取当前页面路径
|
// 获取当前页面路径
|
||||||
@@ -24,16 +26,25 @@ const toUserPage = () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
onMounted(() => {
|
||||||
|
const rankInfos = config.value.randInfos || [];
|
||||||
|
rankInfos.some((r, index) => {
|
||||||
|
lvlName.value = rankInfos[index].name;
|
||||||
|
if (r.upgrade_scores > user.value.scores) {
|
||||||
|
nextLvlPoints.value = r.upgrade_scores;
|
||||||
|
if (rankInfos[index - 1]) {
|
||||||
|
lvlName.value = rankInfos[index - 1].name;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="container" :style="{ width: containerWidth }">
|
<view class="container" :style="{ width: containerWidth }">
|
||||||
<Avatar
|
<Avatar :frame="true" :src="user.avatar" :onClick="toUserPage" :size="42" />
|
||||||
:frame="true"
|
|
||||||
:src="user.avatar"
|
|
||||||
:onClick="toUserPage"
|
|
||||||
:size="42"
|
|
||||||
/>
|
|
||||||
<view class="user-details">
|
<view class="user-details">
|
||||||
<view class="user-name">
|
<view class="user-name">
|
||||||
<text>{{ user.nickName }}</text>
|
<text>{{ user.nickName }}</text>
|
||||||
@@ -44,11 +55,13 @@ const toUserPage = () => {
|
|||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="user-stats">
|
<view class="user-stats">
|
||||||
<text class="level-tag level-tag-first">钻石1级</text>
|
<text class="level-tag level-tag-first">{{ lvlName }}</text>
|
||||||
<text class="level-tag level-tag-second">{{ user.lvl }}</text>
|
<text class="level-tag level-tag-second">L{{ user.lvl }}</text>
|
||||||
<view class="rank-tag">
|
<view class="rank-tag">
|
||||||
<view class="rank-tag-progress" :style="{ width: '40%' }" />
|
<view class="rank-tag-progress" :style="{ width: '40%' }" />
|
||||||
<text class="rank-tag-text">{{ user.lvl }}/{{ user.lvlPoints }}</text>
|
<text class="rank-tag-text"
|
||||||
|
>{{ user.scores }}/{{ user.nextLvlPoints }}</text
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ export const MESSAGETYPES = {
|
|||||||
UserEnterRoom: 2133805521,
|
UserEnterRoom: 2133805521,
|
||||||
UserExitRoom: 3896523333,
|
UserExitRoom: 3896523333,
|
||||||
RoomDestroy: 3617539277,
|
RoomDestroy: 3617539277,
|
||||||
// RoomDestroy: 2921416944,
|
SomeoneComplete: 2921416944,
|
||||||
// 下半场: 388606440,
|
HalfTimeOver: 388606440,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getMessageTypeName = (id) => {
|
export const getMessageTypeName = (id) => {
|
||||||
|
|||||||
@@ -20,8 +20,9 @@ onLoad(async (options) => {
|
|||||||
battleId.value = options.battleId;
|
battleId.value = options.battleId;
|
||||||
const result = await getGameAPI(
|
const result = await getGameAPI(
|
||||||
// options.battleId || "BATTLE-1749386862250435325-854"
|
// options.battleId || "BATTLE-1749386862250435325-854"
|
||||||
options.battleId || "BATTLE-1749397329251504706-197"
|
options.battleId || "BATTLE-1750142722977234017-746"
|
||||||
);
|
);
|
||||||
|
console.log(1212, result);
|
||||||
data.value = result;
|
data.value = result;
|
||||||
if (result.mode === 1 && result.redPlayers[user.value.id]) {
|
if (result.mode === 1 && result.redPlayers[user.value.id]) {
|
||||||
totalPoints.value = result.redTotal;
|
totalPoints.value = result.redTotal;
|
||||||
|
|||||||
@@ -10,12 +10,13 @@ import ScorePanel from "@/components/ScorePanel.vue";
|
|||||||
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 BowPower from "@/components/BowPower.vue";
|
import BowPower from "@/components/BowPower.vue";
|
||||||
import { createPractiseAPI } from "@/apis";
|
import { createPractiseAPI, getHomeData } from "@/apis";
|
||||||
import { MESSAGETYPES } from "@/constants";
|
import { MESSAGETYPES } from "@/constants";
|
||||||
import useStore from "@/store";
|
import useStore from "@/store";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const { user } = storeToRefs(store);
|
const { user } = storeToRefs(store);
|
||||||
|
const { updateUser } = store;
|
||||||
const scores = ref([]);
|
const scores = ref([]);
|
||||||
const step = ref(0);
|
const step = ref(0);
|
||||||
const showScore = ref(false);
|
const showScore = ref(false);
|
||||||
@@ -89,6 +90,8 @@ const nextStep = async () => {
|
|||||||
start.value = true;
|
start.value = true;
|
||||||
}, 500);
|
}, 500);
|
||||||
} else if (step.value === 5) {
|
} else if (step.value === 5) {
|
||||||
|
const result = await getHomeData();
|
||||||
|
if (result.user) updateUser(result.user);
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
delta: 1,
|
delta: 1,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -34,14 +34,14 @@ onLoad(async (options) => {
|
|||||||
name: result.bluePlayers[blueId].name,
|
name: result.bluePlayers[blueId].name,
|
||||||
avatar: result.bluePlayers[blueId].avatar,
|
avatar: result.bluePlayers[blueId].avatar,
|
||||||
arrows: item[blueId],
|
arrows: item[blueId],
|
||||||
totalRing: item[blueId].reduce((a, b) => a + b.ringScore, 0),
|
totalRing: item[blueId].reduce((a, b) => a + b.ring, 0),
|
||||||
totalScore: item[blueId].reduce((a, b) => a + b.ringScore, 0),
|
totalScore: item[blueId].reduce((a, b) => a + b.ringScore, 0),
|
||||||
},
|
},
|
||||||
red: {
|
red: {
|
||||||
name: result.redPlayers[redId].name,
|
name: result.redPlayers[redId].name,
|
||||||
avatar: result.redPlayers[redId].avatar,
|
avatar: result.redPlayers[redId].avatar,
|
||||||
arrows: item[redId],
|
arrows: item[redId],
|
||||||
totalRing: item[redId].reduce((a, b) => a + b.ringScore, 0),
|
totalRing: item[redId].reduce((a, b) => a + b.ring, 0),
|
||||||
totalScore: item[redId].reduce((a, b) => a + b.ringScore, 0),
|
totalScore: item[redId].reduce((a, b) => a + b.ringScore, 0),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -102,7 +102,7 @@ onLoad(async (options) => {
|
|||||||
<view>
|
<view>
|
||||||
<Avatar :src="round.blue.avatar" :size="25" :borderColor="1" />
|
<Avatar :src="round.blue.avatar" :size="25" :borderColor="1" />
|
||||||
<text v-for="(arrow, index2) in round.blue.arrows" :key="index2">
|
<text v-for="(arrow, index2) in round.blue.arrows" :key="index2">
|
||||||
{{ arrow.ringScore }}环
|
{{ arrow.ring }}环
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
@@ -116,7 +116,7 @@ onLoad(async (options) => {
|
|||||||
<view>
|
<view>
|
||||||
<Avatar :src="round.red.avatar" :size="25" :borderColor="2" />
|
<Avatar :src="round.red.avatar" :size="25" :borderColor="2" />
|
||||||
<text v-for="(arrow, index2) in round.red.arrows" :key="index2">
|
<text v-for="(arrow, index2) in round.red.arrows" :key="index2">
|
||||||
{{ arrow.ringScore }}环
|
{{ arrow.ring }}环
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
|
|||||||
@@ -93,6 +93,9 @@ async function onReceiveMessage(content) {
|
|||||||
}
|
}
|
||||||
playersScores.value[msg.userId].push(msg.target);
|
playersScores.value[msg.userId].push(msg.target);
|
||||||
}
|
}
|
||||||
|
if (msg.constructor === MESSAGETYPES.HalfTimeOver) {
|
||||||
|
tips.value = "上半场结束,休息一下吧:) 20秒后进入下半场";
|
||||||
|
}
|
||||||
if (msg.constructor === MESSAGETYPES.MatchOver) {
|
if (msg.constructor === MESSAGETYPES.MatchOver) {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: `/pages/battle-result?battleId=${msg.id}`,
|
url: `/pages/battle-result?battleId=${msg.id}`,
|
||||||
|
|||||||
@@ -8,12 +8,13 @@ import ScoreResult from "@/components/ScoreResult.vue";
|
|||||||
import SButton from "@/components/SButton.vue";
|
import SButton from "@/components/SButton.vue";
|
||||||
import Avatar from "@/components/Avatar.vue";
|
import Avatar from "@/components/Avatar.vue";
|
||||||
import BowPower from "@/components/BowPower.vue";
|
import BowPower from "@/components/BowPower.vue";
|
||||||
import { createPractiseAPI } from "@/apis";
|
import { createPractiseAPI, getHomeData } from "@/apis";
|
||||||
import { MESSAGETYPES, roundsName } from "@/constants";
|
import { MESSAGETYPES, roundsName } from "@/constants";
|
||||||
import useStore from "@/store";
|
import useStore from "@/store";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const { user } = storeToRefs(store);
|
const { user } = storeToRefs(store);
|
||||||
|
const { updateUser } = store;
|
||||||
const start = ref(false);
|
const start = ref(false);
|
||||||
const showScore = ref(false);
|
const showScore = ref(false);
|
||||||
const scores = ref([]);
|
const scores = ref([]);
|
||||||
@@ -52,9 +53,10 @@ async function onReceiveMessage(content) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onComplete() {
|
async function onComplete() {
|
||||||
|
const result = await getHomeData();
|
||||||
|
if (result.user) updateUser(result.user);
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
showScore.value = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -8,12 +8,13 @@ import ScoreResult from "@/components/ScoreResult.vue";
|
|||||||
import SButton from "@/components/SButton.vue";
|
import SButton from "@/components/SButton.vue";
|
||||||
import Avatar from "@/components/Avatar.vue";
|
import Avatar from "@/components/Avatar.vue";
|
||||||
import BowPower from "@/components/BowPower.vue";
|
import BowPower from "@/components/BowPower.vue";
|
||||||
import { createPractiseAPI } from "@/apis";
|
import { createPractiseAPI, getHomeData } from "@/apis";
|
||||||
import { MESSAGETYPES } from "@/constants";
|
import { MESSAGETYPES } from "@/constants";
|
||||||
import useStore from "@/store";
|
import useStore from "@/store";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const { user } = storeToRefs(store);
|
const { user } = storeToRefs(store);
|
||||||
|
const { updateUser } = store;
|
||||||
const start = ref(false);
|
const start = ref(false);
|
||||||
const showScore = ref(false);
|
const showScore = ref(false);
|
||||||
const scores = ref([]);
|
const scores = ref([]);
|
||||||
@@ -49,9 +50,10 @@ async function onReceiveMessage(content) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onComplete() {
|
async function onComplete() {
|
||||||
|
const result = await getHomeData();
|
||||||
|
if (result.user) updateUser(result.user);
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
showScore.value = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -73,9 +73,9 @@ const logout = () => {
|
|||||||
/>
|
/>
|
||||||
<UserItem
|
<UserItem
|
||||||
title="新手试炼场"
|
title="新手试炼场"
|
||||||
:onClick="user.trio > 1 ? null : toFristTryPage"
|
:onClick="user.trio > 0 ? null : toFristTryPage"
|
||||||
>
|
>
|
||||||
<text v-if="user.trio > 1" :style="{ color: '#259249' }">已完成</text>
|
<text v-if="user.trio > 0" :style="{ color: '#259249' }">已完成</text>
|
||||||
<text v-else :style="{ color: '#CC311F' }">未完成</text>
|
<text v-else :style="{ color: '#CC311F' }">未完成</text>
|
||||||
</UserItem>
|
</UserItem>
|
||||||
<UserItem title="会员" :onClick="toBeVipPage"> 已赠送6个月会员 </UserItem>
|
<UserItem title="会员" :onClick="toBeVipPage"> 已赠送6个月会员 </UserItem>
|
||||||
|
|||||||
Reference in New Issue
Block a user