From 135da139f3ac99fd2ee63e579d612ce8c4547911 Mon Sep 17 00:00:00 2001 From: bitbucket Date: Sat, 1 Apr 2023 14:41:56 +0530 Subject: [PATCH] ui changes --- .../booking-summary.component.html | 73 +++++++++++++++---- .../booking-summary.component.scss | 8 ++ .../booking-summary.component.ts | 41 ++++++++++- .../consultants-list.component.html | 8 +- .../consultants/consultants-list.component.ts | 12 +++ .../customer-info.component.html | 4 +- ng-seed/src/app/end-user/end-user.service.ts | 2 + .../end-user/payment/payment.component.html | 4 +- .../app/end-user/payment/payment.component.ts | 30 ++++++-- .../slot-booking-details.component.html | 6 +- .../slot-booking-details.component.ts | 13 +++- .../app/end-user/summary/summary.component.ts | 5 +- 12 files changed, 170 insertions(+), 36 deletions(-) diff --git a/ng-seed/src/app/end-user/booking-summary/booking-summary.component.html b/ng-seed/src/app/end-user/booking-summary/booking-summary.component.html index 3ec05f3..5d66f11 100644 --- a/ng-seed/src/app/end-user/booking-summary/booking-summary.component.html +++ b/ng-seed/src/app/end-user/booking-summary/booking-summary.component.html @@ -1,19 +1,60 @@ Appointment + +
+
+ +
+
+ +
+ +
+

Your appointment has been successfully registered.

+ +

+ An email with the appointment details has been sent to you.

+ +

+ + Please check your spam folder if the email does not arrive within a few minutes. +

+ +
+ +
+ +
+ + +
+ +
+
+
+
+
-
- +
+ + +

Your Booking Summary

# Booking ID
-
- : AP-00001 +
+ :{{bookingSummary.bookingId}}
-
+
Status:Confirmed
@@ -21,32 +62,32 @@
Service
-
- : ENT 15mins +
+ : {{serviceMapDetails.service[0].servicesName}} ( {{serviceMapDetails.service[0].duration}} Minutes)
Practitioner
-
- : Gopi +
+ : {{serviceMapDetails.user[0].userName}}
Date & Time
-
- : 27 Mar 2023 03:30 +
+ : {{bookingSummary.appoinmentDate | date:'fullDate'}}({{bookingSummary.appoinmentSlots | date:'shortTime'}})
Contact Details
-
- : 5689741230 +
+ : {{serviceMapDetails.user[0].contactNo}}
@@ -55,8 +96,8 @@
Booked On
-
- : 27 Mar 2023 +
+ : {{bookingSummary.createdAt | date:'fullDate'}}
@@ -72,6 +113,8 @@
+
+
\ No newline at end of file diff --git a/ng-seed/src/app/end-user/booking-summary/booking-summary.component.scss b/ng-seed/src/app/end-user/booking-summary/booking-summary.component.scss index 74fcb71..875b942 100644 --- a/ng-seed/src/app/end-user/booking-summary/booking-summary.component.scss +++ b/ng-seed/src/app/end-user/booking-summary/booking-summary.component.scss @@ -13,4 +13,12 @@ mat-toolbar{ } ::ng-deep body{ background-color: #f7f8f5 !important; +} +.radius{ + width: 100%; + margin-top: 5%; +} +.radius1{ + + margin-top: 5%; } \ No newline at end of file diff --git a/ng-seed/src/app/end-user/booking-summary/booking-summary.component.ts b/ng-seed/src/app/end-user/booking-summary/booking-summary.component.ts index f24a90f..3669b6f 100644 --- a/ng-seed/src/app/end-user/booking-summary/booking-summary.component.ts +++ b/ng-seed/src/app/end-user/booking-summary/booking-summary.component.ts @@ -1,4 +1,6 @@ import { Component, OnInit } from '@angular/core'; +import { EndUserService } from '../end-user.service'; +import { Router } from '@angular/router'; @Component({ selector: 'app-booking-summary', @@ -6,10 +8,45 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./booking-summary.component.scss'] }) export class BookingSummaryComponent implements OnInit { + bookingSummary: any=[]; + serviceMapDetails: any=[]; + summary:any= false; + constructor(public end_user:EndUserService,private router:Router,) { + this.end_user.summmarylist_observable$.subscribe((res) => { + console.log('booked', res); + if(res.length>0){ + // this.bookedAppointment_servicemap=res[0].id; + }else{ + + let URL = this.router.url; + console.log(URL) + let URL_AS_LIST = URL.split('/'); + console.log(URL_AS_LIST); + this.router.navigate(['customer/business/'+URL_AS_LIST[3]]) + } + + }) - constructor() { } + } ngOnInit(): void { - } + this.end_user.summmarylist_observable$.subscribe((res) => { + console.log('booked2', res); + this.bookingSummary = res[0] + // this.end_user.getcusServicesMapDetails() + let param ={id:this.bookingSummary.serviceMap} + this.end_user.getcusServicesMapDetails(param).subscribe(res => { + if (res.status == 200) { + console.log(res) + this.serviceMapDetails = res['data'][0] + + } + }) + + }) + } + Summaryhide(){ + this.summary = true; + } } diff --git a/ng-seed/src/app/end-user/consultants/consultants-list.component.html b/ng-seed/src/app/end-user/consultants/consultants-list.component.html index 6474f68..82f7355 100644 --- a/ng-seed/src/app/end-user/consultants/consultants-list.component.html +++ b/ng-seed/src/app/end-user/consultants/consultants-list.component.html @@ -19,7 +19,7 @@
-
+
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 bab26a1..34be830 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 @@ -14,10 +14,12 @@ export class ConsultantsListComponent implements OnInit { name: string; consultants:any =[]; public filterdata = null; + bgColorPast: any=[]; constructor(private router:Router,public dialog: MatDialog,public end_user:EndUserService) {} ngOnInit(): void { + let tmp = localStorage.getItem('cusServiceData') let practitioner = JSON.parse(tmp) console.log(practitioner) @@ -56,6 +58,16 @@ export class ConsultantsListComponent implements OnInit { console.log(workinghrs) } + random_ng_past() + { + for(let id of this.consultants){ + var x = Math.floor(Math.random() * 256); + var y = Math.floor(Math.random() * 256); + var z = Math.floor(Math.random() * 256); + this.bgColorPast.push("rgb(" + x + "," + y + "," + z + ")"); + + } + } goToSlotBooking(param){ let URL = this.router.url; diff --git a/ng-seed/src/app/end-user/customer-info/customer-info.component.html b/ng-seed/src/app/end-user/customer-info/customer-info.component.html index e44cde4..272672b 100644 --- a/ng-seed/src/app/end-user/customer-info/customer-info.component.html +++ b/ng-seed/src/app/end-user/customer-info/customer-info.component.html @@ -80,9 +80,9 @@
-
+
diff --git a/ng-seed/src/app/end-user/end-user.service.ts b/ng-seed/src/app/end-user/end-user.service.ts index 2d0dc1a..85af81c 100644 --- a/ng-seed/src/app/end-user/end-user.service.ts +++ b/ng-seed/src/app/end-user/end-user.service.ts @@ -12,6 +12,8 @@ export class EndUserService { public appointmentBooked:BehaviorSubject = new BehaviorSubject([]); public appointmentBooked_observable$ = this.appointmentBooked.asObservable(); +public summmarylist:BehaviorSubject = new BehaviorSubject([]); +public summmarylist_observable$ = this.summmarylist.asObservable(); private apiUrl = environment.apiEndpoint; constructor(private _http: HttpClient) { } diff --git a/ng-seed/src/app/end-user/payment/payment.component.html b/ng-seed/src/app/end-user/payment/payment.component.html index db5cfa0..2a280fd 100644 --- a/ng-seed/src/app/end-user/payment/payment.component.html +++ b/ng-seed/src/app/end-user/payment/payment.component.html @@ -36,9 +36,9 @@
-
+
diff --git a/ng-seed/src/app/end-user/payment/payment.component.ts b/ng-seed/src/app/end-user/payment/payment.component.ts index 081fce1..796b615 100644 --- a/ng-seed/src/app/end-user/payment/payment.component.ts +++ b/ng-seed/src/app/end-user/payment/payment.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { FormControl, FormGroup, Validators } from '@angular/forms'; -import { Router } from '@angular/router'; +import { ActivatedRoute, Router } from '@angular/router'; import { EndUserService } from '../end-user.service'; @Component({ @@ -10,7 +10,24 @@ import { EndUserService } from '../end-user.service'; }) export class PaymentComponent implements OnInit { form: FormGroup; - constructor(private router:Router,public enduser:EndUserService, ) { } + bookedAppointment_servicemap: any; + constructor(private router:Router,public enduser:EndUserService, private route: ActivatedRoute, ) { + this.enduser.appointmentBooked_observable$.subscribe((res) => { + console.log('booked', res); + if(res.length>0){ + this.bookedAppointment_servicemap=res[0].id; + }else{ + + let URL = this.router.url; + console.log(URL) + let URL_AS_LIST = URL.split('/'); + console.log(URL_AS_LIST); + this.router.navigate(['customer/business/'+URL_AS_LIST[3]]) + } + + }) + + } ngOnInit(): void { this.form = new FormGroup({ @@ -45,21 +62,24 @@ export class PaymentComponent implements OnInit { this.enduser.CreatecusServicesMapDetails(paramsmap).subscribe(res => { if (res.status == 200) { console.log(res) - let serviceMap = res['data'].id + let serviceMap = res['data'][0].id let time = new Date().toLocaleTimeString() let params= { "busId": serviceDetails.busId, "cusId": URL_AS_LIST[8], "appoinmentDate": slot_array[0].date, "appoinmentTime": time, - "serviceMap": serviceMap, + "serviceMap": serviceMap, "appoinmentSlots": slot_array[0].slots, + //"servicemap" :this.bookedAppointment_servicemap } console.log(params) this.enduser.CreateAppoinmentsCus(params).subscribe(res => { if (res.status == 200) { console.log(res) - localStorage.setItem('summarylist',JSON.stringify(res.data)) + this.enduser.summmarylist.next(res.data) + + // localStorage.setItem('summarylist',JSON.stringify(res.data)) this.router.navigate([URL+"/bts"]) } }) diff --git a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.html b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.html index 1ce51df..fd73b27 100644 --- a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.html +++ b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.html @@ -30,14 +30,14 @@
--> - +
-
+
diff --git a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.ts b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.ts index 8e5077b..3d84551 100644 --- a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.ts +++ b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.ts @@ -48,9 +48,18 @@ export class SlotBookingDetailsComponent implements OnInit { console.log('booked', res); if(res.length>0){ this.bookedAppointment=res[0].appoinment - } + }else{ + + let URL = this.router.url; + console.log(URL) + let URL_AS_LIST = URL.split('/'); + console.log(URL_AS_LIST); + this.router.navigate(['customer/business/'+URL_AS_LIST[3]]) + } }) + + // Set the minimum to January 1st 20 years in the past and December 31st a year in the future. this.slot_Split() @@ -193,7 +202,7 @@ export class SlotBookingDetailsComponent implements OnInit { // console.log("sksjfjdhkfhsdfcgdjsh") return '0'; }else{ - return 1 + return 0 } }); diff --git a/ng-seed/src/app/end-user/summary/summary.component.ts b/ng-seed/src/app/end-user/summary/summary.component.ts index 30fdf63..9036cc3 100644 --- a/ng-seed/src/app/end-user/summary/summary.component.ts +++ b/ng-seed/src/app/end-user/summary/summary.component.ts @@ -10,7 +10,10 @@ import { ServiceListComponent } from '../service-list-details/service-list.compo export class SummaryComponent implements OnInit { serviceName: any=[]; - constructor() { } + constructor() { + + + } ngOnInit(): void { let tmp = localStorage.getItem("servicedetails")