浏览代码

添加@样式

wkw 1 月之前
父节点
当前提交
d3fb5811b8
共有 1 个文件被更改,包括 33 次插入8 次删除
  1. 33 8
      src/views/im/chat/index.vue

+ 33 - 8
src/views/im/chat/index.vue

@@ -145,6 +145,10 @@
       cancel-text="取消"
       @select="onActionSelect"
     />
+    <!-- @样式 -->
+    <div class="assign" v-if="wsStore.toUserInfo.type == 'group'">
+      <div class="assign-text">有人@我</div>
+    </div>
     <!-- 引用消息展示 -->
     <div v-if="quoteMsg" class="quote-box">
       <div class="quote-content">{{ quoteMsg.fromUsername}}:{{ renderQuoteContent(quoteMsg) }}</div>
@@ -331,6 +335,10 @@ const showNotice = ref(false);
 const noticeRead = ref(false);
 const groupMembersArr = ref([]);
 
+const currentMsg = ref('');
+const showActionSheet = ref(false)
+const actions = ref([])
+
 const formatAvatarUrl = (item) => {
   const url = item?.sender?.avatar || item?.avatar || ''
   if (/^https?:\/\//.test(url)) {
@@ -676,15 +684,21 @@ const onSelectUser = (user) => {
   ccMsg.value.push(user)
 };
 
-const currentMsg = ref('');
-const showActionSheet = ref(false)
-const actions = [
-  { name: "复制", key: "copy" },
-  { name: "撤回", key: "revoke" },
-  { name: "引用", key: "quote" },
-  // { name: "置顶", key: "stick" },
-];
 const onLongPress = (msg) => {
+  if(msg.toUsername == walletStore.account){
+    actions.value = [
+      { name: "复制", key: "copy" },
+      { name: "引用", key: "quote" },
+      // { name: "置顶", key: "stick" },
+    ]
+  }else{
+    actions.value = [
+      { name: "复制", key: "copy" },
+      { name: "撤回", key: "revoke" },
+      { name: "引用", key: "quote" },
+      // { name: "置顶", key: "stick" },
+    ]
+  }
   currentMsg.value = msg;
   showActionSheet.value = true;
 };
@@ -1268,6 +1282,17 @@ const goDetail = () =>{
   color: red;
   margin-left: 6px;
 }
+.assign{
+  margin-bottom: 20px;
+  display: flex;
+  justify-content: flex-end;
+  .assign-text{
+    color: #fff;
+    background: #4765dd;
+    border-radius: 30px 0 0 30px;
+    padding: 3px 10px;
+  }
+}
 // 引用样式
 .quote-box {
   display: flex;