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,421 @@
1
+ import React, {useState, useEffect, useMemo} from 'react';
2
+ import {
3
+ View,
4
+ Text,
5
+ StyleSheet,
6
+ Alert,
7
+ ScrollView,
8
+ TouchableOpacity,
9
+ Image,
10
+ } from 'react-native';
11
+ import {Icon, Divider} from '@rneui/themed';
12
+
13
+ const {Cell, ScreenBackHeader} = global.base.commonComponents;
14
+
15
+ import {
16
+ adjustAddress,
17
+ getUserInfo,
18
+ getAddressUser,
19
+ ACCOUNT_SERVICE,
20
+ delAddress,
21
+ } from '../../../api/';
22
+
23
+ const px = global.base.scaleSize;
24
+ const storage = global.base.storage;
25
+ const fontStyle = global.base.styles.fontStyle;
26
+
27
+ const {useNavigationFocus, useUser, useAddress} = global.base.hooks;
28
+ const {confirmWithContent} = global.base.notice;
29
+
30
+ const ROLE_MAP = {
31
+ 0: '无权限',
32
+ 1: '普通用户',
33
+ 7: '管理员权限',
34
+ 15: '创建者',
35
+ 31: '超级用户',
36
+ };
37
+
38
+ const FROM_MAP = {
39
+ reg_wx: '微信注册',
40
+ reg_phone: '手机号注册',
41
+ reg_name: '用户名注册',
42
+ reg_homed: 'homed账号注册',
43
+ inv_tv: 'tv二维码',
44
+ inv_qrcode: 'App二维码',
45
+ inv_smscode: '短信',
46
+ inv_link: '分享链接',
47
+ self_add: '主动创建',
48
+ };
49
+
50
+ const FamilyDetailScreen = ({navigation, route}) => {
51
+ // const deviceNum = route.params.deviceNum;
52
+ const {addressList, updateAddrFromStorage, updateAddrFromNetwork} =
53
+ useAddress();
54
+ const currentAddr = useMemo(() => {
55
+ return (
56
+ addressList.find(addr => addr.address_id === route.params.address_id) ||
57
+ {}
58
+ );
59
+ }, [addressList]);
60
+ // const roomList = addr.room_list || [];
61
+ // let deviceNum = 0;
62
+ // roomList.forEach(room => {
63
+ // deviceNum += (room.device_list || []).length;
64
+ // });
65
+ const deviceNum = useMemo(() => {
66
+ const roomList = currentAddr.room_list || [];
67
+ let count = 0;
68
+ roomList.forEach(room => {
69
+ count += (room.device_list || []).length;
70
+ });
71
+ return count;
72
+ }, [currentAddr]);
73
+ const [showOperation, setShowOperation] = useState(false);
74
+ const {memberList, isCreator, refresh, currentUser, isAdministrator} =
75
+ useUser(route.params.address_id);
76
+
77
+ useEffect(() => {
78
+ const unsubscribe = navigation.addListener('focus', async function (data) {
79
+ try {
80
+ // 从本地存储中更新数据到当前内存
81
+ updateAddrFromStorage();
82
+ } catch (e) {
83
+ console.log(e);
84
+ }
85
+ });
86
+
87
+ return unsubscribe;
88
+ }, [navigation]);
89
+
90
+ useNavigationFocus(() => {
91
+ refresh();
92
+ }, []);
93
+
94
+ const headerRight = () => {
95
+ return (
96
+ <TouchableOpacity
97
+ onPress={() => {
98
+ setShowOperation(true);
99
+ }}
100
+ style={{
101
+ justifyContent: 'center',
102
+ paddingLeft: px(20),
103
+ height: '100%',
104
+ }}>
105
+ <Icon
106
+ name="ellipsis-horizontal"
107
+ type="ionicon"
108
+ size={30}
109
+ color="#000"
110
+ />
111
+ </TouchableOpacity>
112
+ );
113
+ };
114
+
115
+ const handleAddrNamePress = () => {
116
+ global.dialog.prompt({
117
+ title: '修改家庭名称',
118
+ input: currentAddr.address_name,
119
+ confirmButtonText: '确定',
120
+ confirmCallback: async val => {
121
+ if (val.trim() === '') {
122
+ global.toast.showToast('家庭名称不能为空');
123
+ return;
124
+ }
125
+
126
+ const result = await adjustAddress({
127
+ address_id: currentAddr.address_id,
128
+ address_name: val,
129
+ });
130
+ if (result.code === 0) {
131
+ global.toast.showToast('保存成功');
132
+ await updateAddrFromNetwork();
133
+ }
134
+ },
135
+ cancelButtonText: '取消',
136
+ cancelCallback: () => {},
137
+ });
138
+ };
139
+ const handleAddrDetailPress = () => {
140
+ navigation.navigate('SelectAddressToCreateFamilyScreen', {
141
+ address_id: currentAddr.address_id,
142
+ address_name: currentAddr.address_name,
143
+ address_detail: currentAddr.address_detail,
144
+ });
145
+ };
146
+ const handleGoRoomManageScreen = () => {
147
+ navigation.navigate('RoomManageScreen', {
148
+ address_id: currentAddr.address_id,
149
+ });
150
+ };
151
+ const handleAddMember = () => {
152
+ Alert.alert('添加新成员(待开发)');
153
+ };
154
+
155
+ // 跳转更多
156
+ const handleFamilyMoreScreen = () => {
157
+ navigation.navigate('FamilyMoreScreen');
158
+ };
159
+
160
+ const handleDeleteFamily = () => {
161
+ setShowOperation(false);
162
+ // return;
163
+ if (deviceNum > 0 && isCreator) {
164
+ global.toast.showToast('无法删除家庭,请将所有设备移除后再操作!');
165
+ return;
166
+ }
167
+ confirmWithContent({
168
+ title: '确定删除家庭?',
169
+ component: isCreator
170
+ ? '家庭下所有数据将被删除'
171
+ : '删除家庭后,您将从这个家庭退出,并无法查看和控制这个家庭下的设备',
172
+ confirmButtonText: '确定',
173
+ confirmCallback: async () => {
174
+ global.loading.showLoading('请稍候');
175
+ const result = await delAddress({
176
+ address_id: currentAddr.address_id,
177
+ });
178
+ if (result.code === 0) {
179
+ await updateAddrFromNetwork();
180
+ global.loading.hideLoading();
181
+ global.toast.showToast('删除家庭成功');
182
+ navigation.goBack();
183
+ } else {
184
+ global.loading.hideLoading();
185
+ global.toast.showToast('删除家庭失败');
186
+ }
187
+ },
188
+ cancelButtonText: '取消',
189
+ cancelCallback: () => {},
190
+ });
191
+ };
192
+
193
+ //
194
+ const goMemberDetail = user => {
195
+ // 是否有修改权限
196
+ let hasPermission = false;
197
+ /*
198
+ 1. 自己本身
199
+ 2. 创建者
200
+ 3. 当前用户是管理员,修改普通成员
201
+ */
202
+ if (user.user_id === currentUser.user_id) {
203
+ hasPermission = true;
204
+ }
205
+ if (isCreator) {
206
+ hasPermission = true;
207
+ }
208
+ if (isAdministrator && user.role === 1) {
209
+ hasPermission = true;
210
+ }
211
+ navigation.navigate('MemberDetailScreen', {
212
+ userInfo: user,
213
+ address_id: currentAddr.address_id,
214
+ editable: hasPermission,
215
+ editPermissionAble: hasPermission && (isCreator || isAdministrator),
216
+ });
217
+ };
218
+
219
+ return (
220
+ <View style={styles.container}>
221
+ <ScreenBackHeader title="家庭主页" headerRight={headerRight} />
222
+ <Divider color="#eee" />
223
+
224
+ <View style={styles.familyDetail}>
225
+ <Cell
226
+ style={{
227
+ minHeight: px(151),
228
+ }}
229
+ type="link"
230
+ label="家庭名称"
231
+ value={currentAddr.address_name}
232
+ onRightPress={handleAddrNamePress}
233
+ />
234
+ <Cell
235
+ style={{
236
+ minHeight: px(151),
237
+ }}
238
+ type="link"
239
+ label="家庭位置"
240
+ value={currentAddr.address_detail}
241
+ onRightPress={handleAddrDetailPress}
242
+ />
243
+ <Cell
244
+ style={{
245
+ minHeight: px(151),
246
+ }}
247
+ type="link"
248
+ label="房间与设备"
249
+ onRightPress={handleGoRoomManageScreen}
250
+ />
251
+ <Cell
252
+ style={{
253
+ minHeight: px(151),
254
+ }}
255
+ type="link"
256
+ label="更多"
257
+ onRightPress={handleFamilyMoreScreen}
258
+ />
259
+ </View>
260
+
261
+ <View style={styles.familyMemberTitle}>
262
+ <Text style={styles.familyMemberTitleText}>
263
+ 家庭成员({memberList.length})
264
+ </Text>
265
+ <TouchableOpacity
266
+ style={styles.addMember}
267
+ onPress={() =>
268
+ navigation.navigate('InviteMemberScreen', {
269
+ address_id: currentAddr.address_id,
270
+ })
271
+ }>
272
+ <Icon
273
+ name="add-outline"
274
+ type="ionicon"
275
+ size={px(50)}
276
+ color="#ea6000"
277
+ />
278
+ <Text style={styles.addMemberText}>添加成员</Text>
279
+ </TouchableOpacity>
280
+ </View>
281
+ <View style={styles.memberList}>
282
+ <ScrollView showsVerticalScrollIndicator={false}>
283
+ {memberList.map((item, index) => (
284
+ <Cell
285
+ style={{
286
+ height: px(198),
287
+ }}
288
+ type="link"
289
+ key={index}
290
+ leftComponent={
291
+ <View style={styles.memberLeft}>
292
+ {/*<Icon name="person-outline" type="ionicon" size={px(99)} />*/}
293
+ <Image
294
+ source={
295
+ item.icon_url
296
+ ? {
297
+ uri: `${ACCOUNT_SERVICE}/icon?file=${
298
+ item.icon_url
299
+ }&time=${new Date().getTime()}`,
300
+ }
301
+ : require('../../../assets/img/personal2.png')
302
+ }
303
+ style={{
304
+ width: px(99),
305
+ height: px(99),
306
+ borderRadius: 50,
307
+ }}
308
+ />
309
+ <Text style={styles.memberName}>{item.nick_name}</Text>
310
+ </View>
311
+ }
312
+ value={ROLE_MAP[item.role] || item.role}
313
+ onRightPress={() => goMemberDetail(item)}
314
+ />
315
+ ))}
316
+ </ScrollView>
317
+ </View>
318
+ {showOperation && (
319
+ <TouchableOpacity
320
+ style={styles.mask}
321
+ activeOpacity={1}
322
+ onPress={() => setShowOperation(false)}>
323
+ <View style={styles.operation}>
324
+ <TouchableOpacity
325
+ style={styles.operationItem}
326
+ onPress={() => {
327
+ navigation.navigate('InviteMemberScreen', {
328
+ address_id: currentAddr.address_id,
329
+ });
330
+ setShowOperation(false);
331
+ }}>
332
+ <Text style={styles.operationItemText}>添加成员</Text>
333
+ </TouchableOpacity>
334
+ <Divider color="#eee" width={1} />
335
+ <TouchableOpacity
336
+ style={styles.operationItem}
337
+ onPress={handleDeleteFamily}>
338
+ <Text style={styles.operationItemText}>删除家庭</Text>
339
+ </TouchableOpacity>
340
+ </View>
341
+ </TouchableOpacity>
342
+ )}
343
+ </View>
344
+ );
345
+ };
346
+
347
+ const styles = StyleSheet.create({
348
+ container: {
349
+ flex: 1,
350
+ backgroundColor: 'rgba(238, 238, 238, 1)',
351
+ position: 'relative',
352
+ },
353
+ familyDetail: {
354
+ backgroundColor: '#fff',
355
+ },
356
+ familyMemberTitle: {
357
+ height: px(99),
358
+ flexDirection: 'row',
359
+ alignItems: 'center',
360
+ justifyContent: 'space-between',
361
+ paddingHorizontal: px(38),
362
+ },
363
+ addMember: {
364
+ flexDirection: 'row',
365
+ alignItems: 'center',
366
+ },
367
+ addMemberText: {
368
+ fontWeight: '400',
369
+ color: '#ea6000',
370
+ fontSize: px(38),
371
+ },
372
+ familyMemberTitleText: {
373
+ color: '#333',
374
+ fontSize: px(38),
375
+ fontWeight: '400',
376
+ },
377
+ memberList: {
378
+ flex: 1,
379
+ backgroundColor: '#fff',
380
+ },
381
+ memberLeft: {
382
+ flexDirection: 'row',
383
+ alignItems: 'center',
384
+ height: '100%',
385
+ paddingLeft: px(38),
386
+ },
387
+ memberName: {
388
+ marginLeft: px(19),
389
+ color: '#333',
390
+ fontSize: px(44),
391
+ fontWeight: 'bold',
392
+ },
393
+ memberAvatar: {},
394
+
395
+ mask: {
396
+ position: 'absolute',
397
+ top: 0,
398
+ bottom: 0,
399
+ left: 0,
400
+ right: 0,
401
+ },
402
+ operation: {
403
+ width: px(363),
404
+ position: 'absolute',
405
+ top: px(200),
406
+ right: px(38),
407
+ backgroundColor: '#fff',
408
+ borderRadius: px(22),
409
+ borderWidth: 1,
410
+ borderColor: '#eee',
411
+ },
412
+ operationItem: {
413
+ paddingVertical: px(40),
414
+ },
415
+ operationItemText: {
416
+ ...fontStyle(49),
417
+ textAlign: 'center',
418
+ },
419
+ });
420
+
421
+ export default FamilyDetailScreen;
@@ -0,0 +1,118 @@
1
+ import React, {useState} from 'react';
2
+ import {
3
+ View,
4
+ Text,
5
+ StyleSheet,
6
+ TouchableOpacity,
7
+ ScrollView,
8
+ Image,
9
+ } from 'react-native';
10
+ import {Divider} from '@rneui/themed';
11
+ import {getInvoiceTitle} from '../../../api';
12
+ import useNavigationFocus from '../../../hooks/useNavigationFocus';
13
+
14
+ const {commonComponents, scaleSize: px, hooks} = global.base;
15
+ const fontStyle = global.base.styles.fontStyle;
16
+ // const useNavigationFocus = hooks;
17
+
18
+ const {ScreenBackHeader, Cell} = commonComponents;
19
+
20
+ export default ({navigation, route}) => {
21
+ const [invoiceTitleList, setInvoiceTitleList] = useState([]);
22
+ const jumpPage = route.params?.jumpPage; // 商城跳转
23
+ useNavigationFocus(() => {
24
+ getInvoiceTitle().then(res => {
25
+ if (res.code === 0) {
26
+ setInvoiceTitleList(res.result || []);
27
+ }
28
+ });
29
+ }, []);
30
+
31
+ const headerRight = () => {
32
+ return (
33
+ <TouchableOpacity
34
+ onPress={() => {
35
+ navigation.navigate('EditInvoiceTitleScreen');
36
+ }}>
37
+ <Image
38
+ source={require('../../../assets/img/add.png')}
39
+ style={{
40
+ width: px(58),
41
+ height: px(58),
42
+ }}
43
+ />
44
+ </TouchableOpacity>
45
+ );
46
+ };
47
+
48
+ const selectInvoice = item => {
49
+ if (jumpPage) {
50
+ navigation.navigate({
51
+ name: jumpPage,
52
+ params: {
53
+ invoice: item,
54
+ },
55
+ merge: true,
56
+ });
57
+ } else {
58
+ navigation.navigate('EditInvoiceTitleScreen', {
59
+ usage: 1,
60
+ invoiceTitle: item,
61
+ });
62
+ }
63
+ };
64
+
65
+ return (
66
+ <View style={styles.container}>
67
+ <ScreenBackHeader title="发票抬头" headerRight={headerRight} />
68
+ <Divider color="#eee" />
69
+ <View style={styles.content}>
70
+ <ScrollView showsVerticalScrollIndicator={false}>
71
+ {invoiceTitleList.map(item => (
72
+ <Cell
73
+ style={{
74
+ minHeight: px(230),
75
+ }}
76
+ key={item.title_id}
77
+ leftComponent={
78
+ <View
79
+ style={{
80
+ paddingLeft: px(38),
81
+ }}>
82
+ <Text style={styles.titleName}>{item.name}</Text>
83
+ <Text style={styles.titleType}>
84
+ {item.type === '01' ? '单位' : '个人'}
85
+ </Text>
86
+ </View>
87
+ }
88
+ type="link"
89
+ onRightPress={() => {
90
+ selectInvoice(item);
91
+ }}
92
+ />
93
+ ))}
94
+ </ScrollView>
95
+ </View>
96
+ </View>
97
+ );
98
+ };
99
+
100
+ const styles = StyleSheet.create({
101
+ container: {
102
+ flex: 1,
103
+ backgroundColor: '#fff',
104
+ },
105
+ content: {
106
+ flex: 1,
107
+ },
108
+ titleName: {
109
+ ...fontStyle(49, '#333', '500'),
110
+ marginBottom: px(22),
111
+ marginTop: px(44),
112
+ // marginRight: px(22),
113
+ maxWidth: px(900),
114
+ },
115
+ titleType: {
116
+ ...fontStyle(38, '#666'),
117
+ },
118
+ });