inquiry-human.component.ts 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. import { Component, OnInit } from '@angular/core';
  2. import { IonModal, IonHeader, IonToolbar, IonTitle, IonContent, IonList, IonItem, IonLabel, IonAvatar, IonButton, IonChip, IonIcon, IonBadge, IonText, IonCard, IonSegmentButton, IonSegment, IonCol, IonRow, IonGrid, IonButtons, IonFooter } from '@ionic/angular/standalone';
  3. import { ExploreContainerComponent } from '../../explore-container/explore-container.component';
  4. import { addIcons } from 'ionicons';
  5. import { airplane, bluetooth, call, wifi } from 'ionicons/icons';
  6. import { Router } from '@angular/router';
  7. import { CommonModule } from '@angular/common';
  8. import { FormsModule } from '@angular/forms';
  9. addIcons({ airplane, bluetooth, call, wifi });
  10. interface Doctor {
  11. avatar: string;
  12. name: string;
  13. title: string;
  14. department: string;
  15. hospital: string;
  16. hospitalLevel: string;
  17. hospitalType: string;
  18. expertise: string;
  19. rating: number;
  20. consultations: string;
  21. recommendations: number;
  22. tags?: string[];
  23. prices: {
  24. text: number;
  25. voice: number;
  26. video: number;
  27. }
  28. isVerified?: boolean;
  29. isExpert?: boolean;
  30. }
  31. interface ConsultOption {
  32. id: number;
  33. title: string;
  34. icon: string;
  35. price: number;
  36. unit: string;
  37. isAvailable: boolean; // 是否可用
  38. isSelected?: boolean; // 是否被选中
  39. }
  40. @Component({
  41. selector: 'inquiry-human',
  42. templateUrl: './inquiry-human.component.html',
  43. styleUrls: ['./inquiry-human.component.scss'],
  44. standalone: true,
  45. imports: [
  46. IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent,CommonModule,
  47. IonLabel,IonItem,IonList,IonAvatar,IonLabel,IonButton,IonChip,IonIcon,IonBadge,
  48. IonText,IonCard,IonSegment,IonSegmentButton, FormsModule,IonCol,IonRow,IonGrid,
  49. IonModal,IonButtons,IonFooter
  50. ]
  51. })
  52. export class InquiryHumanComponent implements OnInit {
  53. options: ConsultOption[] = [
  54. {
  55. id: 1,
  56. title: '图文咨询',
  57. icon: 'chatbubbles',
  58. price: 120,
  59. unit: '次',
  60. isAvailable: true,
  61. isSelected: true
  62. },
  63. {
  64. id: 2,
  65. title: '电话咨询',
  66. icon: 'call',
  67. price: 200,
  68. unit: '次起',
  69. isAvailable: true
  70. },
  71. {
  72. id: 3,
  73. title: '视频问诊',
  74. icon: 'videocam',
  75. price: 0,
  76. unit: '',
  77. isAvailable: false
  78. },
  79. {
  80. id: 4,
  81. title: '私人医生',
  82. icon: 'person',
  83. price: 0,
  84. unit: '',
  85. isAvailable: false
  86. },
  87. {
  88. id: 5,
  89. title: '预约',
  90. icon: 'calendar',
  91. price: 0,
  92. unit: '',
  93. isAvailable: false
  94. }
  95. ];
  96. selectOption(option: ConsultOption) {
  97. if (!option.isAvailable) return;
  98. this.options.forEach(opt => opt.isSelected = false);
  99. option.isSelected = true;
  100. }
  101. isModalOpen = false;
  102. doctor: any;
  103. openDetailModal(doctor?: any) {
  104. this.isModalOpen = true;
  105. this.doctor = doctor;
  106. }
  107. closeDetailModal() {
  108. this.isModalOpen = false;
  109. this.doctor = null;
  110. }
  111. constructor(
  112. private router: Router
  113. ) { }
  114. ngOnInit() {}
  115. back:string = "<";
  116. backhome(){
  117. this.router.navigate(['/tabs/tab1']);
  118. }
  119. selectedSegment = '全部';
  120. segments = ['全部', '妇科', '儿科', '眼科', '内科',];
  121. doctors: Doctor[] = [
  122. {
  123. avatar: 'https://app.fmode.cn/dev/jxnu/202226701019/doctor7.png',
  124. name: '张伟',
  125. title: '主任医师',
  126. department: '妇科',
  127. hospital: '首都医科大学附属北京友谊..',
  128. hospitalLevel: '三甲',
  129. hospitalType: '百强医院',
  130. expertise: '擅长:结肠息肉和息肉病、胃息肉、幽门螺杆菌感染、慢性胃炎、胃食管反流、慢性萎缩性胃炎、糜烂性胃炎...',
  131. rating: 5.0,
  132. consultations: '1.1万',
  133. recommendations: 100,
  134. prices: {
  135. text: 100,
  136. voice: 150,
  137. video: 300
  138. },
  139. tags: ['百强医院', '可开处方', '从业24年', '擅长消化系统疾病', '可开处方'],
  140. isVerified: true,
  141. isExpert: true,
  142. },
  143. {
  144. avatar: 'https://app.fmode.cn/dev/jxnu/202226701019/doctor6.png',
  145. name: '张伟',
  146. title: '主任医师',
  147. department: '儿科',
  148. hospital: '首都医科大学附属北京友谊..',
  149. hospitalLevel: '三甲',
  150. hospitalType: '百强医院',
  151. expertise: '擅长:结肠息肉和息肉病、胃息肉、幽门螺杆菌感染、慢性胃炎、胃食管反流、慢性萎缩性胃炎、糜烂性胃炎...',
  152. rating: 5.0,
  153. consultations: '1.1万',
  154. recommendations: 100,
  155. prices: {
  156. text: 100,
  157. voice: 150,
  158. video: 300
  159. },
  160. tags: ['百强医院', '可开处方', '从业24年', '擅长消化系统疾病', '可开处方'],
  161. isVerified: true,
  162. isExpert: true,
  163. },{
  164. avatar: 'https://app.fmode.cn/dev/jxnu/202226701019/doctor5.png',
  165. name: '张伟',
  166. title: '主任医师',
  167. department: '眼科',
  168. hospital: '首都医科大学附属北京友谊..',
  169. hospitalLevel: '三甲',
  170. hospitalType: '百强医院',
  171. expertise: '擅长:结肠息肉和息肉病、胃息肉、幽门螺杆菌感染、慢性胃炎、胃食管反流、慢性萎缩性胃炎、糜烂性胃炎...',
  172. rating: 5.0,
  173. consultations: '1.1万',
  174. recommendations: 100,
  175. prices: {
  176. text: 100,
  177. voice: 150,
  178. video: 300
  179. },
  180. tags: ['百强医院', '可开处方', '从业24年', '擅长消化系统疾病', '可开处方'],
  181. isVerified: true,
  182. isExpert: true,
  183. },{
  184. avatar: 'https://app.fmode.cn/dev/jxnu/202226701019/doctor7.png',
  185. name: '张伟',
  186. title: '主任医师',
  187. department: '内科',
  188. hospital: '首都医科大学附属北京友谊..',
  189. hospitalLevel: '三甲',
  190. hospitalType: '百强医院',
  191. expertise: '擅长:结肠息肉和息肉病、胃息肉、幽门螺杆菌感染、慢性胃炎、胃食管反流、慢性萎缩性胃炎、糜烂性胃炎...',
  192. rating: 5.0,
  193. consultations: '1.1万',
  194. recommendations: 100,
  195. prices: {
  196. text: 100,
  197. voice: 150,
  198. video: 300
  199. },
  200. tags: ['百强医院', '可开处方', '从业24年', '擅长消化系统疾病', '可开处方'],
  201. isVerified: true,
  202. isExpert: true,
  203. }
  204. ];
  205. goToDoctorDetail(doctor: Doctor) {
  206. // this.router.navigate(['/doctor-detail'], { state: { doctor: doctor } });
  207. }
  208. segmentChanged(event: any) {
  209. this.selectedSegment = event.detail.value;
  210. console.log(this.selectedSegment);
  211. }
  212. openConsult(){
  213. console.log("openConsult");
  214. }
  215. }