navigationBar.wxml 1.3 KB

12345678910111213141516171819202122232425
  1. <!-- 参考:https://zhuanlan.zhihu.com/p/117244248 -->
  2. <view class="nav-bar"
  3. style="position:{{navBarConfig.booFixed ? 'fixed' : 'relative'}}; height:{{navBarHeight}}px; background-color: {{navBarConfig.backgroundColor || 'transparent'}};">
  4. <view class="nav-bar-wrap"
  5. style="height:{{menuHeight}}px; min-height:{{menuHeight}}px; line-height:{{menuHeight}}px;left:{{menuRight}}px; bottom:{{menuBottom}}px;"
  6. bind:tap="navBarEvent">
  7. <view class="jump-home"
  8. wx:if="{{historyLength <=1 && navBarConfig.icon === 'back'}}">
  9. <image class="home-icon" src="{{tools.imgFilter('/common/nav_icon_home_white@2x.png')}}"></image>
  10. <text class="home-text">首页</text>
  11. </view>
  12. <block wx:else>
  13. <image class="icon {{navBarConfig.icon}}"
  14. src="{{tools.imgFilter(navBarConfig.iconPath)}}"
  15. wx:if="{{navBarConfig.icon}}"></image>
  16. <text class="label"
  17. wx:if="{{navBarConfig.label}}">{{navBarConfig.label}}</text>
  18. </block>
  19. </view>
  20. <view class="title"
  21. style="height:{{menuHeight}}px; min-height:{{menuHeight}}px; line-height:{{menuHeight}}px;left:{{menuRight}}px;right:{{menuRight}}px;bottom:{{menuBottom}}px;"
  22. wx:if="{{navBarConfig.title}}">{{navBarConfig.title}}
  23. </view>
  24. </view>
  25. <wxs src="../wxs/index.wxs" module="tools"></wxs>