ipanel-rnapp-ajb-base 1.0.40 → 1.0.41

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 CHANGED
@@ -45,10 +45,10 @@ import { appReport } from "./utils/common";
45
45
 
46
46
  // 基础导航页、登录页
47
47
  import BaseScreen from "./screens/BaseScreen";
48
- import SimpleBaseScreen from "./screens/SimpleBaseScreen.js";//简单导航:非爱家宝
49
- import LoginScreen from "./screens/LoginScreen";
50
- import NewLoginScreen from "./screens/LoginScreen/indexNew";
51
- import LoginEduScreen from "./screens/LoginScreen/indexEdu";//教鞭登录页
48
+ import SimpleBaseScreen from "./screens/SimpleBaseScreen.js"; //简单导航:非爱家宝
49
+ import LoginScreen from "./screens/LoginScreen/index";
50
+ import SbkLoginScreen from "./screens/LoginScreen/indexSbk"; // 声必可屏登录页
51
+ import LoginEduScreen from "./screens/LoginScreen/indexEdu"; //教鞭登录页
52
52
  import ResePasswordScreen from "./screens/ResePassword";
53
53
  import SbkScreen from "./screens/SbkScreen";
54
54
 
@@ -121,7 +121,7 @@ if (Platform.OS === "android") {
121
121
  // 公共 栈路由页面
122
122
  const CommonScreens = {
123
123
  Home: {
124
- component: appName==='教鞭'?SimpleBaseScreen:BaseScreen,
124
+ component: appName === "教鞭" ? SimpleBaseScreen : BaseScreen,
125
125
  screenOptions: {
126
126
  title: "首页",
127
127
  headerShown: false,
@@ -129,7 +129,12 @@ const CommonScreens = {
129
129
  },
130
130
  },
131
131
  Login: {
132
- component: appName==='教鞭'?LoginEduScreen:(DeviceInfo.getBrand() === "Allwinner" ? LoginScreen : NewLoginScreen),
132
+ component:
133
+ appName === "教鞭"
134
+ ? LoginEduScreen
135
+ : DeviceInfo.getBrand() === "Allwinner"
136
+ ? SbkLoginScreen /* 声必可屏 */
137
+ : LoginScreen,
133
138
  screenOptions: {
134
139
  title: "登录",
135
140
  headerShown: false,
@@ -85,7 +85,7 @@ const Index = ({
85
85
  editable={editable}
86
86
  keyboardType={keyboardType}
87
87
  maxLength={maxLength}
88
- returnKeyType={returnKeyType}
88
+ returnKeyType={returnKeyType ? returnKeyType : 'done'}
89
89
  />
90
90
  <View style={styles.inputIconBox}>{inputIcon}</View>
91
91
  </View>
@@ -96,6 +96,7 @@ const Prompt = ({ modelRef, setModalVisible }) => {
96
96
  autoFocus={!!modelRef?.autoFocus}
97
97
  onChangeText={setInput}
98
98
  keyboardType={modelRef?.keyboardType}
99
+ returnKeyType={modelRef?.returnKeyType||'done'}
99
100
  leftIcon={modelRef?.leftIcon}
100
101
  containerStyle={{
101
102
  height: 31,
@@ -148,6 +149,7 @@ const Prompt = ({ modelRef, setModalVisible }) => {
148
149
  autoFocus={!!modelRef?.autoFocus2}
149
150
  onChangeText={setInput2}
150
151
  keyboardType={modelRef?.keyboardType2}
152
+ returnKeyType={modelRef?.returnKeyType2||'done'}
151
153
  leftIcon={modelRef?.leftIcon2}
152
154
  containerStyle={{
153
155
  height: 31,
@@ -1,7 +1,12 @@
1
1
  import React, { useEffect, useState } from "react";
2
2
  import { View } from "react-native";
3
3
  import { WebView } from "react-native-webview";
4
- import { bindBossAccount, getUserInfo, getAssets } from "../../../api";
4
+ import {
5
+ bindBossAccount,
6
+ getUserInfo,
7
+ getAssets,
8
+ delThirdId,
9
+ } from "../../../api";
5
10
  const { ScreenBackHeader } = global.base.commonComponents;
6
11
  const { storage } = global.base;
7
12
 
@@ -9,6 +14,8 @@ export default ({ navigation, route }) => {
9
14
  const module = route?.params?.module;
10
15
  const [uri, setUri] = useState("");
11
16
  const [state, setState] = useState("");
17
+ const bind = route?.params?.binding === 0 ? 0 : 1; // 1:绑定,0:解绑
18
+ console.log("bind嘻嘻", bind);
12
19
  useEffect(() => {
13
20
  init();
14
21
  global.loading.showLoading("加载中...");
@@ -16,7 +23,7 @@ export default ({ navigation, route }) => {
16
23
  const init = async () => {
17
24
  const accountData = await storage.get("accountData");
18
25
  console.log("init", accountData, "accountData");
19
- const binding = 1; // 1:绑定,0:解绑.
26
+ const binding = bind; // 1:绑定,0:解绑
20
27
  const redirect_uri =
21
28
  "https://ipanelcloud2.ipanel.cn:50443/iapp/ajbstatic/bind_boss_account/"; // 绑定后跳转地址
22
29
  const state2 = generateRandomString(8);
@@ -33,7 +40,7 @@ export default ({ navigation, route }) => {
33
40
  const data = JSON.parse(e.nativeEvent.data);
34
41
  console.log("onMessage", data);
35
42
  if (data.ret === 0 && data.code && data.state === state) {
36
- global.loading.showLoading("正在绑定...");
43
+ global.loading.showLoading(bind === 1 ? "正在绑定..." : "正在解绑...");
37
44
  const res = await bindBossAccount({
38
45
  code: data.code,
39
46
  oauth2: "72d2453f689fc99548187dca4b922a5b",
@@ -41,8 +48,12 @@ export default ({ navigation, route }) => {
41
48
  console.log(res, "bindBossAccount");
42
49
  global.loading.hideLoading("正在绑定...");
43
50
  if (res.code === 0) {
44
- global.toast.showToast("绑定成功");
45
- await get_user_info();
51
+ if (bind === 1) {
52
+ global.toast.showToast("绑定成功");
53
+ await get_user_info();
54
+ } else {
55
+ await delBind();
56
+ }
46
57
  // navigation.goBack();
47
58
  } else {
48
59
  navigation.goBack();
@@ -52,6 +63,36 @@ export default ({ navigation, route }) => {
52
63
  }
53
64
  };
54
65
 
66
+ const delBind = async () => {
67
+ try {
68
+ const bossData = await storage.get("bossData");
69
+ const appID = await global.base.getAppId();
70
+ const params = {
71
+ third_type: bossData?.third_type,
72
+ third_id: bossData?.third_id,
73
+ user_id: bossData?.user_id,
74
+ };
75
+ if (appID) {
76
+ params.appid = appID;
77
+ }
78
+ const res = await delThirdId(params);
79
+ global.loading.hideLoading("正在解绑...");
80
+ console.log(res, "delThirdId");
81
+ if (res.code === 0) {
82
+ await get_user_info();
83
+ global.toast.showToast("解绑成功");
84
+ } else {
85
+ global.toast.showToast("解绑失败");
86
+ navigation.goBack();
87
+ }
88
+ } catch (error) {
89
+ console.error("delBind error:", error);
90
+ global.loading.hideLoading("正在解绑...");
91
+ global.toast.showToast("解绑失败");
92
+ navigation.goBack();
93
+ }
94
+ };
95
+
55
96
  const get_user_info = async () => {
56
97
  try {
57
98
  const res = await getUserInfo();
@@ -71,7 +112,11 @@ export default ({ navigation, route }) => {
71
112
  console.log(bossData[0]);
72
113
  if (bossData[0]) {
73
114
  await storage.set("bossData", bossData[0]);
115
+ } else {
116
+ await storage.set("bossData", {});
74
117
  }
118
+ } else {
119
+ await storage.set("bossData", {});
75
120
  }
76
121
  if (module === "shop") {
77
122
  await get_assets();
@@ -108,7 +153,11 @@ export default ({ navigation, route }) => {
108
153
  });
109
154
  if (current.length) {
110
155
  await storage.set("isportData", current[0]);
156
+ } else {
157
+ await storage.set("isportData", {});
111
158
  }
159
+ } else {
160
+ await storage.set("isportData", {});
112
161
  }
113
162
  }
114
163
  } catch (error) {
@@ -340,6 +340,7 @@ export default ({ navigation, route }) => {
340
340
  value={item.value}
341
341
  onChangeText={value => onChangeText(item.name, value)}
342
342
  placeholder={item.placeholder}
343
+ returnKeyType="done"
343
344
  />
344
345
  {item.name === 'telephone' && telMsg ? (
345
346
  <Text style={styles.msg}>{telMsg}</Text>