index.wxml
1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<view class="tab-bar">
<view class="tab-bar-border"></view>
<block wx:for="{{list}}" wx:key="pagePath">
<view
class="tab-bar-item {{item.isMatters ? 'tab-bar-item--matters' : ''}} {{item.isMatters && selected === index ? 'tab-bar-item--matters-on' : ''}}"
data-path="{{item.pagePath}}"
data-index="{{index}}"
bindtap="switchTab"
>
<block wx:if="{{item.isMatters}}">
<view class="tab-bar-matters-box">
<block wx:if="{{selected === index}}">
<image
class="tab-bar-matters-act-icon"
src="{{item.selectedIconPath}}"
mode="aspectFit"
/>
</block>
<block wx:else>
<image class="tab-bar-icon" src="{{item.iconPath}}" mode="aspectFit" />
<text class="tab-bar-text">{{item.text}}</text>
</block>
</view>
</block>
<block wx:else>
<view class="tab-bar-icon-wrap">
<image
class="tab-bar-icon-layer"
src="{{item.iconPath}}"
mode="aspectFit"
style="opacity: {{selected === index ? 0 : 1}};"
/>
<image
class="tab-bar-icon-layer"
src="{{item.selectedIconPath}}"
mode="aspectFit"
style="opacity: {{selected === index ? 1 : 0}};"
/>
</view>
<text class="tab-bar-text" style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</text>
</block>
</view>
</block>
</view>