tab3.page.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <ion-header [translucent]="true">
  2. <ion-toolbar>
  3. <ion-title>
  4. 消息
  5. </ion-title>
  6. <ion-button slot="end" (click)="openSettingsPage()">
  7. <ion-icon name="settings-outline"></ion-icon>
  8. </ion-button>
  9. </ion-toolbar>
  10. </ion-header>
  11. <ion-content>
  12. <div style="background-image: url(assets/img/c.jpg);">
  13. <ion-searchbar placeholder="输入关键字搜索"></ion-searchbar>
  14. <ion-card class="card">
  15. <ion-card-header >
  16. <ion-card-title style="color: rgb(0, 4, 255);">最新推荐</ion-card-title>
  17. </ion-card-header>
  18. <ion-card-content >
  19. <ion-avatar>
  20. <ion-img src="assets/img/a.png"></ion-img>
  21. </ion-avatar>
  22. <ion-label>用户名</ion-label><br>
  23. <ion-label>标签</ion-label><br>
  24. <ion-label>聊天内容</ion-label>
  25. <ion-button expand="block">免费提问</ion-button>
  26. </ion-card-content>
  27. </ion-card>
  28. <div style="display: flex; flex-direction: column;">
  29. <ion-segment [ngModelOptions]="{standalone:true}" [(ngModel)]="activeTab" (ionChange)="changeTab($event)">
  30. <ion-segment-button value="explore">
  31. <ion-icon name="chatbubble-ellipses"></ion-icon>
  32. 评论和回复
  33. </ion-segment-button>
  34. <ion-segment-button value="video">
  35. <ion-icon name="thumbs-up"></ion-icon>
  36. 赞与收藏
  37. </ion-segment-button>
  38. <ion-segment-button value="search">
  39. <ion-icon name="person-add"></ion-icon>
  40. 新增关注
  41. </ion-segment-button>
  42. <ion-segment-button value="system">
  43. <ion-icon name="notifications"></ion-icon>
  44. 系统消息
  45. </ion-segment-button>
  46. </ion-segment>
  47. <div *ngIf="activeTab === 'explore'" >
  48. <ion-item>
  49. <ion-avatar slot="start">
  50. <ion-img src="assets/img/b.png"></ion-img>
  51. </ion-avatar>
  52. <ion-label>
  53. <h2>用户名</h2>
  54. <p>这是一条评论内容</p>
  55. </ion-label>
  56. </ion-item>
  57. <ion-item>
  58. <ion-avatar slot="start">
  59. <ion-img src="https://img2.baidu.com/it/u=2453029165,1962533557&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500"></ion-img>
  60. </ion-avatar>
  61. <ion-label>
  62. <h2>回复者用户名</h2>
  63. <p>这是一条回复内容</p>
  64. </ion-label>
  65. </ion-item>
  66. <ion-item>
  67. <ion-input placeholder="添加评论"></ion-input>
  68. <ion-button slot="end" (click)="sendComment()">
  69. <ion-icon name="send"></ion-icon>
  70. </ion-button>
  71. </ion-item>
  72. </div>
  73. <div *ngIf="activeTab === 'video'">
  74. <ion-item>
  75. <ion-avatar slot="start">
  76. <ion-img src="assets/avatar1.jpg"></ion-img>
  77. </ion-avatar>
  78. <ion-label>
  79. <h2>用户名1</h2>
  80. <p>这是一条内容1</p>
  81. </ion-label>
  82. <ion-buttons slot="end">
  83. <ion-button (click)="likePost(1)">
  84. <ion-icon name="heart" [color]="isPostLiked(1) ? 'danger' : 'medium'"></ion-icon>
  85. </ion-button>
  86. <ion-button (click)="toggleFavorite(1)">
  87. <ion-icon name="star" [color]="isPostFavorite(1) ? 'warning' : 'medium'"></ion-icon>
  88. </ion-button>
  89. </ion-buttons>
  90. </ion-item>
  91. <ion-item>
  92. <ion-avatar slot="start">
  93. <ion-img src="assets/avatar2.jpg"></ion-img>
  94. </ion-avatar>
  95. <ion-label>
  96. <h2>用户名2</h2>
  97. <p>这是一条内容2</p>
  98. </ion-label>
  99. <ion-buttons slot="end">
  100. <ion-button (click)="likePost(2)">
  101. <ion-icon name="heart" [color]="isPostLiked(2) ? 'danger' : 'medium'"></ion-icon>
  102. </ion-button>
  103. <ion-button (click)="toggleFavorite(2)">
  104. <ion-icon name="star" [color]="isPostFavorite(2) ? 'warning' : 'medium'"></ion-icon>
  105. </ion-button>
  106. </ion-buttons>
  107. </ion-item>
  108. </div>
  109. <div *ngIf="activeTab === 'search'">
  110. <ion-item>
  111. <ion-avatar slot="start">
  112. <ion-img src="assets/avatar1.jpg"></ion-img>
  113. </ion-avatar>
  114. <ion-label>
  115. <h2>用户名1</h2>
  116. <p>这是一条内容1</p>
  117. </ion-label>
  118. <ion-button slot="end" (click)="toggleFollow(1)" color="primary" [fill]="isUserFollowed(1) ? 'solid' : 'outline'">
  119. {{ isUserFollowed(1) ? '已关注' : '关注' }}
  120. </ion-button>
  121. </ion-item>
  122. <ion-item>
  123. <ion-avatar slot="start">
  124. <ion-img src="assets/avatar2.jpg"></ion-img>
  125. </ion-avatar>
  126. <ion-label>
  127. <h2>用户名2</h2>
  128. <p>这是一条内容2</p>
  129. </ion-label>
  130. <ion-button slot="end" (click)="toggleFollow(2)" color="primary" [fill]="isUserFollowed(2) ? 'solid' : 'outline'">
  131. {{ isUserFollowed(2) ? '已关注' : '关注' }}
  132. </ion-button>
  133. </ion-item>
  134. </div>
  135. <div *ngIf="activeTab === 'system'">
  136. <ion-item>
  137. <ion-avatar slot="start">
  138. <ion-img src="assets/avatar1.jpg"></ion-img>
  139. </ion-avatar>
  140. <ion-label>
  141. <h2>系统消息标题1</h2>
  142. <p>这是一条系统消息内容1</p>
  143. </ion-label>
  144. </ion-item>
  145. <ion-item>
  146. <ion-avatar slot="start">
  147. <ion-img src="assets/avatar2.jpg"></ion-img>
  148. </ion-avatar>
  149. <ion-label>
  150. <h2>系统消息标题2</h2>
  151. <p>这是一条系统消息内容2</p>
  152. </ion-label>
  153. </ion-item>
  154. </div>
  155. </div>
  156. </div>
  157. </ion-content>