微信小程序:底部导航组件封装

1.底部导航

<!-- 底部导航 -->
<view class='tab-bar-p-container'>
  <view wx:if='{{isAuth}}' class='tab-bar-p'>
    <view class='common-style' bindtap='checkCurrentPage' data-tag='1'>
      <image src='{{currentTag == 1 ? "/image/tab_home_selected@2x.png" : "/image/tab_home_normal@2x.png"}}'></image>
      <view class='{{currentTag == 1 ? "selected" : ""}}'>首页</view>
    </view>
    <view class='common-style' bindtap='checkCurrentPage' data-tag='2'>
      <image src='{{currentTag == 2 ? "/image/tab_activity_selected@2x.png" : "/image/tab_activity_normal@2x.png"}}'></image>
      <view class='{{currentTag == 2 ? "selected" : ""}}'>我的活动</view>
    </view>
    <view class='common-style' bindtap='checkCurrentPage' data-tag='3'>
      <image src='{{currentTag == 3 ? "/image/tab_personal_selected@2x.png" : "/image/tab_personal_normal@2x.png"}}'></image>
      <view class='{{currentTag == 3 ? "selected" : ""}}'>个人中心</view>
    </view>
  </view>

<view wx:else class='tab-bar-p'>
    <button class='btn-only-function common-style enterprise-shopping-p' open-type="getUserInfo" bindgetuserinfo="systemGetUserInfo">
      <image src='{{currentTag == 1 ? "/image/tab_home_selected@2x.png" : "/image/tab_home_normal@2x.png"}}'></image>
      <view class='{{currentTag == 1 ? "selected" : ""}}'>首页</view>
    </button>
    <button class='btn-only-function common-style personal-center-p' open-type="getUserInfo" bindgetuserinfo="systemGetUserInfo">
      <image src='{{currentTag == 2 ? "/image/tab_activity_selected@2x.png" : "/image/tab_activity_normal@2x.png"}}'></image>
      <view class='{{currentTag == 2 ? "selected" : ""}}'>我的活动</view>
    </button>
    <button class='btn-only-function common-style personal-center-p' open-type="getUserInfo" bindgetuserinfo="systemGetUserInfo">
      <image src='{{currentTag == 3 ? "/image/tab_personal_selected@2x.png" : "/image/tab_personal_normal@2x.png"}}'></image>
      <view class='{{currentTag == 3 ? "selected" : ""}}'>个人中心</view>
    </button>
  </view>

附图片:

image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容