tab2.page.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <ion-header [translucent]="true">
  2. <ion-toolbar class="custom-toolbar">
  3. <div class="search-bar" >
  4. <ion-searchbar
  5. placeholder="搜索"
  6. class="custom-searchbar"
  7. (ionInput)="searchProducts($event)">
  8. </ion-searchbar>
  9. </div>
  10. @if(!searchTerm){
  11. <div class="header">
  12. <ion-card-header>
  13. <ion-card-title>
  14. <ion-segment [scrollable]="true" value="hotdot" [value]="type" (ionChange)="typeChange($event)">
  15. <ion-segment-button value="hotdot" content-id="hotdot">
  16. <ion-label>热点</ion-label>
  17. </ion-segment-button>
  18. <ion-segment-button value="export" content-id="export">
  19. <ion-label>专家科普</ion-label>
  20. </ion-segment-button>
  21. <ion-segment-button value="短篇小说" content-id="短篇小说">
  22. <ion-label>短篇小说</ion-label>
  23. </ion-segment-button>
  24. <ion-segment-button value="工具箱" content-id="短篇小说">
  25. <ion-label>工具箱</ion-label>
  26. </ion-segment-button>
  27. <!-- <ion-segment-button value="life" content-id="life">
  28. <ion-label>生活</ion-label>
  29. </ion-segment-button>
  30. <ion-segment-button value="男" content-id="male">
  31. <ion-label>男性</ion-label>
  32. </ion-segment-button>
  33. <ion-segment-button value="女" content-id="female">
  34. <ion-label>女性</ion-label>
  35. </ion-segment-button> -->
  36. </ion-segment>
  37. </ion-card-title>
  38. </ion-card-header>
  39. </div>
  40. }
  41. </ion-toolbar>
  42. </ion-header>
  43. <!-- @if(user.id == admin){<p> llll
  44. </p> } -->
  45. <ion-content class="knowledge" [fullscreen]="true">
  46. @if(!searchTerm){
  47. <div class="content">
  48. <ion-card>
  49. <ion-card-header></ion-card-header>
  50. <ion-card-content>
  51. <ion-segment-view>
  52. <ion-segment-content id="female">
  53. <app-article-card (click)="openDetailModal(card)" *ngFor="let card of mycards" [card]="card"></app-article-card>
  54. </ion-segment-content>
  55. </ion-segment-view>
  56. </ion-card-content>
  57. </ion-card>
  58. </div>
  59. }
  60. @if(searchTerm){
  61. <div>
  62. <app-article-card (click)="openDetailModal(product)" *ngFor="let product of products" [card]="product"></app-article-card>
  63. </div>
  64. @if (products.length == 0) {
  65. <div class="no-results" style="margin: 50px auto;">
  66. <h2>寻找中··· 请耐性等待 ····</h2>
  67. </div>
  68. }
  69. }
  70. <!-- 底部弹出模态 -->
  71. <ion-modal [isOpen]="isModalOpen" cssClass="bottom-modal">
  72. <ng-template>
  73. <ion-header>
  74. <ion-toolbar>
  75. <ion-buttons slot="start">
  76. <ion-button (click)="closeDetailModal()">关闭</ion-button>
  77. </ion-buttons>
  78. <ion-title>{{currentProduct.get('category')}}</ion-title>
  79. </ion-toolbar>
  80. </ion-header>
  81. <ion-content class="ion-padding">
  82. <div class="modal-content" *ngIf="currentProduct">
  83. <h1 class="product-name">{{currentProduct.get('title')}}</h1>
  84. <p><strong>作者:</strong>{{currentProduct.get('username')}}</p>
  85. <fm-markdown-preview [content]="currentProduct.get('content2')"></fm-markdown-preview>
  86. <!-- <div class="image-container">
  87. <img style="width: 100%; height: auto;" [src]="currentProduct.get('image')[0]" alt="图片" class="medicine-image">
  88. </div> -->
  89. <!-- <p>{{currentProduct.get('content')[0]}}</p> -->
  90. </div>
  91. </ion-content>
  92. </ng-template>
  93. </ion-modal>
  94. </ion-content>