tab1.page.html 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <ion-header style="background-color: #fffefe;">
  2. <ion-toolbar color="light">
  3. <ion-title>Fearless</ion-title>
  4. </ion-toolbar>
  5. </ion-header>
  6. <ion-content [fullscreen]="true" style="background-color: #f4f4f4;">
  7. <div class="carousel-container" style="border-radius: 25px; margin: 5px auto;">
  8. <div class="carousel" [style.transform]="'translateX(-' + currentSlide * 100 + '%)'">
  9. <div class="slide" *ngFor="let image of images; let i = index">
  10. <img [src]="image" alt="轮播图" class="carousel-image">
  11. </div>
  12. </div>
  13. <!-- 上一张按钮 -->
  14. <button class="prev" (click)="prevSlide()">&#10094;</button>
  15. <button class="next" (click)="nextSlide()">&#10095;</button>
  16. <div class="dots">
  17. <span class="dot" *ngFor="let image of images; let i = index"
  18. [class.active]="i === currentSlide"
  19. (click)="goToSlide(i)"></span>
  20. </div>
  21. </div>
  22. <!-- 标签切换 -->
  23. <ion-segment [(ngModel)]="selectedTab" color="secondary">
  24. <ion-segment-button value="fitnessTips">
  25. 健身技巧
  26. </ion-segment-button>
  27. <ion-segment-button value="sportsNews">
  28. 体育新闻
  29. </ion-segment-button>
  30. <ion-segment-button value="recoveryTutorials">
  31. 恢复教程
  32. </ion-segment-button>
  33. </ion-segment>
  34. <div *ngIf="selectedTab === 'fitnessTips'" style="background: linear-gradient(to right, #fffffe, #fcfbfb); padding: 20px 0; border-radius: 15px;">
  35. <ion-card *ngFor="let tip of fitnessTips" style="border-radius: 10px; overflow: hidden;">
  36. <ion-card-header style="background-color: #e1fbff;">
  37. <ion-card-title>{{ tip.title }}</ion-card-title>
  38. <ion-card-subtitle>{{ tip.subtitle }}</ion-card-subtitle>
  39. </ion-card-header>
  40. <ion-card-content style="background-color: #fff9f2;">
  41. <p>{{ tip.description }}</p>
  42. <ion-button expand="full" color="primary" (click)="goNewspage()">查看技巧</ion-button>
  43. </ion-card-content>
  44. </ion-card>
  45. </div>
  46. <!-- 体育新闻内容 -->
  47. <div *ngIf="selectedTab === 'sportsNews'" style="background-color: #f0f4f7; padding: 20px 0; border-radius: 15px;">
  48. <ion-grid>
  49. <ion-row>
  50. <ion-col size="12" size-md="4" *ngFor="let news of sportsNews">
  51. <ion-card style="border-radius: 15px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);">
  52. <ion-card-header style="background-color: #1e88e5;">
  53. <ion-card-title style="color: #fff;">{{ news.title }}</ion-card-title>
  54. <ion-card-subtitle style="color: #fff;">{{ news.date }}</ion-card-subtitle>
  55. </ion-card-header>
  56. <ion-card-content style="background-color: #e1f5fe;">
  57. <p>{{ news.description }}</p>
  58. <ion-button expand="full" color="primary" (click)="goNewspage()">查看新闻</ion-button>
  59. </ion-card-content>
  60. </ion-card>
  61. </ion-col>
  62. </ion-row>
  63. </ion-grid>
  64. </div>
  65. <!-- 恢复教程内容 -->
  66. <div *ngIf="selectedTab === 'recoveryTutorials'" style="background-color: #f9f9f9; padding: 20px 0; border-radius: 15px;">
  67. <ion-grid>
  68. <ion-row>
  69. <ion-col size="12" size-md="4" *ngFor="let tutorial of recoveryTutorials">
  70. <ion-card style="border-radius: 15px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);">
  71. <ion-card-header style="background-color: #9061ff;">
  72. <ion-card-title style="color: #fff;">{{ tutorial.title }}</ion-card-title>
  73. </ion-card-header>
  74. <ion-card-content style="background-color: #ffe8e0;">
  75. <p>{{ tutorial.description }}</p>
  76. <ion-button expand="full" color="primary" (click)="goNewspage()">查看教程</ion-button>
  77. </ion-card-content>
  78. </ion-card>
  79. </ion-col>
  80. </ion-row>
  81. </ion-grid>
  82. </div>
  83. </ion-content>