feat: onShow静默刷新 + 群组预算双显 + TransactionItem优化

onShow 静默刷新(首次有loading,后续静默):
- budget: 添加 initialLoaded 守卫,避免首次双重请求
- profile: 添加 onShow 刷新概览/预算/账单/群组
- group-manage: 添加 onShow 刷新群组列表
- category-manage: 添加 onShow 刷新分类列表
- add: 添加 onShow 刷新分类(可能新增了分类)

群组模式预算双显:
- 服务端 GET /budget 群组模式额外返回 myAmount(本人预算)
- 客户端 Budget 类型添加 myAmount 字段
- 预算页群组模式:群组总预算卡片(只读)+ 我的预算卡片(可编辑)
- 个人模式保持原样

TransactionItem 群组模式优化:
- 主图标始终显示分类图标(不再显示创建者头像)
- 他人记录在昵称旁显示小头像(28rpx圆形)
This commit is contained in:
2026-06-04 17:45:37 +08:00
parent e110cd5c5d
commit 8bd4af9b9a
8 changed files with 125 additions and 44 deletions

View File

@@ -8,13 +8,8 @@
@touchmove="!disableSwipe && onTouchMove($event)"
@touchend="!disableSwipe && onTouchEnd()"
>
<!-- 头像群组模式下显示他人创建者 -->
<view v-if="isOtherCreator" class="creator-avatar">
<image v-if="creatorAvatarUrl" :src="creatorAvatarUrl" class="creator-img" mode="aspectFill" />
<text v-else class="creator-initial">{{ item.creator_nickname?.[0] }}</text>
</view>
<!-- 始终显示分类图标 -->
<CategoryIcon
v-else
:label="item.category_name?.[0] || '?'"
:color="item.category_color || '#BFB3B3'"
:bg-color="(item.category_color || '#BFB3B3') + '20'"
@@ -23,6 +18,8 @@
<view class="info">
<text class="name">{{ item.note || item.category_name || '未分类' }}</text>
<text class="meta">
<image v-if="isOtherCreator && creatorAvatarUrl" :src="creatorAvatarUrl" class="creator-mini-avatar" mode="aspectFill" />
<text v-else-if="isOtherCreator" class="creator-mini-initial">{{ item.creator_nickname?.[0] }}</text>
<text v-if="isOtherCreator" class="creator-name">{{ item.creator_nickname }} · </text>
{{ item.category_name || '未分类' }}{{ hideDate ? '' : ' · ' + formatDate(item.date) }}
</text>
@@ -151,27 +148,26 @@ function onTouchEnd() {
}
}
.creator-avatar {
width: 80rpx;
height: 80rpx;
.creator-mini-avatar {
width: 28rpx;
height: 28rpx;
border-radius: 50%;
vertical-align: middle;
margin-right: 4rpx;
}
.creator-mini-initial {
display: inline-flex;
width: 28rpx;
height: 28rpx;
border-radius: 50%;
background: #FFF0E6;
display: flex;
font-size: 16rpx;
color: #FF8C69;
align-items: center;
justify-content: center;
overflow: hidden;
flex-shrink: 0;
}
.creator-img {
width: 100%;
height: 100%;
}
.creator-initial {
font-size: 28rpx;
font-weight: 600;
color: #FF8C69;
vertical-align: middle;
margin-right: 4rpx;
}
.info {