ipanel-rnapp-ajb-base 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/.local_dev/DemoPage.js +46 -0
- package/app/.local_dev/env.js +1 -0
- package/app/.local_dev/polyfill.js +83 -0
- package/app/App.js +485 -0
- package/app/api/homedApi.js +42 -0
- package/app/api/index.js +2 -0
- package/app/api/ipanelCloudApi.js +796 -0
- package/app/assets/img/add.png +0 -0
- package/app/assets/img/add_img.png +0 -0
- package/app/assets/img/album.png +0 -0
- package/app/assets/img/album2.png +0 -0
- package/app/assets/img/album3.png +0 -0
- package/app/assets/img/album@2x.png +0 -0
- package/app/assets/img/album@3x.png +0 -0
- package/app/assets/img/audioRecordBar.png +0 -0
- package/app/assets/img/bootom_bar_bg.png +0 -0
- package/app/assets/img/close.png +0 -0
- package/app/assets/img/computer.png +0 -0
- package/app/assets/img/confirm.png +0 -0
- package/app/assets/img/delete_pic.png +0 -0
- package/app/assets/img/disabled.png +0 -0
- package/app/assets/img/goBack.png +0 -0
- package/app/assets/img/goBack2.png +0 -0
- package/app/assets/img/ischeck.png +0 -0
- package/app/assets/img/launch_bg.png +0 -0
- package/app/assets/img/launch_bg_panyu.png +0 -0
- package/app/assets/img/launch_logo.png +0 -0
- package/app/assets/img/launch_logo_panyu.png +0 -0
- package/app/assets/img/launch_text.png +0 -0
- package/app/assets/img/launch_text_panyu.png +0 -0
- package/app/assets/img/link.png +0 -0
- package/app/assets/img/login_bg.png +0 -0
- package/app/assets/img/login_bg_new.png +0 -0
- package/app/assets/img/login_left.png +0 -0
- package/app/assets/img/login_right.png +0 -0
- package/app/assets/img/nocheck.png +0 -0
- package/app/assets/img/personal.png +0 -0
- package/app/assets/img/photo.png +0 -0
- package/app/assets/img/photo@2x.png +0 -0
- package/app/assets/img/photo@3x.png +0 -0
- package/app/assets/img/protocol_checked.png +0 -0
- package/app/assets/img/qiehuan.png +0 -0
- package/app/assets/img/scan_border_bottom_left.png +0 -0
- package/app/assets/img/scan_border_bottom_right.png +0 -0
- package/app/assets/img/scan_border_top_left.png +0 -0
- package/app/assets/img/scan_border_top_right.png +0 -0
- package/app/assets/img/scan_move.png +0 -0
- package/app/assets/img/szjt.png +0 -0
- package/app/assets/img/tab.png +0 -0
- package/app/assets/img/tykz.png +0 -0
- package/app/assets/img/update_bg.png +0 -0
- package/app/assets/img/video.png +0 -0
- package/app/assets/img/video@2x.png +0 -0
- package/app/assets/img/video@3x.png +0 -0
- package/app/assets/img/worker.png +0 -0
- package/app/assets/img/wx.png +0 -0
- package/app/assets/img/ykq.png +0 -0
- package/app/assets/img/zfb.png +0 -0
- package/app/base.js +342 -0
- package/app/components/VersionUpdateConfirm.js +117 -0
- package/app/components/common/AccordionCell/index.js +67 -0
- package/app/components/common/ActionPicker/BasicPicker.js +136 -0
- package/app/components/common/ActionPicker/index.js +106 -0
- package/app/components/common/AddressPicker/index.js +211 -0
- package/app/components/common/Card/index.js +19 -0
- package/app/components/common/Cell/index.js +381 -0
- package/app/components/common/CustomDialog/index.js +120 -0
- package/app/components/common/CustomTabBar/index.js +157 -0
- package/app/components/common/CustomTabBar_bak/TabBarInput.js +210 -0
- package/app/components/common/CustomTabBar_bak/index.js +832 -0
- package/app/components/common/DateTimingPicker/index.js +254 -0
- package/app/components/common/Dialog/Notify.js +36 -0
- package/app/components/common/Dialog/baseDialog.js +146 -0
- package/app/components/common/Dialog/index.js +113 -0
- package/app/components/common/Dialog/prompt.js +145 -0
- package/app/components/common/Dialog/quickSelect.js +54 -0
- package/app/components/common/Dialog/select.js +125 -0
- package/app/components/common/Dialog/styles.js +167 -0
- package/app/components/common/Loading/index.js +71 -0
- package/app/components/common/LoginType/index.js +171 -0
- package/app/components/common/LoginType/protocol.js +160 -0
- package/app/components/common/Notify/index.js +68 -0
- package/app/components/common/OnceTouchable/index.js +33 -0
- package/app/components/common/PaymentPicker/index.js +264 -0
- package/app/components/common/ProductOrderPicker/index.js +524 -0
- package/app/components/common/ScreenBackHeader/index.js +144 -0
- package/app/components/common/ScrollPicker/index.js +232 -0
- package/app/components/common/SelectPicker/index.js +171 -0
- package/app/components/common/SmsCodeInput/index.js +93 -0
- package/app/components/common/SmsCodeInput/indexNew.js +101 -0
- package/app/components/common/Steps/index.js +126 -0
- package/app/components/common/Tag/index.js +17 -0
- package/app/components/common/Toast/index.js +103 -0
- package/app/components/common/WeekDaysPicker/index.js +196 -0
- package/app/components/index.js +8 -0
- package/app/components/iot/AddDeviceActionSheet/index.js +934 -0
- package/app/components/iot/AddressActionSheet/index.js +91 -0
- package/app/components/iot/RoomActionSheet/index.js +205 -0
- package/app/components/iot/ViewDeviceActionSheet/index.js +834 -0
- package/app/components/sheets.js +30 -0
- package/app/eventBus/index.js +54 -0
- package/app/hooks/checkLogin.js +30 -0
- package/app/hooks/shopMessageManager.js +308 -0
- package/app/hooks/useAddress.js +179 -0
- package/app/hooks/useAddress2.js +587 -0
- package/app/hooks/useDebounceFn.js +6 -0
- package/app/hooks/useDynamicPackages.js +22 -0
- package/app/hooks/useKeyboard.js +25 -0
- package/app/hooks/useLatest.js +10 -0
- package/app/hooks/useMessageManager.js +368 -0
- package/app/hooks/useNavigationFocus.js +19 -0
- package/app/hooks/useUser.js +56 -0
- package/app/screens/BaseScreen.js +389 -0
- package/app/screens/CommonScreens/BindPhoneScreen/index.js +179 -0
- package/app/screens/CommonScreens/BossScreen/index.js +138 -0
- package/app/screens/CommonScreens/DeviceAnswerDetailScreen/index.js +50 -0
- package/app/screens/CommonScreens/DeviceFeedbackScreen/index.js +365 -0
- package/app/screens/CommonScreens/EditInvoiceTitleScreen/index.js +279 -0
- package/app/screens/CommonScreens/FamilyDetailScreen/index.js +421 -0
- package/app/screens/CommonScreens/InvoiceTitleListScreen/index.js +118 -0
- package/app/screens/CommonScreens/OperatorSelectScreen/index.js +315 -0
- package/app/screens/CommonScreens/PersonalScreen/index.js +348 -0
- package/app/screens/CommonScreens/ScanQRCodeScreen/index.js +407 -0
- package/app/screens/CommonScreens/TvAlbumScreen/index.js +407 -0
- package/app/screens/LoginScreen/OpenLogSheet.js +241 -0
- package/app/screens/LoginScreen/index.js +920 -0
- package/app/screens/LoginScreen/indexNew.js +1354 -0
- package/app/screens/ResePassword/index.js +364 -0
- package/app/screens/SbkScreen.js +19 -0
- package/app/screens/WebviewScreen.js +41 -0
- package/app/storage/index.js +166 -0
- package/app/utils/EventEmitter.js +43 -0
- package/app/utils/RootNavigation.js +32 -0
- package/app/utils/SBK_plugin/convert.js +90 -0
- package/app/utils/SBK_plugin/convertStatus.js +250 -0
- package/app/utils/SBK_plugin/eventProcess.js +339 -0
- package/app/utils/SBK_plugin/index.js +32 -0
- package/app/utils/SBK_plugin/ipanelDeviceToSbkDevice.js +68 -0
- package/app/utils/SBK_plugin/sbk_defs.js +191 -0
- package/app/utils/StyleComposite.js +37 -0
- package/app/utils/applyPermissions.js +251 -0
- package/app/utils/bundleUpdater.js +46 -0
- package/app/utils/common.js +380 -0
- package/app/utils/config.js +47 -0
- package/app/utils/errCodes.js +3 -0
- package/app/utils/homedData.js +57 -0
- package/app/utils/http.js +178 -0
- package/app/utils/notice.js +15 -0
- package/app/utils/priceConversion.js +30 -0
- package/app/utils/registerDialog.js +90 -0
- package/app/utils/scaleSize.js +12 -0
- package/app/utils/soundPlayer.js +85 -0
- package/bin/local-dev.js +7 -0
- package/index.js +8 -0
- package/package.json +18 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Text, View, TouchableOpacity} from 'react-native';
|
|
3
|
+
import styles from './styles';
|
|
4
|
+
import {Divider} from '@rneui/themed';
|
|
5
|
+
const QuickSelect = ({modelRef, setModalVisible}) => {
|
|
6
|
+
/*
|
|
7
|
+
selectList: [
|
|
8
|
+
{
|
|
9
|
+
title: xxx,
|
|
10
|
+
onpress: 'xxx', 点击事件(函数)
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
*/
|
|
14
|
+
const onCannel = () => {
|
|
15
|
+
setModalVisible(false);
|
|
16
|
+
};
|
|
17
|
+
const onPress = item => {
|
|
18
|
+
if (item.onpress) {
|
|
19
|
+
item.onpress();
|
|
20
|
+
}
|
|
21
|
+
setModalVisible(() => false);
|
|
22
|
+
};
|
|
23
|
+
return modelRef?.selectList ? (
|
|
24
|
+
<View
|
|
25
|
+
style={{
|
|
26
|
+
...styles.contentView,
|
|
27
|
+
paddingTop: 0,
|
|
28
|
+
paddingHorizontal: 0,
|
|
29
|
+
}}>
|
|
30
|
+
{modelRef?.selectList.map((val, i) => {
|
|
31
|
+
return (
|
|
32
|
+
<React.Fragment key={i}>
|
|
33
|
+
<TouchableOpacity
|
|
34
|
+
onPress={() => onPress(val)}
|
|
35
|
+
style={[styles.quickSelectStyle]}>
|
|
36
|
+
<Text style={[styles.quickSelectText, styles.textStyle]}>
|
|
37
|
+
{val?.title}
|
|
38
|
+
</Text>
|
|
39
|
+
</TouchableOpacity>
|
|
40
|
+
<Divider color="#f0f0f0" />
|
|
41
|
+
</React.Fragment>
|
|
42
|
+
);
|
|
43
|
+
})}
|
|
44
|
+
</View>
|
|
45
|
+
) : (
|
|
46
|
+
<View style={styles.contentView}>
|
|
47
|
+
<TouchableOpacity onPress={onCannel} style={styles.quickSelectStyle}>
|
|
48
|
+
<Text style={[styles.quickSelectText, styles.textStyle]}>取消</Text>
|
|
49
|
+
</TouchableOpacity>
|
|
50
|
+
</View>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default QuickSelect;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import React, {useState} from 'react';
|
|
2
|
+
import {Text, View, TouchableHighlight, FlatList} from 'react-native';
|
|
3
|
+
import {Icon} from '@rneui/themed';
|
|
4
|
+
import styles from './styles';
|
|
5
|
+
const SelectDialog = ({modelRef, setModalVisible}) => {
|
|
6
|
+
/*
|
|
7
|
+
selectList: [ (主要内容区)必选
|
|
8
|
+
{
|
|
9
|
+
id: xxx,
|
|
10
|
+
title: 'xxx',
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
defaultSelect: selectList数组的id (select组件默认选中)可选
|
|
14
|
+
confirmButtonText: string, (右边按钮文字)必选
|
|
15
|
+
confirmCallback: (value) => { (右边触发事件)必选,返回选中id
|
|
16
|
+
console.log(111, value)
|
|
17
|
+
},
|
|
18
|
+
cancelButtonText: string, (左边按钮文字)必选
|
|
19
|
+
cancelCallback: () => {}, (左边触发事件)可选
|
|
20
|
+
title: string, (标题)必选
|
|
21
|
+
titleStyle: { (标题样式)可选
|
|
22
|
+
textAlign: 'left',
|
|
23
|
+
borderBottomColor: '#eee',
|
|
24
|
+
borderBottomWidth: 1,
|
|
25
|
+
},
|
|
26
|
+
*/
|
|
27
|
+
const [selectedId, setSelectedId] = useState(modelRef?.defaultSelect || '');
|
|
28
|
+
|
|
29
|
+
const onCannel = () => {
|
|
30
|
+
if (modelRef?.cancelCallback) {
|
|
31
|
+
modelRef?.cancelCallback(selectedId);
|
|
32
|
+
}
|
|
33
|
+
setModalVisible(false);
|
|
34
|
+
};
|
|
35
|
+
const onConfirm = () => {
|
|
36
|
+
if (modelRef?.confirmCallback) {
|
|
37
|
+
modelRef?.confirmCallback(selectedId);
|
|
38
|
+
}
|
|
39
|
+
setModalVisible(false);
|
|
40
|
+
};
|
|
41
|
+
return (
|
|
42
|
+
<View style={styles.contentView}>
|
|
43
|
+
{/* 标题 */}
|
|
44
|
+
<View style={styles.title}>
|
|
45
|
+
<Text
|
|
46
|
+
style={[
|
|
47
|
+
styles.titleText,
|
|
48
|
+
styles.selectTitleStyle,
|
|
49
|
+
modelRef?.titleStyle,
|
|
50
|
+
]}>
|
|
51
|
+
{modelRef?.title}
|
|
52
|
+
</Text>
|
|
53
|
+
</View>
|
|
54
|
+
{/* 内容区 */}
|
|
55
|
+
<SelectContent
|
|
56
|
+
data={modelRef.selectList}
|
|
57
|
+
selectedId={selectedId}
|
|
58
|
+
setSelectedId={setSelectedId}
|
|
59
|
+
/>
|
|
60
|
+
{/* 底部按钮 */}
|
|
61
|
+
<View style={styles.bottomContent}>
|
|
62
|
+
<TouchableHighlight
|
|
63
|
+
activeOpacity={0.6}
|
|
64
|
+
underlayColor="#DDDDDD"
|
|
65
|
+
style={[styles.cancelStyle, styles.buttonStyle]}
|
|
66
|
+
onPress={() => {
|
|
67
|
+
onCannel();
|
|
68
|
+
}}>
|
|
69
|
+
<Text style={styles.cancelTextStyle}>
|
|
70
|
+
{modelRef?.cancelButtonText}
|
|
71
|
+
</Text>
|
|
72
|
+
</TouchableHighlight>
|
|
73
|
+
<TouchableHighlight
|
|
74
|
+
activeOpacity={0.6}
|
|
75
|
+
underlayColor="#DDDDDD"
|
|
76
|
+
style={[styles.confirmStyle, styles.buttonStyle]}
|
|
77
|
+
onPress={() => {
|
|
78
|
+
onConfirm();
|
|
79
|
+
}}>
|
|
80
|
+
<Text style={styles.confirmTextStyle}>
|
|
81
|
+
{modelRef?.confirmButtonText}
|
|
82
|
+
</Text>
|
|
83
|
+
</TouchableHighlight>
|
|
84
|
+
</View>
|
|
85
|
+
</View>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// Select选择框内容区域
|
|
90
|
+
const SelectContent = ({data, selectedId, setSelectedId}) => {
|
|
91
|
+
const renderItem = ({item}) => {
|
|
92
|
+
const isSelect = item.id === selectedId;
|
|
93
|
+
return (
|
|
94
|
+
<ItemList item={item} isSelect={isSelect} setSelectedId={setSelectedId} />
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<View style={styles.selectModalContent}>
|
|
100
|
+
<FlatList
|
|
101
|
+
data={data}
|
|
102
|
+
renderItem={renderItem}
|
|
103
|
+
keyExtractor={item => item.id}
|
|
104
|
+
extraData={selectedId}
|
|
105
|
+
/>
|
|
106
|
+
</View>
|
|
107
|
+
);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const ItemList = ({item, isSelect, setSelectedId}) => (
|
|
111
|
+
<TouchableHighlight
|
|
112
|
+
underlayColor="#fff"
|
|
113
|
+
style={styles.itemStyle}
|
|
114
|
+
onPress={() => setSelectedId(item.id)}
|
|
115
|
+
activeOpacity={0.6}>
|
|
116
|
+
<View style={styles.flexRow}>
|
|
117
|
+
<Text style={styles.textStyle}>{item.id}</Text>
|
|
118
|
+
{isSelect && (
|
|
119
|
+
<Icon name="check" type="material" size={22} color="orange" />
|
|
120
|
+
)}
|
|
121
|
+
</View>
|
|
122
|
+
</TouchableHighlight>
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
export default SelectDialog;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
|
|
3
|
+
const px = global.base.scaleSize;
|
|
4
|
+
const {fontStyle} = global.base.styles;
|
|
5
|
+
|
|
6
|
+
const styles = StyleSheet.create({
|
|
7
|
+
backgroundView: {
|
|
8
|
+
position: 'absolute',
|
|
9
|
+
top: 0,
|
|
10
|
+
bottom: 0,
|
|
11
|
+
opacity: 0.5,
|
|
12
|
+
left: 0,
|
|
13
|
+
right: 0,
|
|
14
|
+
backgroundColor: '#000',
|
|
15
|
+
},
|
|
16
|
+
centeredView: {
|
|
17
|
+
flex: 1,
|
|
18
|
+
justifyContent: 'center',
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
position: 'relative',
|
|
21
|
+
},
|
|
22
|
+
contentView: {
|
|
23
|
+
backgroundColor: '#fff',
|
|
24
|
+
borderRadius: px(17),
|
|
25
|
+
// alignItems: 'center',
|
|
26
|
+
shadowColor: '#000',
|
|
27
|
+
shadowOffset: {
|
|
28
|
+
width: 0,
|
|
29
|
+
height: 2,
|
|
30
|
+
},
|
|
31
|
+
shadowOpacity: 0.25,
|
|
32
|
+
shadowRadius: 3.84,
|
|
33
|
+
elevation: 5,
|
|
34
|
+
width: px(855),
|
|
35
|
+
paddingTop: px(69),
|
|
36
|
+
// paddingHorizontal: px(82),
|
|
37
|
+
},
|
|
38
|
+
title: {
|
|
39
|
+
// width: '100%',
|
|
40
|
+
// paddingBottom: 0,
|
|
41
|
+
paddingVertical: px(50),
|
|
42
|
+
paddingHorizontal: px(20),
|
|
43
|
+
},
|
|
44
|
+
titleText: {
|
|
45
|
+
fontWeight: 'bold',
|
|
46
|
+
color: '#333',
|
|
47
|
+
fontSize: px(46),
|
|
48
|
+
// padding: 12,
|
|
49
|
+
textAlign: 'center',
|
|
50
|
+
// paddingBottom: 3,
|
|
51
|
+
// width: '100%',
|
|
52
|
+
},
|
|
53
|
+
selectTitleStyle: {
|
|
54
|
+
textAlign: 'left',
|
|
55
|
+
borderBottomColor: '#eee',
|
|
56
|
+
borderBottomWidth: 1,
|
|
57
|
+
height: 50,
|
|
58
|
+
lineHeight: 30,
|
|
59
|
+
},
|
|
60
|
+
leftTitle: {
|
|
61
|
+
textAlign: 'left',
|
|
62
|
+
padding: 15,
|
|
63
|
+
},
|
|
64
|
+
modalContent: {
|
|
65
|
+
// padding: 3,
|
|
66
|
+
// textAlign: 'center',
|
|
67
|
+
// color: '#333',
|
|
68
|
+
},
|
|
69
|
+
confirmModalContent: {
|
|
70
|
+
// width: '90%',
|
|
71
|
+
// textAlign: 'center',
|
|
72
|
+
// padding: 10,
|
|
73
|
+
// backgroundColor: 'red',
|
|
74
|
+
// paddingBottom: px(33),
|
|
75
|
+
},
|
|
76
|
+
selectModalContent: {
|
|
77
|
+
width: '100%',
|
|
78
|
+
paddingHorizontal: 5,
|
|
79
|
+
},
|
|
80
|
+
confirmText: {
|
|
81
|
+
textAlign: 'center',
|
|
82
|
+
color: '#333',
|
|
83
|
+
paddingHorizontal: 15,
|
|
84
|
+
},
|
|
85
|
+
textView: {
|
|
86
|
+
// height: 40,
|
|
87
|
+
borderBottomColor: '#f4650e',
|
|
88
|
+
borderBottomWidth: 1,
|
|
89
|
+
// width: '100%',
|
|
90
|
+
textAlign: 'center',
|
|
91
|
+
},
|
|
92
|
+
bottomContent: {
|
|
93
|
+
// marginTop: 10,
|
|
94
|
+
flexDirection: 'row',
|
|
95
|
+
justifyContent: 'center',
|
|
96
|
+
alignItems: 'center',
|
|
97
|
+
borderTopWidth: 1,
|
|
98
|
+
borderTopColor: '#f0f0f0',
|
|
99
|
+
},
|
|
100
|
+
buttonStyle: {
|
|
101
|
+
flex: 1,
|
|
102
|
+
// textAlign: 'center',
|
|
103
|
+
paddingTop: px(29),
|
|
104
|
+
paddingBottom: px(32),
|
|
105
|
+
},
|
|
106
|
+
confirmStyle: {
|
|
107
|
+
borderBottomEndRadius: px(17),
|
|
108
|
+
},
|
|
109
|
+
confirmOneStyle: {
|
|
110
|
+
borderBottomStartRadius: px(17),
|
|
111
|
+
},
|
|
112
|
+
cancelStyle: {
|
|
113
|
+
borderBottomStartRadius: px(17),
|
|
114
|
+
borderRightWidth: 1,
|
|
115
|
+
borderColor: '#f5f5f5',
|
|
116
|
+
},
|
|
117
|
+
cancelTextStyle: {
|
|
118
|
+
color: '#666',
|
|
119
|
+
textAlign: 'center',
|
|
120
|
+
fontWeight: '400',
|
|
121
|
+
fontSize: px(52),
|
|
122
|
+
},
|
|
123
|
+
confirmTextStyle: {
|
|
124
|
+
color: '#E86003',
|
|
125
|
+
textAlign: 'center',
|
|
126
|
+
fontWeight: 'bold',
|
|
127
|
+
fontSize: px(52),
|
|
128
|
+
},
|
|
129
|
+
flexRow: {
|
|
130
|
+
flexDirection: 'row',
|
|
131
|
+
justifyContent: 'space-between',
|
|
132
|
+
alignItems: 'center',
|
|
133
|
+
width: '100%',
|
|
134
|
+
},
|
|
135
|
+
itemStyle: {
|
|
136
|
+
marginVertical: 8,
|
|
137
|
+
marginHorizontal: 3,
|
|
138
|
+
height: 30,
|
|
139
|
+
flexDirection: 'row',
|
|
140
|
+
alignItems: 'center',
|
|
141
|
+
justifyContent: 'space-between',
|
|
142
|
+
},
|
|
143
|
+
textStyle: {
|
|
144
|
+
color: '#333',
|
|
145
|
+
},
|
|
146
|
+
quickSelectText: {
|
|
147
|
+
textAlign: 'center',
|
|
148
|
+
width: '100%',
|
|
149
|
+
fontSize: px(46),
|
|
150
|
+
fontWeight: '400',
|
|
151
|
+
},
|
|
152
|
+
quickSelectStyle: {
|
|
153
|
+
paddingVertical: px(46),
|
|
154
|
+
width: '100%',
|
|
155
|
+
},
|
|
156
|
+
quickSelectBottom: {
|
|
157
|
+
borderBottomColor: '#eee',
|
|
158
|
+
borderBottomWidth: 1,
|
|
159
|
+
},
|
|
160
|
+
tip: {
|
|
161
|
+
marginTop: px(22),
|
|
162
|
+
textAlign: 'center',
|
|
163
|
+
...fontStyle(38, '#EA6000'),
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
export default styles;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React, {useImperativeHandle, useState} from 'react';
|
|
2
|
+
import {Text, StyleSheet, View} from 'react-native';
|
|
3
|
+
import {DialogLoading} from '@rneui/base/dist/Dialog/Dialog.Loading';
|
|
4
|
+
// let width = Dimensions.get('window').width;
|
|
5
|
+
// let height = Dimensions.get('window').height;
|
|
6
|
+
|
|
7
|
+
const Index = ({steps, active, onRef}) => {
|
|
8
|
+
const [show, setShow] = useState(false);
|
|
9
|
+
const [loadingText, setLoadingText] = useState('加载中');
|
|
10
|
+
|
|
11
|
+
useImperativeHandle(onRef, () => {
|
|
12
|
+
return {
|
|
13
|
+
showLoading: title => {
|
|
14
|
+
setShow(true);
|
|
15
|
+
setLoadingText(title || '加载中');
|
|
16
|
+
},
|
|
17
|
+
hideLoading: () => {
|
|
18
|
+
setShow(false);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
return show ? (
|
|
24
|
+
<>
|
|
25
|
+
<View style={styles.mask} />
|
|
26
|
+
<View style={styles.loading}>
|
|
27
|
+
<DialogLoading
|
|
28
|
+
loadingProps={{
|
|
29
|
+
color: '#ffffff',
|
|
30
|
+
}}
|
|
31
|
+
/>
|
|
32
|
+
<Text style={styles.loadingTitle}>{loadingText}</Text>
|
|
33
|
+
</View>
|
|
34
|
+
</>
|
|
35
|
+
) : (
|
|
36
|
+
<View />
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const styles = StyleSheet.create({
|
|
41
|
+
mask: {
|
|
42
|
+
top: 0,
|
|
43
|
+
bottom: 0,
|
|
44
|
+
left: 0,
|
|
45
|
+
right: 0,
|
|
46
|
+
position: 'absolute',
|
|
47
|
+
zIndex: 100,
|
|
48
|
+
opacity: 0,
|
|
49
|
+
},
|
|
50
|
+
loading: {
|
|
51
|
+
zIndex: 200,
|
|
52
|
+
position: 'absolute',
|
|
53
|
+
top: '50%',
|
|
54
|
+
left: '50%',
|
|
55
|
+
height: 120,
|
|
56
|
+
width: 120,
|
|
57
|
+
marginTop: -60,
|
|
58
|
+
marginLeft: -60,
|
|
59
|
+
borderRadius: 10,
|
|
60
|
+
backgroundColor: 'rgb(76, 76, 76)',
|
|
61
|
+
padding: 10,
|
|
62
|
+
justifyContent: 'center',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
},
|
|
65
|
+
loadingTitle: {
|
|
66
|
+
fontSize: 14,
|
|
67
|
+
color: 'white',
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export default Index;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Text,
|
|
5
|
+
Image,
|
|
6
|
+
ImageBackground,
|
|
7
|
+
TouchableOpacity,
|
|
8
|
+
StyleSheet,
|
|
9
|
+
} from "react-native";
|
|
10
|
+
import px from "../../../utils/scaleSize";
|
|
11
|
+
const LoginType = ({ activeIndex, changeActive }) => {
|
|
12
|
+
const handleChangeActive = (val) => {
|
|
13
|
+
changeActive(val);
|
|
14
|
+
};
|
|
15
|
+
return (
|
|
16
|
+
<View
|
|
17
|
+
style={{
|
|
18
|
+
flexDirection: "row",
|
|
19
|
+
height: px(210),
|
|
20
|
+
justifyContent: "space-between",
|
|
21
|
+
backgroundColor: "#fff",
|
|
22
|
+
borderRadius: px(55),
|
|
23
|
+
overflow: "hidden",
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
<TouchableOpacity
|
|
27
|
+
activeOpacity={0.7}
|
|
28
|
+
onPress={() => handleChangeActive(0)}
|
|
29
|
+
style={{
|
|
30
|
+
height: px(260),
|
|
31
|
+
width: "50%",
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
<View
|
|
35
|
+
style={{
|
|
36
|
+
height: px(260),
|
|
37
|
+
width: "100%",
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
marginTop: px(-14),
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
{activeIndex != 0 ? (
|
|
43
|
+
<ImageBackground
|
|
44
|
+
source={require("../../../assets/img/login_left.png")}
|
|
45
|
+
style={{
|
|
46
|
+
height: "100%",
|
|
47
|
+
width: "100%",
|
|
48
|
+
|
|
49
|
+
marginLeft: px(-30),
|
|
50
|
+
}}
|
|
51
|
+
resizeMode="stretch"
|
|
52
|
+
>
|
|
53
|
+
<Text
|
|
54
|
+
style={{
|
|
55
|
+
textAlign: "center",
|
|
56
|
+
paddingVertical: px(43),
|
|
57
|
+
paddingHorizontal: px(150),
|
|
58
|
+
color: "#333",
|
|
59
|
+
fontSize: px(45),
|
|
60
|
+
fontWeight: "600",
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
装维人员
|
|
64
|
+
</Text>
|
|
65
|
+
</ImageBackground>
|
|
66
|
+
) : (
|
|
67
|
+
<>
|
|
68
|
+
<Text
|
|
69
|
+
style={{
|
|
70
|
+
textAlign: "center",
|
|
71
|
+
paddingVertical: px(43),
|
|
72
|
+
paddingHorizontal: px(150),
|
|
73
|
+
color: "#333",
|
|
74
|
+
fontSize: px(45),
|
|
75
|
+
fontWeight: "600",
|
|
76
|
+
}}
|
|
77
|
+
>
|
|
78
|
+
装维人员
|
|
79
|
+
</Text>
|
|
80
|
+
<View
|
|
81
|
+
style={{
|
|
82
|
+
width: px(72),
|
|
83
|
+
height: px(9),
|
|
84
|
+
backgroundColor: "#E86003",
|
|
85
|
+
marginTop: px(-20),
|
|
86
|
+
}}
|
|
87
|
+
/>
|
|
88
|
+
{/* <Image
|
|
89
|
+
source={require('../../assets/img/tab.png')}
|
|
90
|
+
style={{
|
|
91
|
+
width: px(55),
|
|
92
|
+
height: px(5),
|
|
93
|
+
marginTop: px(-20),
|
|
94
|
+
}}
|
|
95
|
+
/> */}
|
|
96
|
+
</>
|
|
97
|
+
)}
|
|
98
|
+
</View>
|
|
99
|
+
</TouchableOpacity>
|
|
100
|
+
<TouchableOpacity
|
|
101
|
+
activeOpacity={0.7}
|
|
102
|
+
onPress={() => handleChangeActive(1)}
|
|
103
|
+
style={{
|
|
104
|
+
height: px(260),
|
|
105
|
+
width: "50%",
|
|
106
|
+
}}
|
|
107
|
+
>
|
|
108
|
+
<View
|
|
109
|
+
style={{
|
|
110
|
+
height: px(260),
|
|
111
|
+
width: "100%",
|
|
112
|
+
alignItems: "center",
|
|
113
|
+
backgroundColor: "#fff",
|
|
114
|
+
marginTop: px(-14),
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
{activeIndex === 1 ? (
|
|
118
|
+
<>
|
|
119
|
+
<Text
|
|
120
|
+
style={{
|
|
121
|
+
textAlign: "center",
|
|
122
|
+
paddingVertical: px(43),
|
|
123
|
+
paddingHorizontal: px(150),
|
|
124
|
+
color: "#333",
|
|
125
|
+
fontSize: px(45),
|
|
126
|
+
fontWeight: "600",
|
|
127
|
+
}}
|
|
128
|
+
>
|
|
129
|
+
普通人员
|
|
130
|
+
</Text>
|
|
131
|
+
<View
|
|
132
|
+
style={{
|
|
133
|
+
width: px(72),
|
|
134
|
+
height: px(9),
|
|
135
|
+
backgroundColor: "#E86003",
|
|
136
|
+
marginTop: px(-20),
|
|
137
|
+
}}
|
|
138
|
+
/>
|
|
139
|
+
</>
|
|
140
|
+
) : (
|
|
141
|
+
<ImageBackground
|
|
142
|
+
source={require("../../../assets/img/login_right.png")}
|
|
143
|
+
style={{
|
|
144
|
+
height: "100%",
|
|
145
|
+
width: "100%",
|
|
146
|
+
|
|
147
|
+
marginLeft: px(30),
|
|
148
|
+
}}
|
|
149
|
+
resizeMode="stretch"
|
|
150
|
+
>
|
|
151
|
+
<Text
|
|
152
|
+
style={{
|
|
153
|
+
textAlign: "center",
|
|
154
|
+
paddingVertical: px(43),
|
|
155
|
+
paddingHorizontal: px(150),
|
|
156
|
+
color: "#333",
|
|
157
|
+
fontSize: px(45),
|
|
158
|
+
fontWeight: "600",
|
|
159
|
+
}}
|
|
160
|
+
>
|
|
161
|
+
普通人员
|
|
162
|
+
</Text>
|
|
163
|
+
</ImageBackground>
|
|
164
|
+
)}
|
|
165
|
+
</View>
|
|
166
|
+
</TouchableOpacity>
|
|
167
|
+
</View>
|
|
168
|
+
);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export default LoginType;
|