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.
Files changed (155) hide show
  1. package/app/.local_dev/DemoPage.js +46 -0
  2. package/app/.local_dev/env.js +1 -0
  3. package/app/.local_dev/polyfill.js +83 -0
  4. package/app/App.js +485 -0
  5. package/app/api/homedApi.js +42 -0
  6. package/app/api/index.js +2 -0
  7. package/app/api/ipanelCloudApi.js +796 -0
  8. package/app/assets/img/add.png +0 -0
  9. package/app/assets/img/add_img.png +0 -0
  10. package/app/assets/img/album.png +0 -0
  11. package/app/assets/img/album2.png +0 -0
  12. package/app/assets/img/album3.png +0 -0
  13. package/app/assets/img/album@2x.png +0 -0
  14. package/app/assets/img/album@3x.png +0 -0
  15. package/app/assets/img/audioRecordBar.png +0 -0
  16. package/app/assets/img/bootom_bar_bg.png +0 -0
  17. package/app/assets/img/close.png +0 -0
  18. package/app/assets/img/computer.png +0 -0
  19. package/app/assets/img/confirm.png +0 -0
  20. package/app/assets/img/delete_pic.png +0 -0
  21. package/app/assets/img/disabled.png +0 -0
  22. package/app/assets/img/goBack.png +0 -0
  23. package/app/assets/img/goBack2.png +0 -0
  24. package/app/assets/img/ischeck.png +0 -0
  25. package/app/assets/img/launch_bg.png +0 -0
  26. package/app/assets/img/launch_bg_panyu.png +0 -0
  27. package/app/assets/img/launch_logo.png +0 -0
  28. package/app/assets/img/launch_logo_panyu.png +0 -0
  29. package/app/assets/img/launch_text.png +0 -0
  30. package/app/assets/img/launch_text_panyu.png +0 -0
  31. package/app/assets/img/link.png +0 -0
  32. package/app/assets/img/login_bg.png +0 -0
  33. package/app/assets/img/login_bg_new.png +0 -0
  34. package/app/assets/img/login_left.png +0 -0
  35. package/app/assets/img/login_right.png +0 -0
  36. package/app/assets/img/nocheck.png +0 -0
  37. package/app/assets/img/personal.png +0 -0
  38. package/app/assets/img/photo.png +0 -0
  39. package/app/assets/img/photo@2x.png +0 -0
  40. package/app/assets/img/photo@3x.png +0 -0
  41. package/app/assets/img/protocol_checked.png +0 -0
  42. package/app/assets/img/qiehuan.png +0 -0
  43. package/app/assets/img/scan_border_bottom_left.png +0 -0
  44. package/app/assets/img/scan_border_bottom_right.png +0 -0
  45. package/app/assets/img/scan_border_top_left.png +0 -0
  46. package/app/assets/img/scan_border_top_right.png +0 -0
  47. package/app/assets/img/scan_move.png +0 -0
  48. package/app/assets/img/szjt.png +0 -0
  49. package/app/assets/img/tab.png +0 -0
  50. package/app/assets/img/tykz.png +0 -0
  51. package/app/assets/img/update_bg.png +0 -0
  52. package/app/assets/img/video.png +0 -0
  53. package/app/assets/img/video@2x.png +0 -0
  54. package/app/assets/img/video@3x.png +0 -0
  55. package/app/assets/img/worker.png +0 -0
  56. package/app/assets/img/wx.png +0 -0
  57. package/app/assets/img/ykq.png +0 -0
  58. package/app/assets/img/zfb.png +0 -0
  59. package/app/base.js +342 -0
  60. package/app/components/VersionUpdateConfirm.js +117 -0
  61. package/app/components/common/AccordionCell/index.js +67 -0
  62. package/app/components/common/ActionPicker/BasicPicker.js +136 -0
  63. package/app/components/common/ActionPicker/index.js +106 -0
  64. package/app/components/common/AddressPicker/index.js +211 -0
  65. package/app/components/common/Card/index.js +19 -0
  66. package/app/components/common/Cell/index.js +381 -0
  67. package/app/components/common/CustomDialog/index.js +120 -0
  68. package/app/components/common/CustomTabBar/index.js +157 -0
  69. package/app/components/common/CustomTabBar_bak/TabBarInput.js +210 -0
  70. package/app/components/common/CustomTabBar_bak/index.js +832 -0
  71. package/app/components/common/DateTimingPicker/index.js +254 -0
  72. package/app/components/common/Dialog/Notify.js +36 -0
  73. package/app/components/common/Dialog/baseDialog.js +146 -0
  74. package/app/components/common/Dialog/index.js +113 -0
  75. package/app/components/common/Dialog/prompt.js +145 -0
  76. package/app/components/common/Dialog/quickSelect.js +54 -0
  77. package/app/components/common/Dialog/select.js +125 -0
  78. package/app/components/common/Dialog/styles.js +167 -0
  79. package/app/components/common/Loading/index.js +71 -0
  80. package/app/components/common/LoginType/index.js +171 -0
  81. package/app/components/common/LoginType/protocol.js +160 -0
  82. package/app/components/common/Notify/index.js +68 -0
  83. package/app/components/common/OnceTouchable/index.js +33 -0
  84. package/app/components/common/PaymentPicker/index.js +264 -0
  85. package/app/components/common/ProductOrderPicker/index.js +524 -0
  86. package/app/components/common/ScreenBackHeader/index.js +144 -0
  87. package/app/components/common/ScrollPicker/index.js +232 -0
  88. package/app/components/common/SelectPicker/index.js +171 -0
  89. package/app/components/common/SmsCodeInput/index.js +93 -0
  90. package/app/components/common/SmsCodeInput/indexNew.js +101 -0
  91. package/app/components/common/Steps/index.js +126 -0
  92. package/app/components/common/Tag/index.js +17 -0
  93. package/app/components/common/Toast/index.js +103 -0
  94. package/app/components/common/WeekDaysPicker/index.js +196 -0
  95. package/app/components/index.js +8 -0
  96. package/app/components/iot/AddDeviceActionSheet/index.js +934 -0
  97. package/app/components/iot/AddressActionSheet/index.js +91 -0
  98. package/app/components/iot/RoomActionSheet/index.js +205 -0
  99. package/app/components/iot/ViewDeviceActionSheet/index.js +834 -0
  100. package/app/components/sheets.js +30 -0
  101. package/app/eventBus/index.js +54 -0
  102. package/app/hooks/checkLogin.js +30 -0
  103. package/app/hooks/shopMessageManager.js +308 -0
  104. package/app/hooks/useAddress.js +179 -0
  105. package/app/hooks/useAddress2.js +587 -0
  106. package/app/hooks/useDebounceFn.js +6 -0
  107. package/app/hooks/useDynamicPackages.js +22 -0
  108. package/app/hooks/useKeyboard.js +25 -0
  109. package/app/hooks/useLatest.js +10 -0
  110. package/app/hooks/useMessageManager.js +368 -0
  111. package/app/hooks/useNavigationFocus.js +19 -0
  112. package/app/hooks/useUser.js +56 -0
  113. package/app/screens/BaseScreen.js +389 -0
  114. package/app/screens/CommonScreens/BindPhoneScreen/index.js +179 -0
  115. package/app/screens/CommonScreens/BossScreen/index.js +138 -0
  116. package/app/screens/CommonScreens/DeviceAnswerDetailScreen/index.js +50 -0
  117. package/app/screens/CommonScreens/DeviceFeedbackScreen/index.js +365 -0
  118. package/app/screens/CommonScreens/EditInvoiceTitleScreen/index.js +279 -0
  119. package/app/screens/CommonScreens/FamilyDetailScreen/index.js +421 -0
  120. package/app/screens/CommonScreens/InvoiceTitleListScreen/index.js +118 -0
  121. package/app/screens/CommonScreens/OperatorSelectScreen/index.js +315 -0
  122. package/app/screens/CommonScreens/PersonalScreen/index.js +348 -0
  123. package/app/screens/CommonScreens/ScanQRCodeScreen/index.js +407 -0
  124. package/app/screens/CommonScreens/TvAlbumScreen/index.js +407 -0
  125. package/app/screens/LoginScreen/OpenLogSheet.js +241 -0
  126. package/app/screens/LoginScreen/index.js +920 -0
  127. package/app/screens/LoginScreen/indexNew.js +1354 -0
  128. package/app/screens/ResePassword/index.js +364 -0
  129. package/app/screens/SbkScreen.js +19 -0
  130. package/app/screens/WebviewScreen.js +41 -0
  131. package/app/storage/index.js +166 -0
  132. package/app/utils/EventEmitter.js +43 -0
  133. package/app/utils/RootNavigation.js +32 -0
  134. package/app/utils/SBK_plugin/convert.js +90 -0
  135. package/app/utils/SBK_plugin/convertStatus.js +250 -0
  136. package/app/utils/SBK_plugin/eventProcess.js +339 -0
  137. package/app/utils/SBK_plugin/index.js +32 -0
  138. package/app/utils/SBK_plugin/ipanelDeviceToSbkDevice.js +68 -0
  139. package/app/utils/SBK_plugin/sbk_defs.js +191 -0
  140. package/app/utils/StyleComposite.js +37 -0
  141. package/app/utils/applyPermissions.js +251 -0
  142. package/app/utils/bundleUpdater.js +46 -0
  143. package/app/utils/common.js +380 -0
  144. package/app/utils/config.js +47 -0
  145. package/app/utils/errCodes.js +3 -0
  146. package/app/utils/homedData.js +57 -0
  147. package/app/utils/http.js +178 -0
  148. package/app/utils/notice.js +15 -0
  149. package/app/utils/priceConversion.js +30 -0
  150. package/app/utils/registerDialog.js +90 -0
  151. package/app/utils/scaleSize.js +12 -0
  152. package/app/utils/soundPlayer.js +85 -0
  153. package/bin/local-dev.js +7 -0
  154. package/index.js +8 -0
  155. package/package.json +18 -0
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import {Text, StyleSheet} from 'react-native';
3
+
4
+ const Index = ({style, title}) => {
5
+ return <Text style={[styles.tag, style]}>{title}</Text>;
6
+ };
7
+
8
+ const styles = StyleSheet.create({
9
+ tag: {
10
+ backgroundColor: '#645cdf',
11
+ paddingVertical: 2,
12
+ paddingHorizontal: 5,
13
+ color: '#fff',
14
+ },
15
+ });
16
+
17
+ export default Index;
@@ -0,0 +1,103 @@
1
+ import React, {useImperativeHandle, useState} from 'react';
2
+ import {Text, StyleSheet, View} from 'react-native';
3
+ // let width = Dimensions.get('window').width;
4
+ // let height = Dimensions.get('window').height;
5
+
6
+ const px = global.base.scaleSize;
7
+
8
+ const Index = ({steps, active, onRef}) => {
9
+ const [show, setShow] = useState(false);
10
+ const [toastText, setToastText] = useState('提示');
11
+ const [showMask, setShowMask] = useState(false);
12
+ const [position, setPosition] = useState('center');
13
+ const [toastTextStyle, setToastTextStyle] = useState({});
14
+
15
+ const toastStyles = {
16
+ center: {
17
+ top: '50%',
18
+ bottom: undefined,
19
+ },
20
+ bottom: {
21
+ top: undefined,
22
+ bottom: 70,
23
+ },
24
+ top: {
25
+ top: 100,
26
+ bottom: undefined,
27
+ },
28
+ };
29
+
30
+ useImperativeHandle(onRef, () => {
31
+ return {
32
+ showToast: args => {
33
+ let duration = 2000;
34
+ if (typeof args === 'object') {
35
+ setPosition(args.position || 'center');
36
+ setToastText(args.message || '提示');
37
+ setShowMask(!!args.forbidClick);
38
+ setToastTextStyle(args.textStyle || {});
39
+ duration = args.duration || 2000;
40
+ } else {
41
+ setPosition('center');
42
+ setToastText(args);
43
+ }
44
+
45
+ setShow(true);
46
+ setTimeout(() => {
47
+ setShow(false);
48
+ setShowMask(false);
49
+ }, duration);
50
+ },
51
+ };
52
+ });
53
+
54
+ return show ? (
55
+ <>
56
+ {showMask ? (
57
+ <View style={styles.mask}>
58
+ <View style={[styles.toast, toastStyles[position]]}>
59
+ <Text style={[styles.title, toastTextStyle]}>{toastText}</Text>
60
+ </View>
61
+ </View>
62
+ ) : (
63
+ <View style={[styles.toast, toastStyles[position]]}>
64
+ <Text style={[styles.title, toastTextStyle]}>{toastText}</Text>
65
+ </View>
66
+ )}
67
+ </>
68
+ ) : (
69
+ <View />
70
+ );
71
+ };
72
+
73
+ const styles = StyleSheet.create({
74
+ mask: {
75
+ top: 0,
76
+ bottom: 0,
77
+ left: 0,
78
+ right: 0,
79
+ position: 'absolute',
80
+ zIndex: 100000,
81
+ opacity: 0,
82
+ },
83
+ toast: {
84
+ zIndex: 200000,
85
+ left: '50%',
86
+ top: '50%',
87
+ width: px(720),
88
+ marginLeft: -px(720 / 2),
89
+ position: 'absolute',
90
+ opacity: 1,
91
+ padding: px(69),
92
+ backgroundColor: 'rgba(0, 0, 0, 0.7)',
93
+ borderRadius: px(17),
94
+ },
95
+ title: {
96
+ fontSize: px(44),
97
+ color: '#fff',
98
+ textAlign: 'center',
99
+ fontWeight: '500',
100
+ },
101
+ });
102
+
103
+ export default Index;
@@ -0,0 +1,196 @@
1
+ import React, {useState} from 'react';
2
+ import {View, Text, StyleSheet, TouchableOpacity} from 'react-native';
3
+ import ActionSheet, {SheetManager} from 'react-native-actions-sheet';
4
+ import {Icon, CheckBox} from '@rneui/themed';
5
+
6
+ const Index = ({sheetId, payload}) => {
7
+ const {title} = payload;
8
+
9
+ const [dates, setDates] = useState([
10
+ {
11
+ name: '周日',
12
+ value: 0,
13
+ checked: false,
14
+ },
15
+ {
16
+ name: '周一',
17
+ value: 1,
18
+ checked: false,
19
+ },
20
+ {
21
+ name: '周二',
22
+ value: 2,
23
+ checked: false,
24
+ },
25
+ {
26
+ name: '周三',
27
+ value: 3,
28
+ checked: false,
29
+ },
30
+ {
31
+ name: '周四',
32
+ value: 4,
33
+ checked: false,
34
+ },
35
+ {
36
+ name: '周五',
37
+ value: 5,
38
+ checked: false,
39
+ },
40
+ {
41
+ name: '周六',
42
+ value: 6,
43
+ checked: false,
44
+ },
45
+ ]);
46
+
47
+ const handleCancel = () => {
48
+ SheetManager.hide(sheetId);
49
+ };
50
+
51
+ const handleConfirm = () => {
52
+ SheetManager.hide(sheetId, {
53
+ payload: {
54
+ dates: dates
55
+ .filter(item => item.checked)
56
+ .map(item => ({
57
+ name: item.name,
58
+ value: item.value,
59
+ })),
60
+ },
61
+ });
62
+ };
63
+
64
+ const handleCheck = day => {
65
+ day.checked = !day.checked;
66
+ setDates([...dates]);
67
+ };
68
+
69
+ return (
70
+ <>
71
+ <ActionSheet id={sheetId} isModal={false} useBottomSafeAreaPadding>
72
+ <View style={styles.title}>
73
+ <TouchableOpacity
74
+ style={styles.cancelBtnBox}
75
+ activeOpacity={0.3}
76
+ onPress={handleCancel}>
77
+ <Text style={styles.cancnelBtnText}>取消</Text>
78
+ </TouchableOpacity>
79
+ <Text style={styles.titleText}>{title}</Text>
80
+ <TouchableOpacity
81
+ style={styles.confirmBtnBox}
82
+ activeOpacity={0.3}
83
+ onPress={handleConfirm}>
84
+ <Text style={styles.confirmBtnText}>确定</Text>
85
+ </TouchableOpacity>
86
+ </View>
87
+
88
+ <View style={styles.weekDayWrap}>
89
+ {dates.map((day, dayIndex) => {
90
+ return (
91
+ <TouchableOpacity
92
+ key={dayIndex}
93
+ activeOpacity={0.75}
94
+ onPress={() => handleCheck(day)}>
95
+ <View style={styles.weekDayInner}>
96
+ <Text style={styles.weekDayLabel}>{day.name}</Text>
97
+ <CheckBox
98
+ center
99
+ checked={day.checked}
100
+ containerStyle={{
101
+ margin: 0,
102
+ padding: 0,
103
+ }}
104
+ onPress={() => handleCheck(day)}
105
+ checkedIcon={
106
+ <Icon
107
+ name="ios-checkbox"
108
+ type="ionicon"
109
+ color="#000"
110
+ size={26}
111
+ />
112
+ }
113
+ uncheckedIcon={
114
+ <Icon
115
+ name="ios-checkbox-outline"
116
+ type="ionicon"
117
+ color="#ccc"
118
+ size={26}
119
+ />
120
+ }
121
+ />
122
+ </View>
123
+ </TouchableOpacity>
124
+ );
125
+ })}
126
+ </View>
127
+ </ActionSheet>
128
+ </>
129
+ );
130
+ };
131
+
132
+ const styles = StyleSheet.create({
133
+ title: {
134
+ position: 'relative',
135
+ height: 50,
136
+ paddingHorizontal: 60,
137
+ alignItems: 'center',
138
+ justifyContent: 'center',
139
+ },
140
+ titleText: {
141
+ fontSize: 18,
142
+ color: '#333',
143
+ },
144
+ cancelBtnBox: {
145
+ position: 'absolute',
146
+ height: '100%',
147
+ top: 0,
148
+ left: 0,
149
+ width: 60,
150
+ alignItems: 'center',
151
+ justifyContent: 'center',
152
+ },
153
+ confirmBtnBox: {
154
+ position: 'absolute',
155
+ height: '100%',
156
+ top: 0,
157
+ right: 0,
158
+ width: 60,
159
+ alignItems: 'center',
160
+ justifyContent: 'center',
161
+ },
162
+ cancnelBtnText: {
163
+ fontSize: 18,
164
+ },
165
+ confirmBtnText: {
166
+ fontSize: 18,
167
+ color: '#2089dc',
168
+ },
169
+
170
+ weekDayWrap: {},
171
+ weekDay: {
172
+ height: 50,
173
+ paddingLeft: 25,
174
+ paddingRight: 10,
175
+ flexDirection: 'row',
176
+ alignItems: 'center',
177
+ justifyContent: 'space-between',
178
+ borderBottomWidth: 1,
179
+ borderBottomColor: '#eee',
180
+ },
181
+ weekDayInner: {
182
+ height: 50,
183
+ paddingLeft: 25,
184
+ paddingRight: 10,
185
+ flexDirection: 'row',
186
+ alignItems: 'center',
187
+ justifyContent: 'space-between',
188
+ borderBottomWidth: 1,
189
+ borderBottomColor: '#eee',
190
+ },
191
+ weekDayLabel: {
192
+ fontSize: 18,
193
+ },
194
+ });
195
+
196
+ export default Index;
@@ -0,0 +1,8 @@
1
+ export AccordionCell from './common/AccordionCell';
2
+ export Cell from './common/Cell';
3
+ export SmsCodeInput from './common/SmsCodeInput';
4
+ export Tag from './common/Tag';
5
+ export ActionPicker from './common/ActionPicker';
6
+ export ScreenBackHeader from './common/ScreenBackHeader';
7
+ export CustomDialog from './common/CustomDialog';
8
+ export OnceTouchable from './common/OnceTouchable';