|
@@ -1,11 +1,13 @@
|
|
|
<template>
|
|
|
- <h1>{{ title === "对方正在输入" ? $t("TUIChat.对方正在输入") : title }}</h1>
|
|
|
+ <h1 @click="onCopyName">{{ title === "对方正在输入" ? $t("TUIChat.对方正在输入") : title }}</h1>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
+import TUIMessage from "../../../../components/messageTUI/index";
|
|
|
import { defineComponent, watchEffect, watch, reactive, toRefs, computed, nextTick } from "vue";
|
|
|
import { handleName, JSONToObject, isTypingMessage, handleUserID } from "../../utils/utils";
|
|
|
import constant from "../../../constant";
|
|
|
+import useClipboard from "vue-clipboard3";
|
|
|
const TypingHeader = defineComponent({
|
|
|
props: {
|
|
|
needTyping: {
|
|
@@ -76,6 +78,16 @@ const TypingHeader = defineComponent({
|
|
|
return conversationName?.value + (conversationUserID.value ? `(${conversationUserID.value})` : "");
|
|
|
});
|
|
|
|
|
|
+ const onCopyName = async () => {
|
|
|
+ const { toClipboard } = useClipboard();
|
|
|
+ await toClipboard(conversationName?.value + (conversationUserID.value ? `(${conversationUserID.value})` : ""));
|
|
|
+ TUIMessage({
|
|
|
+ message: "复制成功",
|
|
|
+ isH5: false,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
const onTyping = (inputContentEmpty: boolean, inputBlur: boolean) => {
|
|
|
if (!data.needTyping || conversationType.value !== "C2C") return;
|
|
|
if (new Date().getTime() / 1000 - data.lastOtherMessageTime < 30) {
|
|
@@ -186,6 +198,7 @@ const TypingHeader = defineComponent({
|
|
|
}, 5000);
|
|
|
|
|
|
return {
|
|
|
+ onCopyName,
|
|
|
...toRefs(data),
|
|
|
conversationID,
|
|
|
conversationName,
|