0210185 před 4 měsíci
rodič
revize
d922c47201
2 změnil soubory, kde provedl 5 přidání a 2 odebrání
  1. 2 2
      app/tab2/tab2.page.html
  2. 3 0
      app/tab2/tab2.page.ts

+ 2 - 2
app/tab2/tab2.page.html

@@ -20,7 +20,7 @@
         <!-- 第七张照片的时间 -->
         <p>2024-07-07 14:00</p>
       </div>
-      <ion-img src="assets/photos/photo7.jpg" class="top-image"></ion-img>
+      <ion-img src="assets/photos/photo7.jpg" class="top-image" (click)="openImageInNewTab('assets/photos/photo7.jpg')"></ion-img>
     </div>
 
     <!-- 前六张照片 -->
@@ -30,7 +30,7 @@
         <p>2024-07-07 12:00</p>
       </div>
       <div class="bottom-images">
-        <ion-card *ngFor="let photo of ['photo6.jpg', 'photo5.jpg', 'photo4.jpg', 'photo3.jpg', 'photo2.jpg', 'photo1.jpg']">
+        <ion-card *ngFor="let photo of ['photo6.jpg', 'photo5.jpg', 'photo4.jpg', 'photo3.jpg', 'photo2.jpg', 'photo1.jpg']" (click)="openImageInNewTab('assets/photos/' + photo)">
           <ion-img src="assets/photos/{{ photo }}"></ion-img>
         </ion-card>
       </div>

+ 3 - 0
app/tab2/tab2.page.ts

@@ -9,4 +9,7 @@ export class Tab2Page {
 
   constructor() {}
 
+  openImageInNewTab(imageUrl: string) {
+    window.open(imageUrl, '_blank');
+  }
 }