yf 4 tháng trước cách đây
mục cha
commit
4996ef645b

+ 138 - 123
wisdom-app/src/app/page/inquiry-human/inquiry-human.component.html

@@ -1,68 +1,71 @@
 <ion-header [translucent]="true">
   <ion-toolbar class="searchbar">
-    <ion-button color="light" slot="start">
-      <ion-back-button  defaultHref="/" ></ion-back-button>
-    </ion-button>
+    <ion-buttons slot="start">
+      <ion-back-button defaultHref="/" color="light"></ion-back-button>
+    </ion-buttons>
     <ion-title>找医生</ion-title>
   </ion-toolbar>
 </ion-header>
 
 <ion-content>
-  <ion-segment [(ngModel)]="selectedSegment" (ionChange)="segmentChanged($event)">
+  <ion-segment [(ngModel)]="selectedSegment" (ionChange)="segmentChanged($event)" class="segment-control">
     <ion-segment-button *ngFor="let segment of segments" [value]="segment">
       {{segment}}
     </ion-segment-button>
   </ion-segment>
-  <div >
-    <ion-card class="ioncard" *ngFor="let doctor of doctors" (click)="openDetailModal(doctor)">
-      <ion-item lines="none">
-        <ion-avatar slot="start">
-          <img [src]="doctor.get('avatar')" alt="医生头像">
-        </ion-avatar>
-        
-        <ion-label>
-          <div class="doctor-header">
-            <h2>{{doctor.get('name')}}</h2>
-            <span>{{doctor.get('title')}}</span>
-            <span>{{doctor.data["specialty"]}}</span>
-            <ion-badge color="primary">可开处方</ion-badge>
-          </div>
-          
-          <div class="hospital-info">
-            <span>{{doctor.get('hospital')}}</span>
-            <ion-badge color="success">{{doctor.get('hospitalLevel')}}</ion-badge>
-            <ion-badge color="warning">{{doctor.get('hospitalType')}}</ion-badge>
-          </div>
-        </ion-label>
-      </ion-item>
-    
-      <ion-item lines="none">
-        <ion-text color="medium" class="expertise">
-          {{doctor.get('expertise')}}
-        </ion-text>
-      </ion-item>
-    
-      <ion-item lines="none">
-        <div class="stats">
-          <div>
-            <ion-text color="warning">{{doctor.get('rating')}}</ion-text>
-            <ion-icon name="star" color="warning"></ion-icon>
-          </div>
-          <div>接诊量 {{doctor.get('consultations')}}</div>
-          <div>同行认可 {{doctor.get('recommendations')}}</div>
-        </div>
-      </ion-item>
-    
-      <ion-item lines="none">
-        <div class="consultation-types">
-          <ion-button fill="outline">图文 ¥{{doctor.data["prices"]?.text}}</ion-button>
-          <ion-button fill="outline">电话 ¥{{doctor.data["prices"]?.voice}}</ion-button>
-          <ion-button fill="outline">视频 ¥{{doctor.data["prices"]?.video}}</ion-button>
-          <ion-button color="success">年度好医生</ion-button>
-        </div>
-      </ion-item>
-    </ion-card>
-  </div>
+
+  <ion-grid>
+    <ion-row>
+      <ion-col size="12">
+        <ion-card class="doctor-card" *ngFor="let doctor of doctors" (click)="openDetailModal(doctor)">
+          <ion-item lines="none">
+            <ion-avatar slot="start">
+              <img [src]="doctor.get('avatar')" alt="医生头像">
+            </ion-avatar>
+            <ion-label>
+              <div class="doctor-header">
+                <h2>{{doctor.get('name')}}</h2>
+                <span class="title">{{doctor.get('title')}}</span>
+                <span class="specialty">{{doctor.data["specialty"]}}</span>
+                <ion-badge color="primary">可开处方</ion-badge>
+              </div>
+              <div class="hospital-info">
+                <span>{{doctor.get('hospital')}}</span>
+                <ion-badge color="success">{{doctor.get('hospitalLevel')}}</ion-badge>
+                <ion-badge color="warning">{{doctor.get('hospitalType')}}</ion-badge>
+              </div>
+            </ion-label>
+          </ion-item>
+
+          <ion-item lines="none">
+            <ion-text color="medium" class="expertise">
+              {{doctor.get('expertise')}}
+            </ion-text>
+          </ion-item>
+
+          <ion-item lines="none">
+            <div class="stats">
+              <div>
+                <ion-text color="warning">{{doctor.get('rating')}}</ion-text>
+                <ion-icon name="star" color="warning"></ion-icon>
+              </div>
+              <div>接诊量 {{doctor.get('consultations')}}</div>
+              <div>同行认可 {{doctor.get('recommendations')}}</div>
+            </div>
+          </ion-item>
+
+          <ion-item lines="none">
+            <div class="consultation-types">
+              <ion-button fill="outline">图文 ¥{{doctor.data["prices"]?.text}}</ion-button>
+              <ion-button fill="outline">电话 ¥{{doctor.data["prices"]?.voice}}</ion-button>
+              <ion-button fill="outline">视频 ¥{{doctor.data["prices"]?.video}}</ion-button>
+              <ion-button color="success">年度好医生</ion-button>
+            </div>
+          </ion-item>
+        </ion-card>
+      </ion-col>
+    </ion-row>
+  </ion-grid>
 
   <!-- 医生详情模态框 -->
   <ion-modal [isOpen]="isModalOpen" cssClass="bottom-modal">
@@ -79,72 +82,74 @@
       </ion-header>
 
       <ion-content class="ion-padding">
-        <div>
-          <ion-card class="first">
-            <div class="doctor-header1" style="display: flex; background-color: rgb(213, 205, 144); border-radius: 5px;">
-              <div class="verification-badge" *ngIf="doctor1.get('isVerified')">
-                <ion-icon name="checkmark-circle"></ion-icon>
-                已通过实名认证
+        <ion-card class="doctor-detail-card">
+          <div class="doctor-header1">
+            <div class="verification-badge" *ngIf="doctor1.get('isVerified')">
+              <ion-icon name="checkmark-circle"></ion-icon>
+              已通过实名认证
+            </div>
+            <div class="qualification-badge">
+              执业资质已审核通过
+            </div>
+          </div>
+
+          <div class="doctor-info1">
+            <div class="left-section">
+              <div class="name-title">
+                <h2>{{doctor1.get('name')}}</h2>
+                <ion-badge *ngIf="doctor1.get('isExpert')" color="warning">知名专家</ion-badge>
+              </div>
+
+              <div class="position">
+                <span>{{doctor1.get('specialty')}}</span>
+                <span>{{doctor1.get('title')}}</span>
               </div>
-              <div class="qualification-badge">
-                执业资质已审核通过
+
+              <div class="hospital">
+                <span>{{doctor1.get('hospital')}}</span>
+                <ion-badge color="success">{{doctor1.get('hospitalLevel')}}</ion-badge>
               </div>
-            </div>
-          
-            <div class="doctor-info1">
-              <div class="left-section">
-                <div class="name-title">
-                  <h2>{{doctor1.get('name')}}</h2>
-                  <ion-badge *ngIf="doctor1.get('isExpert')" color="warning">知名专家</ion-badge>
+
+              <div class="stats">
+                <div class="rating">
+                  <span class="number">{{doctor1.get('rating')}}</span>
+                  <ion-icon name="star" color="warning"></ion-icon>
                 </div>
-                
-                <div class="position">
-                  <span>{{doctor1.get('specialty')}}</span>
-                  <span>{{doctor1.get('title')}}</span>
+                <div class="consult">
+                  <span>接诊量 {{doctor1.get('recommendation')}}</span>
                 </div>
-                
-                <div class="hospital">
-                  <span>{{doctor1.get('hospital')}}</span>
-                  <ion-badge color="success">{{doctor1.get('hospitalLevel')}}</ion-badge>
+                <div class="service">
+                  <span>服务态度好</span>
                 </div>
-          
-                <div class="stats">
-                  <div class="rating">
-                    <span class="number">{{doctor1.get('rating')}}</span>
-                    <ion-icon name="star" color="warning"></ion-icon>
-                  </div>
-                  <div class="consult">
-                    <span>接诊量 {{doctor1.get('recommendation')}}</span>
-                  </div>
-                  <div class="service">
-                    <span>服务态度好</span>
-                  </div>
-                </div>
-              </div>
-          
-              <div class="right-section">
-                <ion-avatar>
-                  <img [src]="doctor1.get('avatar')" alt="医生头像">
-                </ion-avatar>
-                <ion-button style="color: rgb(0, 255, 0);" fill="outline" size="small">
-                  + 关注
-                </ion-button>
               </div>
             </div>
-            <div>
-              <div class="tags">
-                <ion-chip style="color: blue; border-radius: 10px; background-color: rgba(230, 230, 243, 0.671);" *ngFor="let tag of doctor1.data['tags']" outline>
-                  {{tag}}
-                </ion-chip>
-              </div>
+
+            <div class="right-section">
+              <ion-avatar>
+                <img [src]="doctor1.get('avatar')" alt="医生头像">
+              </ion-avatar>
+              <ion-button fill="outline" size="small" color="success">
+                + 关注
+              </ion-button>
             </div>
-          </ion-card>
-        </div>
-        <div class="aa" style="display: flex;">
-          <p class="aaa">保证医生真实</p>
-          <p class="aaa">未使用随时退</p>
-          <p class="aaa">不满意可申诉</p>
+          </div>
+
+          <div class="tags">
+            <ion-chip *ngFor="let tag of doctor1.data['tags']" outline>
+              {{tag}}
+            </ion-chip>
+          </div>
+        </ion-card>
+
+        <div class="info-section">
+          <div class="info-header">
+            <h1>擅长与简介</h1>
+          </div>
+          <div class="info-content">
+            <p>{{doctor1?.get('expertise')}}</p>
+          </div>
         </div>
+
         <div class="consult-options">
           <div class="option-grid">
             <div class="option-item" 
@@ -175,29 +180,39 @@
             </div>
           </div>
         </div>
-        <div class="info" style="margin:0 20px;box-shadow: 1px 1px 1px 0px rgba(0, 0, 0, 0.163), -1px -1px 1px 0px rgba(0, 0, 0, 0.148);">
-          <div style="margin: 5px 10px;">
-            <h1>擅长与简介</h1>
+
+        <div class="info">
+          <div class="info-header">
+            <h1>保证服务</h1>
           </div>
-          <div style="margin: 5px 10px;">
-            <p style="color: grey;">{{doctor1?.get('expertise')}}</p>
+          <div class="info-content guarantee">
+            <p>保证医生真实</p>
+            <p>未使用随时退</p>
+            <p>不满意可申诉</p>
           </div>
         </div>
-        <div>
-          <ion-buttons>
-            <ion-button color="primary" expand="block" (click)="appoint()">立即预约</ion-button>
-          </ion-buttons>
-        </div>
+
+        <ion-buttons>
+          <ion-button color="primary" expand="block" (click)="appoint()">立即预约</ion-button>
+        </ion-buttons>
       </ion-content>
       <ion-footer>
-        <ion-button style="border-radius: 10px;" expand="block" color="success" (click)="openConsult()">立即咨询(¥120/次)</ion-button>
+        <ion-button class="consult-button" expand="block" color="success" (click)="openConsult()">立即咨询(点击付款)</ion-button>
       </ion-footer>
     </ng-template>
   </ion-modal>
 
-  <!-- 新增收款码模态框 -->
+  <!-- 收款码模态框 -->
   <ion-modal [isOpen]="isPaymentModalOpen" cssClass="payment-modal" (ionBackdropTap)="closePaymentModal()">
     <ng-template>
+      <ion-header>
+        <ion-toolbar>
+          <ion-title>支付方式</ion-title>
+          <ion-buttons slot="end">
+            <ion-button (click)="closePaymentModal()">关闭</ion-button>
+          </ion-buttons>
+        </ion-toolbar>
+      </ion-header>
       <ion-content class="ion-padding payment-content">
         <div class="payment-codes">
           <img src="../../../assets/image/paya.png" alt="收款码A" class="payment-image">

+ 140 - 54
wisdom-app/src/app/page/inquiry-human/inquiry-human.component.scss

@@ -1,6 +1,6 @@
 ion-header {
-  background-color: #5c97ff;
-  color: white;
+  --background: #5c97ff;
+  --color: white;
 }
 
 ion-title {
@@ -8,22 +8,37 @@ ion-title {
   font-weight: bold;
   text-align: center;
 }
-.ioncard {
+
+.segment-control {
   margin: 16px;
-  box-shadow: none;
-  border: 1px solid #eee;
+}
+
+.doctor-card {
+  margin: 8px 0;
+  border-radius: 12px;
+  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
+  transition: transform 0.2s;
+}
+
+.doctor-card:hover {
+  transform: translateY(-5px);
 }
 
 .doctor-header {
   display: flex;
   align-items: center;
   gap: 8px;
-  
+
   h2 {
     margin: 0;
     font-size: 18px;
     font-weight: bold;
   }
+
+  .title, .specialty {
+    font-size: 14px;
+    color: #555;
+  }
 }
 
 .hospital-info {
@@ -39,13 +54,14 @@ ion-title {
   display: -webkit-box;
   -webkit-box-orient: vertical;
   overflow: hidden;
+  -webkit-line-clamp: 2;
 }
 
 .stats {
   display: flex;
   gap: 16px;
   font-size: 14px;
-  
+
   div {
     display: flex;
     align-items: center;
@@ -57,20 +73,20 @@ ion-title {
   display: flex;
   gap: 8px;
   overflow-x: auto;
-  
+  padding: 8px 0;
+
   ion-button {
     --padding-start: 16px;
     --padding-end: 16px;
     height: 32px;
     font-size: 14px;
+    white-space: nowrap;
   }
 }
 
-.first {
-  margin: 5px 16px;
-  padding: 12px;
-  box-shadow: none;
-  border: 1px solid #eee;
+.doctor-detail-card {
+  border-radius: 12px;
+  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
 }
 
 .doctor-header1 {
@@ -84,20 +100,28 @@ ion-title {
     display: flex;
     align-items: center;
     gap: 4px;
-    
+
     ion-icon {
       color: #52c41a;
     }
   }
+
+  .qualification-badge {
+    display: flex;
+    align-items: center;
+    gap: 4px;
+    color: #52c41a;
+  }
 }
 
 .doctor-info1 {
   display: flex;
   justify-content: space-between;
-  
+  margin-bottom: 16px;
+
   .left-section {
     flex: 1;
-    
+
     .name-title {
       display: flex;
       align-items: center;
@@ -136,7 +160,7 @@ ion-title {
         display: flex;
         align-items: center;
         gap: 4px;
-        
+
         .number {
           color: #f90;
           font-weight: 500;
@@ -145,16 +169,16 @@ ion-title {
     }
 
     .tags {
-      color: blue;
       display: flex;
       flex-wrap: wrap;
       gap: 8px;
-      
+      margin-top: 8px;
+
       ion-chip {
-        margin: 0;
         height: 24px;
-        --background: rgb(0, 255, 0);
-        --color: #666;
+        --background: rgba(230, 230, 243, 0.7);
+        --color: #333;
+        border-radius: 10px;
       }
     }
   }
@@ -164,7 +188,6 @@ ion-title {
     flex-direction: column;
     align-items: center;
     gap: 8px;
-    margin-left: 16px;
 
     ion-avatar {
       width: 64px;
@@ -179,27 +202,51 @@ ion-title {
   }
 }
 
-.aa{
-  margin: 2px auto;
-  padding: 0;
+.info-section {
+  margin: 16px 0;
+  padding: 12px;
+  background: #f9f9f9;
+  border-radius: 12px;
+  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
 }
-.aaa{
-  font-size: 12px;
+
+.info-header {
+  margin-bottom: 8px;
+}
+
+.info-header h1 {
+  font-size: 18px;
+  color: #333;
+}
+
+.info-content p {
+  color: #555;
+  line-height: 1.6;
+}
+
+.guarantee {
+  display: flex;
+  justify-content: space-around;
+  margin-top: 12px;
+  font-size: 14px;
   color: gray;
-  margin-top: 0px;
-  margin-right: 15px;
-  margin-left: 35px;
+
+  p {
+    margin: 0;
+  }
 }
 
 .consult-options {
   padding: 16px;
   background: #fff;
   margin: 0 10px;
+  border-radius: 12px;
+  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
 }
 
 .option-grid {
   display: grid;
-  grid-template-columns: repeat(5, 1fr);
+  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
   gap: 12px;
 }
 
@@ -210,15 +257,14 @@ ion-title {
   padding: 12px;
   cursor: pointer;
   transition: all 0.3s;
+  text-align: center;
 
   &.selected {
     border-color: var(--ion-color-primary);
     background-color: var(--ion-color-primary-tint);
 
-    .icon-wrapper {
-      ion-icon {
-        color: var(--ion-color-primary);
-      }
+    .icon-wrapper ion-icon {
+      color: var(--ion-color-primary);
     }
 
     .title1 {
@@ -244,7 +290,6 @@ ion-title {
   display: flex;
   flex-direction: column;
   align-items: center;
-  text-align: center;
 }
 
 .icon-wrapper {
@@ -283,31 +328,72 @@ ion-title {
   color: #999;
 }
 
-/* 新增收款码模态框样式 */
+.consult-button {
+  border-radius: 10px;
+}
+
+/* 收款码模态框的样式 */
 .payment-modal {
-  --width: 80%;
-  --max-width: 400px;
-  --height: auto;
-  --border-radius: 12px;
+  --width: 90%;             /* 增加模态框宽度到90% */
+  --max-width: 800px;       /* 增加模态框最大宽度到800px */
+  --border-radius: 12px;    /* 模态框圆角 */
 }
 
+/* 收款码内容区域的布局 */
 .payment-content {
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  flex-direction: column;
+  display: flex;             /* 使用Flex布局 */
+  justify-content: center;   /* 水平居中 */
+  align-items: center;       /* 垂直居中 */
+  flex-direction: column;    /* 垂直排列 */
 }
 
+/* 收款码容器的样式 */
 .payment-codes {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  gap: 16px;
+  display: flex;             /* 使用Flex布局 */
+  flex-direction: row;       /* 水平排列,确保收款码并排 */
+  align-items: center;       /* 居中对齐 */
+  justify-content: center;   /* 水平居中对齐容器内的收款码 */
+  gap: 32px;                 /* 两个收款码之间的间距 */
+  width: 100%;               /* 设置容器宽度为100%,确保收款码在模态框中居中 */
 }
 
+/* 收款码图片的样式 */
 .payment-image {
-  width: 200px; // 根据实际需要调整尺寸
-  height: auto;
-  border: 1px solid #ddd;
-  border-radius: 8px;
+  width: 250px;              /* 增加图片宽度到250px */
+  height: auto;              /* 高度自适应,保持图片比例 */
+  border: 1px solid #ddd;    /* 边框 */
+  border-radius: 8px;        /* 圆角 */
+}
+
+/* 响应式设计:屏幕宽度小于等于768px时的样式调整 */
+@media (max-width: 768px) {
+  /* 医生信息部分改为垂直排列 */
+  .doctor-info1 {
+    flex-direction: column;
+    align-items: flex-start;
+  }
+
+  /* 右侧操作部分改为水平排列 */
+  .right-section {
+    flex-direction: row;
+    align-items: center;
+  }
+
+  /* 保证服务部分改为垂直排列 */
+  .guarantee {
+    flex-direction: column;
+    align-items: flex-start;
+  }
+
+  /* 收款码容器在小屏幕上改为垂直排列 */
+  .payment-codes {
+    flex-direction: column;  /* 垂直排列 */
+    gap: 16px;               /* 减小间距 */
+  }
+
+  /* 收款码图片在小屏幕上调整宽度 */
+  .payment-image {
+    width: 80%;               /* 调整图片宽度以适应小屏幕 */
+    max-width: none;         /* 移除最大宽度限制 */
+  }
 }

+ 41 - 28
wisdom-app/src/app/page/inquiry-human/inquiry-human.component.ts

@@ -7,7 +7,7 @@ import { CommonModule } from '@angular/common';
 import { FormsModule } from '@angular/forms';
 import { CloudObject, CloudQuery, CloudUser } from 'src/lib/ncloud';
 
-addIcons({ airplane, bluetooth, call, wifi });
+addIcons({ airplane, bluetooth, call, wifi, star, checkmarkCircle });
 
 interface Doctor {
   avatar: string;
@@ -50,7 +50,7 @@ interface ConsultOption {
     IonHeader, IonToolbar, IonTitle, IonContent, CommonModule,
     IonLabel, IonItem, IonList, IonAvatar, IonButton, IonChip, IonIcon, IonBadge,
     IonText, IonCard, IonSegment, IonSegmentButton, FormsModule, IonCol, IonRow, IonGrid,
-    IonModal, IonButtons, IonFooter,IonBackButton
+    IonModal, IonButtons, IonFooter, IonBackButton
   ]
 })
 export class InquiryHumanComponent implements OnInit {
@@ -96,7 +96,7 @@ export class InquiryHumanComponent implements OnInit {
       unit: '',
       isAvailable: false
     }
-];
+  ];
 
   selectOption(option: ConsultOption) {
     if (!option.isAvailable) return;
@@ -107,22 +107,23 @@ export class InquiryHumanComponent implements OnInit {
   isModalOpen = false;
   isPaymentModalOpen = false; // 新增状态变量
 
-  currentUser: CloudUser 
+  currentUser: CloudUser;
+
   constructor(
     private alertController: AlertController,
     private router: Router,
     private toastController: ToastController // 注入 ToastController
   ) {
-      addIcons({star,checkmarkCircle});
-      this.currentUser = new CloudUser();
-      this.loadDoctors();
-     }
+    this.currentUser = new CloudUser();
+    this.loadDoctors();
+  }
 
   ngOnInit() { }
 
   // 顶部导航栏
   selectedSegment = '全部';
   segments = ['全部', '妇产科', '儿科', '皮肤性病科', '内科'];
+
   // 选择科室
   async segmentChanged(event: any) {
     this.selectedSegment = event.detail.value;
@@ -133,29 +134,31 @@ export class InquiryHumanComponent implements OnInit {
   // 医生列表
   doctors: Array<CloudObject> = [];
   async loadDoctors() {
-    let query = new CloudQuery('Doctor1')
-    // query.include("depart")
-    // query.include("user")
+    let query = new CloudQuery('Doctor1');
     if (this.selectedSegment != '全部'){
-      query.equalTo('specialty', this.selectedSegment)
+      query.equalTo('specialty', this.selectedSegment);
     }
-    this.doctors = await query.find()
-    console.log(this.doctors)
+    this.doctors = await query.find();
+    console.log(this.doctors);
   }
+
   doctor1: any;
+
   // 打开医生详情模态框
   openDetailModal(doctor: any) {
     this.isModalOpen = true; // 打开模态框
     this.doctor1 = doctor; // 传递医生信息
   }
+
   closeDetailModal() {
     this.isModalOpen = false; // 关闭模态框
     this.doctor1 = null; // 清空医生信息
   }
 
   selectedOption: ConsultOption | undefined;
+
   async openConsult(){
-   this.selectedOption = this.options.find(option => option.isSelected);
+    this.selectedOption = this.options.find(option => option.isSelected);
     if (!this.selectedOption) {
       // 显示 Toast 提示用户选择咨询方式
       const toast = await this.toastController.create({
@@ -177,10 +180,12 @@ export class InquiryHumanComponent implements OnInit {
   closePaymentModal() {
     this.isPaymentModalOpen = false;
   }
-  num:number = 1
+
+  num: number = 1;
+
   // 立即预约 Appointment Doctor User 
   async appoint(){
-    console.log("this.doctor1",this.doctor1)
+    console.log("this.doctor1",this.doctor1);
     let alert = await this.alertController.create({
       header: '温馨提示',
       subHeader: 'Tips',
@@ -193,13 +198,23 @@ export class InquiryHumanComponent implements OnInit {
       message: '已预约,不要重复预约',
       buttons: ['好的'],
     });
+    let alert2 = await this.alertController.create({
+      header: '温馨提示',
+      subHeader: 'Tips',
+      message: '您的个人信息不完整,请先完善个人信息(电话,姓名)',
+      buttons: ['好的'],
+    });
     if(this.num == 0){
-      await alert1.present()
-      return
+      await alert1.present();
+      return;
+    }
+    if(!this.currentUser?.data["phone"] || !this.currentUser?.data["realname"]){
+      await alert2.present();
+      return;
     }
     if(this.num == 1){
-      console.log("立即预约我的医生")
-      let appointment = new CloudObject('appointment')
+      console.log("立即预约我的医生");
+      let appointment = new CloudObject('appointment');
       appointment.set({
         doctor: {
           __type:"Pointer",
@@ -215,13 +230,11 @@ export class InquiryHumanComponent implements OnInit {
         type: this.selectedOption?.title, // 咨询类型
         userPhone: this.currentUser?.data["phone"], // 获取当前用户的手机号
         username : this.currentUser?.data["realname"], // 获取当前用户的姓名
-      }
-      )
-      appointment.save()
-      this.num = 0
-      console.log(appointment)
-      await alert.present()
+      });
+      appointment.save();
+      this.num = 0;
+      console.log(appointment);
+      await alert.present();
     }
-    
   }
 }