lex 8 months ago
parent
commit
b789e43bff

File diff suppressed because it is too large
+ 0 - 0
dist/assets/index-44c59b7b.css


File diff suppressed because it is too large
+ 0 - 0
dist/assets/index-4c4cec4e.js


+ 2 - 2
dist/index.html

@@ -6,8 +6,8 @@
   <link rel="icon" type="image/svg+xml" href="./vite.svg" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <title>IM</title>
-  <script type="module" crossorigin src="./assets/index-68d6cf71.js"></script>
-  <link rel="stylesheet" href="./assets/index-5555502c.css">
+  <script type="module" crossorigin src="./assets/index-4c4cec4e.js"></script>
+  <link rel="stylesheet" href="./assets/index-44c59b7b.css">
 </head>
 
 <body>

+ 14 - 1
src/TUIKit/TUIComponents/container/TUIChat/plugin-components/typingHeader/typingHeader.vue

@@ -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,

+ 2 - 1
src/TUIKit/TUIComponents/container/TUIChat/style/web.scss

@@ -17,7 +17,8 @@
     h1 {
       font-size: 16Px;
       line-height: 30Px;
-      user-select: text;
+      // user-select: text;
+      cursor: pointer;
     }
   }
 

Some files were not shown because too many files changed in this diff