张延森 4 年前
父节点
当前提交
647c7f13ee

+ 24
- 3
src/app.config.js 查看文件

1
+import { getPages } from './routes'
2
+
3
+const { pages } = getPages()
4
+
1
 export default {
5
 export default {
2
-  pages: [
3
-    'pages/index/index'
4
-  ],
6
+  pages,
5
   window: {
7
   window: {
6
     backgroundTextStyle: 'light',
8
     backgroundTextStyle: 'light',
7
     navigationBarBackgroundColor: '#fff',
9
     navigationBarBackgroundColor: '#fff',
8
     navigationBarTitleText: 'WeChat',
10
     navigationBarTitleText: 'WeChat',
9
     navigationBarTextStyle: 'black'
11
     navigationBarTextStyle: 'black'
10
   },
12
   },
13
+  tabBar: {
14
+    color: '#666',
15
+    selectedColor: '#BB9C79',
16
+
17
+    list: [
18
+      {
19
+        pagePath: "pages/index/index",
20
+        text: "首页",
21
+        iconPath: './assets/tabbar/index1.png',
22
+        selectedIconPath: './assets/tabbar/index2.png',
23
+      },
24
+      {
25
+        pagePath: "pages/mine/index",
26
+        text: "我是",
27
+        iconPath: './assets/tabbar/mine1.png',
28
+        selectedIconPath: './assets/tabbar/mine2.png',
29
+      }
30
+    ]
31
+  },
11
   permission: {
32
   permission: {
12
     "scope.userLocation": {
33
     "scope.userLocation": {
13
       desc: "你的位置信息将用于显示当前区域信息"
34
       desc: "你的位置信息将用于显示当前区域信息"

二进制
src/assets/tabbar/index1.png 查看文件


二进制
src/assets/tabbar/index2.png 查看文件


二进制
src/assets/tabbar/mine1.png 查看文件


二进制
src/assets/tabbar/mine2.png 查看文件


+ 0
- 4
src/pages/index/index.scss 查看文件

1
-.index {
2
-  flex-direction: column;
3
-  width: 100%;
4
-}

+ 3
- 0
src/pages/mine/index.config.js 查看文件

1
+export default {
2
+  navigationBarTitleText: '我是'
3
+}

+ 9
- 0
src/pages/mine/index.jsx 查看文件

1
+import React from 'react'
2
+import withLayout from '@/layout'
3
+
4
+export default withLayout((props) => {
5
+  // props 里面包含了一些基本的信息
6
+  console.log('-----props---->', props)
7
+
8
+  return '这里是小程序首页';
9
+})

+ 0
- 0
src/pages/mine/index.scss 查看文件


+ 7
- 7
src/routes.js 查看文件

26
   //   isTab: true,
26
   //   isTab: true,
27
   //   type: 'activity',
27
   //   type: 'activity',
28
   // },
28
   // },
29
-  // {
30
-  //   name: '个人中心',
31
-  //   page: 'pages/person/index',
32
-  //   pkg: 'main',
33
-  //   isTab: true,
34
-  //   type: 'center',
35
-  // },
29
+  {
30
+    name: '个人中心',
31
+    page: 'pages/mine/index',
32
+    pkg: 'main',
33
+    isTab: true,
34
+    type: 'center',
35
+  },
36
 
36
 
37
   // /********************************
37
   // /********************************
38
   //  * 项目相关
38
   //  * 项目相关