community.page.html 840 B

1234567891011121314151617181920212223242526
  1. <ion-header>
  2. <ion-toolbar>
  3. <ion-title>发现</ion-title>
  4. <ion-buttons slot="end">
  5. <ion-button (click)="sharePost()" color="primary">
  6. <ion-icon name="add"></ion-icon>
  7. </ion-button>
  8. </ion-buttons>
  9. </ion-toolbar>
  10. </ion-header>
  11. <ion-content>
  12. <div class="spacer"></div> <!-- 空白区域 -->
  13. <div class="post-grid">
  14. <!-- 动态列表 -->
  15. <ion-card *ngFor="let post of posts" (click)="viewPost(post.id)" class="post-card">
  16. <ion-card-header>
  17. <ion-card-subtitle>{{ post.date | date:'short' }}</ion-card-subtitle> <!-- 使用日期管道 -->
  18. </ion-card-header>
  19. <ion-card-content>
  20. <img [src]="post.imageUrl" *ngIf="post.imageUrl" alt="动态图片" class="post-image" />
  21. <p>{{ post.text }}</p>
  22. </ion-card-content>
  23. </ion-card>
  24. </div>
  25. </ion-content>