فهرست منبع

Merge branch 'im' of https://git.nanodreamtech.com/wkw/wallet_app into im

congjiang 1 ماه پیش
والد
کامیت
a863184372
2فایلهای تغییر یافته به همراه59 افزوده شده و 50 حذف شده
  1. 1 0
      src/assets/svg/qx.svg
  2. 58 50
      src/views/im/chat/index.vue

+ 1 - 0
src/assets/svg/qx.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1756799194209" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6479" width="20" height="20" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M947.203161 512c0 240.351818-194.845925 435.19413-435.20858 435.19413-240.351818 0-435.199548-194.842312-435.199548-435.19413 0-240.350011 194.845925-435.192324 435.199548-435.192324 240.364461-0.001806 435.20858 194.840506 435.20858 435.192324zM511.994581 0C229.230924 0 0 229.238149 0 512 0 794.770882 229.230924 1024 511.994581 1024c282.774494 0 512.005419-229.229118 512.005419-512C1024 229.238149 794.769076 0 511.994581 0z" fill="#000000" p-id="6480"></path><path d="M511.994581 566.305794c54.314825 54.302182 108.62062 108.617007 162.924608 162.922802 14.989815 14.991622 39.303336 14.991622 54.303988 0 15.002459-15.002459 15.002459-39.314173 0-54.303988-54.303988-54.314825-108.607976-108.617007-162.91377-162.922802 54.305794-54.302182 108.609783-108.607976 162.91377-162.911964 15.002459-15.000653 15.002459-39.312367 0-54.303988-15.000653-15.000653-39.314173-15.000653-54.303988 0-54.303988 54.303988-108.609783 108.607976-162.924608 162.91377l-162.91377-162.91377c-14.989815-15.000653-39.303336-15.000653-54.303988 0-14.989815 14.991622-14.989815 39.303336 0 54.303988l162.91377 162.911964c-54.303988 54.305794-108.609783 108.607976-162.91377 162.922802-14.989815 14.991622-14.989815 39.303336 0 54.303988 15.000653 14.991622 39.314173 14.991622 54.303988 0 54.305794-54.305794 108.607976-108.62062 162.91377-162.922802z" fill="#000000" p-id="6481"></path></svg>

+ 58 - 50
src/views/im/chat/index.vue

@@ -42,51 +42,50 @@
             <div class="list-cont">
               <div>{{ item.sender?item.sender.nickname: (item.nickname || item.fromUsername || "匿名用户") }}</div>
 
-              <template v-if="!item.isTemp"> 
-              <!-- 文本消息 -->
-              <div class="content" v-if="item.contentType === MsgType.MSG_TYPE.TEXT" @click="onLongPress(item)">
-                {{ item.content }}
-              </div>
-
-              <!-- 图片消息 -->
-              <div
-                class="img-message"
-                v-else-if="item.contentType === MsgType.MSG_TYPE.IMAGE"
-              >
-                <van-image
-                  :src="item?.localUrl || IM_PATH + item.url"
-                  style="max-width: 120px; border-radius: 8px"
-                  @click="previewImage(item)"
-                />
-              </div>
-
-              <!-- 名片消息 -->
-              <div
-                class="content card-message"
-                v-else-if="item.contentType === 3"
-              >
-                <div class="card-title">名片</div>
-                <div class="card-name">{{ item.content }}</div>
-              </div>
+              <div v-if="!item.isTemp"> 
+                <!-- 文本消息 -->
+                <div class="content" v-if="item.contentType === MsgType.MSG_TYPE.TEXT" @click="onLongPress(item)">
+                  {{ item.content }}
+                </div>
 
-              <!-- 录音消息 -->
-              <div
-                class="audio-message"
-                v-else-if="item.contentType === MsgType.MSG_TYPE.AUDIO"
-              >
-                <messageAudio
-                  :src="item?.localUrl || IM_PATH + item.url"
-                  :isSender="isSender(item.toUsername, item)"
-                />
-              </div>
+                <!-- 图片消息 -->
+                <div
+                  class="img-message"
+                  v-else-if="item.contentType === MsgType.MSG_TYPE.IMAGE"
+                >
+                  <van-image
+                    :src="item?.localUrl || IM_PATH + item.url"
+                    style="max-width: 120px; border-radius: 8px"
+                    @click="previewImage(item)"
+                  />
+                </div>
 
-              <!-- 语音消息 -->
-              <div class="content" v-if="item.contentType === Constant.REJECT_AUDIO_ONLINE || item.contentType === Constant.REJECT_VIDEO_ONLINE">[对方拒绝]</div>
-              <div class="content" v-if="item.contentType === Constant.CANCELL_AUDIO_ONLINE || item.contentType === Constant.CANCELL_VIDEO_ONLINE">[通话结束]</div>
+                <!-- 名片消息 -->
+                <div
+                  class="content card-message"
+                  v-else-if="item.contentType === 3"
+                >
+                  <div class="card-title">名片</div>
+                  <div class="card-name">{{ item.content }}</div>
+                </div>
 
-              <div v-if="item.quote > 0" class="quotation">{{ item.quoteMsg?.content }}</div>
+                <!-- 录音消息 -->
+                <div
+                  class="audio-message"
+                  v-else-if="item.contentType === MsgType.MSG_TYPE.AUDIO"
+                >
+                  <messageAudio
+                    :src="item?.localUrl || IM_PATH + item.url"
+                    :isSender="isSender(item.toUsername, item)"
+                  />
+                </div>
 
-            </template>
+                <!-- 语音消息 -->
+                <div class="content" v-if="item.contentType === Constant.REJECT_AUDIO_ONLINE || item.contentType === Constant.REJECT_VIDEO_ONLINE">[对方拒绝]</div>
+                <div class="content" v-if="item.contentType === Constant.CANCELL_AUDIO_ONLINE || item.contentType === Constant.CANCELL_VIDEO_ONLINE">[通话结束]</div>
+                
+                <div v-if="item.quote > 0" class="quotation">{{ item.quoteMsg?.content }}</div>
+              </div>
               <!-- 阅后即焚消息 -->
               <div
                 v-else
@@ -177,7 +176,11 @@
           name="emoji"
           @click="toggleAppBox(1)"
         />
-        <svg-icon
+        <svg-icon v-if="showBurn" @click="closeMessaageBurning"
+          class="page-icon-qx"
+          name="qx"
+        />
+        <svg-icon v-else
           class="page-icon tools-toggle"
           name="add2"
           @click="toggleAppBox(2)"
@@ -245,7 +248,7 @@
           <svg-icon class="tool-icon" name="mp" />
           <div>名片</div>
         </div> -->
-        <div class="tool-btn" @click="messageBurning?closeMessaageBurning():openMessageBurning()">
+        <div class="tool-btn" @click="openMessageBurning">
           <svg-icon class="tool-icon" name="mp" />
           <div>阅后即焚</div>
         </div>
@@ -289,8 +292,6 @@ const appBoxHeight = ref(210);
 const chatListRef = ref(null);
 const emojiRef = ref(null);
 const toolsRef = ref(null);
-// 阅后即焚
-const messageBurning = ref(false)
 // 听筒模式
 const earMode = ref(false);
 // @成员
@@ -306,6 +307,7 @@ const emojis = [
   "😀", "😃", "😄", "😁", "😆", "😅", "😂", "🤣",
 ];
 const atList = ref();
+const showBurn = ref(false)  // 阅后即焚是否开启
 
 const isSender = (toUsername, item) => {
   if(item?.sender){
@@ -457,11 +459,12 @@ const groupMessageStickTop = (message)=>{
 
 // 开启消息阅后即焚
 const openMessageBurning = ()=>{
-  messageBurning.value = true
+  showBurn.value = true
+  showTools.value = false
 }
 // 关闭消息阅后即焚
 const closeMessaageBurning = ()=>{
-  messageBurning.value = false
+  showBurn.value = false
 }
 
 // 录音相关状态
@@ -543,7 +546,7 @@ const handleTouchEnd = () => {
         msgId: `ms${Date.now()}`, // 消息id
         quote: quoteMsg.value?.id, // 引用消息id
         cc: wsStore.toUserInfo.type == 'user'?"":ccMsg.value.join(","), // @成员
-        isTemp: messageBurning.value === true, // 消息阅后即焚
+        isTemp: showBurn.value === true, // 消息阅后即焚
       }), 
       contentType: MsgType.MSG_TYPE.AUDIO,
       messageType: wsStore.toUserInfo.type == 'user'?MsgType.MESSAGE_TYPE_USER:(ccMsg.value.length> 0?MsgType.MESSAGE_CC_GROUP:MsgType.MESSAGE_TYPE_GROUP),
@@ -646,7 +649,7 @@ const sendMessage = () => {
       msgId: `ms${Date.now()}`, // 消息id
       quote: quoteMsg.value?.id, // 引用消息id
       cc: wsStore.toUserInfo.type == 'user'?"":cc.join(","), // @成员
-      isTemp: messageBurning.value === true, // 消息阅后即焚
+      isTemp: showBurn.value === true, // 消息阅后即焚
     }), 
     contentType: MsgType.MSG_TYPE.TEXT, // 1: 文本消息
     messageType: wsStore.toUserInfo.type == 'user'?MsgType.MESSAGE_TYPE_USER:(cc.length> 0?MsgType.MESSAGE_CC_GROUP:MsgType.MESSAGE_TYPE_GROUP),
@@ -668,7 +671,7 @@ const afterRead = async (file) => {
       msgId: `ms${Date.now()}`, // 消息id
       quote: quoteMsg.value?.id, // 引用消息id
       cc: wsStore.toUserInfo.type == 'user'?"":ccMsg.value.join(","), // @成员
-      isTemp: messageBurning.value === true, // 消息阅后即焚
+      isTemp: showBurn.value === true, // 消息阅后即焚
     }), 
     contentType: MsgType.MSG_TYPE.IMAGE, // 音频消息类型
     messageType: wsStore.toUserInfo.type == 'user'?MsgType.MESSAGE_TYPE_USER:(ccMsg.value.length> 0?MsgType.MESSAGE_CC_GROUP:MsgType.MESSAGE_TYPE_GROUP),
@@ -836,6 +839,11 @@ const goNoticePage = () => {
   height: 24px;
   flex-shrink: 0;
 }
+.page-icon-qx{
+  width: 22px;
+  height: 22px;
+  flex-shrink: 0;
+}
 .container {
   display: flex;
   flex-direction: column;