tab1.page.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  2. <ion-header>
  3. <ion-toolbar color="primary">
  4. <ion-buttons slot="start">
  5. <ion-avatar (click)="openLoginModal()">
  6. <img [src]="userAvatar" alt="User Avatar" />
  7. </ion-avatar>
  8. <ion-button fill="clear" (click)="openLoginModal()">
  9. <ion-label>登录/注册</ion-label>
  10. </ion-button>
  11. </ion-buttons>
  12. <ion-title>
  13. 1分钟了解健康服务
  14. </ion-title>
  15. <ion-buttons slot="end">
  16. <ion-button fill="clear" routerLink="/appointment">
  17. <ion-icon name="medical"></ion-icon>
  18. <ion-label>预约服务</ion-label>
  19. <ion-icon name="chevron-forward-outline"></ion-icon>
  20. </ion-button>
  21. </ion-buttons>
  22. </ion-toolbar>
  23. </ion-header>
  24. <!-- 登录/注册模态框 -->
  25. <ion-modal [isOpen]="isLoginModalOpen" (ionDidDismiss)="onLoginModalDismissed($event)">
  26. <ng-template>
  27. <ion-header>
  28. <ion-toolbar>
  29. <ion-title>登录/注册</ion-title>
  30. <ion-buttons slot="end">
  31. <ion-button (click)="closeLoginModal()" fill="clear">关闭</ion-button>
  32. </ion-buttons>
  33. </ion-toolbar>
  34. </ion-header>
  35. <ion-content class="ion-padding">
  36. <form #loginForm="ngForm" (ngSubmit)="onLoginFormSubmit(loginForm.value)" novalidate>
  37. <ion-item>
  38. <ion-label position="floating">用户名</ion-label>
  39. <ion-input type="text" [(ngModel)]="user.username" name="username" required></ion-input>
  40. <ion-text *ngIf="user.username.length > 0 && user.username.length < 3" color="danger" style="position: absolute; top: 50%; right: 16px; transform: translateY(-50%); opacity: 0.7;">
  41. 还差 {{ 3 - user.username.length }} 位
  42. </ion-text>
  43. </ion-item>
  44. <ion-item>
  45. <ion-label position="floating">密码</ion-label>
  46. <ion-input type="password" [(ngModel)]="user.password" name="password" required></ion-input>
  47. <ion-text *ngIf="user.password.length > 0 && user.password.length < 6" color="danger" style="position: absolute; top: 50%; right: 16px; transform: translateY(-50%); opacity: 0.7;">
  48. 还差 {{ 6 - user.password.length }} 位
  49. </ion-text>
  50. </ion-item>
  51. <ion-row>
  52. <ion-col>
  53. <ion-button expand="block" type="submit" [disabled]="!loginForm.form.valid">登录</ion-button>
  54. </ion-col>
  55. <ion-col>
  56. <ion-button expand="block" (click)="registerUser()">注册</ion-button>
  57. </ion-col>
  58. </ion-row>
  59. </form>
  60. <div *ngIf="errorMessage" class="error-message">{{ errorMessage }}</div>
  61. </ion-content>
  62. </ng-template>
  63. </ion-modal>
  64. <ion-content>
  65. <ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
  66. <ion-refresher-content pullingIcon="chevron-down-circle" pullingText="下拉刷新" refreshingSpinner="circles" refreshingText="正在刷新..."></ion-refresher-content>
  67. </ion-refresher>
  68. <div class="health-banner">
  69. <div class="banner-content">
  70. <div class="banner-header">
  71. 获取健康礼包,开启健康生活
  72. </div>
  73. <div class="banner-body">
  74. <div class="avatar-stack">
  75. <img src="../../assets/images/doctor.png" alt="Doctor 1" class="avatar" />
  76. <img src="../../assets/images/doctor.png" alt="Doctor 2" class="avatar" />
  77. <img src="../../assets/images/doctor.png" alt="Doctor 3" class="avatar" />
  78. </div>
  79. <div class="expert-info">
  80. 10位专家在线等待咨询
  81. </div>
  82. </div>
  83. <div class="banner-footer">
  84. <ion-button expand="block" color="danger" (click)="onConsultNow()">立即咨询</ion-button>
  85. </div>
  86. <div class="banner-bottom">
  87. <div class="bottom-content">
  88. <div class="left-content">
  89. 昨天 下午3点 张医生 正在提供咨询服务
  90. </div>
  91. <div class="right-content">
  92. <ion-button fill="clear" color="light" (click)="onLearnMore()">点击了解更多</ion-button>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. <!-- 推荐医生区域 -->
  99. <div class="recommended-doctors">
  100. <div class="header">
  101. <div class="title">今日推荐医生</div>
  102. <div class="subtitle">每日更新</div>
  103. </div>
  104. <div class="scroll-container" id="carousel" (touchstart)="onTouchStart($event)" (touchmove)="onTouchMove($event)" (touchend)="onTouchEnd($event)" [ngStyle]="{ transform: 'translateX(' + currentTranslate + 'px)' }">
  105. <ng-container *ngFor="let doctor of doctors; let i = index">
  106. <div class="card">
  107. <div class="tag">专家</div>
  108. <img src="{{ doctor.avatar }}" alt="Doctor Avatar" class="avatar" />
  109. <div class="name">{{ doctor.name }}</div>
  110. <div class="specialty">{{ doctor.specialty }}</div>
  111. <ion-button expand="block" (click)="onlineConsultNow(doctor)">在线咨询</ion-button>
  112. </div>
  113. </ng-container>
  114. </div>
  115. </div>
  116. <!-- 功能区 -->
  117. <div class="function-area">
  118. <!-- 第一行功能按钮 -->
  119. <div class="function-row">
  120. <div class="function-item" *ngFor="let item of functionItems1" (click)="navigateTo(item.route)">
  121. <div class="icon">
  122. <ion-icon [name]="item.icon"></ion-icon>
  123. </div>
  124. <div class="label">{{ item.label }}</div>
  125. </div>
  126. </div>
  127. <!-- 第二行功能按钮 -->
  128. <div class="function-row">
  129. <div class="function-item" *ngFor="let item of functionItems2" (click)="navigateTo(item.route)">
  130. <div class="icon">
  131. <ion-icon [name]="item.icon"></ion-icon>
  132. </div>
  133. <div class="label">{{ item.label }}</div>
  134. </div>
  135. </div>
  136. </div>
  137. </ion-content>