ipanel-rnapp-ajb-base 1.0.21 → 1.0.23
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/App.js +180 -166
- package/app/api/ipanelCloudApi.js +210 -208
- package/app/assets/img/launch_bg_panyu.png +0 -0
- package/app/assets/img/launch_logo_panyu.png +0 -0
- package/app/assets/img/launch_text_panyu.png +0 -0
- package/app/assets/img/login_bg_new.png +0 -0
- package/app/base.js +69 -62
- package/app/components/common/LoginType/protocol.js +66 -44
- package/app/screens/BaseScreen.js +111 -108
- package/app/screens/CommonScreens/DeviceFeedbackScreen/index.js +99 -83
- package/app/screens/LoginScreen/index.js +193 -170
- package/app/screens/LoginScreen/indexNew.js +414 -368
- package/app/screens/RegisteCountScreen/index.js +494 -468
- package/app/screens/SbkScreen.js +149 -7
- package/app/utils/applyPermissions.js +4 -2
- package/app/utils/common.js +94 -93
- package/app/utils/config.js +15 -15
- package/package.json +2 -2
package/app/App.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {useState, useEffect, useMemo} from
|
|
1
|
+
import React, { useState, useEffect, useMemo } from "react";
|
|
2
2
|
import {
|
|
3
3
|
View,
|
|
4
4
|
LogBox,
|
|
@@ -11,63 +11,71 @@ import {
|
|
|
11
11
|
AppState,
|
|
12
12
|
NativeEventEmitter,
|
|
13
13
|
DeviceEventEmitter,
|
|
14
|
-
} from
|
|
15
|
-
import {NavigationContainer} from
|
|
16
|
-
import {createStackNavigator} from
|
|
17
|
-
import {SheetProvider} from
|
|
18
|
-
import DeviceInfo from
|
|
19
|
-
import {SafeAreaProvider, SafeAreaView} from
|
|
20
|
-
import VersionUpdateConfirm from
|
|
14
|
+
} from "react-native";
|
|
15
|
+
import { NavigationContainer } from "@react-navigation/native";
|
|
16
|
+
import { createStackNavigator } from "@react-navigation/stack";
|
|
17
|
+
import { SheetProvider } from "react-native-actions-sheet";
|
|
18
|
+
import DeviceInfo from "react-native-device-info";
|
|
19
|
+
import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context";
|
|
20
|
+
import VersionUpdateConfirm from "./components/VersionUpdateConfirm";
|
|
21
21
|
// import NetInfo from '@react-native-community/netinfo';
|
|
22
|
-
import { Provider } from
|
|
22
|
+
import { Provider } from "@ant-design/react-native";
|
|
23
23
|
|
|
24
24
|
// 重要:base.js需放在一切自定义代码之前初始化
|
|
25
|
-
import
|
|
25
|
+
import "./base.js";
|
|
26
26
|
// 版本升级相关代码
|
|
27
|
-
import
|
|
27
|
+
import "./utils/bundleUpdater";
|
|
28
28
|
// 对接声必可屏幕
|
|
29
|
-
import
|
|
29
|
+
import "./utils/SBK_plugin";
|
|
30
30
|
|
|
31
31
|
// 注册actionSheet组件
|
|
32
|
-
import
|
|
32
|
+
import "./components/sheets.js";
|
|
33
33
|
|
|
34
|
-
import Loading from
|
|
35
|
-
import Toast from
|
|
36
|
-
import Dialog from
|
|
37
|
-
import Notify from
|
|
38
|
-
import SheetManage from
|
|
39
|
-
import storage from
|
|
34
|
+
import Loading from "./components/common/Loading";
|
|
35
|
+
import Toast from "./components/common/Toast";
|
|
36
|
+
import Dialog from "./components/common/Dialog";
|
|
37
|
+
import Notify from "./components/common/Notify";
|
|
38
|
+
import SheetManage from "./components/common/SheetManage";
|
|
39
|
+
import storage from "./storage";
|
|
40
40
|
|
|
41
|
-
import {navigationRef} from
|
|
42
|
-
import checkLogin from
|
|
43
|
-
import {getModuleVersionInfo} from
|
|
44
|
-
import {appReport} from
|
|
41
|
+
import { navigationRef } from "./utils/RootNavigation";
|
|
42
|
+
import checkLogin from "./hooks/checkLogin";
|
|
43
|
+
import { getModuleVersionInfo } from "./api/";
|
|
44
|
+
import { appReport } from "./utils/common";
|
|
45
45
|
|
|
46
46
|
// 基础导航页、登录页
|
|
47
|
-
import BaseScreen from
|
|
48
|
-
import LoginScreen from
|
|
49
|
-
import NewLoginScreen from
|
|
50
|
-
import ResePasswordScreen from
|
|
51
|
-
import SbkScreen from
|
|
47
|
+
import BaseScreen from "./screens/BaseScreen";
|
|
48
|
+
import LoginScreen from "./screens/LoginScreen";
|
|
49
|
+
import NewLoginScreen from "./screens/LoginScreen/indexNew";
|
|
50
|
+
import ResePasswordScreen from "./screens/ResePassword";
|
|
51
|
+
import SbkScreen from "./screens/SbkScreen";
|
|
52
52
|
|
|
53
|
-
import eventBus, {EVENTS} from
|
|
53
|
+
import eventBus, { EVENTS } from "./eventBus";
|
|
54
54
|
|
|
55
|
-
import useDynamicPackages from
|
|
56
|
-
import useAddress from
|
|
57
|
-
import useAddress2 from
|
|
58
|
-
import useNavigationFocus from
|
|
59
|
-
import useLatest from
|
|
60
|
-
import useDebounceFn from
|
|
61
|
-
import useUser from
|
|
62
|
-
import useKeyboard from
|
|
55
|
+
import useDynamicPackages from "./hooks/useDynamicPackages";
|
|
56
|
+
import useAddress from "./hooks/useAddress";
|
|
57
|
+
import useAddress2 from "./hooks/useAddress2";
|
|
58
|
+
import useNavigationFocus from "./hooks/useNavigationFocus";
|
|
59
|
+
import useLatest from "./hooks/useLatest";
|
|
60
|
+
import useDebounceFn from "./hooks/useDebounceFn";
|
|
61
|
+
import useUser from "./hooks/useUser";
|
|
62
|
+
import useKeyboard from "./hooks/useKeyboard";
|
|
63
63
|
|
|
64
|
-
import RegisteCountScreen from
|
|
64
|
+
import RegisteCountScreen from "./screens/RegisteCountScreen";
|
|
65
65
|
|
|
66
66
|
LogBox.ignoreLogs([
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
"ViewPropTypes will be removed",
|
|
68
|
+
"ColorPropType will be removed",
|
|
69
69
|
]);
|
|
70
70
|
|
|
71
|
+
if (DeviceInfo.getBrand() === "Allwinner") {
|
|
72
|
+
NativeModules.Orientation?.lockToLandscapeLeft();
|
|
73
|
+
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
NativeModules.Orientation?.lockToLandscapeLeft();
|
|
76
|
+
}, 5000);
|
|
77
|
+
}
|
|
78
|
+
|
|
71
79
|
// base hooks, 内部可能依赖基础的base函数,因此放在基础base初始化之后
|
|
72
80
|
global.base.hooks = {
|
|
73
81
|
useAddress,
|
|
@@ -80,25 +88,25 @@ global.base.hooks = {
|
|
|
80
88
|
};
|
|
81
89
|
|
|
82
90
|
// 公共页面
|
|
83
|
-
import WebviewScreen from
|
|
84
|
-
import ScanQRCodeScreen from
|
|
85
|
-
import OperatorSelectScreen from
|
|
86
|
-
import EditInvoiceTitleScreen from
|
|
87
|
-
import InvoiceTitleListScreen from
|
|
88
|
-
import TvAlbumScreen from
|
|
89
|
-
import DeviceFeedbackScreen from
|
|
90
|
-
import DeviceAnswerDetailScreen from
|
|
91
|
+
import WebviewScreen from "./screens/WebviewScreen";
|
|
92
|
+
import ScanQRCodeScreen from "./screens/CommonScreens/ScanQRCodeScreen";
|
|
93
|
+
import OperatorSelectScreen from "./screens/CommonScreens/OperatorSelectScreen";
|
|
94
|
+
import EditInvoiceTitleScreen from "./screens/CommonScreens/EditInvoiceTitleScreen";
|
|
95
|
+
import InvoiceTitleListScreen from "./screens/CommonScreens/InvoiceTitleListScreen";
|
|
96
|
+
import TvAlbumScreen from "./screens/CommonScreens/TvAlbumScreen";
|
|
97
|
+
import DeviceFeedbackScreen from "./screens/CommonScreens/DeviceFeedbackScreen";
|
|
98
|
+
import DeviceAnswerDetailScreen from "./screens/CommonScreens/DeviceAnswerDetailScreen";
|
|
91
99
|
|
|
92
100
|
// Boss绑定页面
|
|
93
|
-
import BindBossScreen from
|
|
101
|
+
import BindBossScreen from "./screens/CommonScreens/BossScreen";
|
|
94
102
|
|
|
95
103
|
const Stack = createStackNavigator();
|
|
96
104
|
|
|
97
|
-
const envVersion = NativeModules?.RNToNativeEmitter?.serverCluster ||
|
|
105
|
+
const envVersion = NativeModules?.RNToNativeEmitter?.serverCluster || "alpha";
|
|
98
106
|
// const envVersion = 'release';
|
|
99
107
|
|
|
100
108
|
let eventEmitter;
|
|
101
|
-
if (Platform.OS ===
|
|
109
|
+
if (Platform.OS === "android") {
|
|
102
110
|
// ----yusm:安卓使用DeviceEventEmitter
|
|
103
111
|
eventEmitter = DeviceEventEmitter;
|
|
104
112
|
} else {
|
|
@@ -109,30 +117,30 @@ const CommonScreens = {
|
|
|
109
117
|
Home: {
|
|
110
118
|
component: BaseScreen,
|
|
111
119
|
screenOptions: {
|
|
112
|
-
title:
|
|
120
|
+
title: "首页",
|
|
113
121
|
headerShown: false,
|
|
114
122
|
includeBottom: true,
|
|
115
123
|
},
|
|
116
124
|
},
|
|
117
125
|
Login: {
|
|
118
126
|
component:
|
|
119
|
-
DeviceInfo.getBrand() ===
|
|
127
|
+
DeviceInfo.getBrand() === "Allwinner" ? LoginScreen : NewLoginScreen,
|
|
120
128
|
screenOptions: {
|
|
121
|
-
title:
|
|
129
|
+
title: "登录",
|
|
122
130
|
headerShown: false,
|
|
123
131
|
},
|
|
124
132
|
},
|
|
125
133
|
ResePasswordScreen: {
|
|
126
134
|
component: ResePasswordScreen,
|
|
127
135
|
screenOptions: {
|
|
128
|
-
title:
|
|
136
|
+
title: "重置密码",
|
|
129
137
|
headerShown: false,
|
|
130
138
|
},
|
|
131
139
|
},
|
|
132
140
|
RegisteCountScreen: {
|
|
133
141
|
component: RegisteCountScreen,
|
|
134
142
|
screenOptions: {
|
|
135
|
-
title:
|
|
143
|
+
title: "注册",
|
|
136
144
|
headerShown: false,
|
|
137
145
|
},
|
|
138
146
|
},
|
|
@@ -145,62 +153,62 @@ const CommonScreens = {
|
|
|
145
153
|
OperatorSelectScreen: {
|
|
146
154
|
component: OperatorSelectScreen,
|
|
147
155
|
screenOptions: {
|
|
148
|
-
title:
|
|
156
|
+
title: "选择运营商",
|
|
149
157
|
headerShown: false,
|
|
150
158
|
},
|
|
151
159
|
},
|
|
152
160
|
InvoiceTitleListScreen: {
|
|
153
161
|
component: InvoiceTitleListScreen,
|
|
154
162
|
screenOptions: {
|
|
155
|
-
title:
|
|
163
|
+
title: "发票抬头",
|
|
156
164
|
headerShown: false,
|
|
157
165
|
},
|
|
158
166
|
},
|
|
159
167
|
EditInvoiceTitleScreen: {
|
|
160
168
|
component: EditInvoiceTitleScreen,
|
|
161
169
|
screenOptions: {
|
|
162
|
-
title:
|
|
170
|
+
title: "编辑发票抬头",
|
|
163
171
|
headerShown: false,
|
|
164
172
|
},
|
|
165
173
|
},
|
|
166
174
|
WebviewScreen: {
|
|
167
175
|
component: WebviewScreen,
|
|
168
176
|
screenOptions: {
|
|
169
|
-
title:
|
|
177
|
+
title: "",
|
|
170
178
|
headerShown: false,
|
|
171
179
|
},
|
|
172
180
|
},
|
|
173
181
|
TvAlbumScreen: {
|
|
174
182
|
component: TvAlbumScreen,
|
|
175
183
|
screenOptions: {
|
|
176
|
-
title:
|
|
184
|
+
title: "电视相册",
|
|
177
185
|
},
|
|
178
186
|
},
|
|
179
187
|
DeviceFeedbackScreen: {
|
|
180
188
|
component: DeviceFeedbackScreen,
|
|
181
189
|
screenOptions: {
|
|
182
|
-
title:
|
|
190
|
+
title: "帮助与反馈",
|
|
183
191
|
headerShown: false,
|
|
184
192
|
},
|
|
185
193
|
},
|
|
186
194
|
DeviceAnswerDetailScreen: {
|
|
187
195
|
component: DeviceAnswerDetailScreen,
|
|
188
196
|
screenOptions: {
|
|
189
|
-
title:
|
|
197
|
+
title: "解答",
|
|
190
198
|
headerShown: false,
|
|
191
199
|
},
|
|
192
200
|
},
|
|
193
201
|
SbkScreen: {
|
|
194
202
|
component: SbkScreen,
|
|
195
203
|
screenOptions: {
|
|
196
|
-
title:
|
|
204
|
+
title: "爱家宝",
|
|
197
205
|
headerShown: false,
|
|
198
206
|
},
|
|
199
207
|
},
|
|
200
208
|
BindBossScreen: {
|
|
201
209
|
component: BindBossScreen,
|
|
202
210
|
screenOptions: {
|
|
203
|
-
title:
|
|
211
|
+
title: "绑定boss账号",
|
|
204
212
|
headerShown: false,
|
|
205
213
|
},
|
|
206
214
|
},
|
|
@@ -208,7 +216,7 @@ const CommonScreens = {
|
|
|
208
216
|
|
|
209
217
|
// screen分组
|
|
210
218
|
function StackScreenGroup(screens) {
|
|
211
|
-
return Object.entries(screens).map(([name, {component, screenOptions}]) => (
|
|
219
|
+
return Object.entries(screens).map(([name, { component, screenOptions }]) => (
|
|
212
220
|
<Stack.Screen
|
|
213
221
|
name={name}
|
|
214
222
|
component={component}
|
|
@@ -221,24 +229,24 @@ function StackScreenGroup(screens) {
|
|
|
221
229
|
// 兜底的底部导航模块
|
|
222
230
|
const initialNavigationPackages = [
|
|
223
231
|
{
|
|
224
|
-
bundleName:
|
|
232
|
+
bundleName: "index.ios.bundle",
|
|
225
233
|
isMain: 1,
|
|
226
|
-
md5:
|
|
227
|
-
moduleName:
|
|
228
|
-
modulePublishDesc:
|
|
229
|
-
upgradeMode:
|
|
230
|
-
url:
|
|
231
|
-
version:
|
|
234
|
+
md5: "7284896d821f9e206efc979590561e18",
|
|
235
|
+
moduleName: "tvShare",
|
|
236
|
+
modulePublishDesc: "电视分享ios",
|
|
237
|
+
upgradeMode: "force",
|
|
238
|
+
url: "https://dev.ipanelcloud2.ipanel.cn:50443/jshomeapp/appFiles/packFiles/ipanel/ios/tvShare/v1.0.2/20230601120633/ipanel_ios_tvShare_v1.0.2_20230601120633.zip",
|
|
239
|
+
version: "v1.0.2",
|
|
232
240
|
},
|
|
233
241
|
{
|
|
234
|
-
bundleName:
|
|
242
|
+
bundleName: "index.ios.bundle",
|
|
235
243
|
isMain: 1,
|
|
236
|
-
md5:
|
|
237
|
-
moduleName:
|
|
238
|
-
modulePublishDesc:
|
|
239
|
-
upgradeMode:
|
|
240
|
-
url:
|
|
241
|
-
version:
|
|
244
|
+
md5: "0fd7a6212a7b70baa54ce2a9cc99698b",
|
|
245
|
+
moduleName: "smartHome",
|
|
246
|
+
modulePublishDesc: "智能家居ios",
|
|
247
|
+
upgradeMode: "force",
|
|
248
|
+
url: "https://dev.ipanelcloud2.ipanel.cn:50443/jshomeapp/appFiles/packFiles/ipanel/ios/smartHome/v1.0.2/20230601120752/ipanel_ios_smartHome_v1.0.2_20230601120752.zip",
|
|
249
|
+
version: "v1.0.2",
|
|
242
250
|
},
|
|
243
251
|
// {
|
|
244
252
|
// bundleName: 'index.ios.bundle',
|
|
@@ -266,7 +274,7 @@ global.base.initialNavigationPackages = initialNavigationPackages;
|
|
|
266
274
|
// updateNavigationPackagesFromStorage(1);
|
|
267
275
|
|
|
268
276
|
const App = () => {
|
|
269
|
-
const {DynamicStackScreens} = useDynamicPackages();
|
|
277
|
+
const { DynamicStackScreens } = useDynamicPackages();
|
|
270
278
|
// 当前页面是否需要包括底部安全区
|
|
271
279
|
const [includeBottom, setIncludeBottom] = useState(false);
|
|
272
280
|
const [versionUpdateConfirmVisible, setVersionUpdateConfirmVisible] =
|
|
@@ -287,16 +295,16 @@ const App = () => {
|
|
|
287
295
|
|
|
288
296
|
// mounted
|
|
289
297
|
useEffect(() => {
|
|
290
|
-
StatusBar.setBackgroundColor(
|
|
291
|
-
StatusBar.setBarStyle(
|
|
292
|
-
storage.get(
|
|
293
|
-
global.base.accountType = res ||
|
|
298
|
+
StatusBar.setBackgroundColor("transparent");
|
|
299
|
+
StatusBar.setBarStyle("dark-content");
|
|
300
|
+
storage.get("accountType").then((res) => {
|
|
301
|
+
global.base.accountType = res || "ajb";
|
|
294
302
|
});
|
|
295
303
|
|
|
296
304
|
const rnToNative = NativeModules.RNToNativeEmitter;
|
|
297
305
|
// 应用通知app可正常显示,页面正常运行了,在componentDidMount 中加
|
|
298
306
|
rnToNative?.notifyApplicationReady({
|
|
299
|
-
moduleName:
|
|
307
|
+
moduleName: "base",
|
|
300
308
|
}); // 不用传参数
|
|
301
309
|
|
|
302
310
|
// 首次进入app登录鉴权
|
|
@@ -305,35 +313,35 @@ const App = () => {
|
|
|
305
313
|
// 获取最新版本并通知原生平台,由平台判断后弹出升级确认提示
|
|
306
314
|
checkBaseVersion();
|
|
307
315
|
|
|
308
|
-
AppState.addEventListener(
|
|
309
|
-
console.log(
|
|
310
|
-
if (nextAppState ===
|
|
311
|
-
appReport(
|
|
316
|
+
AppState.addEventListener("change", async (nextAppState) => {
|
|
317
|
+
console.log("nextAppState", nextAppState);
|
|
318
|
+
if (nextAppState === "active") {
|
|
319
|
+
appReport("APP_STARTUP");
|
|
312
320
|
}
|
|
313
321
|
});
|
|
314
322
|
|
|
315
323
|
const keyboardDidShowListener = Keyboard.addListener(
|
|
316
|
-
|
|
324
|
+
"keyboardDidShow",
|
|
317
325
|
() => {
|
|
318
326
|
setIsKeyboardVisible(true);
|
|
319
|
-
}
|
|
327
|
+
}
|
|
320
328
|
);
|
|
321
329
|
|
|
322
330
|
const keyboardDidHideListener = Keyboard.addListener(
|
|
323
|
-
|
|
331
|
+
"keyboardDidHide",
|
|
324
332
|
() => {
|
|
325
333
|
setIsKeyboardVisible(false);
|
|
326
|
-
}
|
|
334
|
+
}
|
|
327
335
|
);
|
|
328
336
|
|
|
329
337
|
const cellularDataStateListener = eventEmitter.addListener(
|
|
330
|
-
|
|
331
|
-
data => {
|
|
332
|
-
console.log(JSON.stringify(data),
|
|
338
|
+
"CellularDataState",
|
|
339
|
+
(data) => {
|
|
340
|
+
console.log(JSON.stringify(data), "CellularDataState");
|
|
333
341
|
if (data?.state && data?.state !== 0) {
|
|
334
342
|
checkBaseVersion();
|
|
335
343
|
}
|
|
336
|
-
}
|
|
344
|
+
}
|
|
337
345
|
);
|
|
338
346
|
|
|
339
347
|
return () => {
|
|
@@ -352,23 +360,23 @@ const App = () => {
|
|
|
352
360
|
|
|
353
361
|
const checkBaseVersion = async () => {
|
|
354
362
|
// 当前版本
|
|
355
|
-
const baseVersionInfo = await global.base.getBundleInfo(
|
|
363
|
+
const baseVersionInfo = await global.base.getBundleInfo("base");
|
|
356
364
|
if (!baseVersionInfo) {
|
|
357
365
|
return false;
|
|
358
366
|
}
|
|
359
367
|
try {
|
|
360
368
|
const res = await getModuleVersionInfo({
|
|
361
369
|
platform: Platform.OS,
|
|
362
|
-
operatorId:
|
|
363
|
-
moduleName:
|
|
370
|
+
operatorId: "ipanel",
|
|
371
|
+
moduleName: "base",
|
|
364
372
|
});
|
|
365
373
|
if (res.code === 0) {
|
|
366
374
|
const versionInfo = res.data.packages[0];
|
|
367
375
|
const newVersion = Number(
|
|
368
|
-
versionInfo.version.slice(1).replace(/\./g,
|
|
376
|
+
versionInfo.version.slice(1).replace(/\./g, "")
|
|
369
377
|
);
|
|
370
378
|
const currentVersion = Number(
|
|
371
|
-
baseVersionInfo.version.slice(1).replace(/\./g,
|
|
379
|
+
baseVersionInfo.version.slice(1).replace(/\./g, "")
|
|
372
380
|
);
|
|
373
381
|
if (newVersion > currentVersion) {
|
|
374
382
|
setVersionUpdateConfirmVisible(true);
|
|
@@ -382,21 +390,24 @@ const App = () => {
|
|
|
382
390
|
global.base.checkBaseVersion = checkBaseVersion;
|
|
383
391
|
|
|
384
392
|
// 升级测试
|
|
385
|
-
const onUpdate = versionInfo => {
|
|
393
|
+
const onUpdate = (versionInfo) => {
|
|
386
394
|
const rnToNative = NativeModules.RNToNativeEmitter;
|
|
387
395
|
rnToNative?.selectedInfo({
|
|
388
396
|
packages: [versionInfo],
|
|
389
|
-
operatorId:
|
|
397
|
+
operatorId: "ipanel",
|
|
390
398
|
});
|
|
391
399
|
};
|
|
392
400
|
|
|
393
|
-
const handleStateChange = ({routes}) => {
|
|
401
|
+
const handleStateChange = ({ routes }) => {
|
|
394
402
|
const routeName = routes[routes.length - 1].name;
|
|
395
403
|
setIncludeBottom(
|
|
396
|
-
allStackScreens[routeName]?.screenOptions?.includeBottom || false
|
|
404
|
+
allStackScreens[routeName]?.screenOptions?.includeBottom || false
|
|
397
405
|
);
|
|
398
406
|
/* 加载之后每次navigate都鉴权一把登录状态(重置密码不需要检测) */
|
|
399
|
-
if (
|
|
407
|
+
if (
|
|
408
|
+
routeName !== "ResePasswordScreen" &&
|
|
409
|
+
routeName !== "RegisteCountScreen"
|
|
410
|
+
) {
|
|
400
411
|
checkLogin();
|
|
401
412
|
}
|
|
402
413
|
|
|
@@ -407,71 +418,74 @@ const App = () => {
|
|
|
407
418
|
const renderContent = () => {
|
|
408
419
|
return (
|
|
409
420
|
<>
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
<
|
|
453
|
-
|
|
454
|
-
<
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
421
|
+
<Provider>
|
|
422
|
+
<SheetProvider>
|
|
423
|
+
<NavigationContainer
|
|
424
|
+
ref={navigationRef}
|
|
425
|
+
onStateChange={handleStateChange}
|
|
426
|
+
>
|
|
427
|
+
<Stack.Navigator
|
|
428
|
+
initialRouteName={"Login"}
|
|
429
|
+
screenOptions={{
|
|
430
|
+
headerStyle: {},
|
|
431
|
+
}}
|
|
432
|
+
>
|
|
433
|
+
{/* 首页 */}
|
|
434
|
+
{/*<Stack.Screen*/}
|
|
435
|
+
{/* name="Home"*/}
|
|
436
|
+
{/* component={BaseScreen}*/}
|
|
437
|
+
{/* options={{*/}
|
|
438
|
+
{/* title: '首页',*/}
|
|
439
|
+
{/* headerShown: false,*/}
|
|
440
|
+
{/* }}*/}
|
|
441
|
+
{/*/>*/}
|
|
442
|
+
{/* 登录页 */}
|
|
443
|
+
{/*<Stack.Screen*/}
|
|
444
|
+
{/* name="Login"*/}
|
|
445
|
+
{/* component={LoginScreen}*/}
|
|
446
|
+
{/* options={{*/}
|
|
447
|
+
{/* title: '登录',*/}
|
|
448
|
+
{/* headerShown: false,*/}
|
|
449
|
+
{/* }}*/}
|
|
450
|
+
{/*/>*/}
|
|
451
|
+
|
|
452
|
+
{/* 公共页面 */}
|
|
453
|
+
{StackScreenGroup(CommonScreens)}
|
|
454
|
+
|
|
455
|
+
{/* 动态注册的页面 */}
|
|
456
|
+
{StackScreenGroup(DynamicStackScreens)}
|
|
457
|
+
</Stack.Navigator>
|
|
458
|
+
</NavigationContainer>
|
|
459
|
+
</SheetProvider>
|
|
460
|
+
|
|
461
|
+
<Loading onRef={(ref) => (global.loading = ref)} />
|
|
462
|
+
<Toast onRef={(ref) => (global.toast = ref)} />
|
|
463
|
+
<Notify onRef={(ref) => (global.notify = ref)} />
|
|
464
|
+
<Dialog onRef={(ref) => (global.dialog = ref)} />
|
|
465
|
+
<SheetManage onRef={(ref) => (global.sheetManager = ref)} />
|
|
466
|
+
{versionUpdateConfirmVisible && (
|
|
467
|
+
<VersionUpdateConfirm
|
|
468
|
+
onVisibleChange={setVersionUpdateConfirmVisible}
|
|
469
|
+
latestVersion={latestBaseVersion}
|
|
470
|
+
onUpdate={onUpdate}
|
|
471
|
+
/>
|
|
472
|
+
)}
|
|
473
|
+
{isKeyboardVisible && Platform.OS === "ios" && (
|
|
474
|
+
<TouchableWithoutFeedback onPress={handleTouchOutside}>
|
|
475
|
+
<View style={styles.touchableContainer} />
|
|
476
|
+
</TouchableWithoutFeedback>
|
|
477
|
+
)}
|
|
465
478
|
</Provider>
|
|
466
479
|
</>
|
|
467
480
|
);
|
|
468
481
|
};
|
|
469
482
|
|
|
470
|
-
return Platform.OS ===
|
|
483
|
+
return Platform.OS === "ios" ? (
|
|
471
484
|
<SafeAreaProvider>
|
|
472
485
|
<SafeAreaView
|
|
473
|
-
style={{flex: 1}}
|
|
474
|
-
edges={includeBottom ? [
|
|
486
|
+
style={{ flex: 1 }}
|
|
487
|
+
edges={includeBottom ? ["right", "left"] : ["right", "bottom", "left"]}
|
|
488
|
+
>
|
|
475
489
|
{renderContent()}
|
|
476
490
|
</SafeAreaView>
|
|
477
491
|
</SafeAreaProvider>
|