zhengnaiwen_citu před 5 měsíci
rodič
revize
64e30c8a70

+ 10 - 1
src/hooks/web/useIM.js

@@ -102,7 +102,6 @@ export function useDataSource () {
     }
     const resultConversations = []
     const resp = await getConversationSync(query)
-    // console.log(resp)
     const conversationList = resp
     if (conversationList) {
       conversationList.forEach(conversation => {
@@ -137,9 +136,18 @@ export function useDataSource () {
     const resp = await getMessageSync(query)
     const messageList = resp && resp["messages"]
     if (messageList) {
+      // console.log('messageList', messageList)
       messageList.forEach((msg) => {
         // const message = Convert.toMessage(msg);
         // msg.channel = new Channel(msg.channel_id, msg.channel_type)
+        if (channel.channelID === 'system') {
+          msg.payload = {
+            type: -1,
+            content: Base64.decode(msg.payload)
+          }
+          resultMessages.push(msg)
+          return
+        }
         msg.payload = JSON.parse(Base64.decode(msg.payload))
         if (contentType[msg.payload.type]) {
           msg.payload.content = JSON.parse(msg.payload.content ?? '{}')
@@ -383,6 +391,7 @@ export function send (text, _channel, type) {
   let _text
   if (contentType[type]) {
     _text = new contentType[type](text)
+    console.log(_text)
     WKSDK.shared().chatManager.send(_text, _channel)
     return
   }

+ 5 - 4
src/views/recruit/components/message/components/chatting.vue

@@ -24,7 +24,7 @@
       </div>
     </div>
     <v-divider></v-divider>
-    <div class="py-3 px-7" v-if="interview.length">
+    <div class="py-3 px-7" v-if="interview.length && info.channel?.channelID !== 'system'">
       <div v-for="val in interview" :key="val.id" class="color-666">
         <div class="d-flex justify-space-between">
           <div class="font-weight-bold color-primary">
@@ -50,7 +50,7 @@
         </div>
       </div>
     </div>
-    <v-divider v-if="interview.length"></v-divider>
+    <v-divider v-if="interview.length && info.channel?.channelID !== 'system'"></v-divider>
     <div class="my-3 message-box" @scroll="handleScroll" ref="chatRef">
       <div>
         <div class="d-flex justify-center" v-if="hasMore">
@@ -201,10 +201,11 @@
         </div>
       </div>
     </div>
-    <div class="tools pa-3" v-if="Object.keys(info).length > 0">
+
+    <div class="tools pa-3" v-if="Object.keys(info).length > 0 || info.channel?.channelID !== 'system'">
       <slot name="tools"></slot>
     </div>
-    <div class="bottom-info">
+    <div class="bottom-info" v-if="Object.keys(info).length > 0 || info.channel?.channelID !== 'system'">
       <v-divider></v-divider>
       <div class="pa-3">
         <v-textarea

+ 12 - 0
src/views/recruit/components/message/index.vue

@@ -433,6 +433,18 @@ async function handleChange (items) {
       channel: myChannel,
       unread
     })
+    if (myChannel.channelID === 'system') {
+      channelItem.value = myChannel
+      const { list, more } = await getMoreMessages(1, channelItem.value)
+      messageItems.value = list.value
+      hasMore.value = more
+      chatRef.value.scrollBottom()
+      // 点开窗口消除未读数量
+      await resetUnread(channelItem.value, entBaseInfo?.enterpriseId)
+      await updateConversation()
+      updateUnreadCount()
+      return
+    }
     // 个人端获取面试信息
     if (!isEnterprise) getInterviewInviteList()
     const userId = userInfoVo.userInfoResp.userId