Sfoglia il codice sorgente

修改切换层级显示

lex-xin 8 mesi fa
parent
commit
2ab911ea68
3 ha cambiato i file con 19 aggiunte e 5 eliminazioni
  1. 15 2
      src/App.vue
  2. 2 1
      src/TUIKit/TUIComponents/container/TUIChat/index.vue
  3. 2 2
      src/main.ts

+ 15 - 2
src/App.vue

@@ -1,5 +1,5 @@
 <template>
-  <div :class="['home']" :id="'preloadedImages'">
+  <div :class="['home']" :id="'preloadedImages'" @click="onLevel">
     <main class="home-main">
       <div class="home-main-box">
         <div class="home-TUIKit">
@@ -83,8 +83,9 @@ export default defineComponent({
       dialogShow: false,
     });
 
-    const onClose = () => {
+    const onClose = (e: any) => {
       if (window.parent) {
+        e.stopPropagation();
         window.parent.postMessage(
           {
             api: "onImClose",
@@ -94,6 +95,17 @@ export default defineComponent({
       }
     };
 
+    const onLevel = () => {
+      if (window.parent) {
+        window.parent.postMessage(
+          {
+            api: "onLevel",
+          },
+          "*"
+        );
+      }
+    }
+
     const handleCurrentConversation = (value: string) => {
       data.currentModel = "message";
       data.currentConversationID = value;
@@ -152,6 +164,7 @@ export default defineComponent({
       isMsgNeedReadReceipt,
       displayOnlineStatus,
       onClose,
+      onLevel,
       handleManage,
     };
   },

+ 2 - 1
src/TUIKit/TUIComponents/container/TUIChat/index.vue

@@ -519,8 +519,9 @@ const TUIChat: any = defineComponent({
       }
     };
 
-    const showUserDetail = () => {
+    const showUserDetail = (e: any) => {
       if (window.parent) {
+        e.stopPropagation();
         window.parent?.postMessage(
           {
             api: "openUserDetail",

+ 2 - 2
src/main.ts

@@ -41,8 +41,8 @@ import { TUIComponents, TUICore, genTestUserSig } from "./TUIKit";
 console.log(import.meta.env.DEV, "import.meta.env.DEV");
 
 // 判断是否是测试环境的
-const SDKAppID = parseSearch.appId || hashSearch.appId || 1400799837; // import.meta.env.DEV ? 1400805079 : 1400799837; // 1400805079; // Your SDKAppID
-const secretKey = parseSearch.secretKey || hashSearch.secretKey || "37bfb220843e25e78768cadd0dc06756e460e55bd631354930a4149565a1d0c9"; //import.meta.env.DEV ? "c5f4ea6140128a36c842990446a2c89249ab886b5e1ea6893555aa635a0b3c30" : "37bfb220843e25e78768cadd0dc06756e460e55bd631354930a4149565a1d0c9"; //"c5f4ea6140128a36c842990446a2c89249ab886b5e1ea6893555aa635a0b3c30"; // Your secretKey
+const SDKAppID = parseSearch.appId || hashSearch.appId || 1400805079; // import.meta.env.DEV ? 1400805079 : 1400799837; // 1400805079; // Your SDKAppID
+const secretKey = parseSearch.secretKey || hashSearch.secretKey || "c5f4ea6140128a36c842990446a2c89249ab886b5e1ea6893555aa635a0b3c30"; //import.meta.env.DEV ? "c5f4ea6140128a36c842990446a2c89249ab886b5e1ea6893555aa635a0b3c30" : "37bfb220843e25e78768cadd0dc06756e460e55bd631354930a4149565a1d0c9"; //"c5f4ea6140128a36c842990446a2c89249ab886b5e1ea6893555aa635a0b3c30"; // Your secretKey
 const userID = parseSearch.userID; //|| "KT:140:TEACHER"; // User ID
 
 // init TUIKit