|
|
|
@ -14,18 +14,14 @@
|
|
|
|
<div class="reply-line">|</div>
|
|
|
|
<div class="reply-line">|</div>
|
|
|
|
<div class="reply-title">{{ t("replyText") }}</div>
|
|
|
|
<div class="reply-title">{{ t("replyText") }}</div>
|
|
|
|
<div class="reply-to">
|
|
|
|
<div class="reply-to">
|
|
|
|
<Appellation :account="replyMsg && replyMsg.senderId"
|
|
|
|
<Appellation :account="replyMsg && replyMsg.senderId" :team-id="props.conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM ? to : ''" color="#929299" :fontSize="13"> </Appellation>
|
|
|
|
:team-id="props.conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM ? to : ''"
|
|
|
|
|
|
|
|
color="#929299" :fontSize="13"> </Appellation>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="reply-to-colon">:</div>
|
|
|
|
<div class="reply-to-colon">:</div>
|
|
|
|
<div v-if="replyMsg && replyMsg.messageClientId === 'noFind'" class="reply-noFind">
|
|
|
|
<div v-if="replyMsg && replyMsg.messageClientId === 'noFind'" class="reply-noFind">
|
|
|
|
{{ t("replyNotFindText") }}
|
|
|
|
{{ t("replyNotFindText") }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="reply-message" v-else>
|
|
|
|
<div class="reply-message" v-else>
|
|
|
|
<message-one-line
|
|
|
|
<message-one-line v-if="replyMsg && replyMsg.messageType === V2NIMConst.V2NIMMessageType.V2NIM_MESSAGE_TYPE_TEXT" :text="replyMsg && replyMsg.text"></message-one-line>
|
|
|
|
v-if="replyMsg && replyMsg.messageType === V2NIMConst.V2NIMMessageType.V2NIM_MESSAGE_TYPE_TEXT"
|
|
|
|
|
|
|
|
:text="replyMsg && replyMsg.text"></message-one-line>
|
|
|
|
|
|
|
|
<div v-else>
|
|
|
|
<div v-else>
|
|
|
|
{{ "[" + REPLY_MSG_TYPE_MAP[replyMsg && replyMsg.messageType] + "]" }}
|
|
|
|
{{ "[" + REPLY_MSG_TYPE_MAP[replyMsg && replyMsg.messageType] + "]" }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -53,8 +49,7 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div> -->
|
|
|
|
</div> -->
|
|
|
|
<div class="g_flex_c">
|
|
|
|
<div class="g_flex_c">
|
|
|
|
<div @tap="handleAudioVisible" v-if="!isWeb && false" class="msg-input-button g_p_5"
|
|
|
|
<div @tap="handleAudioVisible" v-if="!isWeb && false" class="msg-input-button g_p_5" style="padding-right: 7px; padding-left: 10px">
|
|
|
|
style="padding-right: 7px; padding-left: 10px">
|
|
|
|
|
|
|
|
<Icon v-if="audioPanelVisible" :size="28" type="audio-btn-selected" key="audio-btn-selected" />
|
|
|
|
<Icon v-if="audioPanelVisible" :size="28" type="audio-btn-selected" key="audio-btn-selected" />
|
|
|
|
<Icon v-else :size="28" type="icon-audio" key="icon-audio" />
|
|
|
|
<Icon v-else :size="28" type="icon-audio" key="icon-audio" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -69,22 +64,14 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!--键盘高度{{keyHeight}} 输入框距离底部距离{{writeStyle}}屏幕高度{{screenHeight}}顶部聊天区域高度{{msgKeyHeight}}-->
|
|
|
|
<!--键盘高度{{keyHeight}} 输入框距离底部距离{{writeStyle}}屏幕高度{{screenHeight}}顶部聊天区域高度{{msgKeyHeight}}-->
|
|
|
|
<input v-show="!showEmojiInput" :focus="isFocus" class="msg-input-input g_flex_1"
|
|
|
|
<input v-show="!showEmojiInput" :focus="isFocus" class="msg-input-input g_flex_1" :maxlength="-1" :placeholder="isTeamMute ? t('teamMutePlaceholder') : t('chatInputPlaceHolder')" v-model="inputText" type="text" :disabled="isTeamMute" :confirm-hold="true" cursor-spacing="20" :adjust-position="pushUp" confirm-type="send" @keyboardheightchange="keyboardheightchange" @confirm="handleSendTextMsg" @blur="handleInputBlur" @input="handleInput" id="msg-input" />
|
|
|
|
:maxlength="-1"
|
|
|
|
|
|
|
|
:placeholder="isTeamMute ? t('teamMutePlaceholder') : t('chatInputPlaceHolder')"
|
|
|
|
|
|
|
|
v-model="inputText" type="text" :disabled="isTeamMute" :confirm-hold="true"
|
|
|
|
|
|
|
|
cursor-spacing="20" :adjust-position="pushUp" confirm-type="send"
|
|
|
|
|
|
|
|
@keyboardheightchange="keyboardheightchange" @confirm="handleSendTextMsg"
|
|
|
|
|
|
|
|
@blur="handleInputBlur" @input="handleInput" id="msg-input" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="msg-input-button" v-if="false">
|
|
|
|
<div class="msg-input-button" v-if="false">
|
|
|
|
<Icon @tap="handleEmojiVisible" class="g_p_6" style="padding-right: 5px" :size="28"
|
|
|
|
<Icon @tap="handleEmojiVisible" class="g_p_6" style="padding-right: 5px" :size="28" type="icon-biaoqing" />
|
|
|
|
type="icon-biaoqing" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="msg-input-button">
|
|
|
|
<div class="msg-input-button">
|
|
|
|
<Icon @tap="handleSendMoreVisible" class="g_p_6" style="padding-left: 5px; padding-right: 8px"
|
|
|
|
<Icon @tap="handleSendMoreVisible" class="g_p_6" style="padding-left: 5px; padding-right: 8px" type="send-more" :size="28" />
|
|
|
|
type="send-more" :size="28" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 表情面板 -->
|
|
|
|
<!-- 表情面板 -->
|
|
|
|
@ -117,15 +104,13 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="icon-text">{{ t("albumText") }}</div>
|
|
|
|
<div class="icon-text">{{ t("albumText") }}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="send-more-panel-item-wrapper"
|
|
|
|
<div class="send-more-panel-item-wrapper" v-if="isApp && props.conversationType !== V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM">
|
|
|
|
v-if="isApp && props.conversationType !== V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM">
|
|
|
|
|
|
|
|
<div class="send-more-panel-item" @tap="handleCall(1)">
|
|
|
|
<div class="send-more-panel-item" @tap="handleCall(1)">
|
|
|
|
<Icon type="icon-audio-call" :size="30"></Icon>
|
|
|
|
<Icon type="icon-audio-call" :size="30"></Icon>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="icon-text">{{ t("voiceCallText") }}</div>
|
|
|
|
<div class="icon-text">{{ t("voiceCallText") }}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="send-more-panel-item-wrapper"
|
|
|
|
<div class="send-more-panel-item-wrapper" v-if="isApp && props.conversationType !== V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM">
|
|
|
|
v-if="isApp && props.conversationType !== V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM">
|
|
|
|
|
|
|
|
<div class="send-more-panel-item" @tap="() => handleCall(2)">
|
|
|
|
<div class="send-more-panel-item" @tap="() => handleCall(2)">
|
|
|
|
<Icon type="icon-video-call" :size="30"></Icon>
|
|
|
|
<Icon type="icon-video-call" :size="30"></Icon>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -143,7 +128,12 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="icon-text">{{ t("customText") }}</div>
|
|
|
|
<div class="icon-text">{{ t("customText") }}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="send-more-panel-item-wrapper" v-if="corpUserFlag">
|
|
|
|
|
|
|
|
<div class="send-more-panel-item" @tap="(event) => handleSendJob()">
|
|
|
|
|
|
|
|
<Icon type="icon-touxiang5" :size="30"></Icon>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="icon-text">{{ "发送职位" }}</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="send-more-panel-item-wrapper">
|
|
|
|
<div class="send-more-panel-item-wrapper">
|
|
|
|
<div class="send-more-panel-item" @tap="(event) => handleSetting()">
|
|
|
|
<div class="send-more-panel-item" @tap="(event) => handleSetting()">
|
|
|
|
<Icon type="icon-shezhi" :size="30"></Icon>
|
|
|
|
<Icon type="icon-shezhi" :size="30"></Icon>
|
|
|
|
@ -157,8 +147,7 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- @消息相关 popup -->
|
|
|
|
<!-- @消息相关 popup -->
|
|
|
|
<UniPopup ref="popupRef" background-color="#ffffff" type="bottom" mask-background-color="rgba(0,0,0,0.4)"
|
|
|
|
<UniPopup ref="popupRef" background-color="#ffffff" type="bottom" mask-background-color="rgba(0,0,0,0.4)" @change="onPopupChange">
|
|
|
|
@change="onPopupChange">
|
|
|
|
|
|
|
|
<MentionMemberList :team-id="to"></MentionMemberList>
|
|
|
|
<MentionMemberList :team-id="to"></MentionMemberList>
|
|
|
|
</UniPopup>
|
|
|
|
</UniPopup>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -166,64 +155,65 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import Face from "./face.vue";
|
|
|
|
import Face from "./face.vue";
|
|
|
|
import VoicePanel from "./voice-panel.vue";
|
|
|
|
import VoicePanel from "./voice-panel.vue";
|
|
|
|
import Icon from "../../../components/Icon.vue";
|
|
|
|
import Icon from "../../../components/Icon.vue";
|
|
|
|
import { ref, getCurrentInstance, computed, onUnmounted, onMounted, defineProps, withDefaults } from "../../../utils/transformVue";
|
|
|
|
import { ref, getCurrentInstance, computed, onUnmounted, onMounted, defineProps, withDefaults, defineEmits } from "../../../utils/transformVue";
|
|
|
|
import { ALLOW_AT, events, REPLY_MSG_TYPE_MAP } from "../../../utils/constants";
|
|
|
|
import { ALLOW_AT, events, REPLY_MSG_TYPE_MAP } from "../../../utils/constants";
|
|
|
|
import { emojiMap } from "../../../utils/emoji";
|
|
|
|
import { emojiMap } from "../../../utils/emoji";
|
|
|
|
import { t } from "../../../utils/i18n";
|
|
|
|
import { t } from "../../../utils/i18n";
|
|
|
|
import { handleNoPermission } from "../../../utils/permission";
|
|
|
|
import { handleNoPermission } from "../../../utils/permission";
|
|
|
|
import { customNavigateTo } from "../../../utils/customNavigate";
|
|
|
|
import { customNavigateTo } from "../../../utils/customNavigate";
|
|
|
|
import MessageOneLine from "../../../components/MessageOneLine.vue";
|
|
|
|
import MessageOneLine from "../../../components/MessageOneLine.vue";
|
|
|
|
import { isAndroidApp, stopAllAudio, isIosWeb, isWeb, isWxApp, startCall, isApp, isIosApp } from "../../../utils";
|
|
|
|
import { isAndroidApp, stopAllAudio, isIosWeb, isWeb, isWxApp, startCall, isApp, isIosApp } from "../../../utils";
|
|
|
|
// @ts-ignore
|
|
|
|
// @ts-ignore
|
|
|
|
import UniPopup from "../../../components/uni-components/uni-popup/components/uni-popup/uni-popup.vue";
|
|
|
|
import UniPopup from "../../../components/uni-components/uni-popup/components/uni-popup/uni-popup.vue";
|
|
|
|
// @ts-ignore
|
|
|
|
// @ts-ignore
|
|
|
|
import MentionMemberList from "./mention-member-list.vue";
|
|
|
|
import MentionMemberList from "./mention-member-list.vue";
|
|
|
|
import { autorun } from "mobx";
|
|
|
|
import { autorun } from "mobx";
|
|
|
|
import Appellation from "../../../components/Appellation.vue";
|
|
|
|
import Appellation from "../../../components/Appellation.vue";
|
|
|
|
import { AT_ALL_ACCOUNT } from "../../../utils/constants";
|
|
|
|
import { AT_ALL_ACCOUNT } from "../../../utils/constants";
|
|
|
|
import { deepClone } from "../../../utils";
|
|
|
|
import { deepClone } from "../../../utils";
|
|
|
|
import { V2NIMTeam, V2NIMTeamChatBannedMode, V2NIMTeamMember } from "nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK/V2NIMTeamService";
|
|
|
|
import { V2NIMTeam, V2NIMTeamChatBannedMode, V2NIMTeamMember } from "nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK/V2NIMTeamService";
|
|
|
|
import { V2NIMMessageForUI, YxServerExt, YxAitMsg } from "@xkit-yx/im-store-v2/dist/types/types";
|
|
|
|
import { V2NIMMessageForUI, YxServerExt, YxAitMsg } from "@xkit-yx/im-store-v2/dist/types/types";
|
|
|
|
import { V2NIMConst } from "nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK";
|
|
|
|
import { V2NIMConst } from "nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK";
|
|
|
|
|
|
|
|
|
|
|
|
export type MentionedMember = { accountId : string; appellation : string };
|
|
|
|
export type MentionedMember = { accountId: string; appellation: string };
|
|
|
|
const corpUserFlag = ref(uni.getStorageSync("apply-userinfo").corpUserFlag);
|
|
|
|
const corpUserFlag = ref(uni.getStorageSync("apply-userinfo").corpUserFlag);
|
|
|
|
|
|
|
|
|
|
|
|
const props = withDefaults(
|
|
|
|
const props = withDefaults(
|
|
|
|
defineProps<{
|
|
|
|
defineProps<{
|
|
|
|
conversationType : V2NIMConst.V2NIMConversationType;
|
|
|
|
conversationType: V2NIMConst.V2NIMConversationType;
|
|
|
|
to : string;
|
|
|
|
to: string;
|
|
|
|
replyMsgsMap ?: {
|
|
|
|
replyMsgsMap?: {
|
|
|
|
[key : string] : V2NIMMessageForUI;
|
|
|
|
[key: string]: V2NIMMessageForUI;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
jobListShow: Boolean;
|
|
|
|
}>(),
|
|
|
|
}>(),
|
|
|
|
{}
|
|
|
|
{}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
const emits = defineEmits(["jobListShow"]);
|
|
|
|
const conversationId = props.conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_P2P ? uni.$UIKitNIM.V2NIMConversationIdUtil.p2pConversationId(props.to) : uni.$UIKitNIM.V2NIMConversationIdUtil.teamConversationId(props.to);
|
|
|
|
const conversationId = props.conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_P2P ? uni.$UIKitNIM.V2NIMConversationIdUtil.p2pConversationId(props.to) : uni.$UIKitNIM.V2NIMConversationIdUtil.teamConversationId(props.to);
|
|
|
|
|
|
|
|
|
|
|
|
const inputText = ref("");
|
|
|
|
const inputText = ref("");
|
|
|
|
const extVisible = ref(false);
|
|
|
|
const extVisible = ref(false);
|
|
|
|
// 音频面板flag
|
|
|
|
// 音频面板flag
|
|
|
|
const audioPanelVisible = ref(false);
|
|
|
|
const audioPanelVisible = ref(false);
|
|
|
|
// 发送更多面板flag
|
|
|
|
// 发送更多面板flag
|
|
|
|
const sendMoreVisible = ref(false);
|
|
|
|
const sendMoreVisible = ref(false);
|
|
|
|
// 表情面板flag
|
|
|
|
// 表情面板flag
|
|
|
|
const emojiVisible = ref(false);
|
|
|
|
const emojiVisible = ref(false);
|
|
|
|
// input框flag
|
|
|
|
// input框flag
|
|
|
|
const inputVisible = computed(() => {
|
|
|
|
const inputVisible = computed(() => {
|
|
|
|
if (audioPanelVisible.value || sendMoreVisible.value) {
|
|
|
|
if (audioPanelVisible.value || sendMoreVisible.value) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// 发起呼叫,type: 1 音频呼叫,2 视频呼叫
|
|
|
|
// 发起呼叫,type: 1 音频呼叫,2 视频呼叫
|
|
|
|
const handleCall = (type : number) => {
|
|
|
|
const handleCall = (type: number) => {
|
|
|
|
const myAccount = uni.$UIKitStore.userStore.myUserInfo.accountId;
|
|
|
|
const myAccount = uni.$UIKitStore.userStore.myUserInfo.accountId;
|
|
|
|
|
|
|
|
|
|
|
|
const remoteShowName = uni.$UIKitStore.uiStore.getAppellation({
|
|
|
|
const remoteShowName = uni.$UIKitStore.uiStore.getAppellation({
|
|
|
|
@ -242,30 +232,30 @@
|
|
|
|
icon: "none",
|
|
|
|
icon: "none",
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
// 用于解决表情面板和键盘冲突,导致输入框滚动消失问题
|
|
|
|
// 用于解决表情面板和键盘冲突,导致输入框滚动消失问题
|
|
|
|
const showEmojiInput = ref(false);
|
|
|
|
const showEmojiInput = ref(false);
|
|
|
|
|
|
|
|
|
|
|
|
// 回复消息相关
|
|
|
|
// 回复消息相关
|
|
|
|
const isReplyMsg = ref(false);
|
|
|
|
const isReplyMsg = ref(false);
|
|
|
|
const isFocus = ref(false);
|
|
|
|
const isFocus = ref(false);
|
|
|
|
const replyMsg = ref<V2NIMMessageForUI>();
|
|
|
|
const replyMsg = ref<V2NIMMessageForUI>();
|
|
|
|
// @消息相关
|
|
|
|
// @消息相关
|
|
|
|
const ctx = getCurrentInstance();
|
|
|
|
const ctx = getCurrentInstance();
|
|
|
|
const popupRef = ref(null);
|
|
|
|
const popupRef = ref(null);
|
|
|
|
const selectedAtMembers = ref<MentionedMember[]>([]);
|
|
|
|
const selectedAtMembers = ref<MentionedMember[]>([]);
|
|
|
|
|
|
|
|
|
|
|
|
// 群相关
|
|
|
|
// 群相关
|
|
|
|
const team = ref<V2NIMTeam>();
|
|
|
|
const team = ref<V2NIMTeam>();
|
|
|
|
const teamMembers = ref<V2NIMTeamMember[]>([]);
|
|
|
|
const teamMembers = ref<V2NIMTeamMember[]>([]);
|
|
|
|
const teamMute = ref<V2NIMTeamChatBannedMode>(V2NIMConst.V2NIMTeamChatBannedMode.V2NIM_TEAM_CHAT_BANNED_MODE_UNBAN);
|
|
|
|
const teamMute = ref<V2NIMTeamChatBannedMode>(V2NIMConst.V2NIMTeamChatBannedMode.V2NIM_TEAM_CHAT_BANNED_MODE_UNBAN);
|
|
|
|
|
|
|
|
|
|
|
|
const isGroupOwner = ref(false);
|
|
|
|
const isGroupOwner = ref(false);
|
|
|
|
const isGroupManager = ref(false);
|
|
|
|
const isGroupManager = ref(false);
|
|
|
|
|
|
|
|
|
|
|
|
// 是否允许@所有人
|
|
|
|
// 是否允许@所有人
|
|
|
|
const allowAtAll = computed(() => {
|
|
|
|
const allowAtAll = computed(() => {
|
|
|
|
let ext : YxServerExt = {};
|
|
|
|
let ext: YxServerExt = {};
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
ext = JSON.parse((team.value || {}).serverExtension || "{}");
|
|
|
|
ext = JSON.parse((team.value || {}).serverExtension || "{}");
|
|
|
|
} catch (error) {
|
|
|
|
} catch (error) {
|
|
|
|
@ -275,29 +265,29 @@
|
|
|
|
return isGroupOwner.value || isGroupManager.value;
|
|
|
|
return isGroupOwner.value || isGroupManager.value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// 是否是群禁言
|
|
|
|
// 是否是群禁言
|
|
|
|
// const isTeamMute = computed(() => {
|
|
|
|
// const isTeamMute = computed(() => {
|
|
|
|
// // console.log(
|
|
|
|
// // console.log(
|
|
|
|
// 'isGroupOwner, isGroupManager',
|
|
|
|
// 'isGroupOwner, isGroupManager',
|
|
|
|
// isGroupOwner.value,
|
|
|
|
// isGroupOwner.value,
|
|
|
|
// isGroupManager.value
|
|
|
|
// isGroupManager.value
|
|
|
|
// )
|
|
|
|
// )
|
|
|
|
|
|
|
|
|
|
|
|
// if (!teamMute.value) {
|
|
|
|
// if (!teamMute.value) {
|
|
|
|
// return false
|
|
|
|
// return false
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// // 群主或者群管理员在群禁言时,可以发送消息
|
|
|
|
// // 群主或者群管理员在群禁言时,可以发送消息
|
|
|
|
// if (isGroupOwner.value || isGroupManager.value) {
|
|
|
|
// if (isGroupOwner.value || isGroupManager.value) {
|
|
|
|
// return false
|
|
|
|
// return false
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// return true
|
|
|
|
// return true
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
const isTeamMute = ref(true);
|
|
|
|
const isTeamMute = ref(true);
|
|
|
|
|
|
|
|
|
|
|
|
const updateTeamMute = () => {
|
|
|
|
const updateTeamMute = () => {
|
|
|
|
if (teamMute.value === V2NIMConst.V2NIMTeamChatBannedMode.V2NIM_TEAM_CHAT_BANNED_MODE_UNBAN) {
|
|
|
|
if (teamMute.value === V2NIMConst.V2NIMTeamChatBannedMode.V2NIM_TEAM_CHAT_BANNED_MODE_UNBAN) {
|
|
|
|
isTeamMute.value = false;
|
|
|
|
isTeamMute.value = false;
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
@ -309,14 +299,14 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
isTeamMute.value = true;
|
|
|
|
isTeamMute.value = true;
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const onPopupChange = (e : any) => {
|
|
|
|
const onPopupChange = (e: any) => {
|
|
|
|
uni.$emit(events.HANDLE_MOVE_THROUGH, e.value);
|
|
|
|
uni.$emit(events.HANDLE_MOVE_THROUGH, e.value);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 点击@群成员
|
|
|
|
// 点击@群成员
|
|
|
|
const handleMentionItemClick = (member : MentionedMember) => {
|
|
|
|
const handleMentionItemClick = (member: MentionedMember) => {
|
|
|
|
//@ts-ignore
|
|
|
|
//@ts-ignore
|
|
|
|
ctx.refs.popupRef.close();
|
|
|
|
ctx.refs.popupRef.close();
|
|
|
|
uni.$emit(events.HANDLE_MOVE_THROUGH, false);
|
|
|
|
uni.$emit(events.HANDLE_MOVE_THROUGH, false);
|
|
|
|
@ -325,15 +315,15 @@
|
|
|
|
const newInputText = inputText.value + nickInTeam + " ";
|
|
|
|
const newInputText = inputText.value + nickInTeam + " ";
|
|
|
|
// 更新input框的内容
|
|
|
|
// 更新input框的内容
|
|
|
|
inputText.value = newInputText;
|
|
|
|
inputText.value = newInputText;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const closePopup = () => {
|
|
|
|
const closePopup = () => {
|
|
|
|
//@ts-ignore
|
|
|
|
//@ts-ignore
|
|
|
|
ctx.refs.popupRef.close();
|
|
|
|
ctx.refs.popupRef.close();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 点击表情输入框,隐藏表情面板,显示键盘
|
|
|
|
// 点击表情输入框,隐藏表情面板,显示键盘
|
|
|
|
const onClickEmojiInput = () => {
|
|
|
|
const onClickEmojiInput = () => {
|
|
|
|
showEmojiInput.value = false;
|
|
|
|
showEmojiInput.value = false;
|
|
|
|
extVisible.value = false;
|
|
|
|
extVisible.value = false;
|
|
|
|
|
|
|
|
|
|
|
|
@ -354,34 +344,28 @@
|
|
|
|
isFocus.value = true;
|
|
|
|
isFocus.value = true;
|
|
|
|
}, 500);
|
|
|
|
}, 500);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const writeStyle = ref("");
|
|
|
|
|
|
|
|
const isIOS = ref(false);
|
|
|
|
|
|
|
|
writeStyle.value = "bottom:0";
|
|
|
|
|
|
|
|
// #ifdef MP-WEIXIN
|
|
|
|
|
|
|
|
const pushUp = ref(false)
|
|
|
|
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
// #ifdef APP-PLUS
|
|
|
|
|
|
|
|
const pushUp = ref(true)
|
|
|
|
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const writeStyle = ref("");
|
|
|
|
|
|
|
|
const isIOS = ref(false);
|
|
|
|
|
|
|
|
writeStyle.value = "bottom:0";
|
|
|
|
|
|
|
|
// #ifdef MP-WEIXIN
|
|
|
|
|
|
|
|
const pushUp = ref(false);
|
|
|
|
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
// #ifdef APP-PLUS
|
|
|
|
|
|
|
|
const pushUp = ref(true);
|
|
|
|
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const keyHeight = ref(350);
|
|
|
|
|
|
|
|
const msgKeyHeight = ref("100%");
|
|
|
|
|
|
|
|
|
|
|
|
const keyHeight = ref(350);
|
|
|
|
const keyboardheightchange = (e) => {
|
|
|
|
const msgKeyHeight = ref('100%')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const keyboardheightchange = (e) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log("键盘高度键盘高度键盘高度键盘高度键盘高度键盘高度键盘高度", e.detail.height);
|
|
|
|
// console.log("键盘高度键盘高度键盘高度键盘高度键盘高度键盘高度键盘高度", e.detail.height);
|
|
|
|
|
|
|
|
|
|
|
|
keyHeight.value = e.detail.height;
|
|
|
|
keyHeight.value = e.detail.height;
|
|
|
|
uni.$emit(events.KeyboardEvent, e.detail.height);
|
|
|
|
uni.$emit(events.KeyboardEvent, e.detail.height);
|
|
|
|
|
|
|
|
|
|
|
|
uni.$emit('KeyboardHeight', e.detail.height);
|
|
|
|
uni.$emit("KeyboardHeight", e.detail.height);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (e.detail.height === 0) {
|
|
|
|
if (e.detail.height === 0) {
|
|
|
|
writeStyle.value = "bottom: 0";
|
|
|
|
writeStyle.value = "bottom: 0";
|
|
|
|
@ -390,17 +374,15 @@
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
uni.$emit(events.KeyboardEvent, 0);
|
|
|
|
uni.$emit(events.KeyboardEvent, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
uni.$emit('msgKeyHeight', '100%');
|
|
|
|
uni.$emit("msgKeyHeight", "100%");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
emojiVisible.value = false;
|
|
|
|
emojiVisible.value = false;
|
|
|
|
extVisible.value = false;
|
|
|
|
extVisible.value = false;
|
|
|
|
audioPanelVisible.value = false;
|
|
|
|
audioPanelVisible.value = false;
|
|
|
|
sendMoreVisible.value = false;
|
|
|
|
sendMoreVisible.value = false;
|
|
|
|
|
|
|
|
|
|
|
|
msgKeyHeight.value = screenHeight.value - keyHeight.value
|
|
|
|
msgKeyHeight.value = screenHeight.value - keyHeight.value;
|
|
|
|
uni.$emit('msgKeyHeight', msgKeyHeight.value);
|
|
|
|
uni.$emit("msgKeyHeight", msgKeyHeight.value);
|
|
|
|
|
|
|
|
|
|
|
|
// #ifdef MP-WEIXIN
|
|
|
|
// #ifdef MP-WEIXIN
|
|
|
|
writeStyle.value = `bottom: calc(${e.detail.height}px - env(safe-area-inset-bottom))`;
|
|
|
|
writeStyle.value = `bottom: calc(${e.detail.height}px - env(safe-area-inset-bottom))`;
|
|
|
|
@ -415,19 +397,15 @@
|
|
|
|
// #endif
|
|
|
|
// #endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleInputBlur = () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleInputBlur = () => {
|
|
|
|
|
|
|
|
isFocus.value = false;
|
|
|
|
isFocus.value = false;
|
|
|
|
uni.$emit('msgKeyHeight', '100%');
|
|
|
|
uni.$emit("msgKeyHeight", "100%");
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 滚动到底部
|
|
|
|
// 滚动到底部
|
|
|
|
const scrollBottom = () => {
|
|
|
|
const scrollBottom = () => {
|
|
|
|
if (isAndroidApp || isWxApp || isIosApp) {
|
|
|
|
if (isAndroidApp || isWxApp || isIosApp) {
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
uni.$emit(events.ON_SCROLL_BOTTOM);
|
|
|
|
uni.$emit(events.ON_SCROLL_BOTTOM);
|
|
|
|
@ -435,10 +413,10 @@
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
uni.$emit(events.ON_SCROLL_BOTTOM);
|
|
|
|
uni.$emit(events.ON_SCROLL_BOTTOM);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 输入框输入事件
|
|
|
|
// 输入框输入事件
|
|
|
|
const handleInput = (event : any) => {
|
|
|
|
const handleInput = (event: any) => {
|
|
|
|
const text = event?.detail?.value;
|
|
|
|
const text = event?.detail?.value;
|
|
|
|
const isAit = text.endsWith("@") || text.endsWith("@\n");
|
|
|
|
const isAit = text.endsWith("@") || text.endsWith("@\n");
|
|
|
|
if (props.conversationType == V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM) {
|
|
|
|
if (props.conversationType == V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM) {
|
|
|
|
@ -451,10 +429,10 @@
|
|
|
|
uni.$emit(events.HANDLE_MOVE_THROUGH, true);
|
|
|
|
uni.$emit(events.HANDLE_MOVE_THROUGH, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 发送文本消息
|
|
|
|
// 发送文本消息
|
|
|
|
const handleSendTextMsg = () => {
|
|
|
|
const handleSendTextMsg = () => {
|
|
|
|
if (inputText.value.trim() === "") return;
|
|
|
|
if (inputText.value.trim() === "") return;
|
|
|
|
const ext = onAtMembersExtHandler();
|
|
|
|
const ext = onAtMembersExtHandler();
|
|
|
|
|
|
|
|
|
|
|
|
@ -482,10 +460,10 @@
|
|
|
|
isReplyMsg.value = false;
|
|
|
|
isReplyMsg.value = false;
|
|
|
|
selectedAtMembers.value = [];
|
|
|
|
selectedAtMembers.value = [];
|
|
|
|
uni.$emit(events.KeyboardEvent, 0); //点击发送消息list会多一段paddingBottom 需要键盘高度设置为0
|
|
|
|
uni.$emit(events.KeyboardEvent, 0); //点击发送消息list会多一段paddingBottom 需要键盘高度设置为0
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 发送文件消息
|
|
|
|
// 发送文件消息
|
|
|
|
const handleSendFileMsg = () => {
|
|
|
|
const handleSendFileMsg = () => {
|
|
|
|
uni.chooseFile({
|
|
|
|
uni.chooseFile({
|
|
|
|
count: 1,
|
|
|
|
count: 1,
|
|
|
|
type: "all",
|
|
|
|
type: "all",
|
|
|
|
@ -512,9 +490,12 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const handleSendJob = () => {
|
|
|
|
const handleSendCustomMsg = () => {
|
|
|
|
console.log("props.jobListShow", props.jobListShow);
|
|
|
|
|
|
|
|
emits("jobListShow", true);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
const handleSendCustomMsg = () => {
|
|
|
|
const customMsg = uni.$UIKitNIM.V2NIMMessageCreator.createCustomMessage(
|
|
|
|
const customMsg = uni.$UIKitNIM.V2NIMMessageCreator.createCustomMessage(
|
|
|
|
"这是PGQ的自定义消息",
|
|
|
|
"这是PGQ的自定义消息",
|
|
|
|
JSON.stringify({
|
|
|
|
JSON.stringify({
|
|
|
|
@ -530,17 +511,16 @@
|
|
|
|
scrollBottom();
|
|
|
|
scrollBottom();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 移除回复消息
|
|
|
|
// 移除回复消息
|
|
|
|
const removeReplyMsg = () => {
|
|
|
|
const removeReplyMsg = () => {
|
|
|
|
uni.$UIKitStore.msgStore.removeReplyMsgActive(replyMsg?.value?.conversationId as string);
|
|
|
|
uni.$UIKitStore.msgStore.removeReplyMsgActive(replyMsg?.value?.conversationId as string);
|
|
|
|
isReplyMsg.value = false;
|
|
|
|
isReplyMsg.value = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 显示表情面板
|
|
|
|
|
|
|
|
const handleEmojiVisible = () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 显示表情面板
|
|
|
|
|
|
|
|
const handleEmojiVisible = () => {
|
|
|
|
showEmojiInput.value = true;
|
|
|
|
showEmojiInput.value = true;
|
|
|
|
|
|
|
|
|
|
|
|
extVisible.value = true;
|
|
|
|
extVisible.value = true;
|
|
|
|
@ -557,10 +537,10 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
uni.$emit(events.ON_SCROLL_BOTTOM);
|
|
|
|
uni.$emit(events.ON_SCROLL_BOTTOM);
|
|
|
|
}, 100);
|
|
|
|
}, 100);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 显示发送更多"+"面板
|
|
|
|
// 显示发送更多"+"面板
|
|
|
|
const handleSendMoreVisible = () => {
|
|
|
|
const handleSendMoreVisible = () => {
|
|
|
|
if (isTeamMute.value) return;
|
|
|
|
if (isTeamMute.value) return;
|
|
|
|
audioPanelVisible.value = false;
|
|
|
|
audioPanelVisible.value = false;
|
|
|
|
emojiVisible.value = false;
|
|
|
|
emojiVisible.value = false;
|
|
|
|
@ -573,12 +553,10 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
uni.$emit(events.ON_SCROLL_BOTTOM);
|
|
|
|
uni.$emit(events.ON_SCROLL_BOTTOM);
|
|
|
|
// }, 300)
|
|
|
|
// }, 300)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 删除表情
|
|
|
|
|
|
|
|
const handleEmojiDelete = () => {
|
|
|
|
// 删除表情
|
|
|
|
|
|
|
|
const handleEmojiDelete = () => {
|
|
|
|
|
|
|
|
let target = "";
|
|
|
|
let target = "";
|
|
|
|
const isEmojiEnd = Object.keys(emojiMap).reduce((prev, cur) => {
|
|
|
|
const isEmojiEnd = Object.keys(emojiMap).reduce((prev, cur) => {
|
|
|
|
const isEnd = inputText.value.endsWith(cur);
|
|
|
|
const isEnd = inputText.value.endsWith(cur);
|
|
|
|
@ -592,10 +570,10 @@
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
inputText.value = inputText.value.slice(0, -1);
|
|
|
|
inputText.value = inputText.value.slice(0, -1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 显示语音面板
|
|
|
|
// 显示语音面板
|
|
|
|
const handleAudioVisible = () => {
|
|
|
|
const handleAudioVisible = () => {
|
|
|
|
if (isTeamMute.value) return;
|
|
|
|
if (isTeamMute.value) return;
|
|
|
|
audioPanelVisible.value = !audioPanelVisible.value;
|
|
|
|
audioPanelVisible.value = !audioPanelVisible.value;
|
|
|
|
emojiVisible.value = false;
|
|
|
|
emojiVisible.value = false;
|
|
|
|
@ -606,10 +584,10 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
uni.$emit(events.ON_SCROLL_BOTTOM);
|
|
|
|
uni.$emit(events.ON_SCROLL_BOTTOM);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 发送图片消息
|
|
|
|
// 发送图片消息
|
|
|
|
const handleSendImageMsg = () => {
|
|
|
|
const handleSendImageMsg = () => {
|
|
|
|
if (isTeamMute.value) return;
|
|
|
|
if (isTeamMute.value) return;
|
|
|
|
stopAllAudio();
|
|
|
|
stopAllAudio();
|
|
|
|
uni.chooseImage({
|
|
|
|
uni.chooseImage({
|
|
|
|
@ -641,10 +619,10 @@
|
|
|
|
//没有开启权限时,提示开启权限
|
|
|
|
//没有开启权限时,提示开启权限
|
|
|
|
complete: handleNoPermission,
|
|
|
|
complete: handleNoPermission,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 发送视频消息(使用相机或者从相册选择)
|
|
|
|
// 发送视频消息(使用相机或者从相册选择)
|
|
|
|
const handleSendVideoMsg = (type : string, event : any) => {
|
|
|
|
const handleSendVideoMsg = (type: string, event: any) => {
|
|
|
|
if (isTeamMute.value) return;
|
|
|
|
if (isTeamMute.value) return;
|
|
|
|
stopAllAudio();
|
|
|
|
stopAllAudio();
|
|
|
|
// 这里做一层拦截的原因是,微信小程序在input聚焦的时候点击+号按钮,会触发此函数执行,阻止冒泡也无法解决该问题,疑为uniapp编译问题
|
|
|
|
// 这里做一层拦截的原因是,微信小程序在input聚焦的时候点击+号按钮,会触发此函数执行,阻止冒泡也无法解决该问题,疑为uniapp编译问题
|
|
|
|
@ -682,10 +660,10 @@
|
|
|
|
//没有开启权限时,提示开启权限
|
|
|
|
//没有开启权限时,提示开启权限
|
|
|
|
complete: handleNoPermission,
|
|
|
|
complete: handleNoPermission,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 发送语音消息
|
|
|
|
// 发送语音消息
|
|
|
|
const handleSendAudioMsg = (filePath : string, duration : number) => {
|
|
|
|
const handleSendAudioMsg = (filePath: string, duration: number) => {
|
|
|
|
const audioMsg = uni.$UIKitNIM.V2NIMMessageCreator.createAudioMessage(filePath);
|
|
|
|
const audioMsg = uni.$UIKitNIM.V2NIMMessageCreator.createAudioMessage(filePath);
|
|
|
|
|
|
|
|
|
|
|
|
uni.$UIKitStore.msgStore
|
|
|
|
uni.$UIKitStore.msgStore
|
|
|
|
@ -715,10 +693,10 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
scrollBottom();
|
|
|
|
scrollBottom();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 跳转设置页
|
|
|
|
// 跳转设置页
|
|
|
|
const handleSetting = () => {
|
|
|
|
const handleSetting = () => {
|
|
|
|
if (props.conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_P2P) {
|
|
|
|
if (props.conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_P2P) {
|
|
|
|
customNavigateTo({
|
|
|
|
customNavigateTo({
|
|
|
|
url: `/pages/Chat/message/p2p-set?id=${props.to}`,
|
|
|
|
url: `/pages/Chat/message/p2p-set?id=${props.to}`,
|
|
|
|
@ -728,17 +706,17 @@
|
|
|
|
url: `/pages/Group/group-set/index?id=${props.to}`,
|
|
|
|
url: `/pages/Group/group-set/index?id=${props.to}`,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
let uninstallTeamWatch = () => { };
|
|
|
|
let uninstallTeamWatch = () => {};
|
|
|
|
const msgHeight = ref(0);
|
|
|
|
const msgHeight = ref(0);
|
|
|
|
const screenHeight = ref(0);
|
|
|
|
const screenHeight = ref(0);
|
|
|
|
screenHeight.value = uni.getSystemInfoSync().windowHeight;
|
|
|
|
screenHeight.value = uni.getSystemInfoSync().windowHeight;
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
uninstallTeamWatch = autorun(() => {
|
|
|
|
uninstallTeamWatch = autorun(() => {
|
|
|
|
if (props.conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM) {
|
|
|
|
if (props.conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM) {
|
|
|
|
const _team : V2NIMTeam = deepClone(uni.$UIKitStore.teamStore.teams.get(props.to));
|
|
|
|
const _team: V2NIMTeam = deepClone(uni.$UIKitStore.teamStore.teams.get(props.to));
|
|
|
|
teamMembers.value = deepClone(uni.$UIKitStore.teamMemberStore.getTeamMember(props.to));
|
|
|
|
teamMembers.value = deepClone(uni.$UIKitStore.teamMemberStore.getTeamMember(props.to));
|
|
|
|
|
|
|
|
|
|
|
|
const myUser = uni.$UIKitStore.userStore.myUserInfo;
|
|
|
|
const myUser = uni.$UIKitStore.userStore.myUserInfo;
|
|
|
|
@ -753,7 +731,7 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// 撤回后,重新编辑消息
|
|
|
|
// 撤回后,重新编辑消息
|
|
|
|
uni.$on(events.ON_REEDIT_MSG, (msg : V2NIMMessageForUI) => {
|
|
|
|
uni.$on(events.ON_REEDIT_MSG, (msg: V2NIMMessageForUI) => {
|
|
|
|
const _replyMsg = props.replyMsgsMap?.[msg.messageClientId];
|
|
|
|
const _replyMsg = props.replyMsgsMap?.[msg.messageClientId];
|
|
|
|
// 如果重新编辑的是回复消息,则需要将回复消息展示在输入框上方
|
|
|
|
// 如果重新编辑的是回复消息,则需要将回复消息展示在输入框上方
|
|
|
|
if (_replyMsg?.messageClientId) {
|
|
|
|
if (_replyMsg?.messageClientId) {
|
|
|
|
@ -766,7 +744,7 @@
|
|
|
|
const extObj = JSON.parse(msg.serverExtension);
|
|
|
|
const extObj = JSON.parse(msg.serverExtension);
|
|
|
|
const yxAitMsg = extObj.yxAitMsg;
|
|
|
|
const yxAitMsg = extObj.yxAitMsg;
|
|
|
|
if (yxAitMsg) {
|
|
|
|
if (yxAitMsg) {
|
|
|
|
const _mentionedMembers : MentionedMember[] = [];
|
|
|
|
const _mentionedMembers: MentionedMember[] = [];
|
|
|
|
Object.keys(yxAitMsg).forEach((key) => {
|
|
|
|
Object.keys(yxAitMsg).forEach((key) => {
|
|
|
|
if (key == AT_ALL_ACCOUNT) {
|
|
|
|
if (key == AT_ALL_ACCOUNT) {
|
|
|
|
_mentionedMembers.push({
|
|
|
|
_mentionedMembers.push({
|
|
|
|
@ -791,13 +769,13 @@
|
|
|
|
isFocus.value = true;
|
|
|
|
isFocus.value = true;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
uni.$on(events.REPLY_MSG, (msg : V2NIMMessageForUI) => {
|
|
|
|
uni.$on(events.REPLY_MSG, (msg: V2NIMMessageForUI) => {
|
|
|
|
isReplyMsg.value = true;
|
|
|
|
isReplyMsg.value = true;
|
|
|
|
isFocus.value = true;
|
|
|
|
isFocus.value = true;
|
|
|
|
replyMsg.value = msg;
|
|
|
|
replyMsg.value = msg;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
uni.$on(events.AIT_TEAM_MEMBER, (member : MentionedMember) => {
|
|
|
|
uni.$on(events.AIT_TEAM_MEMBER, (member: MentionedMember) => {
|
|
|
|
selectedAtMembers.value = [...selectedAtMembers.value.filter((item) => item.accountId !== member.accountId), member];
|
|
|
|
selectedAtMembers.value = [...selectedAtMembers.value.filter((item) => item.accountId !== member.accountId), member];
|
|
|
|
const newInputText = inputText.value + "@" + member.appellation + " ";
|
|
|
|
const newInputText = inputText.value + "@" + member.appellation + " ";
|
|
|
|
// 更新input框的内容
|
|
|
|
// 更新input框的内容
|
|
|
|
@ -818,7 +796,7 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// @消息 @群成员
|
|
|
|
// @消息 @群成员
|
|
|
|
uni.$on(events.HANDLE_AIT_MEMBER, (member : MentionedMember) => {
|
|
|
|
uni.$on(events.HANDLE_AIT_MEMBER, (member: MentionedMember) => {
|
|
|
|
handleMentionItemClick(member);
|
|
|
|
handleMentionItemClick(member);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
@ -863,42 +841,38 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uni.$on("msgHeight", (res) => {
|
|
|
|
uni.$on('msgHeight', (res) => {
|
|
|
|
|
|
|
|
// console.log('inputinputinputinputinputinputinputinput')
|
|
|
|
// console.log('inputinputinputinputinputinputinputinput')
|
|
|
|
// console.log(res)
|
|
|
|
// console.log(res)
|
|
|
|
msgHeight.value = res
|
|
|
|
msgHeight.value = res;
|
|
|
|
})
|
|
|
|
});
|
|
|
|
uni.$on('screenHeight', (res) => {
|
|
|
|
uni.$on("screenHeight", (res) => {
|
|
|
|
// console.log(res)
|
|
|
|
// console.log(res)
|
|
|
|
if (res) {
|
|
|
|
if (res) {
|
|
|
|
screenHeight.value = res
|
|
|
|
screenHeight.value = res;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
screenHeight.value = uni.getSystemInfoSync().windowHeight
|
|
|
|
screenHeight.value = uni.getSystemInfoSync().windowHeight;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isTeamMute.value = false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
// // 点击表情
|
|
|
|
|
|
|
|
// const handleEmoji = (emoji: { key: string; type: string }) => {
|
|
|
|
|
|
|
|
// inputText.value += emoji.key;
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const handleEmoji = (emoji: Emoji) => {
|
|
|
|
isTeamMute.value = false;
|
|
|
|
const handleEmoji = (emoji : { key : string; type : string; emoji : string; text : string }) => {
|
|
|
|
});
|
|
|
|
|
|
|
|
// // 点击表情
|
|
|
|
|
|
|
|
// const handleEmoji = (emoji: { key: string; type: string }) => {
|
|
|
|
|
|
|
|
// inputText.value += emoji.key;
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const handleEmoji = (emoji: Emoji) => {
|
|
|
|
|
|
|
|
const handleEmoji = (emoji: { key: string; type: string; emoji: string; text: string }) => {
|
|
|
|
if (emoji.type === "emoji") {
|
|
|
|
if (emoji.type === "emoji") {
|
|
|
|
inputText.value += emoji.emoji;
|
|
|
|
inputText.value += emoji.emoji;
|
|
|
|
} else if (emoji.type === "text") {
|
|
|
|
} else if (emoji.type === "text") {
|
|
|
|
inputText.value += emoji.text;
|
|
|
|
inputText.value += emoji.text;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const onAtMembersExtHandler = () => {
|
|
|
|
|
|
|
|
let ext: YxServerExt;
|
|
|
|
const onAtMembersExtHandler = () => {
|
|
|
|
|
|
|
|
let ext : YxServerExt;
|
|
|
|
|
|
|
|
if (selectedAtMembers.value.length) {
|
|
|
|
if (selectedAtMembers.value.length) {
|
|
|
|
selectedAtMembers.value
|
|
|
|
selectedAtMembers.value
|
|
|
|
.filter((member) => {
|
|
|
|
.filter((member) => {
|
|
|
|
@ -909,7 +883,7 @@
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.forEach((member) => {
|
|
|
|
.forEach((member) => {
|
|
|
|
const substr = `@${member.appellation}`;
|
|
|
|
const substr = `@${member.appellation}`;
|
|
|
|
const positions : number[] = [];
|
|
|
|
const positions: number[] = [];
|
|
|
|
let pos = inputText.value?.indexOf(substr);
|
|
|
|
let pos = inputText.value?.indexOf(substr);
|
|
|
|
while (pos !== -1) {
|
|
|
|
while (pos !== -1) {
|
|
|
|
positions.push(pos);
|
|
|
|
positions.push(pos);
|
|
|
|
@ -944,9 +918,9 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// @ts-ignore
|
|
|
|
// @ts-ignore
|
|
|
|
return ext;
|
|
|
|
return ext;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
onUnmounted(() => {
|
|
|
|
uni.$off(events.REPLY_MSG);
|
|
|
|
uni.$off(events.REPLY_MSG);
|
|
|
|
uni.$off(events.ON_REEDIT_MSG);
|
|
|
|
uni.$off(events.ON_REEDIT_MSG);
|
|
|
|
uni.$off(events.REPLY_MSG);
|
|
|
|
uni.$off(events.REPLY_MSG);
|
|
|
|
@ -965,36 +939,34 @@
|
|
|
|
uni.$off(events.EMOJI_SEND);
|
|
|
|
uni.$off(events.EMOJI_SEND);
|
|
|
|
removeReplyMsg();
|
|
|
|
removeReplyMsg();
|
|
|
|
uninstallTeamWatch();
|
|
|
|
uninstallTeamWatch();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
|
|
.input-root {
|
|
|
|
|
|
|
|
|
|
|
|
.input-root {
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
flex-direction: column;
|
|
|
|
height: auto;
|
|
|
|
height: auto;
|
|
|
|
max-height: 300px;
|
|
|
|
max-height: 300px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.input-root-h5 {
|
|
|
|
.input-root-h5 {
|
|
|
|
height: auto;
|
|
|
|
height: auto;
|
|
|
|
position: relative;
|
|
|
|
position: relative;
|
|
|
|
order: 1;
|
|
|
|
order: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.msg-input-wrapper {
|
|
|
|
.msg-input-wrapper {
|
|
|
|
padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
|
|
|
|
padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
height: 100%;
|
|
|
|
background-color: #eff1f3;
|
|
|
|
background-color: #eff1f3;
|
|
|
|
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
|
|
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
|
|
z-index: 999;
|
|
|
|
z-index: 999;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.msg-input {
|
|
|
|
.msg-input {
|
|
|
|
overflow-x: hidden;
|
|
|
|
overflow-x: hidden;
|
|
|
|
padding: 7px;
|
|
|
|
padding: 7px;
|
|
|
|
background-color: #eff1f3;
|
|
|
|
background-color: #eff1f3;
|
|
|
|
@ -1011,16 +983,16 @@
|
|
|
|
padding: 0 12px;
|
|
|
|
padding: 0 12px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.msg-button-group {
|
|
|
|
.msg-button-group {
|
|
|
|
padding: 12px 20px 2px 20px;
|
|
|
|
padding: 12px 20px 2px 20px;
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.msg-input-button {
|
|
|
|
.msg-input-button {
|
|
|
|
// flex: 1;
|
|
|
|
// flex: 1;
|
|
|
|
// &:not(:last-child) {
|
|
|
|
// &:not(:last-child) {
|
|
|
|
// margin-right: 60px;
|
|
|
|
// margin-right: 60px;
|
|
|
|
@ -1038,33 +1010,33 @@
|
|
|
|
height: 100%;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.msg-ext {
|
|
|
|
.msg-ext {
|
|
|
|
overflow-y: auto;
|
|
|
|
overflow-y: auto;
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
height: 300px;
|
|
|
|
height: 300px;
|
|
|
|
background-color: #eff1f3;
|
|
|
|
background-color: #eff1f3;
|
|
|
|
z-index: 1;
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.msg-emoji-panel {
|
|
|
|
.msg-emoji-panel {
|
|
|
|
overflow-y: auto;
|
|
|
|
overflow-y: auto;
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
height: 246px;
|
|
|
|
height: 246px;
|
|
|
|
background-color: #eff1f3;
|
|
|
|
background-color: #eff1f3;
|
|
|
|
z-index: 1;
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.msg-audio-panel {
|
|
|
|
.msg-audio-panel {
|
|
|
|
overflow-y: hidden;
|
|
|
|
overflow-y: hidden;
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
height: 300px;
|
|
|
|
height: 300px;
|
|
|
|
background-color: #eff1f3;
|
|
|
|
background-color: #eff1f3;
|
|
|
|
z-index: 1;
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.send-more-panel {
|
|
|
|
.send-more-panel {
|
|
|
|
padding: 15px;
|
|
|
|
padding: 15px;
|
|
|
|
overflow-y: hidden;
|
|
|
|
overflow-y: hidden;
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
@ -1073,9 +1045,9 @@
|
|
|
|
z-index: 1;
|
|
|
|
z-index: 1;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
box-sizing: border-box;
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.send-more-panel-item-wrapper {
|
|
|
|
.send-more-panel-item-wrapper {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
align-items: center;
|
|
|
|
@ -1100,9 +1072,9 @@
|
|
|
|
margin-top: 8px;
|
|
|
|
margin-top: 8px;
|
|
|
|
text-align: center;
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.reply-message-wrapper {
|
|
|
|
.reply-message-wrapper {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
font-size: 13px;
|
|
|
|
font-size: 13px;
|
|
|
|
background-color: #eff1f2;
|
|
|
|
background-color: #eff1f2;
|
|
|
|
@ -1159,22 +1131,22 @@
|
|
|
|
white-space: nowrap;
|
|
|
|
white-space: nowrap;
|
|
|
|
font-size: 13px;
|
|
|
|
font-size: 13px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.input-emoji {
|
|
|
|
.input-emoji {
|
|
|
|
background-color: #fff;
|
|
|
|
background-color: #fff;
|
|
|
|
height: 40px;
|
|
|
|
height: 40px;
|
|
|
|
line-height: 40px;
|
|
|
|
line-height: 40px;
|
|
|
|
font-size: 16px;
|
|
|
|
font-size: 16px;
|
|
|
|
padding: 0 12px;
|
|
|
|
padding: 0 12px;
|
|
|
|
border-radius: 6px;
|
|
|
|
border-radius: 6px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.input-text {
|
|
|
|
.input-text {
|
|
|
|
white-space: nowrap;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.input-placeholder {
|
|
|
|
.input-placeholder {
|
|
|
|
background-color: #fff;
|
|
|
|
background-color: #fff;
|
|
|
|
height: 40px;
|
|
|
|
height: 40px;
|
|
|
|
line-height: 40px;
|
|
|
|
line-height: 40px;
|
|
|
|
@ -1182,9 +1154,9 @@
|
|
|
|
padding: 0 12px;
|
|
|
|
padding: 0 12px;
|
|
|
|
border-radius: 6px;
|
|
|
|
border-radius: 6px;
|
|
|
|
color: gray;
|
|
|
|
color: gray;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.file-picker-wrapper {
|
|
|
|
.file-picker-wrapper {
|
|
|
|
position: absolute;
|
|
|
|
position: absolute;
|
|
|
|
width: 60px;
|
|
|
|
width: 60px;
|
|
|
|
height: 60px;
|
|
|
|
height: 60px;
|
|
|
|
@ -1194,32 +1166,32 @@
|
|
|
|
width: 60px;
|
|
|
|
width: 60px;
|
|
|
|
height: 60px;
|
|
|
|
height: 60px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.pbInput {
|
|
|
|
.pbInput {
|
|
|
|
height: "auto";
|
|
|
|
height: "auto";
|
|
|
|
position: fixed;
|
|
|
|
position: fixed;
|
|
|
|
left: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100vw;
|
|
|
|
width: 100vw;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 临时处理方案, 全局样式在这里不生效
|
|
|
|
// 临时处理方案, 全局样式在这里不生效
|
|
|
|
.g_flex_c {
|
|
|
|
.g_flex_c {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
display: -webkit-flex;
|
|
|
|
display: -webkit-flex;
|
|
|
|
justify-content: center;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.g_p_5 {
|
|
|
|
.g_p_5 {
|
|
|
|
padding: 5px;
|
|
|
|
padding: 5px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.g_p_6 {
|
|
|
|
.g_p_6 {
|
|
|
|
padding: 6px;
|
|
|
|
padding: 6px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.g_flex_1 {
|
|
|
|
.g_flex_1 {
|
|
|
|
flex: 1;
|
|
|
|
flex: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|