Parcourir la source

更新 地图仅显示已通过审核图片

wzh il y a 4 ans
Parent
commit
9a1176c6de
1 fichiers modifiés avec 12 ajouts et 5 suppressions
  1. 12 5
      src/views/voyage/voyageDetail.vue

+ 12 - 5
src/views/voyage/voyageDetail.vue

@@ -785,18 +785,25 @@ export default {
       let markers = [];
       for (let i of medias.value) {
         let content = `<div style='width:160px'>
-        <img id='img${i.id}' style='width:160px;height:160px;object-fit:contain;' src='${i.viewUrl}'/>
+        ${
+          i.audit == 1
+            ? `<img id='img${i.id}' style='width:160px;height:160px;object-fit:contain;' src='${i.viewUrl}'/>`
+            : ``
+        }
         <img src='https://hhd-pat-1255802371.cos.ap-shanghai.myqcloud.com/frontend/ship-red-icon.png' style='display:block;width:20px;height:20px;margin:6px auto'/
       </div>`;
 
         let marker = new AMap.Marker({
           content,
           position: new AMap.LngLat(i.longitude, i.latitude),
-          offset: new AMap.Pixel(-75, -195),
-        });
-        marker.on("click", () => {
-          openMediaModal(i.viewUrl, 1, "航次图片");
+          offset: new AMap.Pixel(-75, i.audit == 1 ? -195 : -30),
         });
+        if (i.audit == 1) {
+          marker.on("click", () => {
+            openMediaModal(i.viewUrl, 1, "航次图片", i);
+          });
+        }
+
         markers.push(marker);
       }