@smart-link/rn-im 1.0.24 → 1.1.1
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/assets/file-dir.jpg +0 -0
- package/dist/api/addressList.d.ts +16 -15
- package/dist/api/addressList.js +15 -1
- package/dist/api/user.js +1 -1
- package/dist/components/Camera/Camera.js +3 -2
- package/dist/components/Camera/CameraCapture.js +61 -12
- package/dist/components/ChatAvatar/ChatAvatar.d.ts +3 -3
- package/dist/components/ChatAvatar/ChatAvatar.js +51 -49
- package/dist/components/ChatAvatar/ChatAvatarId.d.ts +2 -2
- package/dist/components/ChatAvatar/ChatAvatarId.js +19 -46
- package/dist/components/ChatAvatar/ChatAvatarLocal.js +22 -10
- package/dist/components/Favicon.js +1 -1
- package/dist/components/LocalImage.js +3 -1
- package/dist/components/styles.d.ts +7 -1
- package/dist/components/styles.js +16 -11
- package/dist/default-assets.d.ts +1 -0
- package/dist/default-assets.js +1 -0
- package/dist/hooks/useAnimatedValue.d.ts +2 -0
- package/dist/hooks/useAnimatedValue.js +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/init.d.ts +2 -2
- package/dist/init.js +8 -5
- package/dist/interface.d.ts +15 -0
- package/dist/pages/address-list/AddressList.js +22 -40
- package/dist/pages/address-list/ChooseContact.js +209 -45
- package/dist/pages/address-list/MyGroups.d.ts +6 -0
- package/dist/pages/address-list/MyGroups.js +90 -0
- package/dist/pages/address-list/Organization.d.ts +0 -7
- package/dist/pages/address-list/Organization.js +24 -108
- package/dist/pages/address-list/UserDetail.js +5 -5
- package/dist/pages/address-list/UserSearch.js +6 -7
- package/dist/pages/address-list/addressList.routes.d.ts +9 -0
- package/dist/pages/address-list/addressList.routes.js +8 -0
- package/dist/pages/address-list/components/Icons.d.ts +8 -0
- package/dist/pages/address-list/components/Icons.js +15 -0
- package/dist/pages/address-list/components/OrgPath.d.ts +12 -0
- package/dist/pages/address-list/components/OrgPath.js +59 -0
- package/dist/pages/address-list/components/RenderUserItem.d.ts +9 -0
- package/dist/pages/address-list/components/RenderUserItem.js +14 -0
- package/dist/pages/address-list/{UserJobs.js → components/UserJobs.js} +2 -2
- package/dist/pages/address-list/useGroupCategory.d.ts +2 -0
- package/dist/pages/address-list/useGroupCategory.js +11 -0
- package/dist/pages/address-list/useRoleList.d.ts +2 -0
- package/dist/pages/address-list/useRoleList.js +11 -0
- package/dist/pages/collection/Collection.js +52 -8
- package/dist/pages/collection/ContentFactory.js +50 -3
- package/dist/pages/conversation/ForwardToConversation.js +4 -2
- package/dist/pages/conversation/List.js +15 -7
- package/dist/pages/conversation/components/ConversationCard.js +1 -7
- package/dist/pages/conversation/setting/OptionAvatars.d.ts +1 -1
- package/dist/pages/conversation/setting/OptionAvatars.js +0 -1
- package/dist/pages/conversation/setting/OptionGroup.d.ts +2 -2
- package/dist/pages/conversation/setting/OptionGroup.js +4 -4
- package/dist/pages/conversation/setting/OptionGroupManage.js +4 -8
- package/dist/pages/conversation/setting/OptionGroupMoreMember.js +37 -18
- package/dist/pages/conversation/setting/Setting.js +5 -5
- package/dist/pages/conversation/setting/SettingChatBg.js +32 -16
- package/dist/pages/message/ChooseMember.js +2 -2
- package/dist/pages/message/FileSelector.d.ts +6 -0
- package/dist/pages/message/FileSelector.js +272 -0
- package/dist/pages/message/MessageList.js +81 -43
- package/dist/pages/message/MessageRecord.js +34 -23
- package/dist/pages/message/components/MessageItem.d.ts +7 -7
- package/dist/pages/message/components/MessageItem.js +29 -20
- package/dist/pages/message/components/MessageOption.d.ts +7 -3
- package/dist/pages/message/components/MessageOption.js +14 -16
- package/dist/pages/message/components/MessagePayload.d.ts +2 -1
- package/dist/pages/message/components/MessagePictureAlbum.js +6 -4
- package/dist/pages/message/components/Payload/PayloadFile.d.ts +1 -1
- package/dist/pages/message/components/Payload/PayloadFile.js +34 -16
- package/dist/pages/message/components/Payload/PayloadMultiple.js +12 -8
- package/dist/pages/message/components/Payload/PayloadNotify.js +14 -5
- package/dist/pages/message/components/Payload/PayloadPicture.d.ts +1 -1
- package/dist/pages/message/components/Payload/PayloadPicture.js +9 -7
- package/dist/pages/message/components/Payload/PayloadText.js +7 -8
- package/dist/pages/message/components/Payload/PayloadVideo.js +2 -1
- package/dist/pages/message/components/Payload/PayloadVoice.js +7 -13
- package/dist/pages/message/components/Payload/PayloadWrapper.d.ts +2 -1
- package/dist/pages/message/components/Payload/PayloadWrapper.js +46 -20
- package/dist/pages/message/components/Payload/type.d.ts +3 -1
- package/dist/pages/message/components/ReceiptBack.js +2 -2
- package/dist/pages/message/components/TextMixMessage.d.ts +2 -0
- package/dist/pages/message/components/TextMixMessage.js +10 -3
- package/dist/pages/message/components/TextMixQuote.js +10 -15
- package/dist/pages/message/components/TextMixQuoteMessage.d.ts +2 -1
- package/dist/pages/message/components/TextMixQuoteMessage.js +5 -5
- package/dist/pages/message/components/UploadProgress.d.ts +1 -1
- package/dist/pages/message/components/UploadProgress.js +1 -1
- package/dist/pages/message/components/messageBar/EmojiPanel.js +8 -9
- package/dist/pages/message/components/messageBar/MessageBar.d.ts +1 -1
- package/dist/pages/message/components/messageBar/MessageBar.js +14 -12
- package/dist/pages/message/components/messageBar/MessageInput.d.ts +1 -0
- package/dist/pages/message/components/messageBar/MessageInput.js +19 -1
- package/dist/pages/message/components/messageBar/OptionPanel.js +22 -44
- package/dist/pages/message/message.routes.js +10 -0
- package/dist/pages/search/components/SearchUser.js +2 -2
- package/dist/pages/types.d.ts +6 -2
- package/dist/slice/contact/contact.slice.js +1 -0
- package/dist/slice/video/video.action.js +9 -1
- package/dist/utils/common-action-sheet.d.ts +1 -0
- package/dist/utils/common-action-sheet.js +18 -0
- package/dist/utils/file-icon.js +29 -2
- package/dist/utils/file.d.ts +21 -2
- package/dist/utils/file.js +209 -42
- package/dist/utils/phone.d.ts +1 -1
- package/dist/utils/phone.js +1 -9
- package/dist/utils/request.d.ts +2 -1
- package/dist/utils/request.js +17 -6
- package/dist/utils/upload.d.ts +2 -4
- package/dist/utils/upload.js +13 -49
- package/package.json +5 -5
- package/dist/pages/address-list/Icons.d.ts +0 -5
- package/dist/pages/address-list/Icons.js +0 -9
- package/dist/slice/contact/contact.action.d.ts +0 -1
- package/dist/slice/contact/contact.action.js +0 -1
- package/dist/utils/cookie.d.ts +0 -2
- package/dist/utils/cookie.js +0 -25
- package/dist/utils/file-operate.d.ts +0 -1
- package/dist/utils/file-operate.js +0 -3
- package/dist/utils/text-mix.d.ts +0 -9
- package/dist/utils/text-mix.js +0 -75
- /package/dist/pages/address-list/{CardInfo.d.ts → components/CardInfo.d.ts} +0 -0
- /package/dist/pages/address-list/{CardInfo.js → components/CardInfo.js} +0 -0
- /package/dist/pages/address-list/{UserJobs.d.ts → components/UserJobs.d.ts} +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, { useCallback, useEffect,
|
|
3
|
-
import { ScrollView,
|
|
1
|
+
import { ListRow, Loading, NavigationPage, SearchBar, Toast, } from '@smart-link/rn-ui';
|
|
2
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
3
|
+
import { ScrollView, Text, View } from 'react-native';
|
|
4
4
|
import { useTranslationAddrList } from '../../hooks/useTranslation';
|
|
5
5
|
import { listTree, listUser } from '../../api/addressList';
|
|
6
|
-
import
|
|
6
|
+
import OrgPath from "./components/OrgPath";
|
|
7
|
+
import RenderUserItem from "./components/RenderUserItem";
|
|
7
8
|
const Organization = ({ navigation, route: { params } }) => {
|
|
8
9
|
const [orgPath, setOrgPath] = useState([]);
|
|
9
10
|
const [orgList, setOrgList] = useState([]);
|
|
10
11
|
const [userList, setUserList] = useState([]);
|
|
11
12
|
const [loading, setLoading] = useState(false);
|
|
12
13
|
const { t } = useTranslationAddrList();
|
|
13
|
-
const orgPathScroll = useRef(null);
|
|
14
14
|
useEffect(() => {
|
|
15
15
|
navigation.setOptions({ title: t('addressList') });
|
|
16
16
|
if (!params) {
|
|
@@ -19,26 +19,23 @@ const Organization = ({ navigation, route: { params } }) => {
|
|
|
19
19
|
setOrgPath([
|
|
20
20
|
{
|
|
21
21
|
id: params.groupRootIds,
|
|
22
|
-
|
|
22
|
+
name: params.groupCategoryName,
|
|
23
23
|
},
|
|
24
24
|
]);
|
|
25
25
|
queryListTree(params.groupRootIds);
|
|
26
|
-
|
|
26
|
+
queryUserList({ groupId: params.groupRootIds });
|
|
27
|
+
}, [navigation, params]);
|
|
27
28
|
const onPressSearch = useCallback(() => {
|
|
28
29
|
console.log('onPressSearch: ');
|
|
29
30
|
navigation.navigate('UserSearch', {});
|
|
30
31
|
}, [navigation]);
|
|
31
|
-
const
|
|
32
|
+
const handleGroup = (item) => {
|
|
32
33
|
orgPath.push({
|
|
33
34
|
id: item.groupId,
|
|
34
|
-
|
|
35
|
-
groupIdPath: item.groupIdPath,
|
|
35
|
+
name: item.groupName,
|
|
36
36
|
});
|
|
37
37
|
setOrgPath(orgPath);
|
|
38
|
-
|
|
39
|
-
queryListTree(item.groupId);
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
38
|
+
queryListTree(item.groupId);
|
|
42
39
|
queryUserList(item);
|
|
43
40
|
};
|
|
44
41
|
const handleUser = (item) => {
|
|
@@ -58,24 +55,21 @@ const Organization = ({ navigation, route: { params } }) => {
|
|
|
58
55
|
})
|
|
59
56
|
.catch(err => {
|
|
60
57
|
setLoading(false);
|
|
61
|
-
|
|
58
|
+
Toast.error(t('requestFail'));
|
|
62
59
|
setOrgList([]);
|
|
63
60
|
});
|
|
64
61
|
};
|
|
65
62
|
const queryUserList = (item) => {
|
|
66
63
|
setLoading(true);
|
|
67
64
|
listUser({
|
|
68
|
-
|
|
69
|
-
groupId: '',
|
|
70
|
-
groupIdPathLike: item.groupIdPath,
|
|
65
|
+
groupId: item.groupId,
|
|
71
66
|
pageNum: 1,
|
|
72
|
-
pageSize:
|
|
67
|
+
pageSize: 1000,
|
|
73
68
|
queryAll: false,
|
|
74
|
-
userStatus: '',
|
|
69
|
+
userStatus: 'valid',
|
|
75
70
|
})
|
|
76
71
|
.then(({ data }) => {
|
|
77
72
|
setLoading(false);
|
|
78
|
-
setOrgList([]);
|
|
79
73
|
setUserList(data);
|
|
80
74
|
})
|
|
81
75
|
.catch(err => {
|
|
@@ -84,53 +78,23 @@ const Organization = ({ navigation, route: { params } }) => {
|
|
|
84
78
|
};
|
|
85
79
|
const changeOrg = (org, index) => {
|
|
86
80
|
setLoading(true);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
queryChild: false,
|
|
92
|
-
})
|
|
93
|
-
.then(({ data }) => {
|
|
94
|
-
setOrgList(data);
|
|
95
|
-
setUserList([]);
|
|
96
|
-
setLoading(false);
|
|
97
|
-
})
|
|
98
|
-
.catch(err => {
|
|
99
|
-
// Toast.error(t('requestFail'));
|
|
100
|
-
setOrgList([]);
|
|
101
|
-
setLoading(false);
|
|
81
|
+
console.log(org);
|
|
82
|
+
queryListTree(org.id);
|
|
83
|
+
queryUserList({
|
|
84
|
+
groupId: org.id,
|
|
102
85
|
});
|
|
103
86
|
let tmp = orgPath.slice(0, index + 1);
|
|
104
87
|
setOrgPath(tmp);
|
|
105
88
|
};
|
|
106
|
-
const scrollOrgPath = () => {
|
|
107
|
-
if (orgPath.length > 1) {
|
|
108
|
-
orgPathScroll.current.scrollToEnd();
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
orgPathScroll.current.scrollTo({ x: 0, y: 0, animated: false });
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
89
|
return (<NavigationPage noPadding>
|
|
115
|
-
<View style={{
|
|
116
|
-
|
|
117
|
-
|
|
90
|
+
<View style={{ paddingVertical: 8, paddingHorizontal: 10 }}>
|
|
91
|
+
<SearchBar onSearch={onPressSearch}/>
|
|
92
|
+
</View>
|
|
118
93
|
|
|
119
|
-
{orgPath
|
|
120
|
-
<ScrollView ref={orgPathScroll} horizontal={true} onContentSizeChange={scrollOrgPath} onLayout={scrollOrgPath} showsHorizontalScrollIndicator={false} contentContainerStyle={{ paddingRight: 40 }}>
|
|
121
|
-
{orgPath.map((path, index) => {
|
|
122
|
-
if (index !== orgPath.length - 1) {
|
|
123
|
-
return (<TouchableOpacity key={path.id} onPress={() => changeOrg(path, index)}>
|
|
124
|
-
<RenderPathItem path={path} index={index} orgPath={orgPath} active/>
|
|
125
|
-
</TouchableOpacity>);
|
|
126
|
-
}
|
|
127
|
-
return <RenderPathItem path={path} key={path.id} index={index} orgPath={orgPath}/>;
|
|
128
|
-
})}
|
|
129
|
-
</ScrollView>
|
|
130
|
-
</View>)}
|
|
94
|
+
<OrgPath orgPath={orgPath} onChange={changeOrg}/>
|
|
131
95
|
<ScrollView style={{ flex: 1 }}>
|
|
132
96
|
{orgList.length > 0 &&
|
|
133
|
-
orgList.map((org) => (<ListRow key={org.groupId} onPress={() =>
|
|
97
|
+
orgList.map((org) => (<ListRow key={org.groupId} onPress={() => handleGroup(org)} title={org.groupName} topSeparator="full"/>))}
|
|
134
98
|
{userList.length > 0 &&
|
|
135
99
|
userList.map((item) => (<ListRow key={item.userId} onPress={() => handleUser(item)} title={<RenderUserItem data={item}/>} topSeparator="full"/>))}
|
|
136
100
|
{userList.length === 0 && orgList.length === 0 && (<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
|
|
@@ -140,52 +104,4 @@ const Organization = ({ navigation, route: { params } }) => {
|
|
|
140
104
|
<Loading loading={loading} loadingText={t('loading')}/>
|
|
141
105
|
</NavigationPage>);
|
|
142
106
|
};
|
|
143
|
-
const RenderPathItem = (props) => {
|
|
144
|
-
const { path, index, active, orgPath } = props;
|
|
145
|
-
const theme = useTheme();
|
|
146
|
-
return (<View key={index} style={[styles.orgPathItem]}>
|
|
147
|
-
<Text style={{
|
|
148
|
-
textAlignVertical: 'center',
|
|
149
|
-
fontSize: 16,
|
|
150
|
-
height: 40,
|
|
151
|
-
lineHeight: 40,
|
|
152
|
-
color: active ? theme.primaryColor : '#A3A5A8',
|
|
153
|
-
}}>
|
|
154
|
-
{path.groupName}
|
|
155
|
-
</Text>
|
|
156
|
-
{index !== orgPath.length - 1 && (<Icon style={{
|
|
157
|
-
textAlignVertical: 'center',
|
|
158
|
-
height: 40,
|
|
159
|
-
lineHeight: 40,
|
|
160
|
-
}} name="list-arrow" size={18} color={'#bbb'}/>)}
|
|
161
|
-
</View>);
|
|
162
|
-
};
|
|
163
|
-
export const RenderUserItem = (props) => {
|
|
164
|
-
const { data, checkable, disabled, checked } = props;
|
|
165
|
-
return (<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
166
|
-
{checkable && (<View style={{ marginRight: 10 }}>
|
|
167
|
-
<Checkbox style={disabled ? { pointerEvents: 'none' } : undefined} checked={checked}/>
|
|
168
|
-
</View>)}
|
|
169
|
-
<ChatAvatar disabled={disabled} size={dp(40)} id={data.userId} url={data.avatars} name={data.userName}/>
|
|
170
|
-
<Text style={{ marginLeft: dp(10), fontSize: 16, color: '#333' }}>{data.userName}</Text>
|
|
171
|
-
</View>);
|
|
172
|
-
};
|
|
173
|
-
const styles = StyleSheet.create({
|
|
174
|
-
orgBreadcrumb: {
|
|
175
|
-
backgroundColor: '#fff',
|
|
176
|
-
marginBottom: dp(10),
|
|
177
|
-
paddingHorizontal: dp(10),
|
|
178
|
-
},
|
|
179
|
-
orgPathItem: {
|
|
180
|
-
height: dp(40),
|
|
181
|
-
lineHeight: dp(40),
|
|
182
|
-
flexDirection: 'row',
|
|
183
|
-
backgroundColor: '#fff',
|
|
184
|
-
},
|
|
185
|
-
avatars: {
|
|
186
|
-
height: dp(40),
|
|
187
|
-
width: dp(40),
|
|
188
|
-
borderRadius: dp(20),
|
|
189
|
-
},
|
|
190
|
-
});
|
|
191
107
|
export default Organization;
|
|
@@ -12,17 +12,17 @@ import React, { useEffect, useState } from 'react';
|
|
|
12
12
|
import { StyleSheet, Text, View, Dimensions } from 'react-native';
|
|
13
13
|
import { useTranslationAddrList } from '../../hooks/useTranslation';
|
|
14
14
|
import { getImManager } from '../../init';
|
|
15
|
-
import { CardInfo, Line } from './CardInfo';
|
|
16
|
-
import UserJobs from './UserJobs';
|
|
15
|
+
import { CardInfo, Line } from './components/CardInfo';
|
|
16
|
+
import UserJobs from './components/UserJobs';
|
|
17
17
|
import ChatAvatar from '../../components/ChatAvatar/ChatAvatar';
|
|
18
|
-
import {
|
|
18
|
+
import { queryUsersByCond } from '../../api/addressList';
|
|
19
19
|
const { width } = Dimensions.get('window');
|
|
20
20
|
const UserDetail = ({ navigation, route: { params } }) => {
|
|
21
21
|
const [detail, setDetail] = useState({});
|
|
22
22
|
const { t } = useTranslationAddrList();
|
|
23
23
|
useEffect(() => {
|
|
24
24
|
navigation.setOptions({ title: t('userDetail') });
|
|
25
|
-
|
|
25
|
+
queryUsersByCond([params.userId]).then(({ data }) => {
|
|
26
26
|
console.log('userDetail: ', data[0]);
|
|
27
27
|
setDetail(data[0]);
|
|
28
28
|
});
|
|
@@ -34,7 +34,7 @@ const UserDetail = ({ navigation, route: { params } }) => {
|
|
|
34
34
|
return (<NavigationPage noPadding scroll>
|
|
35
35
|
<CardInfo>
|
|
36
36
|
<Line>
|
|
37
|
-
<ChatAvatar id={detail.userId} size={dp(60)} name={detail.userName} url={detail.avatars}
|
|
37
|
+
<ChatAvatar id={detail.userId} size={dp(60)} name={detail.userName} url={detail.avatars} disabled needUpdate/>
|
|
38
38
|
<View style={styles.accountInfo}>
|
|
39
39
|
<Text style={styles.username} numberOfLines={2}>
|
|
40
40
|
{detail.userName}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { NavigationPage, ListRow, HeaderSearchBar } from '@smart-link/rn-ui';
|
|
2
2
|
import React, { memo, useEffect, useState } from 'react';
|
|
3
3
|
import { Text, View, StyleSheet } from 'react-native';
|
|
4
|
-
import
|
|
5
|
-
import { RenderUserItem } from './Organization';
|
|
4
|
+
import useTranslation from '../../hooks/useTranslation';
|
|
6
5
|
import { searchUser } from '../../api/addressList';
|
|
7
6
|
import { getImManager } from '../../init';
|
|
8
7
|
import { useDispatch } from 'react-redux';
|
|
9
8
|
import { onSelectUser } from '../../slice/contact/contact.slice';
|
|
10
9
|
import { useContact } from '../../hooks/useImSelector';
|
|
10
|
+
import RenderUserItem from "./components/RenderUserItem";
|
|
11
11
|
const UserSearch = memo(({ navigation, route: { params } }) => {
|
|
12
12
|
const [keyword, setKeyword] = useState('');
|
|
13
13
|
const { selectUsers } = useContact();
|
|
14
14
|
const { checkable } = params || {};
|
|
15
15
|
const [userList, setUserList] = useState([]);
|
|
16
|
-
const { t } =
|
|
16
|
+
const { t } = useTranslation();
|
|
17
17
|
const imManager = getImManager();
|
|
18
18
|
const dispatch = useDispatch();
|
|
19
19
|
const selectCount = Object.keys(selectUsers).length;
|
|
@@ -23,16 +23,15 @@ const UserSearch = memo(({ navigation, route: { params } }) => {
|
|
|
23
23
|
}
|
|
24
24
|
searchUser({
|
|
25
25
|
userNameLike: keyword,
|
|
26
|
-
tenantId: imManager.user.tenantId,
|
|
27
26
|
}).then(({ data }) => {
|
|
28
|
-
setUserList(data);
|
|
27
|
+
setUserList(data || []);
|
|
29
28
|
});
|
|
30
29
|
}, [keyword]);
|
|
31
30
|
const handleUser = (item) => {
|
|
32
31
|
navigation.navigate('UserDetail', { userId: item.userId, userAccount: item.userAccount });
|
|
33
32
|
};
|
|
34
33
|
return (<>
|
|
35
|
-
<HeaderSearchBar value={keyword} onSubmitEditing={setKeyword}/>
|
|
34
|
+
<HeaderSearchBar value={keyword} onSubmitEditing={setKeyword} confirmText={selectCount > 0 ? `${t('confirm')}(${selectCount})` : undefined}/>
|
|
36
35
|
<NavigationPage noPadding scroll={userList.length > 0}>
|
|
37
36
|
{userList.length > 0 ? (userList.map((item) => (<ListRow key={item.userId} onPress={() => {
|
|
38
37
|
if (checkable) {
|
|
@@ -45,7 +44,7 @@ const UserSearch = memo(({ navigation, route: { params } }) => {
|
|
|
45
44
|
<Text>{t('noData')}</Text>
|
|
46
45
|
</View>)}
|
|
47
46
|
</NavigationPage>
|
|
48
|
-
|
|
47
|
+
</>);
|
|
49
48
|
});
|
|
50
49
|
const styles = StyleSheet.create({
|
|
51
50
|
noData: {
|
|
@@ -46,5 +46,14 @@ declare const addressListRoutes: readonly [{
|
|
|
46
46
|
readonly animation: "fade";
|
|
47
47
|
readonly headerShown: false;
|
|
48
48
|
};
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "MyGroups";
|
|
51
|
+
readonly component: ({ navigation }: {
|
|
52
|
+
navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<import("..").IMPageParamList, "MyGroups", undefined>;
|
|
53
|
+
route: import("@react-navigation/native").RouteProp<import("..").IMPageParamList, "MyGroups">;
|
|
54
|
+
}) => import("react").JSX.Element;
|
|
55
|
+
readonly options: {
|
|
56
|
+
readonly title: "";
|
|
57
|
+
};
|
|
49
58
|
}];
|
|
50
59
|
export default addressListRoutes;
|
|
@@ -3,6 +3,7 @@ import UserSearch from './UserSearch';
|
|
|
3
3
|
import ChooseContact from './ChooseContact';
|
|
4
4
|
import Organization from './Organization';
|
|
5
5
|
import AddressList from './AddressList';
|
|
6
|
+
import MyGroups from "./MyGroups";
|
|
6
7
|
const addressListRoutes = [
|
|
7
8
|
{
|
|
8
9
|
name: 'AddressList',
|
|
@@ -41,5 +42,12 @@ const addressListRoutes = [
|
|
|
41
42
|
headerShown: false,
|
|
42
43
|
},
|
|
43
44
|
},
|
|
45
|
+
{
|
|
46
|
+
name: 'MyGroups',
|
|
47
|
+
component: MyGroups,
|
|
48
|
+
options: {
|
|
49
|
+
title: ''
|
|
50
|
+
}
|
|
51
|
+
}
|
|
44
52
|
];
|
|
45
53
|
export default addressListRoutes;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { dp } from '@smart-link/rn-ui';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Svg, Path } from 'react-native-svg';
|
|
4
|
+
export const Unfold = (props) => {
|
|
5
|
+
const { size = 32, color } = props || {};
|
|
6
|
+
return (<Svg viewBox="0 0 1024 1024" width={dp(size)} height={dp(size)}>
|
|
7
|
+
<Path d="M832 800H256a32 32 0 0 1-32-32V192a32 32 0 0 1 64 0v544h544a32 32 0 1 1 0 64z" fill={color}/>
|
|
8
|
+
</Svg>);
|
|
9
|
+
};
|
|
10
|
+
export const Group = (props) => {
|
|
11
|
+
const { size = 32, color } = props || {};
|
|
12
|
+
return <Svg viewBox="0 0 1024 1024" width={dp(size)} height={dp(size)}>
|
|
13
|
+
<Path fill={color} d="M630.79033203 470.75556641c45.00966797-35.34433594 74.04433594-90.08525391 74.04433594-151.60605469 0-106.34326172-86.50634766-192.85136719-192.85048828-192.85136719-106.34501953 0-192.85136719 86.50634766-192.85136719 192.85136719 0 61.52080078 29.06542969 116.26171875 74.04609375 151.60605469C274.65576172 518.12158203 190.56640625 633.91308594 190.56640625 769.1328125v64.28320313c0 17.76708984 14.37626953 32.14248047 32.14335938 32.14248046h578.55058593c17.76621094 0 32.14160156-14.37539062 32.14160157-32.14248047v-64.28320312c0.00087891-135.25224609-84.05771484-251.01123047-202.6116211-298.37724609zM511.9859375 190.58398437c70.90664063 0 128.56816406 57.65888672 128.56816406 128.56640626S582.89257813 447.71679687 511.9859375 447.71679687 383.41601562 390.05615234 383.41601562 319.14951172s57.66152344-128.56640625 128.56904297-128.56640625z m257.1328125 610.69306641H254.85048828V769.1328125c0-141.77988281 115.35292969-257.1328125 257.16533203-257.1328125 141.78076172 0 257.10117187 115.35292969 257.10117188 257.1328125v32.14335938zM296.81738281 481.92998047c0.87978516-1.94589844 0.87978516-4.01748047 1.31835938-6.02666016 0.31376953-1.22431641 0.65917969-2.38447266 0.81738281-3.67207031 0.24960937-2.54267578 0.09404297-4.95791016-0.25136719-7.43818359-0.12568359-1.31835938 0.18808594-2.57431641-0.12568359-3.89179688-0.18808594-0.75410156-0.72070313-1.28759766-0.94130859-2.04169922-0.50097656-1.44316406-1.19267578-2.72988281-1.8834961-4.07988281-1.31835938-2.76328125-2.76328125-5.2734375-4.7399414-7.50058594-0.28300781-0.31376953-0.62841797-0.53349609-0.9413086-0.84726562a30.84345703 30.84345703 0 0 0-10.10742187-7.03125c-34.77832031-15.50566406-57.25283203-50.03349609-57.25283203-88.07607422 0-44.7609375 30.31962891-83.30449219 73.76132812-93.75732422 17.26347656-4.17568359 27.87275391-21.53320313 23.72958984-38.79667969-4.20644531-17.26435547-21.62724609-27.74707031-38.79667968-23.72958984-72.41308594 17.4515625-122.98007813 81.73476563-122.98007813 156.28359375 0 40.68017578 15.47490234 78.81591797 41.77880859 107.8180664C116.55458984 502.49023437 62.00175781 589.18291016 62.00175781 687.27324219v49.71972656c0 17.76621094 14.37539062 32.14160156 32.14160156 32.14160156s32.14160156-14.37539062 32.14160157-32.14160156v-49.71972656c0-88.89257813 59.76386719-165.16582031 145.51611328-186.76142578 10.67167969-1.50732422 20.37041016-8.00332031 25.0171875-18.58183594zM823.64082031 459.14082031c26.30302734-29.00214844 41.77617188-67.13964844 41.77617188-107.8180664 0-72.60117187-48.90234375-136.44492187-118.93007813-155.24648438-17.10615234-4.584375-34.74667969 5.5546875-39.39257812 22.69335938-4.61425781 17.16943359 5.55556641 34.77919922 22.69423828 39.39257812 41.99677734 11.26845703 71.34609375 49.59404297 71.34609375 93.16230469 0 38.04257812-22.44375 72.50800781-57.19042969 88.04355469-3.89091797 1.69628906-7.3125 4.05-10.26298828 7.12617187-0.25048828 0.28300781-0.56601563 0.47109375-0.81650391 0.75410156-2.00917969 2.22714844-3.45234375 4.80234375-4.80234375 7.59550782-0.65917969 1.35-1.37988281 2.60507812-1.85097656 4.01748046-0.21972656 0.72158203-0.75410156 1.28759766-0.9421875 2.04082032-0.31289062 1.31835938 0 2.57519531-0.12480469 3.89355468-0.34628906 2.47851563-0.50097656 4.89550781-0.25136718 7.43730469 0.15820313 1.28759766 0.50097656 2.44775391 0.81738281 3.67207031 0.43769531 2.00917969 0.43769531 4.08076172 1.31748047 6.02666016 4.64589844 10.57851562 14.34375 17.07626953 25.01455078 18.58183594 85.753125 21.59736328 145.51787109 97.86884766 145.51787109 186.76142578v49.71972656c0 17.76621094 14.37539062 32.14160156 32.14160157 32.14160157s32.14072266-14.37539062 32.14072265-32.14160157v-49.71972656c0.00175781-98.09208984-54.55107422-184.78564453-138.20185547-228.13417969z"></Path>
|
|
14
|
+
</Svg>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type IOrgPath = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
type?: 'org' | 'role' | 'orgCategory';
|
|
6
|
+
};
|
|
7
|
+
export type OrgPathProps = {
|
|
8
|
+
orgPath: IOrgPath[];
|
|
9
|
+
onChange: (org: IOrgPath, index: number) => void;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: React.MemoExoticComponent<({ orgPath, onChange }: OrgPathProps) => React.JSX.Element | null>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React, { memo, useRef } from "react";
|
|
2
|
+
import { ScrollView, StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
3
|
+
import { CaihIcon as Icon, dp, useTheme } from "@smart-link/rn-ui";
|
|
4
|
+
const OrgPath = ({ orgPath, onChange }) => {
|
|
5
|
+
const orgPathScroll = useRef(null);
|
|
6
|
+
if (!orgPath.length)
|
|
7
|
+
return null;
|
|
8
|
+
const scrollOrgPath = () => {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
if (orgPath.length > 1) {
|
|
11
|
+
(_a = orgPathScroll.current) === null || _a === void 0 ? void 0 : _a.scrollToEnd();
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
(_b = orgPathScroll.current) === null || _b === void 0 ? void 0 : _b.scrollTo({ x: 0, y: 0, animated: false });
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
return <View style={styles.orgBreadcrumb}>
|
|
18
|
+
<ScrollView ref={orgPathScroll} horizontal={true} onContentSizeChange={scrollOrgPath} onLayout={scrollOrgPath} showsHorizontalScrollIndicator={false} contentContainerStyle={{ paddingRight: 40 }}>
|
|
19
|
+
{orgPath.map((path, index) => {
|
|
20
|
+
if (index !== orgPath.length - 1) {
|
|
21
|
+
return (<TouchableOpacity key={path.id} onPress={() => onChange(path, index)}>
|
|
22
|
+
<RenderPathItem path={path} index={index} orgPath={orgPath} active/>
|
|
23
|
+
</TouchableOpacity>);
|
|
24
|
+
}
|
|
25
|
+
return <RenderPathItem path={path} key={path.id} index={index} orgPath={orgPath}/>;
|
|
26
|
+
})}
|
|
27
|
+
</ScrollView>
|
|
28
|
+
</View>;
|
|
29
|
+
};
|
|
30
|
+
const RenderPathItem = (props) => {
|
|
31
|
+
const { path, index, active, orgPath } = props;
|
|
32
|
+
const theme = useTheme();
|
|
33
|
+
return (<View key={index} style={[styles.orgPathItem]}>
|
|
34
|
+
<Text style={{
|
|
35
|
+
textAlignVertical: 'center',
|
|
36
|
+
fontSize: 16,
|
|
37
|
+
color: active ? theme.primaryColor : '#A3A5A8',
|
|
38
|
+
}}>
|
|
39
|
+
{path.name}
|
|
40
|
+
</Text>
|
|
41
|
+
{index !== orgPath.length - 1 && (<Icon style={{
|
|
42
|
+
textAlignVertical: 'center',
|
|
43
|
+
}} name="list-arrow" size={18} color={'#bbb'}/>)}
|
|
44
|
+
</View>);
|
|
45
|
+
};
|
|
46
|
+
const styles = StyleSheet.create({
|
|
47
|
+
orgBreadcrumb: {
|
|
48
|
+
backgroundColor: '#fff',
|
|
49
|
+
marginBottom: dp(10),
|
|
50
|
+
paddingHorizontal: dp(10),
|
|
51
|
+
},
|
|
52
|
+
orgPathItem: {
|
|
53
|
+
height: dp(40),
|
|
54
|
+
flexDirection: 'row',
|
|
55
|
+
backgroundColor: '#fff',
|
|
56
|
+
alignItems: 'center',
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
export default memo(OrgPath);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IUser } from "@smart-link/im-base";
|
|
3
|
+
declare const RenderUserItem: (props: {
|
|
4
|
+
data: IUser;
|
|
5
|
+
checkable?: boolean;
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}) => import("react").JSX.Element;
|
|
9
|
+
export default RenderUserItem;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { View, Text } from "react-native";
|
|
2
|
+
import { Checkbox, dp } from "@smart-link/rn-ui";
|
|
3
|
+
import ChatAvatar from "../../../components/ChatAvatar";
|
|
4
|
+
const RenderUserItem = (props) => {
|
|
5
|
+
const { data, checkable, disabled, checked } = props;
|
|
6
|
+
return (<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
7
|
+
{checkable && (<View style={{ marginRight: 10 }}>
|
|
8
|
+
<Checkbox disabled={disabled} style={disabled ? { pointerEvents: 'none' } : undefined} checked={checked}/>
|
|
9
|
+
</View>)}
|
|
10
|
+
<ChatAvatar disabled={disabled} size={dp(40)} id={data.userId} url={data.avatars} name={data.userName}/>
|
|
11
|
+
<Text style={{ marginLeft: dp(10), fontSize: 16, color: '#333' }}>{data.userName}</Text>
|
|
12
|
+
</View>);
|
|
13
|
+
};
|
|
14
|
+
export default RenderUserItem;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { dp, useTheme } from '@smart-link/rn-ui';
|
|
2
2
|
import { View, Text, StyleSheet } from 'react-native';
|
|
3
|
-
import { useTranslationAddrList } from '
|
|
3
|
+
import { useTranslationAddrList } from '../../../hooks/useTranslation';
|
|
4
4
|
import { CardInfo, Line } from './CardInfo';
|
|
5
5
|
const UserJobs = (props) => {
|
|
6
6
|
const { jobs } = props;
|
|
@@ -10,7 +10,7 @@ const UserJobs = (props) => {
|
|
|
10
10
|
return (<CardInfo>
|
|
11
11
|
{(jobs === null || jobs === void 0 ? void 0 : jobs.length) > 0 &&
|
|
12
12
|
jobs.map(job => {
|
|
13
|
-
let isMainJob = job.
|
|
13
|
+
let isMainJob = job.major === 'y';
|
|
14
14
|
return (<Line key={job.groupId}>
|
|
15
15
|
<View style={isMainJob ? styles.mainJob : styles.partJob}>
|
|
16
16
|
<Text style={{ color: isMainJob ? '#fff' : theme.primaryColor }}>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { listGroupCategory } from "../../api/addressList";
|
|
3
|
+
export default function useGroupCategory() {
|
|
4
|
+
const [groupCategoryList, setGroupCategoryList] = useState([]);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
listGroupCategory({}).then(({ data }) => {
|
|
7
|
+
setGroupCategoryList(data);
|
|
8
|
+
});
|
|
9
|
+
}, []);
|
|
10
|
+
return groupCategoryList;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { listRole } from "../../api/addressList";
|
|
3
|
+
export default function useRoleList() {
|
|
4
|
+
const [roleList, setRoleList] = useState([]);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
listRole().then(({ data }) => {
|
|
7
|
+
setRoleList(data);
|
|
8
|
+
});
|
|
9
|
+
}, []);
|
|
10
|
+
return roleList;
|
|
11
|
+
}
|
|
@@ -7,31 +7,75 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { NavigationPage, dp, useNavigation, HeaderSearchBar } from '@smart-link/rn-ui';
|
|
10
|
+
import { NavigationPage, dp, useNavigation, HeaderSearchBar, ActionSheet } from '@smart-link/rn-ui';
|
|
11
11
|
import React, { useEffect, useState } from 'react';
|
|
12
12
|
import { Text, TouchableOpacity, View, StyleSheet, FlatList } from 'react-native';
|
|
13
13
|
import useTranslation from '../../hooks/useTranslation';
|
|
14
14
|
import { getImManager } from '../../init';
|
|
15
15
|
import { useCollection, useConversation } from '../../hooks/useImSelector';
|
|
16
16
|
import ContentFactory from './ContentFactory';
|
|
17
|
+
import { CollectionActions, ConversationActions, MessageActions } from '@smart-link/im-base';
|
|
17
18
|
import { borderStyle, shadowStyle } from '../../components/styles';
|
|
18
19
|
import FormatTimeText from '../../components/FormatTimeText';
|
|
19
|
-
import {
|
|
20
|
+
import { cloneDeep } from "lodash-es";
|
|
21
|
+
import { StackActions } from "@react-navigation/native";
|
|
20
22
|
const Collection = () => {
|
|
21
23
|
const { t } = useTranslation();
|
|
22
24
|
const [keyword, setKeyword] = useState('');
|
|
23
25
|
const { currentConversation } = useConversation();
|
|
24
26
|
const { collections } = useCollection();
|
|
25
27
|
const navigation = useNavigation();
|
|
28
|
+
const imManager = getImManager();
|
|
26
29
|
useEffect(() => {
|
|
27
|
-
|
|
30
|
+
imManager.selectCollections(keyword);
|
|
28
31
|
}, [keyword]);
|
|
29
32
|
const onPressCollection = (collection) => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
const { close } = ActionSheet.open({
|
|
34
|
+
title: null,
|
|
35
|
+
options: [
|
|
36
|
+
{
|
|
37
|
+
text: t('jumpToChatContext'),
|
|
38
|
+
onPress: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
+
close();
|
|
40
|
+
if (currentConversation) {
|
|
41
|
+
navigation.dispatch(StackActions.popToTop());
|
|
42
|
+
}
|
|
43
|
+
yield imManager.store.dispatch(ConversationActions.initSearchConversation(imManager, collection.conversationId, collection.messageSeq));
|
|
44
|
+
navigation.navigate('MessageList');
|
|
45
|
+
})
|
|
46
|
+
},
|
|
47
|
+
currentConversation ? {
|
|
48
|
+
text: t('sendTo') + (currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.name),
|
|
49
|
+
onPress: () => {
|
|
50
|
+
close();
|
|
51
|
+
imManager.sendCollectionMessage(collection);
|
|
52
|
+
navigation.goBack();
|
|
53
|
+
}
|
|
54
|
+
} : {
|
|
55
|
+
text: t('forward'),
|
|
56
|
+
onPress: () => {
|
|
57
|
+
close();
|
|
58
|
+
const forwardMessage = cloneDeep(collection);
|
|
59
|
+
if (forwardMessage.payload) {
|
|
60
|
+
forwardMessage.payload.forward = true;
|
|
61
|
+
}
|
|
62
|
+
imManager.store.dispatch(MessageActions.setForwardMessage(forwardMessage));
|
|
63
|
+
navigation.navigate('ForwardToConversation');
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
text: t('unCollect'),
|
|
68
|
+
textColor: '#ff0617',
|
|
69
|
+
onPress: () => {
|
|
70
|
+
close();
|
|
71
|
+
imManager.store.dispatch(CollectionActions.unCollection(imManager, collection));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
cancelButton: {
|
|
76
|
+
text: t('cancel'),
|
|
77
|
+
}
|
|
78
|
+
});
|
|
35
79
|
};
|
|
36
80
|
const keyExtractor = (item) => item.messageSeq;
|
|
37
81
|
const itemSeparatorComponent = () => <View style={styles.h10}/>;
|