Browse Source

feat: add tabbar page

windyeasy 2 tháng trước cách đây
mục cha
commit
a066555df7
5 tập tin đã thay đổi với 20 bổ sung14 xóa
  1. 2 2
      pages.config.ts
  2. 7 7
      src/pages.json
  3. 2 2
      src/pages/profile/index.vue
  4. 6 0
      src/service/request/index.ts
  5. 3 3
      src/types/uni-pages.d.ts

+ 2 - 2
pages.config.ts

@@ -35,8 +35,8 @@ export default defineUniPages({
       {
         iconPath: 'static/tabbar/example.png',
         selectedIconPath: 'static/tabbar/exampleHL.png',
-        pagePath: 'pages/about/about',
-        text: '关于',
+        pagePath: 'pages/profile/index',
+        text: '我的',
       },
     ],
   },

+ 7 - 7
src/pages.json

@@ -32,28 +32,28 @@
       {
         "iconPath": "static/tabbar/example.png",
         "selectedIconPath": "static/tabbar/exampleHL.png",
-        "pagePath": "pages/about/index",
-        "text": "关于"
+        "pagePath": "pages/profile/index",
+        "text": "我的"
       }
     ]
   },
   "pages": [
     {
-      "path": "pages/index/index",
+      "path": "pages/profile/index",
       "type": "home",
       "style": {
         "navigationStyle": "custom",
-        "navigationBarTitleText": "首页"
+        "navigationBarTitleText": "我的"
       }
     },
     {
-      "path": "pages/about/index",
+      "path": "pages/index/index",
       "type": "home",
       "style": {
         "navigationStyle": "custom",
-        "navigationBarTitleText": "关于"
+        "navigationBarTitleText": "首页"
       }
     }
   ],
   "subPackages": []
-}
+}

+ 2 - 2
src/pages/about/index.vue → src/pages/profile/index.vue

@@ -3,12 +3,12 @@
 {
   style: {
     navigationStyle: 'custom',
-    navigationBarTitleText: '关于',
+    navigationBarTitleText: '我的',
   },
 }
 </route>
 <template>
-  <view>关于</view>
+  <view>我的</view>
 </template>
 
 <script lang="ts" setup></script>

+ 6 - 0
src/service/request/index.ts

@@ -137,6 +137,12 @@ class WdRequest {
           resolve(res)
         },
         fail: (error) => {
+          if (this.config?.interceptor?.responseErrorFn) {
+            error = this.config.interceptor.responseErrorFn(error)
+          }
+          if (config?.interceptor?.responseErrorFn) {
+            error = config?.interceptor?.responseErrorFn(error)
+          }
           reject(error)
         },
       })

+ 3 - 3
src/types/uni-pages.d.ts

@@ -4,13 +4,13 @@
 // Generated by vite-plugin-uni-pages
 
 interface NavigateToOptions {
-  url: "/pages/index/index" |
-       "/pages/about/index";
+  url: "/pages/profile/index" |
+       "/pages/index/index";
 }
 interface RedirectToOptions extends NavigateToOptions {}
 
 interface SwitchTabOptions {
-  url: "/pages/index/index" | "/pages/about/about"
+  url: "/pages/index/index" | "/pages/profile/index"
 }
 
 type ReLaunchOptions = NavigateToOptions | SwitchTabOptions;