Quellcode durchsuchen

‘momo添加底部’

wangyong vor 5 Jahren
Ursprung
Commit
b1b7d8fb4c
4 geänderte Dateien mit 74 neuen und 3 gelöschten Zeilen
  1. 32 0
      pages/momo/momo.js
  2. 10 1
      pages/momo/momo.wxml
  3. 24 1
      pages/momo/momo.wxss
  4. 8 1
      project.config.json

+ 32 - 0
pages/momo/momo.js

@@ -15,6 +15,38 @@ Page({
     limit: 20, //一页20条数据
     requestState: true, //默认是可以向下请求的
     loginStatic: false, //登陆状态,默认为false
+    tabBar: {
+      "color": "#2d2d2d",
+      "selectedColor": "#e81021",
+      "borderStyle": "white",
+      "backgroundColor": "#fff",
+      "list": [
+        {
+          "pagePath": "/pages/index/index",
+          "iconPath": "../../images/news/home.png",
+          "selectedIconPath": "images/news/home_select.png",
+          "text": "首页"
+        },
+        {
+          "pagePath": "/pages/kind/index",
+          "iconPath": "../../images/news/classify.png",
+          "selectedIconPath": "images/news/classify_select.png",
+          "text": "分类"
+        },
+        {
+          "pagePath": "/pages/car/index",
+          "iconPath": "../../images/news/car.png",
+          "selectedIconPath": "images/news/car_select.png",
+          "text": "购物车"
+        },
+        {
+          "pagePath": "/pages/mine/mine",
+          "iconPath": "../../images/news/user.png",
+          "selectedIconPath": "images/news/user_select.png",
+          "text": "我的"
+        }
+      ]
+    },
   },
 
   /**

+ 10 - 1
pages/momo/momo.wxml

@@ -17,4 +17,13 @@
     <data-none wx:if="{{goodsList.length === 0}}"></data-none>
 </view>
 </view>
-<view class='ceng' bindtap='close' wx:if="{{filterStatic}}"></view>
+<view class='ceng' bindtap='close' wx:if="{{filterStatic}}"></view>
+<!-- footer -->
+<view class='momo-footer'>
+  <view class='mf-box f-box'>
+    <navigator class='f-item' open-type="switchTab" wx:for="{{tabBar.list}}" url='{{item.pagePath}}'>
+      <image src='{{item.iconPath}}' class='img'></image>
+      <view>{{item.text}}</view>
+    </navigator>
+  </view>
+</view>

+ 24 - 1
pages/momo/momo.wxss

@@ -110,4 +110,27 @@ width:40rpx;
   z-index:10;
   top:0;
   left:0;
-}
+}
+.momo-footer{
+   padding-top:110rpx;
+}
+.mf-box{
+   position: fixed;
+  bottom:0;
+  left:0;
+  width:100%;
+  height: 100rpx;
+  background:#fff;
+  font-size:22rpx;
+  z-index:100;
+}
+.mf-box .img {
+  width: 28px;
+  height: 28px;
+  display: block;
+  margin: auto;
+}
+.mf-box .f-item{
+  text-align: center;
+  padding-top: 4px;
+}

+ 8 - 1
project.config.json

@@ -28,7 +28,7 @@
 			"list": []
 		},
 		"miniprogram": {
-			"current": 26,
+			"current": 27,
 			"list": [
 				{
 					"id": 0,
@@ -211,6 +211,13 @@
 					"id": -1,
 					"name": "momo",
 					"pathName": "pages/momo/momo",
+					"query": "",
+					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "momo",
+					"pathName": "pages/momo/momo",
 					"scene": null
 				}
 			]