Эх сурвалжийг харах

✨ feat(router): 添加底部导航路由

陈雪 3 долоо хоног өмнө
parent
commit
798c0515fa

+ 54 - 7
src/pages.json

@@ -14,6 +14,7 @@
     }
   },
   "tabBar": {
+    "custom": true,
     "color": "#999999",
     "selectedColor": "#018d71",
     "backgroundColor": "#F8F8F8",
@@ -24,16 +25,34 @@
     "spacing": "3px",
     "list": [
       {
-        "iconPath": "static/tabbar/home.png",
-        "selectedIconPath": "static/tabbar/homeHL.png",
+        "icon": "/static/tabbar/home.png",
         "pagePath": "pages/index/index",
-        "text": "%tabbar.home%"
+        "text": "%tabbar.home%",
+        "iconType": "local"
       },
       {
-        "iconPath": "static/tabbar/example.png",
-        "selectedIconPath": "static/tabbar/exampleHL.png",
-        "pagePath": "pages/about/about",
-        "text": "%tabbar.about%"
+        "icon": "/static/tabbar/category.png",
+        "pagePath": "pages/category/category",
+        "text": "%tabbar.category%",
+        "iconType": "local"
+      },
+      {
+        "icon": "/static/tabbar/cart.png",
+        "pagePath": "pages/cart/cart",
+        "text": "%tabbar.cart%",
+        "iconType": "local"
+      },
+      {
+        "icon": "/static/tabbar/community.png",
+        "pagePath": "pages/community/community",
+        "text": "%tabbar.community%",
+        "iconType": "local"
+      },
+      {
+        "icon": "/static/tabbar/person.png",
+        "pagePath": "pages/person/person",
+        "text": "%tabbar.person%",
+        "iconType": "local"
       }
     ]
   },
@@ -54,6 +73,34 @@
       }
     },
     {
+      "path": "pages/cart/cart",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "%tabbar.cart%"
+      }
+    },
+    {
+      "path": "pages/category/category",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "%tabbar.category%"
+      }
+    },
+    {
+      "path": "pages/community/community",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "%tabbar.community%"
+      }
+    },
+    {
+      "path": "pages/person/person",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "%tabbar.person%"
+      }
+    },
+    {
       "path": "pages/user/login",
       "type": "page",
       "style": {

+ 5 - 1
src/types/uni-pages.d.ts

@@ -6,12 +6,16 @@
 interface NavigateToOptions {
   url: "/pages/index/index" |
        "/pages/about/about" |
+       "/pages/cart/cart" |
+       "/pages/category/category" |
+       "/pages/community/community" |
+       "/pages/person/person" |
        "/pages/user/login";
 }
 interface RedirectToOptions extends NavigateToOptions {}
 
 interface SwitchTabOptions {
-  url: "/pages/index/index" | "/pages/about/about"
+  url: "/pages/index/index" | "/pages/category/category" | "/pages/cart/cart" | "/pages/community/community" | "/pages/person/person"
 }
 
 type ReLaunchOptions = NavigateToOptions | SwitchTabOptions;