显示头像相框
This commit is contained in:
@@ -241,11 +241,8 @@ async function onReceiveMessage(messages = []) {
|
||||
if (msg.constructor === MESSAGETYPES.ShootResult) {
|
||||
if (room.value.battleType === 1) {
|
||||
const isRed = redTeam.value.find((item) => item.id === msg.userId);
|
||||
if (isRed) {
|
||||
scores.value = [msg.target];
|
||||
} else {
|
||||
blueScores.value = [msg.target];
|
||||
}
|
||||
if (isRed) scores.value = [msg.target];
|
||||
else blueScores.value = [msg.target];
|
||||
}
|
||||
if (room.value.battleType === 2) {
|
||||
scores.value.push(msg.target);
|
||||
|
||||
@@ -55,6 +55,7 @@ onMounted(async () => {
|
||||
const token = uni.getStorageSync("token");
|
||||
if (token) {
|
||||
const result = await getHomeData();
|
||||
console.log("首页数据:", result);
|
||||
if (result.user) {
|
||||
updateUser(result.user);
|
||||
const devices = await getMyDevicesAPI();
|
||||
|
||||
@@ -85,7 +85,10 @@ const onPractiseLoading = async (page) => {
|
||||
<view v-if="item.mode === 1" class="contest-team">
|
||||
<block v-if="item.bluePlayers[0]">
|
||||
<view class="player">
|
||||
<Avatar frame :src="item.bluePlayers[0].avatar" />
|
||||
<Avatar
|
||||
:score="item.bluePlayers[0].totalScore"
|
||||
:src="item.bluePlayers[0].avatar"
|
||||
/>
|
||||
<text>{{ item.bluePlayers[0].name }}</text>
|
||||
<image
|
||||
v-if="item.winner === 1"
|
||||
@@ -96,7 +99,10 @@ const onPractiseLoading = async (page) => {
|
||||
</block>
|
||||
<block v-if="item.redPlayers[0]">
|
||||
<view class="player">
|
||||
<Avatar frame :src="item.redPlayers[0].avatar" />
|
||||
<Avatar
|
||||
:score="item.redPlayers[0].totalScore"
|
||||
:src="item.redPlayers[0].avatar"
|
||||
/>
|
||||
<text>{{ item.redPlayers[0].name }}</text>
|
||||
<image
|
||||
v-if="item.winner === 0"
|
||||
@@ -136,7 +142,10 @@ const onPractiseLoading = async (page) => {
|
||||
<view v-if="item.mode === 1" class="contest-team">
|
||||
<block v-if="item.bluePlayers[0]">
|
||||
<view class="player">
|
||||
<Avatar frame :src="item.bluePlayers[0].avatar" />
|
||||
<Avatar
|
||||
:score="item.bluePlayers[0].totalScore"
|
||||
:src="item.bluePlayers[0].avatar"
|
||||
/>
|
||||
<text>{{ item.bluePlayers[0].name }}</text>
|
||||
<image
|
||||
v-if="item.winner === 1"
|
||||
@@ -147,7 +156,10 @@ const onPractiseLoading = async (page) => {
|
||||
</block>
|
||||
<block v-if="item.redPlayers[0]">
|
||||
<view class="player">
|
||||
<Avatar frame :src="item.redPlayers[0].avatar" />
|
||||
<Avatar
|
||||
:score="item.redPlayers[0].totalScore"
|
||||
:src="item.redPlayers[0].avatar"
|
||||
/>
|
||||
<text>{{ item.redPlayers[0].name }}</text>
|
||||
<image
|
||||
v-if="item.winner === 0"
|
||||
|
||||
@@ -117,7 +117,7 @@ const toRankListPage = () => {
|
||||
<view class="ranking-my-data" v-if="user.id">
|
||||
<view>
|
||||
<view class="user-info">
|
||||
<Avatar :src="user.avatar" frame :size="30" />
|
||||
<Avatar :src="user.avatar" :score="user.scores" :size="30" />
|
||||
<text>{{ user.nickName }}</text>
|
||||
</view>
|
||||
<view class="ranking-season" v-if="seasonData.length">
|
||||
|
||||
@@ -140,11 +140,8 @@ async function onReceiveMessage(messages = []) {
|
||||
}
|
||||
if (msg.constructor === MESSAGETYPES.ShootResult) {
|
||||
const isRed = redTeam.value.find((item) => item.id === msg.userId);
|
||||
if (isRed) {
|
||||
scores.value = [msg.target];
|
||||
} else {
|
||||
blueScores.value = [msg.target];
|
||||
}
|
||||
if (isRed) scores.value = [msg.target];
|
||||
else blueScores.value = [msg.target];
|
||||
}
|
||||
if (msg.constructor === MESSAGETYPES.CurrentRoundEnded) {
|
||||
const result = msg.preRoundResult;
|
||||
|
||||
Reference in New Issue
Block a user