Repository navigation
Expand file tree
/
Copy pathApp.js
More file actions
179 lines (149 loc) · 4.8 KB
/
Copy pathApp.js
File metadata and controls
179 lines (149 loc) · 4.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
import React, { Component } from 'react';
import { AppRegistry, StyleSheet, Image } from 'react-native';
//导入stack导航组件
import { StackNavigator, TabNavigator } from 'react-navigation';
import { Dimensions } from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome'
import Login from './app/Login'
import CheckHome from './app/containers/check/CheckHome'
import RecordHome from './app/containers/record/RecordHome'
import OrgList from './app/containers/check/OrgList'
import PointTypeList from './app/containers/check/PointTypeList'
import PointList from './app/containers/check/PointList'
import CheckList from './app/containers/check/CheckList'
import AddProblem from "./app/containers/check/AddProblem";
import AddAdvantage from "./app/containers/check/AddAdvantage";
import Test from "./app/containers/check/Test";
import AdvantageList from "./app/containers/record/AdvantageList";
import ProblemList from "./app/containers/record/ProblemList";
import ProblemDetail from "./app/containers/record/ProblemDetail";
import AdvantageDetail from "./app/containers/record/AdvantageDetail";
import ImagePickers from './app/components/ImagePickers';
import {Toast} from 'antd-mobile';
import {
Button
} from 'react-native';
const deviceW = Dimensions.get('window').width
const basePx = 375
function px2dp(px) {
return px * deviceW / basePx
}
const MainNavigator = TabNavigator({
Check: {
screen: CheckHome,
navigationOptions: {
tabBarLabel: '检查',
header: null,
tabBarIcon: ({ tintColor }) =>
(<Image
source={require('./app/iconImages/check.png')}
style={[styles.icon, { tintColor: tintColor }]}
/>),
}
},
RecordHome: {
screen: RecordHome,
navigationOptions: {
tabBarLabel: '记录',
header: null,
tabBarIcon: ({ tintColor }) => (<Image
source={require('./app/iconImages/record.png')}
style={[styles.icon, { tintColor: tintColor }]}
/>),
}
},
}, {
animationEnabled: true,// 切换页面时是否有动画效果
tabBarPosition: 'bottom',
swipeEnabled: true,// 是否可以左右滑动切换tab
backBehavior: 'none',// 按 back 键是否跳转到第一个Tab(首页), none 为不跳转
tabBarOptions: {
activeTintColor: '#3e9ce9',// 文字和图片选中颜色
inactiveTintColor: '#999999',// 文字和图片未选中颜色
showIcon: true,// android 默认不显示 icon, 需要设置为 true 才会显示
indicatorStyle: {
height: 0, // 如TabBar下面显示有一条线,可以设高度为0后隐藏
opacity: 0
},
style: {
backgroundColor: '#fff',// TabBar 背景色
// height: 44,
// lineHeight:44,
},
tabStyle: {
padding: 0
},
labelStyle: {
fontSize: 12, // 文字大小
},
},
},
)
//进行导航的注册
const Route = StackNavigator({
initialRouteName: { screen: Login },
Login: {
screen: Login,
navigationOptions: {
header: null,
}
},
TabBars: { screen: MainNavigator },
OrgList: {
screen: OrgList, navigationOptions: {
title: '受检单位'
}
},
PointTypeList: { screen: PointTypeList },
PointList: { screen: PointList },
CheckList: { screen: CheckList },
AddProblem: {
screen: AddProblem, navigationOptions: {
title: '新增问题'
}
},
AddAdvantage: {
screen: AddAdvantage, navigationOptions: {
title: '新增优点'
}
},
AdvantageList: {
screen: AdvantageList, navigationOptions: {
title: '优点记录'
}
},
ProblemList: {
screen: ProblemList, navigationOptions: {
title: '问题记录'
}
},
ProblemDetail: {
screen: ProblemDetail, navigationOptions: {
title: '问题详情'
}
},
AdvantageDetail: {
screen: AdvantageDetail, navigationOptions: {
title: '优点详情',
initialRouteParams: {}
}
},
Test: {
screen: Test, navigationOptions: {
title: '测试Art',
initialRouteParams: {}
}
},
ImagePickers: {
screen: ImagePickers, navigationOptions: {
header: null
}
},
});
const styles = StyleSheet.create({
icon: {
width: 26,
height: 26,
},
})
AppRegistry.registerComponent('junan', () => Route);