Files
wxapp_escort/custom-tab-bar/index.wxml
T
2026-10-02 11:56:08 +08:00

27 lines
802 B
Plaintext

<view class="tab-bar">
<view
class="tab-item {{ selected === index ? 'is-active' : '' }}"
wx:for="{{ list }}"
wx:key="pagePath"
data-index="{{ index }}"
data-path="{{ item.pagePath }}"
bindtap="onTap"
>
<!-- 配置了 imgPath 的 tab(AI客服)走位图:灰色未选中 / 暖橙选中两态切换;
其余 tab 走 TDesign 线性图标,选中态只换颜色 -->
<image
wx:if="{{ item.imgPath }}"
class="tab-icon-img"
src="{{ selected === index ? item.imgActivePath : item.imgPath }}"
mode="aspectFit"
/>
<t-icon
wx:else
name="{{ item.icon }}"
size="44rpx"
color="{{ selected === index ? activeColor : inactiveColor }}"
/>
<text class="tab-text">{{ item.text }}</text>
</view>
</view>