community.component.html 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <ion-header>
  2. <ion-toolbar>
  3. <ion-icon name="compass-outline" size="large" color="dark"></ion-icon>
  4. <ion-button slot="end" fill="clear" size="small" routerLink="share">
  5. <ion-icon name="add-circle-outline" size="large" color="dark"></ion-icon>
  6. <ion-note>发布</ion-note>
  7. </ion-button>
  8. </ion-toolbar>
  9. </ion-header>
  10. <ion-content color="light">
  11. <!-- 导航 -->
  12. <ion-card class="navbar">
  13. <ion-toolbar>
  14. <ion-segment value="推荐">
  15. <ion-segment-button value="推荐" (click)="cate='推荐'">
  16. <ion-label>推荐</ion-label>
  17. </ion-segment-button>
  18. <ion-segment-button value="关注" (click)="cate='关注'">
  19. <ion-label>关注</ion-label>
  20. </ion-segment-button>
  21. <ion-segment-button value="科普" (click)="cate='科普'">
  22. <ion-label>科普</ion-label>
  23. </ion-segment-button>
  24. </ion-segment>
  25. </ion-toolbar>
  26. </ion-card>
  27. <!-- 推荐 -->
  28. <ng-container *ngIf="cate=='推荐'">
  29. <ion-grid>
  30. <ion-row>
  31. <ng-container *ngFor="let attention of recommendList">
  32. <ion-col size="6">
  33. <ion-card class="roleCard" (click)="goRecommendDetail(attention)">
  34. <img alt="推荐图" [src]="attention?.get('img')" />
  35. <ion-card-header>
  36. <ion-card-title>
  37. {{attention?.get('name')}}
  38. </ion-card-title>
  39. <ion-card-subtitle style="font-size:0.7rem;">
  40. 作者:{{attention?.get('user')?.get('name') || "无名"}}
  41. </ion-card-subtitle>
  42. </ion-card-header>
  43. <div class="metadata-end-wrapper">
  44. <ion-button shape="round" size="small" color="danger">
  45. <ion-icon name="heart-outline" size="small"></ion-icon>
  46. {{attention?.get('like')}}
  47. </ion-button>
  48. </div>
  49. </ion-card>
  50. </ion-col>
  51. </ng-container>
  52. </ion-row>
  53. </ion-grid>
  54. </ng-container>
  55. <!-- 关注 -->
  56. <ng-container *ngIf="cate=='关注'">
  57. <div class="carousel-container">
  58. <div class="carousel">
  59. <div class="card">Card 1</div>
  60. <div class="card">Card 2</div>
  61. <div class="card">Card 3</div>
  62. <div class="card">Card 4</div>
  63. <div class="card">Card 5</div>
  64. </div>
  65. </div>
  66. </ng-container>
  67. <!-- 科普 -->
  68. <ng-container *ngIf="cate=='科普'">
  69. <ng-container *ngFor="let science of scienceList">
  70. <ion-card (click)="goScienceDetail(science)">
  71. <img alt="科普图" [src]="science?.get('img')" />
  72. <ion-card-header>
  73. <ion-card-title>{{science?.get('name')}}</ion-card-title>
  74. <ion-card-subtitle>{{science?.get('createdAt') | date: 'YYYY/MM/dd' || "发布时间"}}</ion-card-subtitle>
  75. <div class="metadata-end-wrapper">
  76. <ion-button fill="clear" color="dark" size="small" class="see">
  77. <ion-icon name="eye-outline" size="small"></ion-icon>
  78. <ion-note>{{science?.get('see')}}</ion-note>
  79. </ion-button>
  80. <ion-button fill="clear" color="dark" size="small" class="like">
  81. <ion-icon name="heart-outline" size="small"></ion-icon>
  82. <ion-note>{{science?.get('like')}}</ion-note>
  83. </ion-button>
  84. </div>
  85. </ion-card-header>
  86. <ion-card-content>
  87. <p class="foodContent">{{science?.get('content')}}</p>
  88. </ion-card-content>
  89. </ion-card>
  90. </ng-container>
  91. </ng-container>
  92. </ion-content>