@smart-link/rn-im 1.0.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/README.md +34 -0
- package/assets/avatars-busi-notify.png +0 -0
- package/assets/avatars-empty.png +0 -0
- package/assets/avatars-group.jpg +0 -0
- package/assets/avatars-man.jpg +0 -0
- package/assets/avatars-woman.jpg +0 -0
- package/assets/cloud-backup-begin.png +0 -0
- package/assets/cloud-backup.png +0 -0
- package/assets/group-mgr.png +0 -0
- package/assets/group-owner.png +0 -0
- package/assets/hook-black-double.png +0 -0
- package/assets/hook-black.png +0 -0
- package/assets/hook-blue-double.png +0 -0
- package/assets/hook-blue.png +0 -0
- package/assets/hook-green.png +0 -0
- package/assets/no_message.png +0 -0
- package/assets/share.jpeg +0 -0
- package/assets/voice-left-playing.gif +0 -0
- package/assets/voice-left.png +0 -0
- package/dist/api/addressList.d.ts +27 -0
- package/dist/api/addressList.js +18 -0
- package/dist/api/backup.d.ts +18 -0
- package/dist/api/backup.js +29 -0
- package/dist/api/file.d.ts +4 -0
- package/dist/api/file.js +49 -0
- package/dist/api/user.d.ts +8 -0
- package/dist/api/user.js +16 -0
- package/dist/components/CachedImage.d.ts +11 -0
- package/dist/components/CachedImage.js +48 -0
- package/dist/components/Camera/Camera.d.ts +10 -0
- package/dist/components/Camera/Camera.js +100 -0
- package/dist/components/Camera/CameraCapture.d.ts +32 -0
- package/dist/components/Camera/CameraCapture.js +360 -0
- package/dist/components/Camera/CameraResult.d.ts +11 -0
- package/dist/components/Camera/CameraResult.js +102 -0
- package/dist/components/ChatAvatar/ChatAvatar.d.ts +15 -0
- package/dist/components/ChatAvatar/ChatAvatar.js +134 -0
- package/dist/components/ChatAvatar/ChatAvatarId.d.ts +8 -0
- package/dist/components/ChatAvatar/ChatAvatarId.js +92 -0
- package/dist/components/ChatAvatar/ChatAvatarLocal.d.ts +9 -0
- package/dist/components/ChatAvatar/ChatAvatarLocal.js +76 -0
- package/dist/components/ChatAvatar/index.d.ts +2 -0
- package/dist/components/ChatAvatar/index.js +23 -0
- package/dist/components/Favicon.d.ts +7 -0
- package/dist/components/Favicon.js +74 -0
- package/dist/components/FormatTimeText.d.ts +8 -0
- package/dist/components/FormatTimeText.js +24 -0
- package/dist/components/Highlighter.d.ts +9 -0
- package/dist/components/Highlighter.js +42 -0
- package/dist/components/IndicatorText.d.ts +10 -0
- package/dist/components/IndicatorText.js +47 -0
- package/dist/components/LocalImage.d.ts +10 -0
- package/dist/components/LocalImage.js +37 -0
- package/dist/components/NetworkUnconnected.d.ts +3 -0
- package/dist/components/NetworkUnconnected.js +55 -0
- package/dist/components/PopoverWrapper.d.ts +13 -0
- package/dist/components/PopoverWrapper.js +78 -0
- package/dist/components/VideoPlayer.d.ts +13 -0
- package/dist/components/VideoPlayer.js +288 -0
- package/dist/components/styles.d.ts +19 -0
- package/dist/components/styles.js +23 -0
- package/dist/default-assets.d.ts +18 -0
- package/dist/default-assets.js +22 -0
- package/dist/hooks/useFormatMsgTime.d.ts +4 -0
- package/dist/hooks/useFormatMsgTime.js +53 -0
- package/dist/hooks/useImSelector.d.ts +15 -0
- package/dist/hooks/useImSelector.js +48 -0
- package/dist/hooks/useTranslation.d.ts +13 -0
- package/dist/hooks/useTranslation.js +12 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +28 -0
- package/dist/init.d.ts +17 -0
- package/dist/init.js +116 -0
- package/dist/interface.d.ts +47 -0
- package/dist/interface.js +2 -0
- package/dist/locales/en/addressList.d.ts +3 -0
- package/dist/locales/en/addressList.js +31 -0
- package/dist/locales/index.d.ts +4 -0
- package/dist/locales/index.js +27 -0
- package/dist/locales/lao/addressList.d.ts +3 -0
- package/dist/locales/lao/addressList.js +31 -0
- package/dist/locales/zh/addressList.d.ts +30 -0
- package/dist/locales/zh/addressList.js +32 -0
- package/dist/pages/address-list/AddressList.d.ts +6 -0
- package/dist/pages/address-list/AddressList.js +158 -0
- package/dist/pages/address-list/CardInfo.d.ts +15 -0
- package/dist/pages/address-list/CardInfo.js +42 -0
- package/dist/pages/address-list/ChooseContact.d.ts +6 -0
- package/dist/pages/address-list/ChooseContact.js +197 -0
- package/dist/pages/address-list/Icons.d.ts +5 -0
- package/dist/pages/address-list/Icons.js +16 -0
- package/dist/pages/address-list/Organization.d.ts +13 -0
- package/dist/pages/address-list/Organization.js +221 -0
- package/dist/pages/address-list/UserDetail.d.ts +6 -0
- package/dist/pages/address-list/UserDetail.js +131 -0
- package/dist/pages/address-list/UserJobs.d.ts +6 -0
- package/dist/pages/address-list/UserJobs.js +50 -0
- package/dist/pages/address-list/UserSearch.d.ts +6 -0
- package/dist/pages/address-list/UserSearch.js +82 -0
- package/dist/pages/address-list/addressList.routes.d.ts +50 -0
- package/dist/pages/address-list/addressList.routes.js +50 -0
- package/dist/pages/collection/Collection.d.ts +3 -0
- package/dist/pages/collection/Collection.js +136 -0
- package/dist/pages/collection/ContentFactory.d.ts +6 -0
- package/dist/pages/collection/ContentFactory.js +167 -0
- package/dist/pages/collection/collection.routes.d.ts +9 -0
- package/dist/pages/collection/collection.routes.js +17 -0
- package/dist/pages/conversation/ForwardToConversation.d.ts +6 -0
- package/dist/pages/conversation/ForwardToConversation.js +172 -0
- package/dist/pages/conversation/List.d.ts +6 -0
- package/dist/pages/conversation/List.js +204 -0
- package/dist/pages/conversation/components/ConversationCard.d.ts +12 -0
- package/dist/pages/conversation/components/ConversationCard.js +142 -0
- package/dist/pages/conversation/components/ConversationOption.d.ts +11 -0
- package/dist/pages/conversation/components/ConversationOption.js +99 -0
- package/dist/pages/conversation/conversation.routes.d.ts +2 -0
- package/dist/pages/conversation/conversation.routes.js +74 -0
- package/dist/pages/conversation/setting/GroupTransfer.d.ts +6 -0
- package/dist/pages/conversation/setting/GroupTransfer.js +88 -0
- package/dist/pages/conversation/setting/OptionAvatars.d.ts +22 -0
- package/dist/pages/conversation/setting/OptionAvatars.js +152 -0
- package/dist/pages/conversation/setting/OptionCancelGroup.d.ts +6 -0
- package/dist/pages/conversation/setting/OptionCancelGroup.js +49 -0
- package/dist/pages/conversation/setting/OptionConversation.d.ts +19 -0
- package/dist/pages/conversation/setting/OptionConversation.js +71 -0
- package/dist/pages/conversation/setting/OptionGroup.d.ts +17 -0
- package/dist/pages/conversation/setting/OptionGroup.js +76 -0
- package/dist/pages/conversation/setting/OptionGroupManage.d.ts +6 -0
- package/dist/pages/conversation/setting/OptionGroupManage.js +68 -0
- package/dist/pages/conversation/setting/OptionGroupMoreMember.d.ts +4 -0
- package/dist/pages/conversation/setting/OptionGroupMoreMember.js +124 -0
- package/dist/pages/conversation/setting/OptionGroupNameOrNoticeEdit.d.ts +6 -0
- package/dist/pages/conversation/setting/OptionGroupNameOrNoticeEdit.js +149 -0
- package/dist/pages/conversation/setting/Setting.d.ts +6 -0
- package/dist/pages/conversation/setting/Setting.js +184 -0
- package/dist/pages/conversation/setting/SettingChatBg.d.ts +6 -0
- package/dist/pages/conversation/setting/SettingChatBg.js +95 -0
- package/dist/pages/index.d.ts +8 -0
- package/dist/pages/index.js +27 -0
- package/dist/pages/message/ChooseMember.d.ts +6 -0
- package/dist/pages/message/ChooseMember.js +185 -0
- package/dist/pages/message/MessageBackup/Bar.d.ts +8 -0
- package/dist/pages/message/MessageBackup/Bar.js +77 -0
- package/dist/pages/message/MessageBackup/MessageBackup.d.ts +10 -0
- package/dist/pages/message/MessageBackup/MessageBackup.js +133 -0
- package/dist/pages/message/MessageBackup/RestoreBackupPage.d.ts +6 -0
- package/dist/pages/message/MessageBackup/RestoreBackupPage.js +135 -0
- package/dist/pages/message/MessageBackup/StartBackupPage.d.ts +6 -0
- package/dist/pages/message/MessageBackup/StartBackupPage.js +135 -0
- package/dist/pages/message/MessageBackup/index.d.ts +3 -0
- package/dist/pages/message/MessageBackup/index.js +12 -0
- package/dist/pages/message/MessageBackup/utils.d.ts +46 -0
- package/dist/pages/message/MessageBackup/utils.js +239 -0
- package/dist/pages/message/MessageList.d.ts +6 -0
- package/dist/pages/message/MessageList.js +175 -0
- package/dist/pages/message/MessageRecord.d.ts +6 -0
- package/dist/pages/message/MessageRecord.js +97 -0
- package/dist/pages/message/components/BusiNotifyCard.d.ts +6 -0
- package/dist/pages/message/components/BusiNotifyCard.js +132 -0
- package/dist/pages/message/components/ChatBg.d.ts +7 -0
- package/dist/pages/message/components/ChatBg.js +65 -0
- package/dist/pages/message/components/MessageItem.d.ts +16 -0
- package/dist/pages/message/components/MessageItem.js +205 -0
- package/dist/pages/message/components/MessageItemQuote.d.ts +7 -0
- package/dist/pages/message/components/MessageItemQuote.js +83 -0
- package/dist/pages/message/components/MessageItemTips.d.ts +9 -0
- package/dist/pages/message/components/MessageItemTips.js +67 -0
- package/dist/pages/message/components/MessageOption.d.ts +11 -0
- package/dist/pages/message/components/MessageOption.js +360 -0
- package/dist/pages/message/components/MessagePayload.d.ts +14 -0
- package/dist/pages/message/components/MessagePayload.js +96 -0
- package/dist/pages/message/components/MessagePictureAlbum.d.ts +10 -0
- package/dist/pages/message/components/MessagePictureAlbum.js +105 -0
- package/dist/pages/message/components/MessageReceiptStatus.d.ts +6 -0
- package/dist/pages/message/components/MessageReceiptStatus.js +61 -0
- package/dist/pages/message/components/MessageUndo.d.ts +10 -0
- package/dist/pages/message/components/MessageUndo.js +75 -0
- package/dist/pages/message/components/MultipleBar/index.d.ts +5 -0
- package/dist/pages/message/components/MultipleBar/index.js +116 -0
- package/dist/pages/message/components/Payload/PayloadContact.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadContact.js +86 -0
- package/dist/pages/message/components/Payload/PayloadFile.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadFile.js +115 -0
- package/dist/pages/message/components/Payload/PayloadMultiple.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadMultiple.js +102 -0
- package/dist/pages/message/components/Payload/PayloadNotify.d.ts +9 -0
- package/dist/pages/message/components/Payload/PayloadNotify.js +92 -0
- package/dist/pages/message/components/Payload/PayloadPicture.d.ts +7 -0
- package/dist/pages/message/components/Payload/PayloadPicture.js +69 -0
- package/dist/pages/message/components/Payload/PayloadShare.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadShare.js +100 -0
- package/dist/pages/message/components/Payload/PayloadText.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadText.js +128 -0
- package/dist/pages/message/components/Payload/PayloadVideo.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadVideo.js +78 -0
- package/dist/pages/message/components/Payload/PayloadVoice.d.ts +6 -0
- package/dist/pages/message/components/Payload/PayloadVoice.js +155 -0
- package/dist/pages/message/components/Payload/PayloadWrapper.d.ts +12 -0
- package/dist/pages/message/components/Payload/PayloadWrapper.js +73 -0
- package/dist/pages/message/components/Payload/type.d.ts +9 -0
- package/dist/pages/message/components/Payload/type.js +2 -0
- package/dist/pages/message/components/ReceiptBack.d.ts +7 -0
- package/dist/pages/message/components/ReceiptBack.js +82 -0
- package/dist/pages/message/components/TextMixMessage.d.ts +9 -0
- package/dist/pages/message/components/TextMixMessage.js +62 -0
- package/dist/pages/message/components/TextMixQuote.d.ts +61 -0
- package/dist/pages/message/components/TextMixQuote.js +276 -0
- package/dist/pages/message/components/TextMixQuoteMessage.d.ts +14 -0
- package/dist/pages/message/components/TextMixQuoteMessage.js +74 -0
- package/dist/pages/message/components/UploadProgress.d.ts +9 -0
- package/dist/pages/message/components/UploadProgress.js +51 -0
- package/dist/pages/message/components/messageBar/EmojiPanel.d.ts +11 -0
- package/dist/pages/message/components/messageBar/EmojiPanel.js +101 -0
- package/dist/pages/message/components/messageBar/Icons.d.ts +18 -0
- package/dist/pages/message/components/messageBar/Icons.js +88 -0
- package/dist/pages/message/components/messageBar/MessageBar.d.ts +12 -0
- package/dist/pages/message/components/messageBar/MessageBar.js +273 -0
- package/dist/pages/message/components/messageBar/MessageInput.d.ts +21 -0
- package/dist/pages/message/components/messageBar/MessageInput.js +203 -0
- package/dist/pages/message/components/messageBar/OptionPanel.d.ts +8 -0
- package/dist/pages/message/components/messageBar/OptionPanel.js +240 -0
- package/dist/pages/message/components/messageBar/VoiceBar.d.ts +3 -0
- package/dist/pages/message/components/messageBar/VoiceBar.js +272 -0
- package/dist/pages/message/components/messageBar/index.d.ts +2 -0
- package/dist/pages/message/components/messageBar/index.js +23 -0
- package/dist/pages/message/message.routes.d.ts +2 -0
- package/dist/pages/message/message.routes.js +79 -0
- package/dist/pages/search/Search.d.ts +6 -0
- package/dist/pages/search/Search.js +84 -0
- package/dist/pages/search/SearchChatRecords.d.ts +3 -0
- package/dist/pages/search/SearchChatRecords.js +173 -0
- package/dist/pages/search/SearchFile.d.ts +3 -0
- package/dist/pages/search/SearchFile.js +202 -0
- package/dist/pages/search/SearchManager.d.ts +6 -0
- package/dist/pages/search/SearchManager.js +111 -0
- package/dist/pages/search/SearchPicturePage.d.ts +6 -0
- package/dist/pages/search/SearchPicturePage.js +56 -0
- package/dist/pages/search/components/ChatRecords.d.ts +6 -0
- package/dist/pages/search/components/ChatRecords.js +151 -0
- package/dist/pages/search/components/MyGroupChat.d.ts +6 -0
- package/dist/pages/search/components/MyGroupChat.js +128 -0
- package/dist/pages/search/components/PictureMulipleBar.d.ts +10 -0
- package/dist/pages/search/components/PictureMulipleBar.js +105 -0
- package/dist/pages/search/components/SearchFileList.d.ts +7 -0
- package/dist/pages/search/components/SearchFileList.js +173 -0
- package/dist/pages/search/components/SearchPictures.d.ts +8 -0
- package/dist/pages/search/components/SearchPictures.js +220 -0
- package/dist/pages/search/components/SearchShareLinkList.d.ts +7 -0
- package/dist/pages/search/components/SearchShareLinkList.js +112 -0
- package/dist/pages/search/components/SearchUser.d.ts +6 -0
- package/dist/pages/search/components/SearchUser.js +83 -0
- package/dist/pages/search/components/useSearchMessage.d.ts +11 -0
- package/dist/pages/search/components/useSearchMessage.js +68 -0
- package/dist/pages/search/search.routes.d.ts +2 -0
- package/dist/pages/search/search.routes.js +48 -0
- package/dist/pages/search/utils.d.ts +12 -0
- package/dist/pages/search/utils.js +42 -0
- package/dist/pages/types.d.ts +70 -0
- package/dist/pages/types.js +2 -0
- package/dist/slice/contact/contact.action.d.ts +1 -0
- package/dist/slice/contact/contact.action.js +2 -0
- package/dist/slice/contact/contact.slice.d.ts +12 -0
- package/dist/slice/contact/contact.slice.js +60 -0
- package/dist/slice/index.d.ts +9 -0
- package/dist/slice/index.js +15 -0
- package/dist/slice/panel/panel.slice.d.ts +8 -0
- package/dist/slice/panel/panel.slice.js +19 -0
- package/dist/slice/video/video.action.d.ts +5 -0
- package/dist/slice/video/video.action.js +65 -0
- package/dist/slice/video/video.slice.d.ts +17 -0
- package/dist/slice/video/video.slice.js +40 -0
- package/dist/utils/color.d.ts +1 -0
- package/dist/utils/color.js +9 -0
- package/dist/utils/common-action-sheet.d.ts +8 -0
- package/dist/utils/common-action-sheet.js +45 -0
- package/dist/utils/cookie.d.ts +1 -0
- package/dist/utils/cookie.js +29 -0
- package/dist/utils/emoji.d.ts +9 -0
- package/dist/utils/emoji.js +627 -0
- package/dist/utils/file-icon.d.ts +7 -0
- package/dist/utils/file-icon.js +80 -0
- package/dist/utils/file-operate.d.ts +1 -0
- package/dist/utils/file-operate.js +4 -0
- package/dist/utils/file.d.ts +23 -0
- package/dist/utils/file.js +255 -0
- package/dist/utils/golden-rectangle.d.ts +4 -0
- package/dist/utils/golden-rectangle.js +34 -0
- package/dist/utils/phone.d.ts +2 -0
- package/dist/utils/phone.js +24 -0
- package/dist/utils/request.d.ts +34 -0
- package/dist/utils/request.js +67 -0
- package/dist/utils/scroll.d.ts +1 -0
- package/dist/utils/scroll.js +12 -0
- package/dist/utils/summary.d.ts +2 -0
- package/dist/utils/summary.js +42 -0
- package/dist/utils/take-camera.d.ts +2 -0
- package/dist/utils/take-camera.js +41 -0
- package/dist/utils/text-mix.d.ts +9 -0
- package/dist/utils/text-mix.js +82 -0
- package/dist/utils/upload.d.ts +5 -0
- package/dist/utils/upload.js +80 -0
- package/package.json +79 -0
@@ -0,0 +1,197 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
32
|
+
});
|
33
|
+
};
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
36
|
+
};
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
38
|
+
const react_1 = __importStar(require("react"));
|
39
|
+
const react_native_1 = require("react-native");
|
40
|
+
const rn_ui_1 = require("@smart-link/rn-ui");
|
41
|
+
const useTranslation_1 = __importDefault(require("../../hooks/useTranslation"));
|
42
|
+
const useImSelector_1 = require("../../hooks/useImSelector");
|
43
|
+
const init_1 = require("../../init");
|
44
|
+
const im_base_1 = require("@smart-link/im-base");
|
45
|
+
const contact_slice_1 = require("../../slice/contact/contact.slice");
|
46
|
+
const Organization_1 = require("./Organization");
|
47
|
+
const react_redux_1 = require("react-redux");
|
48
|
+
const user_1 = require("../../api/user");
|
49
|
+
const rootEntry = [
|
50
|
+
{
|
51
|
+
name: 'organization',
|
52
|
+
locale: 'selectByDepartments',
|
53
|
+
},
|
54
|
+
{
|
55
|
+
name: 'role',
|
56
|
+
locale: 'selectByCharacters',
|
57
|
+
},
|
58
|
+
];
|
59
|
+
const ChooseContact = ({ navigation, route: { params } }) => {
|
60
|
+
const { checkedIds = [] } = params;
|
61
|
+
const { t } = (0, useTranslation_1.default)();
|
62
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
63
|
+
const { currentConversation } = (0, useImSelector_1.useConversation)();
|
64
|
+
const { selectUsers, choosePurpose } = (0, useImSelector_1.useContact)();
|
65
|
+
const [keyword, setKeyword] = (0, react_1.useState)('');
|
66
|
+
const [userList, setUserList] = (0, react_1.useState)([]);
|
67
|
+
const selectCount = Object.keys(selectUsers).length;
|
68
|
+
(0, react_1.useEffect)(() => {
|
69
|
+
navigation.setOptions({
|
70
|
+
title: t('selectContacts'),
|
71
|
+
headerRight: () => (<react_native_1.TouchableOpacity onPress={() => __awaiter(void 0, void 0, void 0, function* () {
|
72
|
+
if (!selectCount) {
|
73
|
+
navigation.goBack();
|
74
|
+
return;
|
75
|
+
}
|
76
|
+
// 处理确认事件
|
77
|
+
const imManager = (0, init_1.getImManager)();
|
78
|
+
const list = Object.values(selectUsers);
|
79
|
+
if (choosePurpose === 'createGroup') {
|
80
|
+
yield imManager.store.dispatch(im_base_1.ConversationActions.groupOriginate(imManager, {
|
81
|
+
selectUserList: list,
|
82
|
+
}));
|
83
|
+
}
|
84
|
+
if (choosePurpose === 'addMember') {
|
85
|
+
yield imManager.store.dispatch(im_base_1.ConversationActions.addGroupMembers(imManager, {
|
86
|
+
selectUserList: list,
|
87
|
+
}));
|
88
|
+
}
|
89
|
+
if (choosePurpose === 'contact') {
|
90
|
+
yield imManager.sendContactMessage(Object.assign({}, currentConversation), list[0]);
|
91
|
+
}
|
92
|
+
navigation.goBack();
|
93
|
+
})} style={{ width: 120 }}>
|
94
|
+
<react_native_1.Text style={{
|
95
|
+
color: '#fff',
|
96
|
+
textAlign: 'right',
|
97
|
+
fontSize: (0, rn_ui_1.dp)(14),
|
98
|
+
}}>
|
99
|
+
{selectCount ? `${t('confirm')}(${selectCount})` : t('cancel')}
|
100
|
+
</react_native_1.Text>
|
101
|
+
</react_native_1.TouchableOpacity>),
|
102
|
+
});
|
103
|
+
const remove = navigation.addListener('beforeRemove', () => {
|
104
|
+
(0, init_1.getImManager)().store.dispatch((0, contact_slice_1.resetState)());
|
105
|
+
});
|
106
|
+
return () => {
|
107
|
+
remove();
|
108
|
+
};
|
109
|
+
}, [t, currentConversation, choosePurpose, selectCount, navigation]);
|
110
|
+
(0, react_1.useEffect)(() => {
|
111
|
+
if (checkedIds.length) {
|
112
|
+
(0, user_1.queryUserByIds)(checkedIds).then(resp => {
|
113
|
+
dispatch((0, contact_slice_1.onDefaultCheckedUser)(resp.data));
|
114
|
+
setUserList(resp.data);
|
115
|
+
});
|
116
|
+
}
|
117
|
+
}, [checkedIds]);
|
118
|
+
(0, react_1.useEffect)(() => {
|
119
|
+
if (!keyword || keyword === '') {
|
120
|
+
return;
|
121
|
+
}
|
122
|
+
(0, user_1.searchUser)({
|
123
|
+
searchKey: keyword,
|
124
|
+
pageSize: 50,
|
125
|
+
}).then(({ data }) => {
|
126
|
+
setUserList(data);
|
127
|
+
});
|
128
|
+
}, [keyword]);
|
129
|
+
return (<rn_ui_1.NavigationPage noPadding scroll={false}>
|
130
|
+
<react_native_1.View style={{ height: 10 }}/>
|
131
|
+
<rn_ui_1.SearchInput style={{ marginHorizontal: 10 }} onSubmitEditing={e => {
|
132
|
+
setKeyword(e.nativeEvent.text);
|
133
|
+
}} placeholder={t('search')}/>
|
134
|
+
<react_native_1.View style={{ height: 8 }}/>
|
135
|
+
<react_native_1.View style={{ flex: 1 }}>
|
136
|
+
{userList.length > 0 ? (<react_native_1.ScrollView contentContainerStyle={{ paddingBottom: 20 }}>
|
137
|
+
{userList.map((item) => (<rn_ui_1.ListRow key={item.userId} onPress={() => {
|
138
|
+
dispatch((0, contact_slice_1.onSelectUser)(item));
|
139
|
+
}} title={<Organization_1.RenderUserItem disabled checkable={true} checked={!!selectUsers[item.userId]} data={item}/>} topSeparator="full" accessory="none"/>))}
|
140
|
+
</react_native_1.ScrollView>) : (<react_native_1.View style={[styles.noData]}>
|
141
|
+
<react_native_1.Text>{t('noData')}</react_native_1.Text>
|
142
|
+
</react_native_1.View>)}
|
143
|
+
</react_native_1.View>
|
144
|
+
</rn_ui_1.NavigationPage>);
|
145
|
+
};
|
146
|
+
const styles = react_native_1.StyleSheet.create({
|
147
|
+
orgInfo: {
|
148
|
+
paddingTop: 20,
|
149
|
+
backgroundColor: '#f1f1f1',
|
150
|
+
textAlignVertical: 'center',
|
151
|
+
},
|
152
|
+
orgLine: {
|
153
|
+
width: (0, rn_ui_1.dp)(350),
|
154
|
+
flexDirection: 'row',
|
155
|
+
alignItems: 'center',
|
156
|
+
},
|
157
|
+
orgLinBorder: {
|
158
|
+
borderColor: '#f1f1f1',
|
159
|
+
borderTopWidth: 1,
|
160
|
+
},
|
161
|
+
compName: {
|
162
|
+
width: (0, rn_ui_1.dp)(305),
|
163
|
+
fontSize: 16,
|
164
|
+
fontWeight: '500',
|
165
|
+
textAlignVertical: 'center',
|
166
|
+
marginLeft: 10,
|
167
|
+
},
|
168
|
+
iconView: {
|
169
|
+
width: 30,
|
170
|
+
height: 30,
|
171
|
+
borderRadius: 3,
|
172
|
+
// backgroundColor: Theme.primaryColorThin
|
173
|
+
},
|
174
|
+
icon: {
|
175
|
+
lineHeight: 30,
|
176
|
+
textAlign: 'center',
|
177
|
+
},
|
178
|
+
smallIcon: {
|
179
|
+
width: 30,
|
180
|
+
height: 30,
|
181
|
+
lineHeight: 30,
|
182
|
+
textAlign: 'center',
|
183
|
+
textAlignVertical: 'center',
|
184
|
+
},
|
185
|
+
title: {
|
186
|
+
marginLeft: 10,
|
187
|
+
textAlignVertical: 'center',
|
188
|
+
fontSize: 16,
|
189
|
+
},
|
190
|
+
noData: {
|
191
|
+
flex: 1,
|
192
|
+
textAlign: 'center',
|
193
|
+
alignItems: 'center',
|
194
|
+
justifyContent: 'center',
|
195
|
+
},
|
196
|
+
});
|
197
|
+
exports.default = ChooseContact;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.Unfold = void 0;
|
7
|
+
const rn_ui_1 = require("@smart-link/rn-ui");
|
8
|
+
const react_1 = __importDefault(require("react"));
|
9
|
+
const react_native_svg_1 = require("react-native-svg");
|
10
|
+
const Unfold = (props) => {
|
11
|
+
const { size = 32, color } = props || {};
|
12
|
+
return (<react_native_svg_1.Svg viewBox="0 0 1024 1024" width={(0, rn_ui_1.dp)(size)} height={(0, rn_ui_1.dp)(size)}>
|
13
|
+
<react_native_svg_1.Path d="M832 800H256a32 32 0 0 1-32-32V192a32 32 0 0 1 64 0v544h544a32 32 0 1 1 0 64z" fill={color}/>
|
14
|
+
</react_native_svg_1.Svg>);
|
15
|
+
};
|
16
|
+
exports.Unfold = Unfold;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { NativeStackScreenProps } from '@react-navigation/native-stack/lib/typescript/src/types';
|
2
|
+
import React from 'react';
|
3
|
+
import { IMPageParamList } from '../types';
|
4
|
+
import { IUser } from '@smart-link/im-base';
|
5
|
+
type OrganizationProps = NativeStackScreenProps<IMPageParamList, 'Organization'>;
|
6
|
+
declare const Organization: ({ navigation, route: { params } }: OrganizationProps) => React.JSX.Element;
|
7
|
+
export declare const RenderUserItem: (props: {
|
8
|
+
data: IUser;
|
9
|
+
checkable?: boolean;
|
10
|
+
checked?: boolean;
|
11
|
+
disabled?: boolean;
|
12
|
+
}) => React.JSX.Element;
|
13
|
+
export default Organization;
|
@@ -0,0 +1,221 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
|
+
};
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
+
exports.RenderUserItem = void 0;
|
30
|
+
const rn_ui_1 = require("@smart-link/rn-ui");
|
31
|
+
const react_1 = __importStar(require("react"));
|
32
|
+
const react_native_1 = require("react-native");
|
33
|
+
const useTranslation_1 = require("../../hooks/useTranslation");
|
34
|
+
const addressList_1 = require("../../api/addressList");
|
35
|
+
const ChatAvatar_1 = __importDefault(require("../../components/ChatAvatar/ChatAvatar"));
|
36
|
+
const Organization = ({ navigation, route: { params } }) => {
|
37
|
+
const [orgPath, setOrgPath] = (0, react_1.useState)([]);
|
38
|
+
const [orgList, setOrgList] = (0, react_1.useState)([]);
|
39
|
+
const [userList, setUserList] = (0, react_1.useState)([]);
|
40
|
+
const [loading, setLoading] = (0, react_1.useState)(false);
|
41
|
+
const { t } = (0, useTranslation_1.useTranslationAddrList)();
|
42
|
+
const orgPathScroll = (0, react_1.useRef)(null);
|
43
|
+
(0, react_1.useEffect)(() => {
|
44
|
+
navigation.setOptions({ title: t('addressList') });
|
45
|
+
if (!params) {
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
setOrgPath([
|
49
|
+
{
|
50
|
+
id: params.groupRootIds,
|
51
|
+
groupName: params.groupCategoryName,
|
52
|
+
},
|
53
|
+
]);
|
54
|
+
queryListTree(params.groupRootIds);
|
55
|
+
}, [params]);
|
56
|
+
const onPressSearch = (0, react_1.useCallback)(() => {
|
57
|
+
console.log('onPressSearch: ');
|
58
|
+
navigation.navigate('UserSearch', {});
|
59
|
+
}, [navigation]);
|
60
|
+
const handleGroupCategory = (item) => {
|
61
|
+
orgPath.push({
|
62
|
+
id: item.groupId,
|
63
|
+
groupName: item.groupName,
|
64
|
+
groupIdPath: item.groupIdPath,
|
65
|
+
});
|
66
|
+
setOrgPath(orgPath);
|
67
|
+
if (item.parent) {
|
68
|
+
queryListTree(item.groupId);
|
69
|
+
return;
|
70
|
+
}
|
71
|
+
queryUserList(item);
|
72
|
+
};
|
73
|
+
const handleUser = (item) => {
|
74
|
+
navigation.navigate('UserDetail', { userId: item.userId, userAccount: item.userAccount });
|
75
|
+
};
|
76
|
+
const queryListTree = (parentId) => {
|
77
|
+
setLoading(true);
|
78
|
+
(0, addressList_1.listTree)({
|
79
|
+
groupCatId: params === null || params === void 0 ? void 0 : params.groupCategoryId,
|
80
|
+
parentId,
|
81
|
+
groupStatus: 'valid',
|
82
|
+
queryChild: false,
|
83
|
+
})
|
84
|
+
.then(({ data }) => {
|
85
|
+
setLoading(false);
|
86
|
+
setOrgList(data);
|
87
|
+
})
|
88
|
+
.catch(err => {
|
89
|
+
setLoading(false);
|
90
|
+
// Toast.error(t('requestFail'));
|
91
|
+
setOrgList([]);
|
92
|
+
});
|
93
|
+
};
|
94
|
+
const queryUserList = (item) => {
|
95
|
+
setLoading(true);
|
96
|
+
(0, addressList_1.listUser)({
|
97
|
+
groupCategoryId: item.groupId,
|
98
|
+
groupId: '',
|
99
|
+
groupIdPathLike: item.groupIdPath,
|
100
|
+
pageNum: 1,
|
101
|
+
pageSize: 100,
|
102
|
+
queryAll: false,
|
103
|
+
userStatus: '',
|
104
|
+
})
|
105
|
+
.then(({ data }) => {
|
106
|
+
setLoading(false);
|
107
|
+
setOrgList([]);
|
108
|
+
setUserList(data);
|
109
|
+
})
|
110
|
+
.catch(err => {
|
111
|
+
setLoading(false);
|
112
|
+
});
|
113
|
+
};
|
114
|
+
const changeOrg = (org, index) => {
|
115
|
+
setLoading(true);
|
116
|
+
(0, addressList_1.listTree)({
|
117
|
+
groupCatId: params === null || params === void 0 ? void 0 : params.groupCategoryId,
|
118
|
+
parentId: org.id,
|
119
|
+
groupStatus: 'valid',
|
120
|
+
queryChild: false,
|
121
|
+
})
|
122
|
+
.then(({ data }) => {
|
123
|
+
setOrgList(data);
|
124
|
+
setUserList([]);
|
125
|
+
setLoading(false);
|
126
|
+
})
|
127
|
+
.catch(err => {
|
128
|
+
// Toast.error(t('requestFail'));
|
129
|
+
setOrgList([]);
|
130
|
+
setLoading(false);
|
131
|
+
});
|
132
|
+
let tmp = orgPath.slice(0, index + 1);
|
133
|
+
setOrgPath(tmp);
|
134
|
+
};
|
135
|
+
const scrollOrgPath = () => {
|
136
|
+
if (orgPath.length > 1) {
|
137
|
+
orgPathScroll.current.scrollToEnd();
|
138
|
+
}
|
139
|
+
else {
|
140
|
+
orgPathScroll.current.scrollTo({ x: 0, y: 0, animated: false });
|
141
|
+
}
|
142
|
+
};
|
143
|
+
return (<rn_ui_1.NavigationPage noPadding>
|
144
|
+
<react_native_1.View style={{ height: 10 }}/>
|
145
|
+
<rn_ui_1.SearchBar onSearch={onPressSearch}/>
|
146
|
+
<react_native_1.View style={{ height: 8 }}/>
|
147
|
+
|
148
|
+
{orgPath.length > 0 && (<react_native_1.View style={styles.orgBreadcrumb}>
|
149
|
+
<react_native_1.ScrollView ref={orgPathScroll} horizontal={true} onContentSizeChange={scrollOrgPath} onLayout={scrollOrgPath} showsHorizontalScrollIndicator={false} contentContainerStyle={{ paddingRight: 40 }}>
|
150
|
+
{orgPath.map((path, index) => {
|
151
|
+
if (index !== orgPath.length - 1) {
|
152
|
+
return (<react_native_1.TouchableOpacity key={path.id} onPress={() => changeOrg(path, index)}>
|
153
|
+
<RenderPathItem path={path} index={index} orgPath={orgPath} active/>
|
154
|
+
</react_native_1.TouchableOpacity>);
|
155
|
+
}
|
156
|
+
return <RenderPathItem path={path} key={path.id} index={index} orgPath={orgPath}/>;
|
157
|
+
})}
|
158
|
+
</react_native_1.ScrollView>
|
159
|
+
</react_native_1.View>)}
|
160
|
+
<react_native_1.ScrollView style={{ flex: 1 }}>
|
161
|
+
{orgList.length > 0 &&
|
162
|
+
orgList.map((org) => (<rn_ui_1.ListRow key={org.groupId} onPress={() => handleGroupCategory(org)} title={org.groupName} topSeparator="full"/>))}
|
163
|
+
{userList.length > 0 &&
|
164
|
+
userList.map((item) => (<rn_ui_1.ListRow key={item.userId} onPress={() => handleUser(item)} title={<exports.RenderUserItem data={item}/>} topSeparator="full"/>))}
|
165
|
+
{userList.length === 0 && orgList.length === 0 && (<react_native_1.View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
|
166
|
+
<react_native_1.Text>{t('noData')}</react_native_1.Text>
|
167
|
+
</react_native_1.View>)}
|
168
|
+
</react_native_1.ScrollView>
|
169
|
+
<rn_ui_1.Loading loading={loading} loadingText={t('loading')}/>
|
170
|
+
</rn_ui_1.NavigationPage>);
|
171
|
+
};
|
172
|
+
const RenderPathItem = (props) => {
|
173
|
+
const { path, index, active, orgPath } = props;
|
174
|
+
const theme = (0, rn_ui_1.useTheme)();
|
175
|
+
return (<react_native_1.View key={index} style={[styles.orgPathItem]}>
|
176
|
+
<react_native_1.Text style={{
|
177
|
+
textAlignVertical: 'center',
|
178
|
+
fontSize: 16,
|
179
|
+
height: 40,
|
180
|
+
lineHeight: 40,
|
181
|
+
color: active ? theme.primaryColor : '#A3A5A8',
|
182
|
+
}}>
|
183
|
+
{path.groupName}
|
184
|
+
</react_native_1.Text>
|
185
|
+
{index !== orgPath.length - 1 && (<rn_ui_1.CaihIcon style={{
|
186
|
+
textAlignVertical: 'center',
|
187
|
+
height: 40,
|
188
|
+
lineHeight: 40,
|
189
|
+
}} name="list-arrow" size={18} color={'#bbb'}/>)}
|
190
|
+
</react_native_1.View>);
|
191
|
+
};
|
192
|
+
const RenderUserItem = (props) => {
|
193
|
+
const { data, checkable, disabled, checked } = props;
|
194
|
+
return (<react_native_1.View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
195
|
+
{checkable && (<react_native_1.View style={{ marginRight: 10 }}>
|
196
|
+
<rn_ui_1.Checkbox style={disabled ? { pointerEvents: 'none' } : undefined} checked={checked}/>
|
197
|
+
</react_native_1.View>)}
|
198
|
+
<ChatAvatar_1.default disabled={disabled} size={(0, rn_ui_1.dp)(40)} id={data.userId} url={data.avatars} name={data.userName}/>
|
199
|
+
<react_native_1.Text style={{ marginLeft: (0, rn_ui_1.dp)(10), fontSize: 16, color: '#333' }}>{data.userName}</react_native_1.Text>
|
200
|
+
</react_native_1.View>);
|
201
|
+
};
|
202
|
+
exports.RenderUserItem = RenderUserItem;
|
203
|
+
const styles = react_native_1.StyleSheet.create({
|
204
|
+
orgBreadcrumb: {
|
205
|
+
backgroundColor: '#fff',
|
206
|
+
marginBottom: (0, rn_ui_1.dp)(10),
|
207
|
+
paddingHorizontal: (0, rn_ui_1.dp)(10),
|
208
|
+
},
|
209
|
+
orgPathItem: {
|
210
|
+
height: (0, rn_ui_1.dp)(40),
|
211
|
+
lineHeight: (0, rn_ui_1.dp)(40),
|
212
|
+
flexDirection: 'row',
|
213
|
+
backgroundColor: '#fff',
|
214
|
+
},
|
215
|
+
avatars: {
|
216
|
+
height: (0, rn_ui_1.dp)(40),
|
217
|
+
width: (0, rn_ui_1.dp)(40),
|
218
|
+
borderRadius: (0, rn_ui_1.dp)(20),
|
219
|
+
},
|
220
|
+
});
|
221
|
+
exports.default = Organization;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { NativeStackScreenProps } from '@react-navigation/native-stack/lib/typescript/src/types';
|
2
|
+
import React from 'react';
|
3
|
+
import { IMPageParamList } from '../../pages/types';
|
4
|
+
type UserDetailProps = NativeStackScreenProps<IMPageParamList, 'UserDetail'>;
|
5
|
+
declare const UserDetail: ({ navigation, route: { params } }: UserDetailProps) => React.JSX.Element;
|
6
|
+
export default UserDetail;
|
@@ -0,0 +1,131 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
32
|
+
});
|
33
|
+
};
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
36
|
+
};
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
38
|
+
const rn_ui_1 = require("@smart-link/rn-ui");
|
39
|
+
const react_1 = __importStar(require("react"));
|
40
|
+
const react_native_1 = require("react-native");
|
41
|
+
const useTranslation_1 = require("../../hooks/useTranslation");
|
42
|
+
const init_1 = require("../../init");
|
43
|
+
const CardInfo_1 = require("./CardInfo");
|
44
|
+
const UserJobs_1 = __importDefault(require("./UserJobs"));
|
45
|
+
const ChatAvatar_1 = __importDefault(require("../../components/ChatAvatar/ChatAvatar"));
|
46
|
+
const addressList_1 = require("../../api/addressList");
|
47
|
+
const { width } = react_native_1.Dimensions.get('window');
|
48
|
+
const UserDetail = ({ navigation, route: { params } }) => {
|
49
|
+
const [detail, setDetail] = (0, react_1.useState)({});
|
50
|
+
const { t } = (0, useTranslation_1.useTranslationAddrList)();
|
51
|
+
(0, react_1.useEffect)(() => {
|
52
|
+
navigation.setOptions({ title: t('userDetail') });
|
53
|
+
(0, addressList_1.queryUser)(params.userId).then(({ data }) => {
|
54
|
+
console.log('userDetail: ', data[0]);
|
55
|
+
setDetail(data[0]);
|
56
|
+
});
|
57
|
+
}, [params.userId]);
|
58
|
+
const openChatPanel = () => __awaiter(void 0, void 0, void 0, function* () {
|
59
|
+
yield (0, init_1.getImManager)().initUserConversation(detail);
|
60
|
+
navigation.navigate('MessageList');
|
61
|
+
});
|
62
|
+
return (<rn_ui_1.NavigationPage noPadding scroll>
|
63
|
+
<CardInfo_1.CardInfo>
|
64
|
+
<CardInfo_1.Line>
|
65
|
+
<ChatAvatar_1.default id={detail.userId} size={(0, rn_ui_1.dp)(60)} name={detail.userName} url={detail.avatars} priority={'outside'}/>
|
66
|
+
<react_native_1.View style={styles.accountInfo}>
|
67
|
+
<react_native_1.Text style={styles.username} numberOfLines={2}>
|
68
|
+
{detail.userName}
|
69
|
+
</react_native_1.Text>
|
70
|
+
<react_native_1.Text style={{
|
71
|
+
lineHeight: (0, rn_ui_1.dp)(16),
|
72
|
+
fontSize: (0, rn_ui_1.dp)(12),
|
73
|
+
color: '#6e6e6e',
|
74
|
+
}}>
|
75
|
+
{t('userCode')}:{detail.userCode || t('noAdd')}
|
76
|
+
</react_native_1.Text>
|
77
|
+
<react_native_1.Text style={{
|
78
|
+
lineHeight: (0, rn_ui_1.dp)(16),
|
79
|
+
fontSize: (0, rn_ui_1.dp)(12),
|
80
|
+
color: '#6e6e6e',
|
81
|
+
}}>
|
82
|
+
{t('mobile')}:{detail.mobile || t('noAdd')}
|
83
|
+
</react_native_1.Text>
|
84
|
+
<react_native_1.Text style={{
|
85
|
+
lineHeight: (0, rn_ui_1.dp)(16),
|
86
|
+
fontSize: (0, rn_ui_1.dp)(12),
|
87
|
+
color: '#6e6e6e',
|
88
|
+
}}>
|
89
|
+
{t('email')}:{detail.email || t('noAdd')}
|
90
|
+
</react_native_1.Text>
|
91
|
+
</react_native_1.View>
|
92
|
+
</CardInfo_1.Line>
|
93
|
+
</CardInfo_1.CardInfo>
|
94
|
+
|
95
|
+
<UserJobs_1.default jobs={detail.groups}/>
|
96
|
+
|
97
|
+
<react_native_1.View style={{ height: (0, rn_ui_1.dp)(20) }}/>
|
98
|
+
|
99
|
+
<react_native_1.View style={styles.button}>
|
100
|
+
<rn_ui_1.Button type="primary" onPress={openChatPanel}>
|
101
|
+
{t('sendNews')}
|
102
|
+
</rn_ui_1.Button>
|
103
|
+
</react_native_1.View>
|
104
|
+
|
105
|
+
<react_native_1.View style={{ height: (0, rn_ui_1.dp)(20) }}/>
|
106
|
+
</rn_ui_1.NavigationPage>);
|
107
|
+
};
|
108
|
+
const styles = react_native_1.StyleSheet.create({
|
109
|
+
lineIcon: {
|
110
|
+
width: (0, rn_ui_1.dp)(40),
|
111
|
+
textAlign: 'center',
|
112
|
+
},
|
113
|
+
accountInfo: {
|
114
|
+
marginLeft: (0, rn_ui_1.dp)(20),
|
115
|
+
width: width - (0, rn_ui_1.dp)(80 + 20 + 10),
|
116
|
+
},
|
117
|
+
username: {
|
118
|
+
lineHeight: (0, rn_ui_1.dp)(25),
|
119
|
+
fontSize: (0, rn_ui_1.dp)(18),
|
120
|
+
fontWeight: '500',
|
121
|
+
textAlignVertical: 'center',
|
122
|
+
},
|
123
|
+
button: {
|
124
|
+
marginHorizontal: (0, rn_ui_1.dp)(20),
|
125
|
+
},
|
126
|
+
btnText: {
|
127
|
+
paddingVertical: (0, rn_ui_1.dp)(4),
|
128
|
+
fontSize: (0, rn_ui_1.dp)(16),
|
129
|
+
},
|
130
|
+
});
|
131
|
+
exports.default = UserDetail;
|
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const rn_ui_1 = require("@smart-link/rn-ui");
|
4
|
+
const react_native_1 = require("react-native");
|
5
|
+
const useTranslation_1 = require("../../hooks/useTranslation");
|
6
|
+
const CardInfo_1 = require("./CardInfo");
|
7
|
+
const UserJobs = (props) => {
|
8
|
+
const { jobs } = props;
|
9
|
+
const { t } = (0, useTranslation_1.useTranslationAddrList)();
|
10
|
+
const theme = (0, rn_ui_1.useTheme)();
|
11
|
+
const styles = makeStyles(theme);
|
12
|
+
return (<CardInfo_1.CardInfo>
|
13
|
+
{(jobs === null || jobs === void 0 ? void 0 : jobs.length) > 0 &&
|
14
|
+
jobs.map(job => {
|
15
|
+
let isMainJob = job.majorFlag === 'y';
|
16
|
+
return (<CardInfo_1.Line key={job.groupId}>
|
17
|
+
<react_native_1.View style={isMainJob ? styles.mainJob : styles.partJob}>
|
18
|
+
<react_native_1.Text style={{ color: isMainJob ? '#fff' : theme.primaryColor }}>
|
19
|
+
{isMainJob ? t('job') : t('otherJob')}
|
20
|
+
</react_native_1.Text>
|
21
|
+
</react_native_1.View>
|
22
|
+
<react_native_1.View style={{ flexDirection: 'column', flex: 1 }}>
|
23
|
+
<react_native_1.View style={{ marginLeft: 0 }}>
|
24
|
+
<react_native_1.Text style={{ color: '#393939' }}>{job.groupNamePath}</react_native_1.Text>
|
25
|
+
</react_native_1.View>
|
26
|
+
<react_native_1.View style={{ marginBottom: 5 }}>
|
27
|
+
<react_native_1.Text style={{ color: '#393939' }}>{job.postName}</react_native_1.Text>
|
28
|
+
</react_native_1.View>
|
29
|
+
</react_native_1.View>
|
30
|
+
</CardInfo_1.Line>);
|
31
|
+
})}
|
32
|
+
</CardInfo_1.CardInfo>);
|
33
|
+
};
|
34
|
+
const makeStyles = (theme) => react_native_1.StyleSheet.create({
|
35
|
+
mainJob: {
|
36
|
+
padding: (0, rn_ui_1.dp)(4),
|
37
|
+
borderRadius: (0, rn_ui_1.dp)(3),
|
38
|
+
marginRight: (0, rn_ui_1.dp)(10),
|
39
|
+
backgroundColor: theme.primaryColor,
|
40
|
+
},
|
41
|
+
partJob: {
|
42
|
+
padding: (0, rn_ui_1.dp)(3),
|
43
|
+
borderRadius: (0, rn_ui_1.dp)(3),
|
44
|
+
marginRight: (0, rn_ui_1.dp)(10),
|
45
|
+
borderColor: theme.primaryColor,
|
46
|
+
borderWidth: (0, rn_ui_1.dp)(1),
|
47
|
+
backgroundColor: '#fff',
|
48
|
+
},
|
49
|
+
});
|
50
|
+
exports.default = UserJobs;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { NativeStackScreenProps } from '@react-navigation/native-stack/lib/typescript/src/types';
|
2
|
+
import React from 'react';
|
3
|
+
import { IMPageParamList } from '../../pages/types';
|
4
|
+
type UserSearchProps = NativeStackScreenProps<IMPageParamList, 'UserSearch'>;
|
5
|
+
declare const UserSearch: React.MemoExoticComponent<({ navigation, route: { params } }: UserSearchProps) => React.JSX.Element>;
|
6
|
+
export default UserSearch;
|