ipanel-rnapp-ajb-base 1.0.26 → 1.0.28
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 +132 -122
- package/app/api/homedApi.js +23 -13
- package/app/api/ipanelCloudApi.js +32 -1
- package/app/assets/img/empty-image-search.png +0 -0
- package/app/assets/img/home_bg.png +0 -0
- package/app/assets/img/refresh.png +0 -0
- package/app/screens/CommonScreens/HomedLoginScreen/index.js +208 -0
- package/app/screens/CommonScreens/ScanQRCodeScreen/index.js +91 -78
- package/app/screens/LoginScreen/GraphSmscode.js +185 -0
- package/app/screens/LoginScreen/indexNew.js +89 -43
- package/app/screens/RegisteCountScreen/index.js +4 -2
- package/app/utils/SBK_plugin/eventProcess.js +79 -73
- package/app/utils/common.js +26 -23
- package/app/utils/config.js +3 -0
- 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,64 +11,64 @@ 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() ===
|
|
71
|
+
if (DeviceInfo.getBrand() === "Allwinner") {
|
|
72
72
|
NativeModules.Orientation?.lockToLandscapeLeft();
|
|
73
73
|
|
|
74
74
|
setTimeout(() => {
|
|
@@ -88,25 +88,26 @@ global.base.hooks = {
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
// 公共页面
|
|
91
|
-
import WebviewScreen from
|
|
92
|
-
import
|
|
93
|
-
import
|
|
94
|
-
import
|
|
95
|
-
import
|
|
96
|
-
import
|
|
97
|
-
import
|
|
98
|
-
import
|
|
91
|
+
import WebviewScreen from "./screens/WebviewScreen";
|
|
92
|
+
import HomedLoginScreen from "./screens/CommonScreens/HomedLoginScreen";
|
|
93
|
+
import ScanQRCodeScreen from "./screens/CommonScreens/ScanQRCodeScreen";
|
|
94
|
+
import OperatorSelectScreen from "./screens/CommonScreens/OperatorSelectScreen";
|
|
95
|
+
import EditInvoiceTitleScreen from "./screens/CommonScreens/EditInvoiceTitleScreen";
|
|
96
|
+
import InvoiceTitleListScreen from "./screens/CommonScreens/InvoiceTitleListScreen";
|
|
97
|
+
import TvAlbumScreen from "./screens/CommonScreens/TvAlbumScreen";
|
|
98
|
+
import DeviceFeedbackScreen from "./screens/CommonScreens/DeviceFeedbackScreen";
|
|
99
|
+
import DeviceAnswerDetailScreen from "./screens/CommonScreens/DeviceAnswerDetailScreen";
|
|
99
100
|
|
|
100
101
|
// Boss绑定页面
|
|
101
|
-
import BindBossScreen from
|
|
102
|
+
import BindBossScreen from "./screens/CommonScreens/BossScreen";
|
|
102
103
|
|
|
103
104
|
const Stack = createStackNavigator();
|
|
104
105
|
|
|
105
|
-
const envVersion = NativeModules?.RNToNativeEmitter?.serverCluster ||
|
|
106
|
+
const envVersion = NativeModules?.RNToNativeEmitter?.serverCluster || "alpha";
|
|
106
107
|
// const envVersion = 'release';
|
|
107
108
|
|
|
108
109
|
let eventEmitter;
|
|
109
|
-
if (Platform.OS ===
|
|
110
|
+
if (Platform.OS === "android") {
|
|
110
111
|
// ----yusm:安卓使用DeviceEventEmitter
|
|
111
112
|
eventEmitter = DeviceEventEmitter;
|
|
112
113
|
} else {
|
|
@@ -117,30 +118,36 @@ const CommonScreens = {
|
|
|
117
118
|
Home: {
|
|
118
119
|
component: BaseScreen,
|
|
119
120
|
screenOptions: {
|
|
120
|
-
title:
|
|
121
|
+
title: "首页",
|
|
121
122
|
headerShown: false,
|
|
122
123
|
includeBottom: true,
|
|
123
124
|
},
|
|
124
125
|
},
|
|
125
126
|
Login: {
|
|
126
127
|
component:
|
|
127
|
-
DeviceInfo.getBrand() ===
|
|
128
|
+
DeviceInfo.getBrand() === "Allwinner" ? LoginScreen : NewLoginScreen,
|
|
128
129
|
screenOptions: {
|
|
129
|
-
title:
|
|
130
|
+
title: "登录",
|
|
130
131
|
headerShown: false,
|
|
131
132
|
},
|
|
132
133
|
},
|
|
133
134
|
ResePasswordScreen: {
|
|
134
135
|
component: ResePasswordScreen,
|
|
135
136
|
screenOptions: {
|
|
136
|
-
title:
|
|
137
|
+
title: "重置密码",
|
|
137
138
|
headerShown: false,
|
|
138
139
|
},
|
|
139
140
|
},
|
|
140
141
|
RegisteCountScreen: {
|
|
141
142
|
component: RegisteCountScreen,
|
|
142
143
|
screenOptions: {
|
|
143
|
-
title:
|
|
144
|
+
title: "注册",
|
|
145
|
+
headerShown: false,
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
HomedLoginScreen: {
|
|
149
|
+
component: HomedLoginScreen,
|
|
150
|
+
screenOptions: {
|
|
144
151
|
headerShown: false,
|
|
145
152
|
},
|
|
146
153
|
},
|
|
@@ -153,62 +160,62 @@ const CommonScreens = {
|
|
|
153
160
|
OperatorSelectScreen: {
|
|
154
161
|
component: OperatorSelectScreen,
|
|
155
162
|
screenOptions: {
|
|
156
|
-
title:
|
|
163
|
+
title: "选择运营商",
|
|
157
164
|
headerShown: false,
|
|
158
165
|
},
|
|
159
166
|
},
|
|
160
167
|
InvoiceTitleListScreen: {
|
|
161
168
|
component: InvoiceTitleListScreen,
|
|
162
169
|
screenOptions: {
|
|
163
|
-
title:
|
|
170
|
+
title: "发票抬头",
|
|
164
171
|
headerShown: false,
|
|
165
172
|
},
|
|
166
173
|
},
|
|
167
174
|
EditInvoiceTitleScreen: {
|
|
168
175
|
component: EditInvoiceTitleScreen,
|
|
169
176
|
screenOptions: {
|
|
170
|
-
title:
|
|
177
|
+
title: "编辑发票抬头",
|
|
171
178
|
headerShown: false,
|
|
172
179
|
},
|
|
173
180
|
},
|
|
174
181
|
WebviewScreen: {
|
|
175
182
|
component: WebviewScreen,
|
|
176
183
|
screenOptions: {
|
|
177
|
-
title:
|
|
184
|
+
title: "",
|
|
178
185
|
headerShown: false,
|
|
179
186
|
},
|
|
180
187
|
},
|
|
181
188
|
TvAlbumScreen: {
|
|
182
189
|
component: TvAlbumScreen,
|
|
183
190
|
screenOptions: {
|
|
184
|
-
title:
|
|
191
|
+
title: "电视相册",
|
|
185
192
|
},
|
|
186
193
|
},
|
|
187
194
|
DeviceFeedbackScreen: {
|
|
188
195
|
component: DeviceFeedbackScreen,
|
|
189
196
|
screenOptions: {
|
|
190
|
-
title:
|
|
197
|
+
title: "帮助与反馈",
|
|
191
198
|
headerShown: false,
|
|
192
199
|
},
|
|
193
200
|
},
|
|
194
201
|
DeviceAnswerDetailScreen: {
|
|
195
202
|
component: DeviceAnswerDetailScreen,
|
|
196
203
|
screenOptions: {
|
|
197
|
-
title:
|
|
204
|
+
title: "解答",
|
|
198
205
|
headerShown: false,
|
|
199
206
|
},
|
|
200
207
|
},
|
|
201
208
|
SbkScreen: {
|
|
202
209
|
component: SbkScreen,
|
|
203
210
|
screenOptions: {
|
|
204
|
-
title:
|
|
211
|
+
title: "爱家宝",
|
|
205
212
|
headerShown: false,
|
|
206
213
|
},
|
|
207
214
|
},
|
|
208
215
|
BindBossScreen: {
|
|
209
216
|
component: BindBossScreen,
|
|
210
217
|
screenOptions: {
|
|
211
|
-
title:
|
|
218
|
+
title: "绑定boss账号",
|
|
212
219
|
headerShown: false,
|
|
213
220
|
},
|
|
214
221
|
},
|
|
@@ -216,7 +223,7 @@ const CommonScreens = {
|
|
|
216
223
|
|
|
217
224
|
// screen分组
|
|
218
225
|
function StackScreenGroup(screens) {
|
|
219
|
-
return Object.entries(screens).map(([name, {component, screenOptions}]) => (
|
|
226
|
+
return Object.entries(screens).map(([name, { component, screenOptions }]) => (
|
|
220
227
|
<Stack.Screen
|
|
221
228
|
name={name}
|
|
222
229
|
component={component}
|
|
@@ -229,24 +236,24 @@ function StackScreenGroup(screens) {
|
|
|
229
236
|
// 兜底的底部导航模块
|
|
230
237
|
const initialNavigationPackages = [
|
|
231
238
|
{
|
|
232
|
-
bundleName:
|
|
239
|
+
bundleName: "index.ios.bundle",
|
|
233
240
|
isMain: 1,
|
|
234
|
-
md5:
|
|
235
|
-
moduleName:
|
|
236
|
-
modulePublishDesc:
|
|
237
|
-
upgradeMode:
|
|
238
|
-
url:
|
|
239
|
-
version:
|
|
241
|
+
md5: "7284896d821f9e206efc979590561e18",
|
|
242
|
+
moduleName: "tvShare",
|
|
243
|
+
modulePublishDesc: "电视分享ios",
|
|
244
|
+
upgradeMode: "force",
|
|
245
|
+
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",
|
|
246
|
+
version: "v1.0.2",
|
|
240
247
|
},
|
|
241
248
|
{
|
|
242
|
-
bundleName:
|
|
249
|
+
bundleName: "index.ios.bundle",
|
|
243
250
|
isMain: 1,
|
|
244
|
-
md5:
|
|
245
|
-
moduleName:
|
|
246
|
-
modulePublishDesc:
|
|
247
|
-
upgradeMode:
|
|
248
|
-
url:
|
|
249
|
-
version:
|
|
251
|
+
md5: "0fd7a6212a7b70baa54ce2a9cc99698b",
|
|
252
|
+
moduleName: "smartHome",
|
|
253
|
+
modulePublishDesc: "智能家居ios",
|
|
254
|
+
upgradeMode: "force",
|
|
255
|
+
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",
|
|
256
|
+
version: "v1.0.2",
|
|
250
257
|
},
|
|
251
258
|
// {
|
|
252
259
|
// bundleName: 'index.ios.bundle',
|
|
@@ -274,7 +281,7 @@ global.base.initialNavigationPackages = initialNavigationPackages;
|
|
|
274
281
|
// updateNavigationPackagesFromStorage(1);
|
|
275
282
|
|
|
276
283
|
const App = () => {
|
|
277
|
-
const {DynamicStackScreens} = useDynamicPackages();
|
|
284
|
+
const { DynamicStackScreens } = useDynamicPackages();
|
|
278
285
|
// 当前页面是否需要包括底部安全区
|
|
279
286
|
const [includeBottom, setIncludeBottom] = useState(false);
|
|
280
287
|
const [versionUpdateConfirmVisible, setVersionUpdateConfirmVisible] =
|
|
@@ -295,18 +302,18 @@ const App = () => {
|
|
|
295
302
|
|
|
296
303
|
// mounted
|
|
297
304
|
useEffect(() => {
|
|
298
|
-
if (Platform.OS ===
|
|
299
|
-
StatusBar.setBackgroundColor(
|
|
305
|
+
if (Platform.OS === "android") {
|
|
306
|
+
StatusBar.setBackgroundColor("transparent");
|
|
300
307
|
}
|
|
301
|
-
StatusBar.setBarStyle(
|
|
302
|
-
storage.get(
|
|
303
|
-
global.base.accountType = res ||
|
|
308
|
+
StatusBar.setBarStyle("dark-content");
|
|
309
|
+
storage.get("accountType").then((res) => {
|
|
310
|
+
global.base.accountType = res || "ajb";
|
|
304
311
|
});
|
|
305
312
|
|
|
306
313
|
const rnToNative = NativeModules.RNToNativeEmitter;
|
|
307
314
|
// 应用通知app可正常显示,页面正常运行了,在componentDidMount 中加
|
|
308
315
|
rnToNative?.notifyApplicationReady({
|
|
309
|
-
moduleName:
|
|
316
|
+
moduleName: "base",
|
|
310
317
|
}); // 不用传参数
|
|
311
318
|
|
|
312
319
|
// 首次进入app登录鉴权
|
|
@@ -315,35 +322,35 @@ const App = () => {
|
|
|
315
322
|
// 获取最新版本并通知原生平台,由平台判断后弹出升级确认提示
|
|
316
323
|
checkBaseVersion();
|
|
317
324
|
|
|
318
|
-
AppState.addEventListener(
|
|
319
|
-
console.log(
|
|
320
|
-
if (nextAppState ===
|
|
321
|
-
appReport(
|
|
325
|
+
AppState.addEventListener("change", async (nextAppState) => {
|
|
326
|
+
console.log("nextAppState", nextAppState);
|
|
327
|
+
if (nextAppState === "active") {
|
|
328
|
+
appReport("APP_STARTUP");
|
|
322
329
|
}
|
|
323
330
|
});
|
|
324
331
|
|
|
325
332
|
const keyboardDidShowListener = Keyboard.addListener(
|
|
326
|
-
|
|
333
|
+
"keyboardDidShow",
|
|
327
334
|
() => {
|
|
328
335
|
setIsKeyboardVisible(true);
|
|
329
|
-
}
|
|
336
|
+
}
|
|
330
337
|
);
|
|
331
338
|
|
|
332
339
|
const keyboardDidHideListener = Keyboard.addListener(
|
|
333
|
-
|
|
340
|
+
"keyboardDidHide",
|
|
334
341
|
() => {
|
|
335
342
|
setIsKeyboardVisible(false);
|
|
336
|
-
}
|
|
343
|
+
}
|
|
337
344
|
);
|
|
338
345
|
|
|
339
346
|
const cellularDataStateListener = eventEmitter.addListener(
|
|
340
|
-
|
|
341
|
-
data => {
|
|
342
|
-
console.log(JSON.stringify(data),
|
|
347
|
+
"CellularDataState",
|
|
348
|
+
(data) => {
|
|
349
|
+
console.log(JSON.stringify(data), "CellularDataState");
|
|
343
350
|
if (data?.state && data?.state !== 0) {
|
|
344
351
|
checkBaseVersion();
|
|
345
352
|
}
|
|
346
|
-
}
|
|
353
|
+
}
|
|
347
354
|
);
|
|
348
355
|
|
|
349
356
|
return () => {
|
|
@@ -355,23 +362,23 @@ const App = () => {
|
|
|
355
362
|
|
|
356
363
|
const checkBaseVersion = async () => {
|
|
357
364
|
// 当前版本
|
|
358
|
-
const baseVersionInfo = await global.base.getBundleInfo(
|
|
365
|
+
const baseVersionInfo = await global.base.getBundleInfo("base");
|
|
359
366
|
if (!baseVersionInfo) {
|
|
360
367
|
return false;
|
|
361
368
|
}
|
|
362
369
|
try {
|
|
363
370
|
const res = await getModuleVersionInfo({
|
|
364
371
|
platform: Platform.OS,
|
|
365
|
-
operatorId:
|
|
366
|
-
moduleName:
|
|
372
|
+
operatorId: "ipanel",
|
|
373
|
+
moduleName: "base",
|
|
367
374
|
});
|
|
368
375
|
if (res.code === 0) {
|
|
369
376
|
const versionInfo = res.data.packages[0];
|
|
370
377
|
const newVersion = Number(
|
|
371
|
-
versionInfo.version.slice(1).replace(/\./g,
|
|
378
|
+
versionInfo.version.slice(1).replace(/\./g, "")
|
|
372
379
|
);
|
|
373
380
|
const currentVersion = Number(
|
|
374
|
-
baseVersionInfo.version.slice(1).replace(/\./g,
|
|
381
|
+
baseVersionInfo.version.slice(1).replace(/\./g, "")
|
|
375
382
|
);
|
|
376
383
|
if (newVersion > currentVersion) {
|
|
377
384
|
setVersionUpdateConfirmVisible(true);
|
|
@@ -385,23 +392,23 @@ const App = () => {
|
|
|
385
392
|
global.base.checkBaseVersion = checkBaseVersion;
|
|
386
393
|
|
|
387
394
|
// 升级测试
|
|
388
|
-
const onUpdate = versionInfo => {
|
|
395
|
+
const onUpdate = (versionInfo) => {
|
|
389
396
|
const rnToNative = NativeModules.RNToNativeEmitter;
|
|
390
397
|
rnToNative?.selectedInfo({
|
|
391
398
|
packages: [versionInfo],
|
|
392
|
-
operatorId:
|
|
399
|
+
operatorId: "ipanel",
|
|
393
400
|
});
|
|
394
401
|
};
|
|
395
402
|
|
|
396
|
-
const handleStateChange = ({routes}) => {
|
|
403
|
+
const handleStateChange = ({ routes }) => {
|
|
397
404
|
const routeName = routes[routes.length - 1].name;
|
|
398
405
|
setIncludeBottom(
|
|
399
|
-
allStackScreens[routeName]?.screenOptions?.includeBottom || false
|
|
406
|
+
allStackScreens[routeName]?.screenOptions?.includeBottom || false
|
|
400
407
|
);
|
|
401
408
|
/* 加载之后每次navigate都鉴权一把登录状态(重置密码不需要检测) */
|
|
402
409
|
if (
|
|
403
|
-
routeName !==
|
|
404
|
-
routeName !==
|
|
410
|
+
routeName !== "ResePasswordScreen" &&
|
|
411
|
+
routeName !== "RegisteCountScreen"
|
|
405
412
|
) {
|
|
406
413
|
checkLogin();
|
|
407
414
|
}
|
|
@@ -417,12 +424,14 @@ const App = () => {
|
|
|
417
424
|
<SheetProvider>
|
|
418
425
|
<NavigationContainer
|
|
419
426
|
ref={navigationRef}
|
|
420
|
-
onStateChange={handleStateChange}
|
|
427
|
+
onStateChange={handleStateChange}
|
|
428
|
+
>
|
|
421
429
|
<Stack.Navigator
|
|
422
|
-
initialRouteName={
|
|
430
|
+
initialRouteName={"Login"}
|
|
423
431
|
screenOptions={{
|
|
424
432
|
headerStyle: {},
|
|
425
|
-
}}
|
|
433
|
+
}}
|
|
434
|
+
>
|
|
426
435
|
{/* 首页 */}
|
|
427
436
|
{/*<Stack.Screen*/}
|
|
428
437
|
{/* name="Home"*/}
|
|
@@ -451,11 +460,11 @@ const App = () => {
|
|
|
451
460
|
</NavigationContainer>
|
|
452
461
|
</SheetProvider>
|
|
453
462
|
|
|
454
|
-
<Loading onRef={ref => (global.loading = ref)} />
|
|
455
|
-
<Toast onRef={ref => (global.toast = ref)} />
|
|
456
|
-
<Notify onRef={ref => (global.notify = ref)} />
|
|
457
|
-
<Dialog onRef={ref => (global.dialog = ref)} />
|
|
458
|
-
<SheetManage onRef={ref => (global.sheetManager = ref)} />
|
|
463
|
+
<Loading onRef={(ref) => (global.loading = ref)} />
|
|
464
|
+
<Toast onRef={(ref) => (global.toast = ref)} />
|
|
465
|
+
<Notify onRef={(ref) => (global.notify = ref)} />
|
|
466
|
+
<Dialog onRef={(ref) => (global.dialog = ref)} />
|
|
467
|
+
<SheetManage onRef={(ref) => (global.sheetManager = ref)} />
|
|
459
468
|
{versionUpdateConfirmVisible && (
|
|
460
469
|
<VersionUpdateConfirm
|
|
461
470
|
onVisibleChange={setVersionUpdateConfirmVisible}
|
|
@@ -468,11 +477,12 @@ const App = () => {
|
|
|
468
477
|
);
|
|
469
478
|
};
|
|
470
479
|
|
|
471
|
-
return Platform.OS ===
|
|
480
|
+
return Platform.OS === "ios" ? (
|
|
472
481
|
<SafeAreaProvider>
|
|
473
482
|
<SafeAreaView
|
|
474
|
-
style={{flex: 1}}
|
|
475
|
-
edges={includeBottom ? [
|
|
483
|
+
style={{ flex: 1 }}
|
|
484
|
+
edges={includeBottom ? ["right", "left"] : ["right", "bottom", "left"]}
|
|
485
|
+
>
|
|
476
486
|
{renderContent()}
|
|
477
487
|
</SafeAreaView>
|
|
478
488
|
</SafeAreaProvider>
|
package/app/api/homedApi.js
CHANGED
|
@@ -1,45 +1,55 @@
|
|
|
1
|
-
import {homedHttp} from
|
|
2
|
-
import config from
|
|
1
|
+
import { homedHttp } from "../utils/http";
|
|
2
|
+
import config from "../utils/config";
|
|
3
3
|
|
|
4
4
|
export const homedGet = (url, data) => {
|
|
5
5
|
return homedHttp({
|
|
6
6
|
url: url,
|
|
7
|
-
method:
|
|
7
|
+
method: "GET",
|
|
8
8
|
data,
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
export const getHomedUserInfo = async data => {
|
|
12
|
+
export const getHomedUserInfo = async (data) => {
|
|
13
13
|
return homedHttp({
|
|
14
14
|
url: `http://access.${await global.base.getHomedDomain()}/account/user/get_info`,
|
|
15
|
-
method:
|
|
15
|
+
method: "GET",
|
|
16
16
|
data,
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
// /account/device/get_list
|
|
21
|
-
export const getUserList = async data => {
|
|
22
|
-
const domain = await global.base.getHomedDomain()
|
|
23
|
-
const host = domain ===
|
|
21
|
+
export const getUserList = async (data) => {
|
|
22
|
+
const domain = await global.base.getHomedDomain();
|
|
23
|
+
const host = domain === "pyitv.com" ? 12690 : 80;
|
|
24
24
|
return homedHttp({
|
|
25
25
|
url: `http://access.${domain}:${host}/account/user/get_list`,
|
|
26
|
-
method:
|
|
26
|
+
method: "GET",
|
|
27
27
|
data,
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
|
-
export const getRegionList = async data => {
|
|
30
|
+
export const getRegionList = async (data) => {
|
|
31
31
|
return homedHttp({
|
|
32
32
|
url: `http://iusm.${await global.base.getHomedDomain()}/account/get_region_list`,
|
|
33
|
-
method:
|
|
33
|
+
method: "GET",
|
|
34
34
|
data,
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
export const getAccessToken = async (data, domain) => {
|
|
39
|
-
const host = domain ===
|
|
39
|
+
const host = domain === "pyitv.com" ? 12690 : 80;
|
|
40
40
|
return homedHttp({
|
|
41
41
|
url: `http://access.${domain}:${host}/account/get_accesstoken`,
|
|
42
|
-
method:
|
|
42
|
+
method: "POST",
|
|
43
|
+
data,
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const mobileRelationLogin = async (data) => {
|
|
48
|
+
const domain = await global.base.getHomedDomain();
|
|
49
|
+
const host = domain === "pyitv.com" ? 12690 : 80;
|
|
50
|
+
return homedHttp({
|
|
51
|
+
url: `http://access.${domain}:${host}/account/mobile_relation_login`,
|
|
52
|
+
method: "GET",
|
|
43
53
|
data,
|
|
44
54
|
});
|
|
45
55
|
};
|
|
@@ -13,7 +13,7 @@ export const ACCOUNT_SERVICE = `${config.IPANEL_CLOUD_BASE_URI}/s/account`;
|
|
|
13
13
|
|
|
14
14
|
export const ADG_SERVICE = `${config.IPANEL_CLOUD_BASE_ADG_URI}/s/install_ea`;
|
|
15
15
|
|
|
16
|
-
export const APARTMENT_SERVICE = "http://192.168.
|
|
16
|
+
export const APARTMENT_SERVICE = "http://192.168.22.194:47070/smartapartment";
|
|
17
17
|
|
|
18
18
|
// todo 云端获取token服务:https://ai.baidu.com/ai-doc/SPEECH/Mk38lxpgn
|
|
19
19
|
export const baiduAsr = (cuid, len, speechBase64) => {
|
|
@@ -154,6 +154,17 @@ export const accountRegiste = (data, type) => {
|
|
|
154
154
|
});
|
|
155
155
|
};
|
|
156
156
|
|
|
157
|
+
export const deviceReportThird = (data) => {
|
|
158
|
+
return request({
|
|
159
|
+
url: ACCOUNT_SERVICE,
|
|
160
|
+
method: "POST",
|
|
161
|
+
data: {
|
|
162
|
+
action: "device_report_third",
|
|
163
|
+
...data,
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
|
|
157
168
|
export const obtainThirdToken = (data) => {
|
|
158
169
|
return request({
|
|
159
170
|
url: ACCOUNT_SERVICE,
|
|
@@ -831,3 +842,23 @@ export const queryCountByName = (data) => {
|
|
|
831
842
|
},
|
|
832
843
|
});
|
|
833
844
|
};
|
|
845
|
+
|
|
846
|
+
// 获取图形验证码
|
|
847
|
+
export const getCaptcha = (data) => {
|
|
848
|
+
return request({
|
|
849
|
+
url: "https://code.ipanel.cn/captcha/get",
|
|
850
|
+
method: "GET",
|
|
851
|
+
data,
|
|
852
|
+
});
|
|
853
|
+
};
|
|
854
|
+
|
|
855
|
+
// 校验图形验证码
|
|
856
|
+
export const checkCaptcha = (data) => {
|
|
857
|
+
return fetch("https://code.ipanel.cn/captcha/check", {
|
|
858
|
+
method: "POST",
|
|
859
|
+
body: data,
|
|
860
|
+
headers: {
|
|
861
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
862
|
+
},
|
|
863
|
+
}).then((res) => res.json());
|
|
864
|
+
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|