Pārlūkot izejas kodu

feature:修改导航栏,tabbar的警告

zeng.chen 1 gadu atpakaļ
vecāks
revīzija
17b5a9b297

+ 2 - 2
custom-tab-bar/index.wxml

@@ -2,7 +2,7 @@
 <cover-view class="tab-bar">
   <cover-view class="tab-bar-border"></cover-view>
   <cover-view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
-    <cover-image src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></cover-image>
-    <cover-view style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</cover-view>
+    <cover-image class="item-image" src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></cover-image>
+    <cover-view class="item-view" style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</cover-view>
   </cover-view>
 </cover-view>

+ 3 - 2
custom-tab-bar/index.wxss

@@ -29,11 +29,12 @@
   flex-direction: column;
 }
 
-.tab-bar-item cover-image {
+.item-image {
   width: 27px;
   height: 27px;
 }
 
-.tab-bar-item cover-view {
+
+.item-view {
   font-size: 10px;
 }

+ 1 - 0
custom-tab-bar/tabbar.js

@@ -48,6 +48,7 @@ function eventOn(curPage) {
       curPage.setData({
         rightId: data
       })
+      console.log("页面:"+curPage.data.rightId);
       if (curPage.data.rightId === 2) {
         let num = curPage.data.rightId === 1 ? 2 : 1
         if (typeof curPage.getTabBar === 'function' &&

+ 2 - 2
pages/components/navbar/navbar.wxml

@@ -1,8 +1,8 @@
 <view class='nav-wrap nav-bgc-class' style='height: calc({{navBarHeight}}px - {{MenuButtonTop}}px); padding-top: {{MenuButtonTop}}px;'>
      <view class="nav-info" style="height: {{ MenuButtonheight }}px;">
         <view  bindtap='_navback' style="height: {{ MenuButtonheight }}px;" class="device-pic">
-          <image wx:if='{{navbarData.showCapsule}}' bindtap=""  mode="heightFix"  src="./../../../img/goback.png"></image>
+          <image class="capsule" wx:if='{{navbarData.showCapsule}}' bindtap=""  mode="heightFix"  src="./../../../img/goback.png"></image>
         </view>
-        <text class="nav-title-class" style="height: {{ MenuButtonheight }}px; line-height: {{ MenuButtonheight }}px;">{{navbarData.title}}</text>
+        <text class="nav-title" style="height: {{ MenuButtonheight }}px; line-height: {{ MenuButtonheight }}px;">{{navbarData.title}}</text>
      </view>
   </view>

+ 3 - 3
pages/components/navbar/navbar.wxss

@@ -20,12 +20,12 @@
   width: 40rpx;
 }
 
-.nav-wrap .nav-info .device-pic image {
+.nav-wrap .nav-info .device-pic .capsule {
   height: 36rpx;
 }
 
-.nav-wrap .nav-info text {
-  width: 100%;
+.nav-title {
+  width: 100%; 
   text-align: center;
   font-size: 35rpx;
   color: #000;