ipanel-rnapp-ajb-base 1.0.42 → 1.0.44
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/.vscode/settings.json +5 -0
- package/app/App.js +3 -1
- package/app/screens/ChatModeScreen/components/SimpleProfileScreen.js +52 -61
- package/app/screens/ChatModeScreen/index.js +8 -11
- package/app/screens/LoginScreen/index.js +1 -1
- package/app/screens/LoginScreen/indexEdu.js +1 -1
- package/app/screens/LoginScreen/indexNew.js +1 -1
- package/app/screens/LoginScreen/indexSbk.js +1 -1
- package/app/screens/RegisteCountScreen/index.js +1 -1
- package/app/screens/ResePassword/index.js +1 -1
- package/package.json +2 -2
package/app/App.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
import {
|
|
3
3
|
View,
|
|
4
4
|
Text,
|
|
5
5
|
StyleSheet,
|
|
6
|
-
SafeAreaView,
|
|
7
6
|
StatusBar,
|
|
8
7
|
TouchableOpacity,
|
|
9
8
|
Platform,
|
|
10
9
|
NativeModules,
|
|
11
|
-
} from
|
|
12
|
-
import {
|
|
10
|
+
} from "react-native";
|
|
11
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
12
|
+
import { Icon } from "@rneui/themed";
|
|
13
13
|
|
|
14
14
|
const { storage, replace, popToTop, px } = global.base;
|
|
15
15
|
|
|
@@ -18,33 +18,35 @@ const { storage, replace, popToTop, px } = global.base;
|
|
|
18
18
|
* 专门为本地开发环境设计,只包含退出登录功能
|
|
19
19
|
*/
|
|
20
20
|
function SimpleProfileScreen({ navigation }) {
|
|
21
|
+
const insets = useSafeAreaInsets();
|
|
22
|
+
|
|
21
23
|
const handleLogout = async () => {
|
|
22
24
|
try {
|
|
23
25
|
// 清除所有认证相关的token
|
|
24
|
-
await storage.set(
|
|
25
|
-
await storage.set(
|
|
26
|
-
await storage.set(
|
|
27
|
-
await storage.set(
|
|
28
|
-
await storage.set(
|
|
29
|
-
await storage.set(
|
|
26
|
+
await storage.set("accessToken", null);
|
|
27
|
+
await storage.set("refreshToken", null);
|
|
28
|
+
await storage.set("adgAccessToken", null);
|
|
29
|
+
await storage.set("adgRefreshToken", null);
|
|
30
|
+
await storage.set("homedAccessToken", null);
|
|
31
|
+
await storage.set("homedTouristAccessToken", null);
|
|
30
32
|
|
|
31
33
|
// 清理其他用户相关数据
|
|
32
|
-
await storage.set(
|
|
33
|
-
await storage.set(
|
|
34
|
+
await storage.set("accountData", null);
|
|
35
|
+
await storage.set("activeAddr", null);
|
|
34
36
|
|
|
35
37
|
// 处理导航栈
|
|
36
|
-
if (navigation.getState().type ===
|
|
38
|
+
if (navigation.getState().type === "stack") {
|
|
37
39
|
popToTop();
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
// 跳转到登录页面
|
|
41
|
-
replace(
|
|
43
|
+
replace("Login", {
|
|
42
44
|
skip: true,
|
|
43
45
|
});
|
|
44
46
|
} catch (error) {
|
|
45
|
-
console.log(
|
|
47
|
+
console.log("退出登录失败:", error);
|
|
46
48
|
// 即使出错也尝试跳转到登录页
|
|
47
|
-
replace(
|
|
49
|
+
replace("Login");
|
|
48
50
|
}
|
|
49
51
|
};
|
|
50
52
|
|
|
@@ -53,13 +55,7 @@ function SimpleProfileScreen({ navigation }) {
|
|
|
53
55
|
};
|
|
54
56
|
|
|
55
57
|
return (
|
|
56
|
-
<
|
|
57
|
-
<StatusBar
|
|
58
|
-
barStyle="dark-content"
|
|
59
|
-
backgroundColor="#f5f5f5"
|
|
60
|
-
translucent={false}
|
|
61
|
-
/>
|
|
62
|
-
|
|
58
|
+
<View style={[styles.container, { paddingTop: insets.top }]}>
|
|
63
59
|
{/* 顶部导航栏 */}
|
|
64
60
|
<View style={styles.header}>
|
|
65
61
|
<TouchableOpacity
|
|
@@ -67,12 +63,7 @@ function SimpleProfileScreen({ navigation }) {
|
|
|
67
63
|
onPress={handleGoBack}
|
|
68
64
|
activeOpacity={0.8}
|
|
69
65
|
>
|
|
70
|
-
<Icon
|
|
71
|
-
name="chevron-back"
|
|
72
|
-
type="ionicon"
|
|
73
|
-
size={px(48)}
|
|
74
|
-
color="#333"
|
|
75
|
-
/>
|
|
66
|
+
<Icon name="chevron-back" type="ionicon" size={px(48)} color="#333" />
|
|
76
67
|
</TouchableOpacity>
|
|
77
68
|
|
|
78
69
|
<View style={styles.headerCenter}>
|
|
@@ -118,78 +109,78 @@ function SimpleProfileScreen({ navigation }) {
|
|
|
118
109
|
<Text style={styles.versionSubText}>LocalDev Mode</Text>
|
|
119
110
|
</View>
|
|
120
111
|
</View>
|
|
121
|
-
</
|
|
112
|
+
</View>
|
|
122
113
|
);
|
|
123
114
|
}
|
|
124
115
|
|
|
125
116
|
const styles = StyleSheet.create({
|
|
126
117
|
container: {
|
|
127
118
|
flex: 1,
|
|
128
|
-
backgroundColor:
|
|
119
|
+
backgroundColor: "#f5f5f5",
|
|
129
120
|
},
|
|
130
121
|
header: {
|
|
131
122
|
height: px(100),
|
|
132
|
-
backgroundColor:
|
|
133
|
-
flexDirection:
|
|
134
|
-
alignItems:
|
|
135
|
-
justifyContent:
|
|
123
|
+
backgroundColor: "#f5f5f5",
|
|
124
|
+
flexDirection: "row",
|
|
125
|
+
alignItems: "center",
|
|
126
|
+
justifyContent: "space-between",
|
|
136
127
|
paddingHorizontal: px(32),
|
|
137
128
|
},
|
|
138
129
|
backButton: {
|
|
139
130
|
width: px(48),
|
|
140
131
|
height: px(48),
|
|
141
|
-
alignItems:
|
|
142
|
-
justifyContent:
|
|
132
|
+
alignItems: "center",
|
|
133
|
+
justifyContent: "center",
|
|
143
134
|
},
|
|
144
135
|
headerCenter: {
|
|
145
136
|
flex: 1,
|
|
146
|
-
alignItems:
|
|
137
|
+
alignItems: "center",
|
|
147
138
|
},
|
|
148
139
|
headerTitle: {
|
|
149
|
-
fontSize: px(
|
|
150
|
-
fontWeight:
|
|
151
|
-
color:
|
|
140
|
+
fontSize: px(38),
|
|
141
|
+
fontWeight: "600",
|
|
142
|
+
color: "#333",
|
|
152
143
|
},
|
|
153
144
|
headerRight: {
|
|
154
145
|
width: px(48),
|
|
155
146
|
},
|
|
156
147
|
content: {
|
|
157
148
|
flex: 1,
|
|
158
|
-
alignItems:
|
|
159
|
-
justifyContent:
|
|
149
|
+
alignItems: "center",
|
|
150
|
+
justifyContent: "space-between",
|
|
160
151
|
paddingHorizontal: px(60),
|
|
161
152
|
paddingVertical: px(120),
|
|
162
153
|
},
|
|
163
154
|
welcomeSection: {
|
|
164
|
-
alignItems:
|
|
155
|
+
alignItems: "center",
|
|
165
156
|
flex: 1,
|
|
166
|
-
justifyContent:
|
|
157
|
+
justifyContent: "center",
|
|
167
158
|
},
|
|
168
159
|
welcomeText: {
|
|
169
160
|
fontSize: px(48),
|
|
170
|
-
fontWeight:
|
|
171
|
-
color:
|
|
161
|
+
fontWeight: "600",
|
|
162
|
+
color: "#333",
|
|
172
163
|
marginTop: px(40),
|
|
173
164
|
},
|
|
174
165
|
subText: {
|
|
175
166
|
fontSize: px(32),
|
|
176
|
-
color:
|
|
167
|
+
color: "#666",
|
|
177
168
|
marginTop: px(16),
|
|
178
169
|
},
|
|
179
170
|
actionSection: {
|
|
180
|
-
width:
|
|
181
|
-
alignItems:
|
|
171
|
+
width: "100%",
|
|
172
|
+
alignItems: "center",
|
|
182
173
|
marginBottom: px(80),
|
|
183
174
|
},
|
|
184
175
|
logoutButton: {
|
|
185
|
-
flexDirection:
|
|
186
|
-
alignItems:
|
|
187
|
-
justifyContent:
|
|
188
|
-
backgroundColor:
|
|
176
|
+
flexDirection: "row",
|
|
177
|
+
alignItems: "center",
|
|
178
|
+
justifyContent: "center",
|
|
179
|
+
backgroundColor: "#FF6B6B",
|
|
189
180
|
paddingHorizontal: px(80),
|
|
190
181
|
paddingVertical: px(32),
|
|
191
182
|
borderRadius: px(50),
|
|
192
|
-
shadowColor:
|
|
183
|
+
shadowColor: "#000",
|
|
193
184
|
shadowOffset: {
|
|
194
185
|
width: 0,
|
|
195
186
|
height: 2,
|
|
@@ -204,21 +195,21 @@ const styles = StyleSheet.create({
|
|
|
204
195
|
},
|
|
205
196
|
logoutText: {
|
|
206
197
|
fontSize: px(36),
|
|
207
|
-
fontWeight:
|
|
208
|
-
color:
|
|
198
|
+
fontWeight: "600",
|
|
199
|
+
color: "#fff",
|
|
209
200
|
},
|
|
210
201
|
versionSection: {
|
|
211
|
-
alignItems:
|
|
202
|
+
alignItems: "center",
|
|
212
203
|
},
|
|
213
204
|
versionText: {
|
|
214
205
|
fontSize: px(28),
|
|
215
|
-
color:
|
|
206
|
+
color: "#999",
|
|
216
207
|
},
|
|
217
208
|
versionSubText: {
|
|
218
209
|
fontSize: px(24),
|
|
219
|
-
color:
|
|
210
|
+
color: "#ccc",
|
|
220
211
|
marginTop: px(8),
|
|
221
212
|
},
|
|
222
213
|
});
|
|
223
214
|
|
|
224
|
-
export default SimpleProfileScreen;
|
|
215
|
+
export default SimpleProfileScreen;
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
StyleSheet,
|
|
5
5
|
TouchableOpacity,
|
|
6
6
|
Text,
|
|
7
|
-
SafeAreaView,
|
|
8
7
|
KeyboardAvoidingView,
|
|
9
8
|
Platform,
|
|
10
9
|
StatusBar,
|
|
11
10
|
Keyboard,
|
|
12
11
|
NativeModules,
|
|
13
12
|
} from "react-native";
|
|
13
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
14
14
|
import { Icon } from "@rneui/themed";
|
|
15
15
|
import MyChat from "./chat/MyChat";
|
|
16
16
|
import ChatInputBar from "./components/ChatInputBar";
|
|
@@ -22,6 +22,8 @@ const { px } = global.base;
|
|
|
22
22
|
* 专门为爱家宝品牌提供全屏AI智能客服对话界面
|
|
23
23
|
*/
|
|
24
24
|
function ChatModeScreen({ navigation }) {
|
|
25
|
+
const insets = useSafeAreaInsets();
|
|
26
|
+
|
|
25
27
|
const handleProfilePress = () => {
|
|
26
28
|
// 判断是否为本地开发环境(与polyfill.js中的逻辑一致)
|
|
27
29
|
const isLocalDev = !NativeModules.RNToNativeEmitter?.isMultiBundle;
|
|
@@ -54,12 +56,7 @@ function ChatModeScreen({ navigation }) {
|
|
|
54
56
|
};
|
|
55
57
|
|
|
56
58
|
return (
|
|
57
|
-
<
|
|
58
|
-
<StatusBar
|
|
59
|
-
barStyle="dark-content"
|
|
60
|
-
backgroundColor="#f5f5f5"
|
|
61
|
-
translucent={false}
|
|
62
|
-
/>
|
|
59
|
+
<View style={[styles.container, { paddingTop: insets.top }]}>
|
|
63
60
|
<KeyboardAvoidingView
|
|
64
61
|
style={styles.keyboardView}
|
|
65
62
|
behavior={Platform.OS === "ios" ? "padding" : undefined}
|
|
@@ -73,7 +70,7 @@ function ChatModeScreen({ navigation }) {
|
|
|
73
70
|
<TouchableOpacity
|
|
74
71
|
style={styles.profileButton}
|
|
75
72
|
onPress={handleProfilePress}
|
|
76
|
-
activeOpacity={0.
|
|
73
|
+
activeOpacity={0.7}
|
|
77
74
|
>
|
|
78
75
|
<Text style={styles.profileButtonText}>我的</Text>
|
|
79
76
|
</TouchableOpacity>
|
|
@@ -88,7 +85,7 @@ function ChatModeScreen({ navigation }) {
|
|
|
88
85
|
onMediaSelect={handleMediaSelect}
|
|
89
86
|
/>
|
|
90
87
|
</KeyboardAvoidingView>
|
|
91
|
-
</
|
|
88
|
+
</View>
|
|
92
89
|
);
|
|
93
90
|
}
|
|
94
91
|
|
|
@@ -115,7 +112,7 @@ const styles = StyleSheet.create({
|
|
|
115
112
|
alignItems: "center",
|
|
116
113
|
},
|
|
117
114
|
headerTitle: {
|
|
118
|
-
fontSize: px(
|
|
115
|
+
fontSize: px(38),
|
|
119
116
|
fontWeight: "600",
|
|
120
117
|
color: "#333",
|
|
121
118
|
},
|
|
@@ -138,7 +135,7 @@ const styles = StyleSheet.create({
|
|
|
138
135
|
elevation: 5,
|
|
139
136
|
},
|
|
140
137
|
profileButtonText: {
|
|
141
|
-
fontSize: px(
|
|
138
|
+
fontSize: px(38),
|
|
142
139
|
fontWeight: "600",
|
|
143
140
|
color: "#333",
|
|
144
141
|
},
|
|
@@ -396,7 +396,7 @@ function LoginScreen({ navigation, route }) {
|
|
|
396
396
|
Alert.alert("请输入手机号");
|
|
397
397
|
return false;
|
|
398
398
|
}
|
|
399
|
-
if (!/^
|
|
399
|
+
if (!/^1[3-9]\d{9}$/.test(phone)) {
|
|
400
400
|
// Alert.alert('请输入正确的手机号');
|
|
401
401
|
global.toast.showToast("手机号无效,请检查!");
|
|
402
402
|
return false;
|
|
@@ -198,7 +198,7 @@ function LoginScreen({ navigation, route }) {
|
|
|
198
198
|
Alert.alert("请输入手机号");
|
|
199
199
|
return false;
|
|
200
200
|
}
|
|
201
|
-
if (!/^
|
|
201
|
+
if (!/^1[3-9]\d{9}$/.test(phone)) {
|
|
202
202
|
// Alert.alert('请输入正确的手机号');
|
|
203
203
|
global.toast.showToast("手机号无效,请检查!");
|
|
204
204
|
return false;
|
|
@@ -395,7 +395,7 @@ function LoginScreen({ navigation, route }) {
|
|
|
395
395
|
Alert.alert("请输入手机号");
|
|
396
396
|
return false;
|
|
397
397
|
}
|
|
398
|
-
if (!/^
|
|
398
|
+
if (!/^1[3-9]\d{9}$/.test(phone)) {
|
|
399
399
|
// Alert.alert('请输入正确的手机号');
|
|
400
400
|
global.toast.showToast("手机号无效,请检查!");
|
|
401
401
|
return false;
|
|
@@ -108,7 +108,7 @@ const Index = ({ route }) => {
|
|
|
108
108
|
Alert.alert("请输入手机号");
|
|
109
109
|
return false;
|
|
110
110
|
}
|
|
111
|
-
if (!/^
|
|
111
|
+
if (!/^1[3-9]\d{9}$/.test(phoneNumber)) {
|
|
112
112
|
// Alert.alert('请输入正确的手机号');
|
|
113
113
|
global.toast.showToast("手机号无效,请检查!");
|
|
114
114
|
return false;
|
|
@@ -45,7 +45,7 @@ const Index = ({route}) => {
|
|
|
45
45
|
Alert.alert('请输入手机号');
|
|
46
46
|
return false;
|
|
47
47
|
}
|
|
48
|
-
if (!/^
|
|
48
|
+
if (!/^1[3-9]\d{9}$/.test(phoneNumber)) {
|
|
49
49
|
// Alert.alert('请输入正确的手机号');
|
|
50
50
|
global.toast.showToast('手机号无效,请检查!');
|
|
51
51
|
return false;
|