Bladeren bron

添加逻辑

lex-xin 10 maanden geleden
bovenliggende
commit
e289c320e4
4 gewijzigde bestanden met toevoegingen van 40 en 7 verwijderingen
  1. 28 3
      src/TUIKit/TUIComponents/container/TUIConversation/components/list/index.vue
  2. 7 0
      src/TUIKit/api.ts
  3. 4 3
      src/main.ts
  4. 1 1
      vite.config.ts

+ 28 - 3
src/TUIKit/TUIComponents/container/TUIConversation/components/list/index.vue

@@ -22,11 +22,17 @@
       @handle="handleItem"
       :types="types"
     />
+
+     <DialogTUI title="提示" :show="quitDialogShow" :isH5="isH5" :center="true" :isHeaderShow="!isH5" @submit="handleManage()" @update:show="(e) => (quitDialogShow = e)">
+        <p class="delDialog-title">该用户已注销,是否删除会话?</p>
+      </DialogTUI>
   </ul>
 </template>
 <script lang="ts">
 import { defineComponent, reactive, ref, toRefs, watch, watchEffect } from "vue";
 import LiteItem from "../list-item";
+import DialogTUI from "../../../../components/dialogTUi/index.vue";
+import { api_getMessageUser } from '../../../../../api'
 const TUIConversationList: any = defineComponent({
   props: {
     data: {
@@ -50,10 +56,12 @@ const TUIConversationList: any = defineComponent({
       default: () => new Map(),
     },
   },
-  components: { LiteItem },
+  components: { LiteItem, DialogTUI },
   setup(props: any, ctx: any) {
     const TUIServer: any = TUIConversationList?.TUIServer;
     const obj = reactive({
+      quitDialogShow: false,
+      tempConversation: {},
       data: {},
       currentID: "",
       toggleID: "",
@@ -78,9 +86,25 @@ const TUIConversationList: any = defineComponent({
       { deep: true }
     );
 
-    const handleListItem = (item: any) => {
-      ctx.emit("handleItem", item);
+    const handleListItem = async (item: any) => {
+      try {
+        const {data} = await api_getMessageUser({
+          id: item.userProfile.userID
+        })
+        if(data.delFlag) {
+          obj.tempConversation = item
+          obj.quitDialogShow = true
+        } else {
+          ctx.emit("handleItem", item);
+        }
+      } catch {
+
+      }
+      
     };
+    const handleManage = async () => {
+      handleDeleteConversation(obj.tempConversation);
+    }
 
     const handleItem = (params: any) => {
       const { name, conversation } = params;
@@ -160,6 +184,7 @@ const TUIConversationList: any = defineComponent({
 
     return {
       ...toRefs(obj),
+      handleManage,
       handleListItem,
       handleItem,
       handleToggleListItem,

+ 7 - 0
src/TUIKit/api.ts

@@ -116,3 +116,10 @@ export const imGroupDismiss = (params?: any) => {
     data: params,
   });
 };
+
+/**
+ * 酷乐秀获取当前用户是否已删除
+ */
+export const api_getMessageUser = (params?: any) => {
+  return request.post("/api-admin/imUserFriend/getMessageUser/" + params.id);
+};

+ 4 - 3
src/main.ts

@@ -39,10 +39,11 @@ import { TUIComponents, TUICore, genTestUserSig } from "./TUIKit";
 // import { TUICallKit } from "@tencentcloud/call-uikit-vue";
 
 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
+// import.meta.env.DEV ? 1400805079 : 1400799837; // 1400805079; // Your SDKAppID
+const SDKAppID = parseSearch.appId || hashSearch.appId || 1400805079; 
+//import.meta.env.DEV ? "c5f4ea6140128a36c842990446a2c89249ab886b5e1ea6893555aa635a0b3c30" : "37bfb220843e25e78768cadd0dc06756e460e55bd631354930a4149565a1d0c9"; //"c5f4ea6140128a36c842990446a2c89249ab886b5e1ea6893555aa635a0b3c30"; // Your secretKey
+const secretKey = parseSearch.secretKey || hashSearch.secretKey || "c5f4ea6140128a36c842990446a2c89249ab886b5e1ea6893555aa635a0b3c30"; 
 const userID = parseSearch.userID; //|| "KT:140:TEACHER"; // User ID
 
 // init TUIKit

+ 1 - 1
vite.config.ts

@@ -12,7 +12,7 @@ function pathResolve(dir: string) {
 // function resolve(dir: string) {
 //   return path.join(__dirname, dir);
 // }
-const proxyUrl = "https://test.lexiaoya.cn";
+const proxyUrl = "https://test.colexiu.com";
 // https://vitejs.dev/config/
 export default defineConfig({
   base: "./",