wkw преди 1 седмица
родител
ревизия
efc4756afc
променени са 1 файла, в които са добавени 11 реда и са изтрити 2 реда
  1. 11 2
      src/views/im/chat/index.vue

+ 11 - 2
src/views/im/chat/index.vue

@@ -268,10 +268,19 @@ const toggleAppBox = async (type) => {
 
 // 预览图片
 const previewImage = (item) => {
-  const url = item?.localUrl || IM_PATH + item.url;
-  showImagePreview([url]);
+  const imageList = wsStore.messages
+    .filter(m => m.contentType === MSG_TYPE.IMAGE)
+    .map(m => m.localUrl || IM_PATH + m.url);
+
+  const index = imageList.findIndex(url => url === (item.localUrl || IM_PATH + item.url));
+
+  showImagePreview({
+    images: imageList,
+    startPosition: index
+  });
 };
 
+
 const onFocus = () => {
   // 隐藏所有面板
   showEmoji.value = false;