|
@@ -1,5 +1,5 @@
|
|
import { Component } from '@angular/core';
|
|
import { Component } from '@angular/core';
|
|
-import { IonCardHeader, IonHeader, IonToolbar, IonTitle, IonContent, IonTabButton, IonSearchbar, IonLabel, IonItem, IonList, NavController, IonCard, IonCardTitle, IonCardSubtitle, IonCardContent, IonThumbnail } from '@ionic/angular/standalone';
|
|
|
|
|
|
+import { IonCardHeader, IonHeader, IonToolbar, IonTitle, IonContent, IonTabButton, IonSearchbar, IonLabel, IonItem, IonList, NavController, IonCard, IonCardTitle, IonCardSubtitle, IonCardContent, IonThumbnail, IonRippleEffect, IonFab, IonFabList, IonFabButton, IonBadge } from '@ionic/angular/standalone';
|
|
import { ExploreContainerComponent } from '../explore-container/explore-container.component';
|
|
import { ExploreContainerComponent } from '../explore-container/explore-container.component';
|
|
import { IonButton } from '@ionic/angular/standalone';
|
|
import { IonButton } from '@ionic/angular/standalone';
|
|
import { IonIcon } from '@ionic/angular/standalone';
|
|
import { IonIcon } from '@ionic/angular/standalone';
|
|
@@ -9,14 +9,35 @@ import { ModalController } from '@ionic/angular/standalone';
|
|
import { HttpClient } from '@angular/common/http';
|
|
import { HttpClient } from '@angular/common/http';
|
|
import { addIcons } from 'ionicons';
|
|
import { addIcons } from 'ionicons';
|
|
import { documentText, chatbubbles, person, calendar, newspaper,
|
|
import { documentText, chatbubbles, person, calendar, newspaper,
|
|
- medkit,clipboard, podium, videocam, people } from 'ionicons/icons';
|
|
|
|
|
|
+ medkit,clipboard, podium, videocam, people, chevronForwardOutline,
|
|
|
|
+ add} from 'ionicons/icons';
|
|
import { CloudObject, CloudQuery, CloudUser } from 'src/lib/ncloud';
|
|
import { CloudObject, CloudQuery, CloudUser } from 'src/lib/ncloud';
|
|
import { ChatPanelOptions, FmodeChat, FmodeChatMessage, openChatPanelModal } from 'fmode-ng';
|
|
import { ChatPanelOptions, FmodeChat, FmodeChatMessage, openChatPanelModal } from 'fmode-ng';
|
|
-import { openUserLoginModal } from 'src/lib/user/modal-user-login/modal-user-login.component';
|
|
|
|
-import { ArticleCardComponent } from '../component/article-card/article-card.component';
|
|
|
|
addIcons({ documentText, chatbubbles, person, calendar, newspaper,
|
|
addIcons({ documentText, chatbubbles, person, calendar, newspaper,
|
|
- medkit,clipboard, podium, videocam, people
|
|
|
|
|
|
+ medkit,clipboard, podium, videocam, people,add
|
|
});
|
|
});
|
|
|
|
+ import { FmodeMapModule } from 'fmode-ng';
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+interface ClinicAd {
|
|
|
|
+ id: number;
|
|
|
|
+ title: string;
|
|
|
|
+ price?: string;
|
|
|
|
+ description: string;
|
|
|
|
+ image: string;
|
|
|
|
+ backgroundColor: string;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+interface ServiceItem {
|
|
|
|
+ id: number;
|
|
|
|
+ title: string;
|
|
|
|
+ description: string;
|
|
|
|
+ image: string;
|
|
|
|
+ hasDetail?: boolean;
|
|
|
|
+ isHot?: boolean;
|
|
|
|
+ backgroundColor?: string;
|
|
|
|
+ size?: 'large' | 'small';
|
|
|
|
+}
|
|
@Component({
|
|
@Component({
|
|
selector: 'app-tab1',
|
|
selector: 'app-tab1',
|
|
templateUrl: 'tab1.page.html',
|
|
templateUrl: 'tab1.page.html',
|
|
@@ -25,17 +46,104 @@ addIcons({ documentText, chatbubbles, person, calendar, newspaper,
|
|
imports: [
|
|
imports: [
|
|
IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent, IonTabButton, IonButton,
|
|
IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent, IonTabButton, IonButton,
|
|
IonIcon,IonSearchbar,IonLabel,IonItem,IonList,CommonModule,IonCard,IonCardHeader,IonCardTitle,IonCardSubtitle,
|
|
IonIcon,IonSearchbar,IonLabel,IonItem,IonList,CommonModule,IonCard,IonCardHeader,IonCardTitle,IonCardSubtitle,
|
|
- IonCardContent, IonThumbnail,
|
|
|
|
|
|
+ IonCardContent, IonThumbnail, IonRippleEffect, IonFab, IonFabButton, IonFabList,IonBadge
|
|
],
|
|
],
|
|
})
|
|
})
|
|
export class Tab1Page {
|
|
export class Tab1Page {
|
|
-
|
|
|
|
|
|
+ title1 = "特色服务";
|
|
|
|
+ subtitle1 = "一站式医疗健康解决方案";
|
|
|
|
+
|
|
|
|
+ services: ServiceItem[] = [
|
|
|
|
+ {
|
|
|
|
+ id: 1,
|
|
|
|
+ title: "援脑妇科病",
|
|
|
|
+ description: "小症状隐藏大隐患",
|
|
|
|
+ image: "../../assets/image/doctor7.png",
|
|
|
|
+ hasDetail: true,
|
|
|
|
+ backgroundColor: "#E8F5F2",
|
|
|
|
+ size: 'large'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 2,
|
|
|
|
+ title: "解决口腔难题",
|
|
|
|
+ description: "享健康生活",
|
|
|
|
+ image: "../../assets/image/doctor7.png",
|
|
|
|
+ hasDetail: true,
|
|
|
|
+ isHot: true,
|
|
|
|
+ backgroundColor: "#E8F5F2",
|
|
|
|
+ size: 'large'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 3,
|
|
|
|
+ title: "解决皮肤难题",
|
|
|
|
+ description: "专业医生来助力",
|
|
|
|
+ image: "../../assets/image/doctor7.png",
|
|
|
|
+ size: 'small'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 4,
|
|
|
|
+ title: "儿科常见疾病",
|
|
|
|
+ description: "在家就能请专家",
|
|
|
|
+ image: "../../assets/image/doctor7.png",
|
|
|
|
+ size: 'small'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 5,
|
|
|
|
+ title: "赶走烦恼困扰",
|
|
|
|
+ description: "科学治疗好经不费",
|
|
|
|
+ image: "../../assets/image/doctor7.png",
|
|
|
|
+ size: 'small'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 6,
|
|
|
|
+ title: "知己心理",
|
|
|
|
+ description: "温暖地陪你懂自己",
|
|
|
|
+ image: "../../assets/image/doctor7.png",
|
|
|
|
+ size: 'small'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 7,
|
|
|
|
+ title: "搞定偏头痛",
|
|
|
|
+ description: "止疼彻底合集",
|
|
|
|
+ image: "../../assets/image/doctor7.png",
|
|
|
|
+ size: 'small'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 8,
|
|
|
|
+ title: "搞定偏头痛",
|
|
|
|
+ description: "止疼彻底合集",
|
|
|
|
+ image: "../../assets/image/doctor7.png",
|
|
|
|
+ size: 'small'
|
|
|
|
+ }
|
|
|
|
+ ];
|
|
|
|
+ title = "专科门诊";
|
|
|
|
+ subtitle = "智养高复诊率、高口碑名医";
|
|
|
|
+
|
|
|
|
+ clinicAds: ClinicAd[] = [
|
|
|
|
+ {
|
|
|
|
+ id: 1,
|
|
|
|
+ title: "专业男科",
|
|
|
|
+ price: "18元起",
|
|
|
|
+ description: "阳痿早泄",
|
|
|
|
+ image: "../../assets/image/doctor7.png",
|
|
|
|
+ backgroundColor: "#EEF4FF"
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 2,
|
|
|
|
+ title: "智养中医馆",
|
|
|
|
+ price: "18元起",
|
|
|
|
+ description: "口碑中医",
|
|
|
|
+ image: "../../assets/image/doctor6.png",
|
|
|
|
+ backgroundColor: "#FFF5EB"
|
|
|
|
+ }
|
|
|
|
+ ];
|
|
constructor(
|
|
constructor(
|
|
private router: Router,
|
|
private router: Router,
|
|
private modalCtrl: ModalController,
|
|
private modalCtrl: ModalController,
|
|
// private navCtrl: NavController,
|
|
// private navCtrl: NavController,
|
|
private http: HttpClient // 注入 HttpClient
|
|
private http: HttpClient // 注入 HttpClient
|
|
- ) {}
|
|
|
|
|
|
+ ) {
|
|
|
|
+ addIcons({chevronForwardOutline});}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 轮播图
|
|
* 轮播图
|
|
@@ -43,7 +151,10 @@ export class Tab1Page {
|
|
images = [
|
|
images = [
|
|
'https://picsum.photos/800/400?random=1',
|
|
'https://picsum.photos/800/400?random=1',
|
|
'https://picsum.photos/800/400?random=2',
|
|
'https://picsum.photos/800/400?random=2',
|
|
- 'https://picsum.photos/800/400?random=3'
|
|
|
|
|
|
+ 'https://picsum.photos/800/400?random=3',
|
|
|
|
+ 'https://picsum.photos/800/400?random=4',
|
|
|
|
+ 'https://picsum.photos/800/400?random=5',
|
|
|
|
+ 'https://picsum.photos/800/400?random=6',
|
|
];
|
|
];
|
|
currentSlide = 0;
|
|
currentSlide = 0;
|
|
intervalId: any;
|
|
intervalId: any;
|
|
@@ -78,6 +189,11 @@ export class Tab1Page {
|
|
*/
|
|
*/
|
|
goToPage1(){
|
|
goToPage1(){
|
|
console.log(['route'])
|
|
console.log(['route'])
|
|
|
|
+ let user = new CloudUser;
|
|
|
|
+ if (!user.id){
|
|
|
|
+ this.router.navigate(['/tabs/tab4'])
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.router.navigate(['/tabs/inquiry/ai'])
|
|
this.router.navigate(['/tabs/inquiry/ai'])
|
|
}
|
|
}
|
|
|
|
|
|
@@ -85,6 +201,11 @@ export class Tab1Page {
|
|
* Go to the human page
|
|
* Go to the human page
|
|
*/
|
|
*/
|
|
goToPage2(){
|
|
goToPage2(){
|
|
|
|
+ let user = new CloudUser;
|
|
|
|
+ if (!user.id){
|
|
|
|
+ this.router.navigate(['/tabs/tab4'])
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.router.navigate(['/tabs/inquiry/human'])
|
|
this.router.navigate(['/tabs/inquiry/human'])
|
|
}
|
|
}
|
|
|
|
|
|
@@ -111,51 +232,19 @@ export class Tab1Page {
|
|
|
|
|
|
// 功能按钮数据
|
|
// 功能按钮数据
|
|
functionItems1 = [
|
|
functionItems1 = [
|
|
- { label: '我的健康', icon: 'document-text', route: '/tabs/my-health' },
|
|
|
|
- { label: '健康档案', icon: 'person', route: '/tabs/health-records' },
|
|
|
|
- { label: '电话问诊', icon: 'calendar', route: '/tabs/phone-inquiry' },
|
|
|
|
- { label: '购买药品', icon: 'medkit', route: '/tabs/drug-purchase' },
|
|
|
|
- ];
|
|
|
|
-
|
|
|
|
- functionItems2 = [
|
|
|
|
- { label: '专业男科', icon: 'clipboard', route: '/tabs/tab1' },
|
|
|
|
- { label: '权威专家', icon: 'podium', route: '/tabs/authority-experts' },
|
|
|
|
- { label: '健康资讯', icon: 'newspaper', route: '/tabs/health-information' },
|
|
|
|
- { label: '智慧社区', icon: 'people', route: '/tabs/smart-community' }
|
|
|
|
- ];
|
|
|
|
-
|
|
|
|
- doctors = [
|
|
|
|
- {
|
|
|
|
- name: '余海涛',
|
|
|
|
- age: 20,
|
|
|
|
- position: '主任医师',
|
|
|
|
- department: '中医草药科',
|
|
|
|
- hospital: '南昌市江西师范医院',
|
|
|
|
- desc:'中医大师,擅长用中药调养身体来根治病症',
|
|
|
|
- image: '../../assets/image/doctor5.png',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: '聂翼伏',
|
|
|
|
- age: 25,
|
|
|
|
- position: '副主任医师',
|
|
|
|
- department: '骨科',
|
|
|
|
- hospital: 'YY市人民医院',
|
|
|
|
- desc:'骨科专家,擅长治疗各种骨骼损伤症状',
|
|
|
|
- image: '../../assets/image/doctor7.png',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: '徐君豪',
|
|
|
|
- age: 28,
|
|
|
|
- position: '主治医师',
|
|
|
|
- department: '心理科',
|
|
|
|
- hospital: 'XX市第一医院',
|
|
|
|
- desc:'心理专家,擅长解决各类心理问题和疾病',
|
|
|
|
- image: '../../assets/image/doctor6.png',
|
|
|
|
- },
|
|
|
|
|
|
+ { label: '专属医生', icon: 'document-text', route: '/tabs/create-agent' },
|
|
|
|
+ { label: '我的健康', icon: 'person', route: '/tabs/my-health' },
|
|
|
|
+ { label: '药品展示', icon: 'calendar', route: '/tabs/tab3' },
|
|
|
|
+ { label: '健康科普', icon: 'medkit', route: '/tabs/tab2' },
|
|
];
|
|
];
|
|
|
|
|
|
// 导航到指定路由
|
|
// 导航到指定路由
|
|
navigateTo(route: string) {
|
|
navigateTo(route: string) {
|
|
|
|
+ let user = new CloudUser;
|
|
|
|
+ if (!user.id){
|
|
|
|
+ this.router.navigate(['/tabs/tab4'])
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.router.navigate([route]);
|
|
this.router.navigate([route]);
|
|
console.log("route: ",route)
|
|
console.log("route: ",route)
|
|
}
|
|
}
|
|
@@ -169,10 +258,17 @@ export class Tab1Page {
|
|
async loadDoctorList(){
|
|
async loadDoctorList(){
|
|
let query = new CloudQuery("Doctor");
|
|
let query = new CloudQuery("Doctor");
|
|
query.include("depart")
|
|
query.include("depart")
|
|
- this.doctorList = await query.find()
|
|
|
|
|
|
+ let List = await query.find()
|
|
|
|
+ for(let i = 0; i < 3; i++) {
|
|
|
|
+ this.doctorList.push(List[i])
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ goToViewAll(){
|
|
|
|
+ console.log(['route'])
|
|
|
|
+ this.router.navigate(['/tabs/inquiry/ai'])
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ currentUser:CloudUser|undefined
|
|
/** 示例:问诊根据doctor拼接提示词 */
|
|
/** 示例:问诊根据doctor拼接提示词 */
|
|
async openInquiry(doctor:any){
|
|
async openInquiry(doctor:any){
|
|
// 验证用户登录
|
|
// 验证用户登录
|
|
@@ -180,13 +276,15 @@ export class Tab1Page {
|
|
let userPrompt = ``
|
|
let userPrompt = ``
|
|
if(!currentUser?.id){
|
|
if(!currentUser?.id){
|
|
console.log("用户未登录,请登录后重试");
|
|
console.log("用户未登录,请登录后重试");
|
|
- let user = await openUserLoginModal(this.modalCtrl);
|
|
|
|
- if(!user?.id){
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- currentUser = user;
|
|
|
|
|
|
+ // let user = await openUserLoginModal(this.modalCtrl);
|
|
|
|
+ // if(!user?.id){
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ // currentUser = user;
|
|
|
|
+ this.router.navigate(['/tabs/tab4'])
|
|
|
|
+ return
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ console.log("currentUser: ",currentUser)
|
|
if(currentUser?.get("realname")){
|
|
if(currentUser?.get("realname")){
|
|
userPrompt += `当前来访的患者,姓名:${currentUser?.get("realname")}`
|
|
userPrompt += `当前来访的患者,姓名:${currentUser?.get("realname")}`
|
|
}
|
|
}
|
|
@@ -252,7 +350,7 @@ export class Tab1Page {
|
|
- 完成处方时,请在消息结尾附带: [处方完成]
|
|
- 完成处方时,请在消息结尾附带: [处方完成]
|
|
|
|
|
|
# 开始话语
|
|
# 开始话语
|
|
-当您准备好了,可以以一个医生的身份,向来访的用户打招呼。
|
|
|
|
|
|
+当您准备好了,可以以一个医生的身份,先向来访的用户亲切地打招呼。
|
|
${userPrompt}
|
|
${userPrompt}
|
|
`);
|
|
`);
|
|
},
|
|
},
|
|
@@ -268,12 +366,20 @@ ${userPrompt}
|
|
consult.save();
|
|
consult.save();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
},
|
|
},
|
|
onChatSaved:(chat:FmodeChat)=>{
|
|
onChatSaved:(chat:FmodeChat)=>{
|
|
// chat?.chatSession?.id 本次会话的 chatId
|
|
// chat?.chatSession?.id 本次会话的 chatId
|
|
console.log("onChatSaved",chat,chat?.chatSession,chat?.chatSession?.id)
|
|
console.log("onChatSaved",chat,chat?.chatSession,chat?.chatSession?.id)
|
|
|
|
+ // consult.set({
|
|
|
|
+ // chatId:chat?.chatSession?.id
|
|
|
|
+ // })
|
|
|
|
+ console.log("chat.MessageList", chat?.messageList)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
openChatPanelModal(this.modalCtrl,options)
|
|
openChatPanelModal(this.modalCtrl,options)
|
|
}
|
|
}
|
|
|
|
+ addNew(){
|
|
|
|
+ this.router.navigate(["/tabs/create-agent"]);
|
|
|
|
+ }
|
|
}
|
|
}
|