Commit 0b94abd3 by liangjianmin

style(approve): replace u-badge with custom count badge component

- Replace u-badge component with custom count-badge styling for consistency
- Add gradient background (red #ff6b6b to #ee5a6f) with box shadow for visual depth
- Implement custom badge layout with flexbox centering and 32rpx dimensions
- Update count display logic to show "99+" for values exceeding 99
- Add smooth transitions and scale transforms for enhanced visual feedback
- Remove absolute positioning dependency for better layout control
parent 884e0bbd
......@@ -37,6 +37,33 @@
line-height: 1.2;
}
.count-badge {
position: relative;
margin-left: 10rpx;
min-width: 32rpx;
height: 32rpx;
padding: 0 8rpx;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
border-radius: 16rpx;
box-shadow: 0 2rpx 8rpx rgba(255, 107, 107, 0.25);
transition: all 0.3s ease;
.count-text {
font-size: 20rpx;
font-weight: 600;
color: #ffffff;
line-height: 1;
transform: scale(0.95);
}
.badge-pulse {
display: none;
}
}
&.active {
.tab-text {
color: #3b82f6;
......
......@@ -8,7 +8,9 @@
<view class="custom-tabs row">
<view v-for="(tab, index) in tabList" :key="index" class="tab-item row verCenter rowCenter" :class="{ active: currentTab === index }" @click="onTabChange({ index })">
<text class="tab-text">{{ tab.baseName || tab.name }}</text>
<u-badge v-if="tab.count > 0" :value="tab.count" bgColor="#ff4757" color="#ffffff" :show="true" :max="99" :absolute="false" style="margin-left: 6rpx; font-size: 20rpx;"></u-badge>
<view v-if="tab.count > 0" class="count-badge">
<text class="count-text">{{ tab.count > 99 ? '99+' : tab.count }}</text>
</view>
</view>
</view>
<view class="tab-line" :style="{ left: currentTab === 0 ? '25%' : '75%', transform: 'translateX(-50%)' }"></view>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment