linwu 9 月之前
父節點
當前提交
ea3002e42b
共有 2 個文件被更改,包括 8 次插入2 次删除
  1. 2 0
      app/mobile/controller/Jfm.php
  2. 6 2
      app/mobile/view/jfm/policy_detail.html

+ 2 - 0
app/mobile/controller/Jfm.php

@@ -73,6 +73,8 @@ class Jfm extends MobileBaseController
         $info->volume++;
         $info->save();
 
+        $info->content = str_replace('<img','<img @click="showImage($event)"',$info->content);
+
         return view('', [
             'info' => $info,
         ]);

+ 6 - 2
app/mobile/view/jfm/policy_detail.html

@@ -6,7 +6,7 @@
     .article .article-info {align-items: center;display: flex;justify-content: space-between;margin: 5px;font-size:12px;}
     .article .article-info .s-time {color:#b4b4b4;}
     .article .article-info .s-comment {background: #f5f7f9;border-radius: 5px;flex-shrink: 0;font-size: 14px;padding:5px 10px;}
-    .content,.content img {max-width:100%;}
+    .content,.content img {max-width:100%;display:block;}
 </style>
 {/block}
 {block name="body"}
@@ -41,7 +41,7 @@
             </aside>
         </section>
     </header>
-    <section class="content">
+    <section class="content" ref="content">
         {$info.content}
     </section>
 </div>
@@ -56,6 +56,10 @@
             history.back();
         };
 
+        base.showImage = (e) => {
+            vant.showImagePreview([e.target.src]);
+        };
+
         return base;
     }
 </script>