Merge branch 'master' of bitbucket.org:venbainformationtechnology/appointments_frontend

This commit is contained in:
Surendiran 2023-05-29 15:50:16 +05:30
commit 87ea4a06be
5 changed files with 88 additions and 32 deletions

View File

@ -610,11 +610,11 @@ console.log(params)
this.date= param this.date= param
console.log(this.date,param,this.duration, this.ServiceId) console.log(this.date,param,this.duration, this.ServiceId)
let thirtyMinutes = this.duration * 60 * 1000; // convert 30 minutes to milliseconds let thirtyMinutes = this.duration*60000; // convert 30 minutes to milliseconds
let date1 = new Date(param); let date1 = new Date(param);
let date2 = new Date(date1.getTime() + thirtyMinutes); let date2 = new Date(date1.getTime() + thirtyMinutes);
console.log(date1); console.log(date1);
console.log(date2); console.log(date2,thirtyMinutes);
const currentTime = new Date(); // Get the current time const currentTime = new Date(); // Get the current time
//const filteredTimes = this.slots.filter(time => new Date(time) > date1); //const filteredTimes = this.slots.filter(time => new Date(time) > date1);
@ -630,10 +630,10 @@ console.log(params)
const filteredTimes = this.slots.filter(time => new Date(time) >= firstSlt && new Date(time) <= lastSlt); const filteredTimes = this.slots.filter(time => new Date(time) >= firstSlt && new Date(time) <= lastSlt);
console.log(resultArray,filteredTimes); console.log(resultArray,filteredTimes);
if(filteredTimes.length > 1){ // if(filteredTimes.length > 1){
let result = filteredTimes.pop(); // let result = filteredTimes.pop();
console.log(result); // console.log(result);
} // }
this.slotsResult = filteredTimes this.slotsResult = filteredTimes
// this.show = false; // this.show = false;

View File

@ -56,9 +56,15 @@ export class BookingSummaryComponent implements OnInit {
console.log(URL,slot_array) console.log(URL,slot_array)
let URL_AS_LIST = URL.split('/'); let URL_AS_LIST = URL.split('/');
console.log(URL_AS_LIST); console.log(URL_AS_LIST);
let cusID;
if(URL_AS_LIST[2] == 'business'){
cusID=URL_AS_LIST[9]
}else{
cusID=URL_AS_LIST[8]
}
// if(serviceDetails.hasOwnProperty('userId')){ // if(serviceDetails.hasOwnProperty('userId')){
serviceDetails.userId = localStorage.getItem('user_id') serviceDetails.userId = localStorage.getItem('user_id')
let paramPay = {"cusId":URL_AS_LIST[9]} let paramPay = {"cusId":cusID}
this.end_user.paymentstatus(paramPay).subscribe(resPay => { this.end_user.paymentstatus(paramPay).subscribe(resPay => {
@ -79,19 +85,61 @@ export class BookingSummaryComponent implements OnInit {
console.log(res) console.log(res)
let serviceMap = res['data'][0].id let serviceMap = res['data'][0].id
let time = new Date().toLocaleTimeString() let time = new Date().toLocaleTimeString()
let params= { let param= {
"busId": serviceDetails.busId, "busId": serviceDetails.busId,
"cusId": URL_AS_LIST[9], "cusId": cusID,
"appoinmentDate": slot_array[0].date, "appoinmentDate": slot_array[0].date,
"appoinmentTime": time, "userId": serviceDetails.userId,
"serviceMap": serviceMap, "appoinmentSlots": JSON.stringify(slot_array[0].slots)
"paymentStatus": 1, //"servicemap" :this.bookedAppointment_servicemap
"paymentMode":"online", }
"createdBy":"customer", console.log(param)
"appoinmentSlots": JSON.stringify(slot_array[0].slots)
//"servicemap" :this.bookedAppointment_servicemap this.end_user.CheckAppoinmentsDetails(param).subscribe(res => {
} if (res.status == 200) {
console.log(params) console.log(res)
res = res.data;
// this.end_user.summmarylist.next(res.data)
console.log('booked2', res);
this.customerBookingDetails = res[0].customer[0]
console.log(this.customerBookingDetails)
this.bookingSummary = res[0]
this.bookingSummary.createdAt2 = this.bookingSummary.createdAt
if(this.bookingSummary.appoinmentSlots instanceof Array){
this.bookingSummary.appoinmentSlots =this.bookingSummary.appoinmentSlots
}else{
this.bookingSummary.appoinmentSlots =JSON.parse(this.bookingSummary.appoinmentSlots)
}
// this.bookingSummary.appoinmentSlots =JSON.parse(this.bookingSummary.appoinmentSlots)
// 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]
this.busCurrency = this.serviceMapDetails['business'][0].currency
}
})
}else{
let params= {
"busId": serviceDetails.busId,
"cusId": cusID,
"appoinmentDate": slot_array[0].date,
"appoinmentTime": time,
"serviceMap": serviceMap,
"paymentStatus": 1,
"paymentMode":"online",
"createdBy":"customer",
"appoinmentSlots": JSON.stringify(slot_array[0].slots)
//"servicemap" :this.bookedAppointment_servicemap
}
this.end_user.CreateAppoinmentsCus(params).subscribe(res => { this.end_user.CreateAppoinmentsCus(params).subscribe(res => {
if (res.status == 200) { if (res.status == 200) {
console.log(res) console.log(res)
@ -125,6 +173,9 @@ export class BookingSummaryComponent implements OnInit {
}) })
} }
})
}
}) })

View File

@ -54,16 +54,16 @@ const routes: Routes = [{
// component: ConsultantsListComponent // component: ConsultantsListComponent
// }, // },
{ {
path: 'practitioner/:randstr/details', path: 'practitioner/:randstr',
component: DoctorProfileComponent component: DoctorProfileComponent
}, },
{ {
path: 'practitioner/:randstr/details/services', path: 'practitioner/:randstr/services',
component: ServiceListComponent component: ServiceListComponent
}, },
{ {
path: 'practitioner/:randstr/details/services/slots/list', path: 'practitioner/:randstr/services/slots/list',
component: SlotBookingDetailsComponent component: SlotBookingDetailsComponent
}, },
@ -89,15 +89,15 @@ const routes: Routes = [{
}, },
/// ///
{ {
path: 'practitioner/:randstr/details/services/slots/list/cus', path: 'practitioner/:randstr/services/slots/list/cus',
component: CustomerInfoComponent component: CustomerInfoComponent
}, },
{ {
path: 'practitioner/:randstr/details/services/slots/list/cus/:cusId/pt', path: 'practitioner/:randstr/services/slots/list/cus/:cusId/pt',
component: PaymentComponent component: PaymentComponent
}, },
{ {
path: 'practitioner/:randstr/details/services/slots/list/cus/:cusId/pt/bts', path: 'practitioner/:randstr/services/slots/list/cus/:cusId/pt/bts',
component: BookingSummaryComponent component: BookingSummaryComponent
}, },
{ {

View File

@ -51,6 +51,11 @@ private apiUrl = environment.apiEndpoint;
} }
CheckAppoinmentsDetails(Params): Observable<any> {
return this._http.post(this.apiUrl + 'CheckAppoinmentsDetails', Params)
}
paymentRequest(Params): Observable<any> { paymentRequest(Params): Observable<any> {
return this._http.post(this.apiUrl + 'paymentRequest', Params) return this._http.post(this.apiUrl + 'paymentRequest', Params)

View File

@ -78,11 +78,11 @@ export class SlotBookingDetailsComponent implements OnInit {
let URL_AS_LIST = URL.split('/'); let URL_AS_LIST = URL.split('/');
console.log(URL_AS_LIST); console.log(URL_AS_LIST);
if(URL_AS_LIST[2] == 'practitioner'){ // if(URL_AS_LIST[2] == 'practitioner'){
this.router.navigate(['customer/'+URL_AS_LIST[2]+'/'+URL_AS_LIST[3]+'/details']) // this.router.navigate(['customer/'+URL_AS_LIST[2]+'/'+URL_AS_LIST[3]+'/details'])
}else{ // }else{
this.router.navigate(['customer/'+URL_AS_LIST[2]+'/'+URL_AS_LIST[3]]) // this.router.navigate(['customer/'+URL_AS_LIST[2]+'/'+URL_AS_LIST[3]])
} // }
} }
}) })
@ -255,7 +255,7 @@ if(this.getHours.length != 0){
this.slotTime = param this.slotTime = param
console.log(this.date,param,this.servicesName.duration) console.log(this.date,param,this.servicesName.duration)
let thirtyMinutes = this.servicesName.duration * 60 * 1000; // convert 30 minutes to milliseconds let thirtyMinutes = this.servicesName.duration *60000; // convert 30 minutes to milliseconds
console.log(thirtyMinutes) console.log(thirtyMinutes)
let date1 = new Date(param); let date1 = new Date(param);
let date2 = new Date(date1.getTime() + thirtyMinutes); let date2 = new Date(date1.getTime() + thirtyMinutes);