Browse Source

始宁农业管理后台:农户管理-入驻申请

panyong 2 years ago
parent
commit
dd124e657b

+ 2 - 0
htmldev/shiningWxMini/custom-tab-bar/index.js

@@ -20,6 +20,8 @@ Component({
     app.addTabBarList = res => {
       this.setData({
         list: res
+      }, () => {
+        this.triggerEvent('getTabBarList', res)
       })
     }
   },

+ 13 - 7
htmldev/shiningWxMini/pages/home/home.js

@@ -36,13 +36,14 @@ Page({
         icon: 'collection@2x.png',
         name: '收藏',
         path: 'collection'
-      },
-      {
-        icon: 'news.png',
-        name: '农事天地',
-        path: 'news'
       }
     ],
+    objNews: {
+      icon: 'news.png',
+      name: '农事天地',
+      path: 'news'
+    },
+    hasNewsTab: false,
     categoryList: [],
     leftList: [],
     rightList: []
@@ -63,14 +64,19 @@ Page({
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady() {
-
+    this.setData({
+      hasNewsTab: this.getTabBar().data.list.findIndex(item => item.pagePath === 'pages/news/news') > -1
+    })
   },
 
   /**
    * 生命周期函数--监听页面显示
    */
   onShow() {
-    this.getTabBar().init()
+    const that = this
+    this.getTabBar().init((value) => {
+      console.log(value)
+    })
   },
 
   /**

+ 8 - 0
htmldev/shiningWxMini/pages/home/home.wxml

@@ -67,6 +67,14 @@
       <image src="../../image/home/{{item.icon}}"></image>
       <text>{{item.name}}</text>
     </view>
+    <view
+      class="nav"
+      data-item="{{objNews}}"
+      bind:tap="handleSubscribeMessage"
+      wx:if="{{hasNewsTab}}">
+      <image src="../../image/home/{{objNews.icon}}"></image>
+      <text>{{objNews.name}}</text>
+    </view>
   </view>
   <!-- 核心入口:最新上架、VR看菜园、频道:村长说农货 -->
   <view class="marketing-wrap">

+ 2 - 1
htmldev/shiningWxMini/pages/home/home.wxss

@@ -97,7 +97,6 @@
 
 .header-nav {
   display: flex;
-  justify-content: space-between;
   align-items: center;
   width: 690rpx;
   margin: 25rpx auto 0;
@@ -107,11 +106,13 @@
   display: flex;
   flex-direction: column;
   align-items: center;
+  width: 25%;
 }
 
 .header-nav .nav image {
   width: 70rpx;
   height: 70rpx;
+  margin: 0 auto;
 }
 
 .header-nav .nav text {