This commit is contained in:
Zy
2026-08-29 08:47:01 +08:00
4 changed files with 28 additions and 15 deletions

View File

@@ -8,10 +8,10 @@
<view class="page-content">
<view class="sticky-header">
<!-- 状态栏占位 -->
<view class="status_bar" :style="{ height: statusBarHeight + 'px' }"></view>
<!-- <view class="status_bar" :style="{ height: statusBarHeight + 'px' }"></view> -->
<!-- 导航栏 -->
<view class="nav-bar">
<text class="nav-title">首页</text>
<text class="nav-title"></text>
</view>
<!-- 小区选择 -->
<view class="header-container" @click="navigateToPage">
@@ -26,10 +26,19 @@
<text class="community-name">{{ currentCommunity }}</text>
<view class="community-icon">
<image
src="https://wuyeadmin.bugtc.com/images/imgs/三角形.png"
src="https://wuyeadmin.bugtc.com/images/imgs/adress.png"
style="height: 100%; width: 100%"
></image>
</view>
<view class="community-selector">
<text class="community-name">{{ currentCommunity }}</text>
<view class="community-icon">
<image
src="https://wuyeadmin.bugtc.com/images/imgs/三角形.png"
style="height: 100%; width: 100%"
></image>
</view>
</view>
</view>
</view>
</view>
@@ -355,7 +364,7 @@ const getNoticeData = () => {
.then(res => {
const notice =
res.code === 200 && res.data
? `${res.data.notice || ''} : ${res.data.item || ''}`
? [res.data.notice, res.data.item].filter(Boolean).join(' : ') || '暂无公告'
: '暂无公告'
// 仅在内容真正变化时才更新
if (noticeText.value !== notice) {
@@ -420,12 +429,13 @@ function getMyOrderNum() {
})
}
// 接收选择小区返回的参数
// 切换小区返回的参数
const slelctHomeData = data => {
currentCommunity.value = data.villageName
uni.setStorageSync('currentVillage', JSON.stringify(data))
getNoticeData()
getInspectionData()
getbannarData(true)
}
onShow(() => {
@@ -435,10 +445,8 @@ onShow(() => {
getbannarData()
getMyOrderNum()
permStore.initPerm() // 刷新权限缓存
// currentVillageData 和 getInspectionData 已在 onLoad 中调用,不再重复
return
}
// 从其他页面返回 / 从后台恢复:只刷新可能变化的数据
getbannarData()
getMyOrderNum()
getNoticeData()
@@ -461,7 +469,7 @@ onLoad(() => {
})
return
}
// 已登录:确保 tabBar 显示(未登录启动时曾被 hideTabBar 隐藏,switchTab 不会自动恢复)
// 已登录:确保 tabBar 显示
uni.showTabBar({ animation: false })
uni.$on('confirm', slelctHomeData)
currentVillageData()
@@ -469,7 +477,6 @@ onLoad(() => {
})
onReady(() => {
// 已登录:首页即最终页,渲染完成后关闭启动屏(未登录由引导页 onReady 关闭)
if (isLoggedIn.value) {
// #ifdef APP-PLUS
plus.navigator.closeSplashscreen()

View File

@@ -1,7 +1,7 @@
<template>
<view class="content-style">
<view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
<uni-nav-bar title="我的" backgroundColor="transparent" :border="false" />
<!-- <view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view> -->
<uni-nav-bar backgroundColor="transparent" :border="false" />
<scroll-view class="page" scroll-y>
<view class="user-card">
<image src="https://wuyeadmin.bugtc.com/images/guanjia-logo.png" class="avatar" />
@@ -105,7 +105,7 @@ const onItemClick = item => {
.user-card {
display: flex;
align-items: center;
padding: 40rpx 0;
padding: 40rpx 0 0 0;
}
.avatar {