|
@@ -1,89 +1,149 @@
|
|
import { CommonModule } from '@angular/common';
|
|
import { CommonModule } from '@angular/common';
|
|
-import { Component, OnInit } from '@angular/core';
|
|
|
|
-import { IonBackButton, IonButton, IonContent, IonHeader, IonItem, IonLabel, IonList, IonRefresher, IonRefresherContent, IonTitle, IonToolbar } from '@ionic/angular/standalone';
|
|
|
|
|
|
+import { Component, OnInit, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
|
|
+import {
|
|
|
|
+ IonBackButton,
|
|
|
|
+ IonButton,
|
|
|
|
+ IonButtons, // 导入 IonButtons
|
|
|
|
+ IonCard,
|
|
|
|
+ IonCardContent,
|
|
|
|
+ IonCardHeader,
|
|
|
|
+ IonCardTitle,
|
|
|
|
+ IonContent,
|
|
|
|
+ IonHeader,
|
|
|
|
+ IonIcon,
|
|
|
|
+ IonItem,
|
|
|
|
+ IonLabel,
|
|
|
|
+ IonList,
|
|
|
|
+ IonRefresher,
|
|
|
|
+ IonRefresherContent,
|
|
|
|
+ IonTitle,
|
|
|
|
+ IonToolbar,
|
|
|
|
+ AlertController
|
|
|
|
+} from '@ionic/angular/standalone';
|
|
import { CloudObject, CloudQuery, CloudUser } from 'src/lib/ncloud';
|
|
import { CloudObject, CloudQuery, CloudUser } from 'src/lib/ncloud';
|
|
|
|
|
|
@Component({
|
|
@Component({
|
|
selector: 'app-page-user-inquery',
|
|
selector: 'app-page-user-inquery',
|
|
templateUrl: './page-user-inquery.component.html',
|
|
templateUrl: './page-user-inquery.component.html',
|
|
styleUrls: ['./page-user-inquery.component.scss'],
|
|
styleUrls: ['./page-user-inquery.component.scss'],
|
|
|
|
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
standalone: true,
|
|
standalone: true,
|
|
imports: [
|
|
imports: [
|
|
- CommonModule,IonTitle,IonContent,IonToolbar,IonHeader,IonList,IonLabel,IonItem,IonButton,
|
|
|
|
- IonRefresher,IonRefresherContent,IonBackButton
|
|
|
|
|
|
+ CommonModule,
|
|
|
|
+ IonTitle,
|
|
|
|
+ IonContent,
|
|
|
|
+ IonToolbar,
|
|
|
|
+ IonHeader,
|
|
|
|
+ IonList,
|
|
|
|
+ IonLabel,
|
|
|
|
+ IonItem,
|
|
|
|
+ IonButton,
|
|
|
|
+ IonButtons, // 添加 IonButtons 到 imports
|
|
|
|
+ IonRefresher,
|
|
|
|
+ IonRefresherContent,
|
|
|
|
+ IonBackButton,
|
|
|
|
+ IonCard,
|
|
|
|
+ IonCardContent,
|
|
|
|
+ IonIcon
|
|
]
|
|
]
|
|
})
|
|
})
|
|
-export class PageUserInqueryComponent implements OnInit {
|
|
|
|
- handleRefresh(event:any) {
|
|
|
|
|
|
+export class PageUserInqueryComponent implements OnInit {
|
|
|
|
+ appointmentList: Array<CloudObject> = [];
|
|
|
|
+ currentUser: CloudUser;
|
|
|
|
+
|
|
|
|
+ constructor(private alertController: AlertController) {
|
|
|
|
+ this.currentUser = new CloudUser();
|
|
|
|
+ this.appointDisplay();
|
|
|
|
+ // this.load()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ngOnInit() {}
|
|
|
|
+
|
|
|
|
+ handleRefresh(event: any) {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
// Any calls to load data go here
|
|
// Any calls to load data go here
|
|
- this.appointDisplay()
|
|
|
|
|
|
+ this.appointDisplay();
|
|
event.target.complete();
|
|
event.target.complete();
|
|
}, 2000);
|
|
}, 2000);
|
|
}
|
|
}
|
|
- currentUser:CloudUser;
|
|
|
|
- constructor(
|
|
|
|
|
|
|
|
- ) {
|
|
|
|
- this.currentUser = new CloudUser();
|
|
|
|
- this.appointDisplay()
|
|
|
|
- // this.load()
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- ngOnInit() {
|
|
|
|
- }
|
|
|
|
- appointmentList: Array<CloudObject> = []
|
|
|
|
// 用来显示预约列表
|
|
// 用来显示预约列表
|
|
- async appointDisplay(){
|
|
|
|
- console.log('appointDisplay')
|
|
|
|
|
|
+ async appointDisplay() {
|
|
|
|
+ console.log('appointDisplay');
|
|
let query = new CloudQuery('appointment');
|
|
let query = new CloudQuery('appointment');
|
|
// query.include("user")
|
|
// query.include("user")
|
|
- query.equalTo('doctor', this.currentUser?.id)
|
|
|
|
- this.appointmentList = await query.find()
|
|
|
|
- console.log('我的appointmentList',this.appointmentList)
|
|
|
|
- console.log("this.currentUser",this.currentUser)
|
|
|
|
|
|
+ query.equalTo('doctor', this.currentUser?.id);
|
|
|
|
+ this.appointmentList = await query.find();
|
|
|
|
+ console.log('我的appointmentList', this.appointmentList);
|
|
|
|
+ console.log("this.currentUser", this.currentUser);
|
|
}
|
|
}
|
|
|
|
|
|
// 用来认证医生
|
|
// 用来认证医生
|
|
- async load(){
|
|
|
|
|
|
+ async load() {
|
|
let depart = new CloudQuery('Department');
|
|
let depart = new CloudQuery('Department');
|
|
- depart.equalTo("name", "妇产科")
|
|
|
|
- let object = await depart.find()
|
|
|
|
- console.log('object',object)
|
|
|
|
|
|
+ depart.equalTo("name", "妇产科");
|
|
|
|
+ let object = await depart.find();
|
|
|
|
+ console.log('object', object);
|
|
// this.currentUser = new CloudUser();
|
|
// this.currentUser = new CloudUser();
|
|
// console.log('currentUser',this.currentUser)
|
|
// console.log('currentUser',this.currentUser)
|
|
let doctor = new CloudObject('Doctor1');
|
|
let doctor = new CloudObject('Doctor1');
|
|
doctor.set({
|
|
doctor.set({
|
|
avatar: 'https://app.fmode.cn/dev/jxnu/202226701019/doctor7.png',
|
|
avatar: 'https://app.fmode.cn/dev/jxnu/202226701019/doctor7.png',
|
|
- name: '李四',
|
|
|
|
- title: '主任医师',
|
|
|
|
- depart: {
|
|
|
|
- __type:"Pointer",
|
|
|
|
- className:"Department",
|
|
|
|
- objectId:object[0].id
|
|
|
|
- },
|
|
|
|
- hospital: '首都医科大学附属北京友谊..',
|
|
|
|
- hospitalLevel: '三甲',
|
|
|
|
- hospitalType: '百强医院',
|
|
|
|
- expertise: '擅长:结肠息肉和息肉病、胃息肉、幽门螺杆菌感染、慢性胃炎、胃食管反流、慢性萎缩性胃炎、糜烂性胃炎...',
|
|
|
|
- rating: 5.0,
|
|
|
|
- consultations: '1.1万',
|
|
|
|
- recommendations: 100,
|
|
|
|
- prices: {
|
|
|
|
- text: 100,
|
|
|
|
- voice: 150,
|
|
|
|
- video: 300
|
|
|
|
- },
|
|
|
|
- tags: ['百强医院', '可开处方', '从业24年', '擅长消化系统疾病', '可开处方'],
|
|
|
|
- isVerified: true,
|
|
|
|
- isExpert: true,
|
|
|
|
- user: {
|
|
|
|
- __type:"Pointer",
|
|
|
|
- className:"User",
|
|
|
|
- objectId:"Gx3N24u5gl"
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- doctor.save()
|
|
|
|
- console.log('doctor',doctor)
|
|
|
|
|
|
+ name: '李四',
|
|
|
|
+ title: '主任医师',
|
|
|
|
+ depart: {
|
|
|
|
+ __type: "Pointer",
|
|
|
|
+ className: "Department",
|
|
|
|
+ objectId: object[0].id
|
|
|
|
+ },
|
|
|
|
+ hospital: '首都医科大学附属北京友谊..',
|
|
|
|
+ hospitalLevel: '三甲',
|
|
|
|
+ hospitalType: '百强医院',
|
|
|
|
+ expertise: '擅长:结肠息肉和息肉病、胃息肉、幽门螺杆菌感染、慢性胃炎、胃食管反流、慢性萎缩性胃炎、糜烂性胃炎...',
|
|
|
|
+ rating: 5.0,
|
|
|
|
+ consultations: '1.1万',
|
|
|
|
+ recommendations: 100,
|
|
|
|
+ prices: {
|
|
|
|
+ text: 100,
|
|
|
|
+ voice: 150,
|
|
|
|
+ video: 300
|
|
|
|
+ },
|
|
|
|
+ tags: ['百强医院', '可开处方', '从业24年', '擅长消化系统疾病', '可开处方'],
|
|
|
|
+ isVerified: true,
|
|
|
|
+ isExpert: true,
|
|
|
|
+ user: {
|
|
|
|
+ __type: "Pointer",
|
|
|
|
+ className: "User",
|
|
|
|
+ objectId: "Gx3N24u5gl"
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ doctor.save();
|
|
|
|
+ console.log('doctor', doctor);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 显示预约信息的弹出框
|
|
|
|
+ async presentAlert(username: string, userPhone: string) {
|
|
|
|
+ const alert = await this.alertController.create({
|
|
|
|
+ header: '预约确认',
|
|
|
|
+ message: `患者${username}已向您预约,请拨打 ${userPhone} 号码联系患者。`,
|
|
|
|
+ cssClass: 'custom-alert',
|
|
|
|
+ buttons: [
|
|
|
|
+ {
|
|
|
|
+ text: '取消',
|
|
|
|
+ role: 'cancel',
|
|
|
|
+ cssClass: 'secondary',
|
|
|
|
+ handler: () => {
|
|
|
|
+ console.log('取消点击');
|
|
|
|
+ }
|
|
|
|
+ }, {
|
|
|
|
+ text: '拨打电话',
|
|
|
|
+ handler: () => {
|
|
|
|
+ window.location.href = `tel:${userPhone}`;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ await alert.present();
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|