完善页面

This commit is contained in:
kron
2025-09-25 14:22:03 +08:00
parent ef96f90470
commit 8c45e7f4eb
8 changed files with 79 additions and 48 deletions

View File

@@ -59,10 +59,15 @@ const loading = ref(false);
const showLoader = ref(false);
const pointBook = ref(null);
const showProgress = ref(false);
const heat = ref(0);
const updateLoading = (value) => {
loading.value = value;
};
const updateHot = (value) => {
heat.value = value;
};
onMounted(() => {
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
@@ -75,13 +80,15 @@ onMounted(() => {
) {
showLoader.value = true;
}
uni.$on("update-header-loading", updateLoading);
if (currentPage.route === "pages/team-battle") {
showProgress.value = true;
}
uni.$on("update-header-loading", updateLoading);
uni.$on("update-hot", updateHot);
});
onBeforeUnmount(() => {
uni.$off("update-header-loading", updateLoading);
uni.$off("update-hot", updateHot);
});
</script>
@@ -110,6 +117,11 @@ onBeforeUnmount(() => {
borderColor="#333"
/>
<text>{{ user.nickName }}</text>
<image
v-if="heat"
:src="`../static/hot${heat}.png`"
mode="widthFix"
/>
</block>
<block v-else>
<image src="../static/user-icon.png" mode="widthFix" />
@@ -248,12 +260,15 @@ onBeforeUnmount(() => {
align-items: center;
justify-content: flex-start;
}
.user-header > image {
.user-header > image:first-child {
width: 40px;
height: 40px;
border-radius: 50%;
border: 2rpx solid #333;
}
.user-header > image:last-child {
width: 36rpx;
}
.user-header > text:nth-child(2) {
font-weight: 500;
font-size: 30rpx;