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,91 @@
|
|
|
1
|
+
import React, {useState} from 'react';
|
|
2
|
+
import {View, Text, StyleSheet, Alert, ScrollView} from 'react-native';
|
|
3
|
+
import ActionSheet, {
|
|
4
|
+
SheetProps,
|
|
5
|
+
SheetManager,
|
|
6
|
+
} from 'react-native-actions-sheet';
|
|
7
|
+
import {Icon, Button} from '@rneui/themed';
|
|
8
|
+
import {Cell, Picker} from '../../index';
|
|
9
|
+
import {addRoom, adjustRoom} from '../../../api';
|
|
10
|
+
|
|
11
|
+
const RoomActionSheet = ({sheetId, payload}) => {
|
|
12
|
+
let title = '创建家庭';
|
|
13
|
+
let submitBtnText = '创建';
|
|
14
|
+
|
|
15
|
+
const [roomName, setRoomName] = useState('');
|
|
16
|
+
|
|
17
|
+
const handleShowAddressPicker = () => {};
|
|
18
|
+
|
|
19
|
+
const handleSaveRoom = async () => {
|
|
20
|
+
if (!roomName) {
|
|
21
|
+
Alert.alert('请填写家庭名称');
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<>
|
|
28
|
+
<ActionSheet id={sheetId} isModal={false} useBottomSafeAreaPadding>
|
|
29
|
+
<View style={styles.title}>
|
|
30
|
+
<Text style={styles.titleText}>{title}</Text>
|
|
31
|
+
<View style={styles.closeBtn}>
|
|
32
|
+
<Icon
|
|
33
|
+
name="close"
|
|
34
|
+
type="ionicon"
|
|
35
|
+
size={28}
|
|
36
|
+
color="#999"
|
|
37
|
+
onPress={() => {
|
|
38
|
+
SheetManager.hide(sheetId);
|
|
39
|
+
}}
|
|
40
|
+
/>
|
|
41
|
+
</View>
|
|
42
|
+
</View>
|
|
43
|
+
|
|
44
|
+
<ScrollView keyboardShouldPersistTaps="handled">
|
|
45
|
+
<Cell
|
|
46
|
+
type="input"
|
|
47
|
+
label="家庭名称"
|
|
48
|
+
value={roomName}
|
|
49
|
+
placeholder="请输入家庭名称"
|
|
50
|
+
onChangeText={text => setRoomName(text)}
|
|
51
|
+
/>
|
|
52
|
+
<Cell
|
|
53
|
+
type="link"
|
|
54
|
+
label="家庭位置"
|
|
55
|
+
value={roomName}
|
|
56
|
+
onRightPress={handleShowAddressPicker}
|
|
57
|
+
/>
|
|
58
|
+
</ScrollView>
|
|
59
|
+
|
|
60
|
+
<View>
|
|
61
|
+
<Button title={submitBtnText} size="lg" onPress={handleSaveRoom} />
|
|
62
|
+
</View>
|
|
63
|
+
</ActionSheet>
|
|
64
|
+
</>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const styles = StyleSheet.create({
|
|
69
|
+
title: {
|
|
70
|
+
position: 'relative',
|
|
71
|
+
height: 50,
|
|
72
|
+
paddingHorizontal: 60,
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
justifyContent: 'center',
|
|
75
|
+
},
|
|
76
|
+
titleText: {
|
|
77
|
+
fontSize: 18,
|
|
78
|
+
color: '#333',
|
|
79
|
+
},
|
|
80
|
+
closeBtn: {
|
|
81
|
+
position: 'absolute',
|
|
82
|
+
height: '100%',
|
|
83
|
+
top: 0,
|
|
84
|
+
right: 0,
|
|
85
|
+
width: 60,
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
justifyContent: 'center',
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
export default RoomActionSheet;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import React, {useState} from 'react';
|
|
2
|
+
import {View, Text, StyleSheet, Alert} from 'react-native';
|
|
3
|
+
import ActionSheet, {
|
|
4
|
+
SheetProps,
|
|
5
|
+
SheetManager,
|
|
6
|
+
} from 'react-native-actions-sheet';
|
|
7
|
+
import {Icon, Button} from '@rneui/themed';
|
|
8
|
+
import {Cell, Picker} from '../../index';
|
|
9
|
+
import {addRoom, adjustRoom} from '../../../api';
|
|
10
|
+
|
|
11
|
+
const roomTypes = [
|
|
12
|
+
{
|
|
13
|
+
name: '公司 会议室',
|
|
14
|
+
value: 'MEETING',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: '公司 办公区',
|
|
18
|
+
value: 'OFFICE',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: '公司 办公室',
|
|
22
|
+
value: 'OFFICEAREA',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: '家庭 客厅',
|
|
26
|
+
value: 'LIVINGROOM',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: '家庭 餐厅',
|
|
30
|
+
value: 'DININGROOM',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: '家庭 主卧',
|
|
34
|
+
value: 'MASTERBEDROOM',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: '家庭 儿童房',
|
|
38
|
+
value: 'KIDSROOM',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: '家庭 客房',
|
|
42
|
+
value: 'GUESTROOM',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: '家庭 书房',
|
|
46
|
+
value: 'STUDYROOM',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: '酒店 客房',
|
|
50
|
+
value: 'HOTELROOM',
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
const roomTypeNames = roomTypes.map(item => item.name);
|
|
55
|
+
|
|
56
|
+
const RoomActionSheet = ({sheetId, payload}) => {
|
|
57
|
+
let title = '添加房间';
|
|
58
|
+
let submitBtnText = '添加';
|
|
59
|
+
|
|
60
|
+
let defaultRoomTypeIndex = 0;
|
|
61
|
+
let defaultRoomType = roomTypes[defaultRoomTypeIndex];
|
|
62
|
+
let defaultRoomName = '';
|
|
63
|
+
|
|
64
|
+
if (payload.type === 'editRoom') {
|
|
65
|
+
title = '编辑房间';
|
|
66
|
+
submitBtnText = '保存';
|
|
67
|
+
const currentRoom = payload.roomData;
|
|
68
|
+
defaultRoomTypeIndex = roomTypes.findIndex(
|
|
69
|
+
item => item.value === currentRoom.room_type,
|
|
70
|
+
);
|
|
71
|
+
if (defaultRoomTypeIndex > -1) {
|
|
72
|
+
defaultRoomType = roomTypes[defaultRoomTypeIndex];
|
|
73
|
+
} else {
|
|
74
|
+
defaultRoomType = {
|
|
75
|
+
name: currentRoom.room_type,
|
|
76
|
+
value: currentRoom.room_type,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
defaultRoomName = currentRoom.room_name;
|
|
80
|
+
} else {
|
|
81
|
+
defaultRoomName = roomTypes[0].name.split(' ')[1];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const [roomTypeIndex, setRoomTypeIndex] = useState(defaultRoomTypeIndex);
|
|
85
|
+
const [roomType, setRoomType] = useState(defaultRoomType);
|
|
86
|
+
const onRightPress = async () => {
|
|
87
|
+
const result = await SheetManager.show('action-picker', {
|
|
88
|
+
context: 'global',
|
|
89
|
+
payload: {
|
|
90
|
+
title: '选择场所类型',
|
|
91
|
+
defaultIndex: roomTypeIndex,
|
|
92
|
+
columns: roomTypes,
|
|
93
|
+
nameProp: 'name',
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
if (result) {
|
|
98
|
+
setRoomTypeIndex(result.index);
|
|
99
|
+
setRoomType(result.data);
|
|
100
|
+
console.log(result.data);
|
|
101
|
+
setRoomName(result.data.name.split(' ')[1]);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const [roomName, setRoomName] = useState(defaultRoomName);
|
|
106
|
+
|
|
107
|
+
const handleSaveRoom = async () => {
|
|
108
|
+
if (!roomName) {
|
|
109
|
+
Alert.alert('请填写房间名称');
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (payload.type === 'addRoom') {
|
|
114
|
+
const result = await addRoom({
|
|
115
|
+
address_id: payload.addressId,
|
|
116
|
+
room_name: roomName,
|
|
117
|
+
room_type: roomType.value,
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
if (result.code === 0) {
|
|
121
|
+
SheetManager.hide(sheetId, {
|
|
122
|
+
payload: true,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
} else if (payload.type === 'editRoom') {
|
|
126
|
+
const result = await adjustRoom({
|
|
127
|
+
room_id: payload.roomData.room_id,
|
|
128
|
+
room_name: roomName,
|
|
129
|
+
room_type: roomType.value,
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
if (result.code === 0) {
|
|
133
|
+
SheetManager.hide(sheetId, {
|
|
134
|
+
payload: true,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<>
|
|
142
|
+
<ActionSheet id={sheetId} isModal={false} useBottomSafeAreaPadding>
|
|
143
|
+
<View style={styles.title}>
|
|
144
|
+
<Text style={styles.titleText}>{title}</Text>
|
|
145
|
+
<View style={styles.closeBtn}>
|
|
146
|
+
<Icon
|
|
147
|
+
name="close"
|
|
148
|
+
type="ionicon"
|
|
149
|
+
size={28}
|
|
150
|
+
color="#999"
|
|
151
|
+
onPress={() => {
|
|
152
|
+
SheetManager.hide(sheetId);
|
|
153
|
+
}}
|
|
154
|
+
/>
|
|
155
|
+
</View>
|
|
156
|
+
</View>
|
|
157
|
+
|
|
158
|
+
{defaultRoomTypeIndex > -1 && (
|
|
159
|
+
<Cell
|
|
160
|
+
type="link"
|
|
161
|
+
label="场所类型"
|
|
162
|
+
value={roomType.name}
|
|
163
|
+
onRightPress={onRightPress}
|
|
164
|
+
/>
|
|
165
|
+
)}
|
|
166
|
+
<Cell
|
|
167
|
+
type="input"
|
|
168
|
+
label="房间名称"
|
|
169
|
+
value={roomName}
|
|
170
|
+
placeholder="请输入房间名称"
|
|
171
|
+
onChangeText={text => setRoomName(text)}
|
|
172
|
+
/>
|
|
173
|
+
|
|
174
|
+
<View>
|
|
175
|
+
<Button title={submitBtnText} size="lg" onPress={handleSaveRoom} />
|
|
176
|
+
</View>
|
|
177
|
+
</ActionSheet>
|
|
178
|
+
</>
|
|
179
|
+
);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const styles = StyleSheet.create({
|
|
183
|
+
title: {
|
|
184
|
+
position: 'relative',
|
|
185
|
+
height: 50,
|
|
186
|
+
paddingHorizontal: 60,
|
|
187
|
+
alignItems: 'center',
|
|
188
|
+
justifyContent: 'center',
|
|
189
|
+
},
|
|
190
|
+
titleText: {
|
|
191
|
+
fontSize: 18,
|
|
192
|
+
color: '#333',
|
|
193
|
+
},
|
|
194
|
+
closeBtn: {
|
|
195
|
+
position: 'absolute',
|
|
196
|
+
height: '100%',
|
|
197
|
+
top: 0,
|
|
198
|
+
right: 0,
|
|
199
|
+
width: 60,
|
|
200
|
+
alignItems: 'center',
|
|
201
|
+
justifyContent: 'center',
|
|
202
|
+
},
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
export default RoomActionSheet;
|