guhongwei 5 年之前
父節點
當前提交
9644d183ec
共有 5 個文件被更改,包括 28 次插入16 次删除
  1. 9 5
      commpents/navbar/navbar.js
  2. 13 8
      commpents/navbar/navbar.wxml
  3. 2 1
      pages/home/index.js
  4. 2 1
      pages/policy/index.js
  5. 2 1
      pages/policyDetail/index.js

+ 9 - 5
commpents/navbar/navbar.js

@@ -1,7 +1,7 @@
 const app = getApp()
 const app = getApp()
 Component({
 Component({
   properties: {
   properties: {
-    navbarData: {   //navbarData   由父页面传递的数据,变量名字自命名
+    navbarData: { //navbarData   由父页面传递的数据,变量名字自命名
       type: Object,
       type: Object,
       value: {},
       value: {},
       observer: function (newVal, oldVal) {}
       observer: function (newVal, oldVal) {}
@@ -11,7 +11,8 @@ Component({
     height: '',
     height: '',
     //默认值  默认显示左上角
     //默认值  默认显示左上角
     navbarData: {
     navbarData: {
-      showCapsule: 1
+      showCapsule: 1,
+      showMess: 1
     }
     }
   },
   },
   attached: function () {
   attached: function () {
@@ -25,11 +26,14 @@ Component({
     })
     })
   },
   },
   methods: {
   methods: {
-  // 返回上一页面
+    // 返回上一页面
     _navback() {
     _navback() {
       wx.navigateBack()
       wx.navigateBack()
     },
     },
-  //返回到首页
+    _navbackMess() {
+      console.log('消息中心');
+    },
+    //返回到首页
     _backhome() {
     _backhome() {
       wx.switchTab({
       wx.switchTab({
         url: '/pages/index/index',
         url: '/pages/index/index',
@@ -37,4 +41,4 @@ Component({
     }
     }
   }
   }
 
 
-}) 
+})

+ 13 - 8
commpents/navbar/navbar.wxml

@@ -1,10 +1,15 @@
 <view class='nav-wrap' style='height: {{height*2 + 80}}rpx;'>
 <view class='nav-wrap' style='height: {{height*2 + 80}}rpx;'>
-  <view class='nav-title' style='line-height: {{height*2 + 44}}px;'>{{navbarData.title}}</view>
-  <view style='display: flex; justify-content: space-around;flex-direction: column'>
-    <view class='nav-capsule' style='height: {{height*2 + 44}}px;' wx:if='{{navbarData.showCapsule}}'>
-      <view bindtap='_navback' wx:if='{{!share}}'>
-        <image src='/pages/images/notice.png' style="width:44rpx;height:44rpx;margin-top:10rpx;"></image>
-      </view>
-    </view>
-  </view>
+	<view class='nav-title' style='line-height: {{height*2 + 44}}px;'>{{navbarData.title}}</view>
+	<view style='display: flex; justify-content: space-around;flex-direction: column'>
+		<view class='nav-capsule' style='height: {{height*2 + 44}}px;' wx:if='{{navbarData.showCapsule}}'>
+			<view bindtap='_navbackMess' wx:if='{{!share}}'>
+				<image src='/pages/images/notice.png' style="width:44rpx;height:44rpx;margin-top:10rpx;"></image>
+			</view>
+		</view>
+		<view class='nav-capsule' style='height: {{height*2 + 44}}px;' wx:if='{{navbarData.showBack}}'>
+			<view bindtap='_navback' wx:if='{{!share}}'>
+				<van-icon name="arrow-left" />
+			</view>
+		</view>
+	</view>
 </view>
 </view>

+ 2 - 1
pages/home/index.js

@@ -8,7 +8,8 @@ Page({
   data: {
   data: {
     // 组件所需的参数
     // 组件所需的参数
     nvabarData: {
     nvabarData: {
-      showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
+      showCapsule: 1, //是否显示左上角图标,消息中心   1表示显示    0表示不显示
+      showBack: 0,//返回
       title: '我的主页', //导航栏 中间的标题
       title: '我的主页', //导航栏 中间的标题
     },
     },
     // 此页面 页面内容距最顶部的距离
     // 此页面 页面内容距最顶部的距离

+ 2 - 1
pages/policy/index.js

@@ -7,7 +7,8 @@ Page({
    */
    */
   data: {
   data: {
     nvabarData: {
     nvabarData: {
-      showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
+      showCapsule: 1, //是否显示左上角图标,消息中心   1表示显示    0表示不显示
+      showBack: 0, //返回
       title: '政策信息', //导航栏 中间的标题
       title: '政策信息', //导航栏 中间的标题
       // 此页面 页面内容距最顶部的距离
       // 此页面 页面内容距最顶部的距离
       height: app.globalData.height * 2 + 20,
       height: app.globalData.height * 2 + 20,

+ 2 - 1
pages/policyDetail/index.js

@@ -7,7 +7,8 @@ Page({
    */
    */
   data: {
   data: {
     nvabarData: {
     nvabarData: {
-      showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
+      showCapsule: 0, //是否显示左上角图标,消息中心   1表示显示    0表示不显示
+      showBack: 1, //返回
       title: '政策信息', //导航栏 中间的标题
       title: '政策信息', //导航栏 中间的标题
       // 此页面 页面内容距最顶部的距离
       // 此页面 页面内容距最顶部的距离
       height: app.globalData.height * 2 + 20,
       height: app.globalData.height * 2 + 20,