From ad71378d13b7b4a2f0893da099aa7f64506760c9 Mon Sep 17 00:00:00 2001 From: bitbucket Date: Mon, 17 Apr 2023 17:14:52 +0530 Subject: [PATCH] end user doctor routing --- .../user/add-user/add-user.component.ts | 2 +- .../consultants/consultants-list.component.ts | 87 ++++++++++++++++++- .../doctor-profile.component.ts | 10 ++- .../app/end-user/end-user-routing.module.ts | 31 +++++++ .../service-list.component.ts | 9 ++ .../slot-booking-details.component.scss | 2 +- .../layouts/admin/admin-layout.component.html | 2 +- 7 files changed, 136 insertions(+), 7 deletions(-) diff --git a/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts b/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts index d948338..fbc2ed1 100644 --- a/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts +++ b/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts @@ -157,7 +157,7 @@ export class AddUserComponent implements OnInit { } let tmp = this.form.value tmp.id = this.local_data.id - console.log(this.formData.getAll('image')); + console.log(tmp,this.formData.getAll('image')); if(this.busId == null){ this.busId = localStorage.getItem('busNameID') || null } diff --git a/ng-seed/src/app/end-user/consultants/consultants-list.component.ts b/ng-seed/src/app/end-user/consultants/consultants-list.component.ts index 9db4364..c6fd1e0 100644 --- a/ng-seed/src/app/end-user/consultants/consultants-list.component.ts +++ b/ng-seed/src/app/end-user/consultants/consultants-list.component.ts @@ -20,14 +20,24 @@ export class ConsultantsListComponent implements OnInit { busName:any=[] private apiUrl = environment.apiEndpoint; + ServicesMapDetailsList: any=[]; constructor(private router:Router,public dialog: MatDialog,public end_user:EndUserService,private spinner:NgxSpinnerService) { this.spinner.show(); } ngOnInit(): void { + this.busName = localStorage.getItem('busName') - let tmp = localStorage.getItem('cusServiceData') + let tmp = localStorage.getItem('cusServiceData') + let URL = this.router.url; + console.log(URL); + let URL_AS_LIST = URL.split('/'); + console.log(URL_AS_LIST); + if(URL_AS_LIST[2] == 'business'){ + + + let practitioner = JSON.parse(tmp) console.log(practitioner) let arr_val=[] @@ -87,7 +97,9 @@ export class ConsultantsListComponent implements OnInit { }); console.log(workinghrs) - +}else{ + this.getpractitionerList() +} } random_ng_past() { @@ -103,6 +115,11 @@ export class ConsultantsListComponent implements OnInit { goToSlotBooking(param){ let URL = this.router.url; console.log(URL,param) + let URL_AS_LIST = URL.split('/'); + console.log(URL_AS_LIST); + if(URL_AS_LIST[2] == 'business'){ + + let tmp = localStorage.getItem('cusServiceData') let practitioner = JSON.parse(tmp) console.log(practitioner) @@ -122,10 +139,76 @@ export class ConsultantsListComponent implements OnInit { // console.log(URL+"/"+data.randStr+"/practitioner") // this.router.navigate([URL+"/slot"]) this.router.navigate([URL+"/details"]) + }else{ + console.log(URL,param,this.ServicesMapDetailsList) + + let filter = this.ServicesMapDetailsList.filter(arr=>{return arr.userId == param.id && arr.busId ==param.busId}) + console.log(filter) + localStorage.setItem('workingHrs',param.practitionerInfos + [0].workingHours) + this.end_user.appointmentBooked.next(filter) + + this.router.navigate([URL+"/details"]) + + } } image_view(image){ return this.apiUrl+'imageViewer?img_name='+image; } + + + getpractitionerList() { + + let URL = this.router.url; + console.log(URL); + let URL_AS_LIST = URL.split('/'); + console.log(URL_AS_LIST); + //this._pd.getTabStatusPdDetails(this.tabStatus) + let params = { + "randStr":URL_AS_LIST[3], + "queryName":URL_AS_LIST[2] + + } + console.log(params); + + this.end_user.getcusServicesMapDetails(params).subscribe(res => { + if (res.status == 200) { + console.log(res) + let tmp =[] + let arr_val =res['data']; + this.ServicesMapDetailsList = arr_val + arr_val.forEach(element => { + tmp.push(element.user[0] ) + + }); + + + let filter = tmp.filter(arr=>{return arr.role == "PRACTITIONER"}) + console.log(tmp,filter) + + + let result = filter.filter((obj, index, self) => + + index === self.findIndex((t) => ( + + t.id=== obj.id + + + + + )) + ); + this.consultants = result; + setTimeout(() => { + /** spinner ends after 5 seconds */ + this.spinner.hide(); + }, 1000); + console.log(this.consultants) + + } + }) + } + } diff --git a/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.ts b/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.ts index a2d6c93..b9cd563 100644 --- a/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.ts +++ b/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.ts @@ -58,8 +58,14 @@ export class DoctorProfileComponent implements OnInit { let URL = this.router.url; console.log(URL) - // this.router.navigate([URL+"/slot"]) - this.router.navigate([URL+"/slot"]) + let URL_AS_LIST = URL.split('/'); + console.log(URL_AS_LIST); + if(URL_AS_LIST[2] == 'business'){ + this.router.navigate([URL+"/slot"]) + }else{ + this.router.navigate([URL+"/services"]) + } + } image_view(image){ diff --git a/ng-seed/src/app/end-user/end-user-routing.module.ts b/ng-seed/src/app/end-user/end-user-routing.module.ts index bd5b514..4afd11e 100644 --- a/ng-seed/src/app/end-user/end-user-routing.module.ts +++ b/ng-seed/src/app/end-user/end-user-routing.module.ts @@ -49,6 +49,24 @@ const routes: Routes = [{ path: 'business/:randstr', component: ServiceListComponent }, + { + path: 'practitioner/:randstr', + component: ConsultantsListComponent + }, + { + path: 'practitioner/:randstr/details', + component: DoctorProfileComponent + }, + { + path: 'practitioner/:randstr/details/services', + component: ServiceListComponent + }, + + { + path: 'practitioner/:randstr/details/services/slots/list', + component: SlotBookingDetailsComponent + }, + { path: 'business/:randstr/:randstrs/practitioner', component: ConsultantsListComponent @@ -69,6 +87,19 @@ const routes: Routes = [{ path: 'business/:randstr/:randstrs/practitioner/details/slot/cus/:cusId/pt/bts', component: BookingSummaryComponent }, + /// + { + path: 'practitioner/:randstr/details/services/slots/list/cus', + component: CustomerInfoComponent + }, + { + path: 'practitioner/:randstr/details/services/slots/list/cus/:cusId/pt', + component: PaymentComponent + }, + { + path: 'practitioner/:randstr/details/services/slots/list/cus/:cusId/pt/bts', + component: BookingSummaryComponent + }, { path: 'business/:randstr/:randstrs/practitioner/details', component: DoctorProfileComponent diff --git a/ng-seed/src/app/end-user/service-list-details/service-list.component.ts b/ng-seed/src/app/end-user/service-list-details/service-list.component.ts index ac59aed..26ef11d 100644 --- a/ng-seed/src/app/end-user/service-list-details/service-list.component.ts +++ b/ng-seed/src/app/end-user/service-list-details/service-list.component.ts @@ -209,6 +209,12 @@ let updatevalue = { serviceId: row_obj.serviceId, } goto(data){ let URL = this.router.url; + + let URL_AS_LIST = URL.split('/'); + console.log(URL_AS_LIST); + if(URL_AS_LIST[2] == 'business'){ + + console.log(URL,data,this.full_data) let filter = this.full_data.filter(arr=>{return arr.serviceId == data.serviceId && arr.busId ==data.busId}) console.log(filter) @@ -216,6 +222,9 @@ let updatevalue = { serviceId: row_obj.serviceId, localStorage.setItem("servicedetails",JSON.stringify(data)) console.log(URL+"/"+data.randStr+"/practitioner") this.router.navigate([URL+"/"+data.randStr+"/practitioner"]) + }else{ + this.router.navigate([URL+"/slots/list"]) + } } diff --git a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.scss b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.scss index 866e390..9a6534b 100644 --- a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.scss +++ b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.scss @@ -275,7 +275,7 @@ footer { } .scrollHV { - height: calc(100vh - 150px); + //height: calc(100vh - 150px); // zoom: 90%; } diff --git a/ng-seed/src/app/layouts/admin/admin-layout.component.html b/ng-seed/src/app/layouts/admin/admin-layout.component.html index 096b866..628dda0 100644 --- a/ng-seed/src/app/layouts/admin/admin-layout.component.html +++ b/ng-seed/src/app/layouts/admin/admin-layout.component.html @@ -188,7 +188,7 @@ -
+