From d15067f2fe0d0b8f2e1332da5f7d6c6ceab5c5a8 Mon Sep 17 00:00:00 2001 From: FrozenArcher Date: Sun, 3 Mar 2024 19:25:29 +0800 Subject: [PATCH] add tab bar --- project.config.json | 60 +++++++++++++++---------------- project.private.config.json | 12 +++---- src/app.config.ts | 20 ++++++++++- src/app.ts | 2 +- src/pages/index/index.config.ts | 3 +- src/pages/index/index.tsx | 4 +-- src/pages/repair/repair.config.ts | 3 ++ src/pages/repair/repair.scss | 0 src/pages/repair/repair.tsx | 12 +++++++ src/pages/user/user.config.ts | 3 ++ src/pages/user/user.scss | 0 src/pages/user/user.tsx | 12 +++++++ 12 files changed, 89 insertions(+), 42 deletions(-) create mode 100644 src/pages/repair/repair.config.ts create mode 100644 src/pages/repair/repair.scss create mode 100644 src/pages/repair/repair.tsx create mode 100644 src/pages/user/user.config.ts create mode 100644 src/pages/user/user.scss create mode 100644 src/pages/user/user.tsx diff --git a/project.config.json b/project.config.json index 9b2a0e9..2bbcdfa 100644 --- a/project.config.json +++ b/project.config.json @@ -1,31 +1,31 @@ -{ - "miniprogramRoot": "dist/", - "projectname": "EVA-Notify", - "description": "A Wechat miniprogram project of EVA platform", - "appid": "wx636eb7cf2b84f305", - "setting": { - "urlCheck": true, - "es6": false, - "enhance": false, - "compileHotReLoad": false, - "postcss": false, - "minified": false, - "babelSetting": { - "ignore": [], - "disablePlugins": [], - "outputPath": "" - } - }, - "compileType": "miniprogram", - "libVersion": "3.3.4", - "srcMiniprogramRoot": "dist/", - "packOptions": { - "ignore": [], - "include": [] - }, - "condition": {}, - "editorSetting": { - "tabIndent": "insertSpaces", - "tabSize": 2 - } +{ + "miniprogramRoot": "dist/", + "projectname": "EVA-Notify", + "description": "A Wechat miniprogram project of EVA platform", + "appid": "wxa76ef89a218f32f8", + "setting": { + "urlCheck": true, + "es6": false, + "enhance": false, + "compileHotReLoad": false, + "postcss": false, + "minified": false, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + } + }, + "compileType": "miniprogram", + "libVersion": "3.3.4", + "srcMiniprogramRoot": "dist/", + "packOptions": { + "ignore": [], + "include": [] + }, + "condition": {}, + "editorSetting": { + "tabIndent": "insertSpaces", + "tabSize": 2 + } } \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index 71da47a..7051cd4 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -1,7 +1,7 @@ -{ - "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", - "projectname": "EVA-Notify", - "setting": { - "compileHotReLoad": true - } +{ + "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "projectname": "EVA-Notify", + "setting": { + "compileHotReLoad": true + } } \ No newline at end of file diff --git a/src/app.config.ts b/src/app.config.ts index 15c683b..d490642 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -1,11 +1,29 @@ export default defineAppConfig({ pages: [ - 'pages/index/index' + 'pages/index/index', + 'pages/repair/repair', + 'pages/user/user', ], window: { backgroundTextStyle: 'light', navigationBarBackgroundColor: '#fff', navigationBarTitleText: 'WeChat', navigationBarTextStyle: 'black' + }, + tabBar: { + list: [ + { + pagePath: 'pages/index/index', + text: '主页' + }, + { + pagePath: 'pages/repair/repair', + text: '维修' + }, + { + pagePath: 'pages/user/user', + text: '我的' + } + ] } }) diff --git a/src/app.ts b/src/app.ts index 648f15b..fdb7da3 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,6 +1,6 @@ import { PropsWithChildren } from 'react' import { useLaunch } from '@tarojs/taro' -import 'taro-ui/dist/style/index.scss' +//import 'taro-ui/dist/style/index.scss' import './app.scss' function App({ children }: PropsWithChildren) { diff --git a/src/pages/index/index.config.ts b/src/pages/index/index.config.ts index 12abc5f..cd12ca7 100644 --- a/src/pages/index/index.config.ts +++ b/src/pages/index/index.config.ts @@ -1,3 +1,4 @@ export default definePageConfig({ - navigationBarTitleText: '首页' + navigationBarTitleText: '首页', + usingComponents: {} }) diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 0f3dfd6..7a01e2d 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -14,9 +14,7 @@ class Index extends Component { render(): ReactNode { return ( - - {this.state.msg} - + {this.state.msg} ) } diff --git a/src/pages/repair/repair.config.ts b/src/pages/repair/repair.config.ts new file mode 100644 index 0000000..3b7672d --- /dev/null +++ b/src/pages/repair/repair.config.ts @@ -0,0 +1,3 @@ +export default definePageConfig({ + usingComponents: {}, +}) \ No newline at end of file diff --git a/src/pages/repair/repair.scss b/src/pages/repair/repair.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/repair/repair.tsx b/src/pages/repair/repair.tsx new file mode 100644 index 0000000..d96552c --- /dev/null +++ b/src/pages/repair/repair.tsx @@ -0,0 +1,12 @@ +import { View, Text } from "@tarojs/components"; +import { Component, ReactNode } from "react"; + +export default class RepairPage extends Component { + render(): ReactNode { + return ( + + Repair Page + + ) + } +} \ No newline at end of file diff --git a/src/pages/user/user.config.ts b/src/pages/user/user.config.ts new file mode 100644 index 0000000..3b7672d --- /dev/null +++ b/src/pages/user/user.config.ts @@ -0,0 +1,3 @@ +export default definePageConfig({ + usingComponents: {}, +}) \ No newline at end of file diff --git a/src/pages/user/user.scss b/src/pages/user/user.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/user/user.tsx b/src/pages/user/user.tsx new file mode 100644 index 0000000..415e029 --- /dev/null +++ b/src/pages/user/user.tsx @@ -0,0 +1,12 @@ +import { View, Text } from "@tarojs/components"; +import { Component, ReactNode } from "react"; + +export default class UserPage extends Component { + render(): ReactNode { + return ( + + User Page + + ) + } +} \ No newline at end of file