diff --git a/ng-seed/src/app/app.routing.ts b/ng-seed/src/app/app.routing.ts index a6a049a..fd8413b 100644 --- a/ng-seed/src/app/app.routing.ts +++ b/ng-seed/src/app/app.routing.ts @@ -47,6 +47,10 @@ export const AppRoutes: Routes = [{ ] }, { + path: 'customer', + loadChildren: () => import('./end-user/end-user.module').then(m => m.EndUserModule) + +},{ path: '', component: AuthLayoutComponent, children: [{ 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 new file mode 100644 index 0000000..b21970d --- /dev/null +++ b/ng-seed/src/app/end-user/booking-summary/booking-summary.component.html @@ -0,0 +1,77 @@ + + Appointment + +
+
+ +

Your Booking Summary

+ +
+
+ # Booking ID +
+
+ : AP-00001 +
+
+
Status:Confirmed
+
+
+
+
+ Service +
+
+ : ENT 15mins +
+
+
+
+ Practitioner +
+
+ : Gopi +
+
+
+
+ Date & Time +
+
+ : 27 Mar 2023 03:30 +
+
+
+
+ Contact Details +
+
+ : 5689741230 + + +
+
+
+
+ Booked On +
+
+ : 27 Mar 2023 +
+
+
+
+
+ +
+ +
+
+ +
+
+
+
+
\ 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 new file mode 100644 index 0000000..7140c56 --- /dev/null +++ b/ng-seed/src/app/end-user/booking-summary/booking-summary.component.scss @@ -0,0 +1,13 @@ +.summaryHeading{ + text-align: center; + border-bottom: 2px solid #000; + padding: 20px; +} + +.head{ + color: #7c7f81; +} +mat-toolbar{ + background-color: #227f6e; + color:#fff; +} \ No newline at end of file diff --git a/ng-seed/src/app/end-user/consultants/consultants-details/consultants-details.component.spec.ts b/ng-seed/src/app/end-user/booking-summary/booking-summary.component.spec.ts similarity index 50% rename from ng-seed/src/app/end-user/consultants/consultants-details/consultants-details.component.spec.ts rename to ng-seed/src/app/end-user/booking-summary/booking-summary.component.spec.ts index 32a57b6..64b0921 100644 --- a/ng-seed/src/app/end-user/consultants/consultants-details/consultants-details.component.spec.ts +++ b/ng-seed/src/app/end-user/booking-summary/booking-summary.component.spec.ts @@ -1,20 +1,20 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ConsultantsDetailsComponent } from './consultants-details.component'; +import { BookingSummaryComponent } from './booking-summary.component'; -describe('ConsultantsDetailsComponent', () => { - let component: ConsultantsDetailsComponent; - let fixture: ComponentFixture; +describe('BookingSummaryComponent', () => { + let component: BookingSummaryComponent; + let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ConsultantsDetailsComponent ] + declarations: [ BookingSummaryComponent ] }) .compileComponents(); }); beforeEach(() => { - fixture = TestBed.createComponent(ConsultantsDetailsComponent); + fixture = TestBed.createComponent(BookingSummaryComponent); component = fixture.componentInstance; fixture.detectChanges(); }); 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 new file mode 100644 index 0000000..f24a90f --- /dev/null +++ b/ng-seed/src/app/end-user/booking-summary/booking-summary.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-booking-summary', + templateUrl: './booking-summary.component.html', + styleUrls: ['./booking-summary.component.scss'] +}) +export class BookingSummaryComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/ng-seed/src/app/end-user/business-centers/centers-list.component.ts b/ng-seed/src/app/end-user/business-centers/centers-list.component.ts index 1772e06..fbde690 100644 --- a/ng-seed/src/app/end-user/business-centers/centers-list.component.ts +++ b/ng-seed/src/app/end-user/business-centers/centers-list.component.ts @@ -1,5 +1,7 @@ import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; import { BusinessService } from 'app/appoinment/business/business-service/business.service'; +import { EndUserService } from '../end-user.service'; @Component({ selector: 'app-centers-list', @@ -9,17 +11,28 @@ import { BusinessService } from 'app/appoinment/business/business-service/busine export class CentersListComponent implements OnInit { public filterdata = null; businessList: any; - constructor(public _bus:BusinessService) { } + constructor(public enduser:EndUserService, private router: Router,) { } ngOnInit(): void { this.getServicesList() } getServicesList() { + + let URL = this.router.url; + console.log(URL); + let URL_AS_LIST = URL.split('/'); + console.log(URL_AS_LIST); //this._pd.getTabStatusPdDetails(this.tabStatus) - this._bus.getBusinessListDetails().subscribe(res => { + let params = { + "randStr":URL_AS_LIST[3], + "queryName":URL_AS_LIST[2] + + } + console.log(params); + this.enduser.getcusServicesMapDetails(params).subscribe(res => { if (res.status == 200) { - this.businessList = res.data; + // this.businessList = res.data; } }); } diff --git a/ng-seed/src/app/end-user/consultants/consultants-details/consultants-details.component.html b/ng-seed/src/app/end-user/consultants/consultants-details/consultants-details.component.html deleted file mode 100644 index 76ec4a3..0000000 --- a/ng-seed/src/app/end-user/consultants/consultants-details/consultants-details.component.html +++ /dev/null @@ -1,107 +0,0 @@ -

- -

-
Date & Time:
-

{{selected | date:'mediumDate'}}

-
-
- - - - -
- -
- - - - - - - - - - - - -
- - - -
-
- - - - - - - - - - - -
- - - - -
-
- - - - - - - - - - - -
- -
-
- - - - - - - - - - - - - -
-
-
-
- - - -- - - {{business.workspace}} - - - Please choose an Workspace - Please choose any other - -
-
-
-
-
- -
-

I have read and un derstood the Terms & Conditions of usage of 24x7, - Privacy policy, Refund Policy and consent to the same.

-
- - diff --git a/ng-seed/src/app/end-user/consultants/consultants-details/consultants-details.component.scss b/ng-seed/src/app/end-user/consultants/consultants-details/consultants-details.component.scss deleted file mode 100644 index 1edfbc2..0000000 --- a/ng-seed/src/app/end-user/consultants/consultants-details/consultants-details.component.scss +++ /dev/null @@ -1,49 +0,0 @@ -$color_red_orange_approx: #4caf50; -$white: #fff; -.button{ - margin-bottom: 1rem; - background-color: #ffff !important; - margin-top: -3rem; - float: right; -} -.calender{ - margin-left: -1rem; - padding-right: 6rem; -} -mat-card{ - width: 140%; -} -::ng-deep .mat-tab-label { -margin-left: -3rem!important; -} -.img{ - width: 50px; -} -.btn-red { - background-color: $color_red_orange_approx; - color: $white; - border: 1px solid $color_red_orange_approx; - float: right; -} -h6{ - color: #0087ba; - font-weight: 600; -} -.primary{ - background-color: #658F9B; - color: white; -} -::ng-deep .mat-tab-group.mat-primary .mat-ink-bar, .mat-tab-nav-bar.mat-primary .mat-ink-bar { - background-color: #658F9B!important; -} -// ::ng-deep .mat-form-field-appearance-legacy .mat-form-field-wrapper { -// width: 250%; -// } -.success { - background: #fff; - box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2); - padding: 5px; - color: #0087ba; - font-weight: 600; - border-radius: 10px; - } \ No newline at end of file diff --git a/ng-seed/src/app/end-user/consultants/consultants-details/consultants-details.component.ts b/ng-seed/src/app/end-user/consultants/consultants-details/consultants-details.component.ts deleted file mode 100644 index 3c46d6a..0000000 --- a/ng-seed/src/app/end-user/consultants/consultants-details/consultants-details.component.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { Component, Inject, OnInit } from '@angular/core'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; -export interface DialogData { - animal: string; - name: string; -} -export interface UsersData { - workspace: string; -} -@Component({ - selector: 'app-consultants-details', - templateUrl: './consultants-details.component.html', - styleUrls: ['./consultants-details.component.scss'] -}) -export class ConsultantsDetailsComponent implements OnInit { - form: FormGroup; - local_data:any; - selected: Date | null; - name = 'Angular'; - date = new Date(); - control = new FormControl( - { - from: this.date, - // to: new Date(this.date.getTime() + 1 * 24 * 60 * 60 * 1000), - }, - Validators.required - ); - workspace = new FormControl('', [Validators.required]); - selects = [ - {workspace: 'test 1'}, - {workspace: 'test 2'}, - {workspace: 'test 3'}, - ]; - constructor( - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: DialogData) {} - - onNoClick(): void { - this.dialogRef.close(); - } - close() { - // console.log(this.form.value); - this.dialogRef.close(); -} - - ngOnInit(): void { - this.form = new FormGroup({ - - workspace: new FormControl('', [Validators.required]), - }); -console.log(this.local_data, this.selects) -// this.form.controls['note'].setValue('Sample') - this.form.patchValue(this.local_data) - } - submit(){ - console.log(this.form.value); - } -} 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 6ad9cee..fad3655 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 @@ -1,17 +1,21 @@ + + Appointment + +
-

consultant List

+

Practitioner List

- - Search consultant + + Search practitioner search
-
+
@@ -23,21 +27,21 @@
- user list image + user list image
-
{{consultant.name}}
- {{consultant.specialist}}
- {{consultant.year}}
- {{consultant.qualification}}
- Starts at ₹ {{consultant.payment}}
+
{{consultant.userName}}
+ {{consultant.specialist || "ENT" }}
+ {{consultant.year || "1 YRS EXP"}}
+ {{consultant.qualification || "MBBS"}}
+ Starts at ₹ {{consultant.payment || 100}}
transcribe - {{consultant.language}} + {{consultant.language || "English"}} location_on @@ -60,4 +64,5 @@
- \ No newline at end of file + +
\ No newline at end of file diff --git a/ng-seed/src/app/end-user/consultants/consultants-list.component.scss b/ng-seed/src/app/end-user/consultants/consultants-list.component.scss index 0233cf6..81a3da5 100644 --- a/ng-seed/src/app/end-user/consultants/consultants-list.component.scss +++ b/ng-seed/src/app/end-user/consultants/consultants-list.component.scss @@ -9,6 +9,9 @@ $black_60: rgba(0, 0, 0, 0.6); padding: 0rem 0.5rem 1rem; padding-bottom: 4rem; } +.flexRow{ + display: flex !important; +} .page-h{ color: #217e69; font-family: sans-serif; @@ -113,4 +116,8 @@ $black_60: rgba(0, 0, 0, 0.6); mat-icon{ color: #979797; font-size: 20px; +} +mat-toolbar{ + background-color: #227f6e; + color:#fff; } \ No newline at end of file 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 2d29e76..31f33e8 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 @@ -1,7 +1,6 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { Router } from '@angular/router'; -import { ConsultantsDetailsComponent } from '../consultants-details/consultants-details.component'; @Component({ selector: 'app-consultants-list', @@ -11,93 +10,104 @@ import { ConsultantsDetailsComponent } from '../consultants-details/consultants- export class ConsultantsListComponent implements OnInit { animal: string; name: string; + consultants:any =[]; public filterdata = null; constructor(private router:Router,public dialog: MatDialog) {} - openDialog(): void { - const dialogRef = this.dialog.open(ConsultantsDetailsComponent, { - width: '60%', - data: {name: this.name, animal: this.animal} - }); - - dialogRef.afterClosed().subscribe(result => { - console.log('The dialog was closed'); - this.animal = result; - }); - } ngOnInit(): void { - } - consultants: Object[] = [{ - name: 'Dr. Suganya', - specialist: 'ENT', - year: '1 YRS EXP', - qualification: 'MBBS, MS', - payment: '800', - language: 'TAMIL, ENGILSH', - city: 'Apollo Hospital Chennai', - image:'assets/images/face1.jpg', - time: 'Available in 3 mins', - img:'assets/images/stethoscope.png' + let tmp = localStorage.getItem('cusServiceData') + let practitioner = JSON.parse(tmp) + console.log(practitioner) + let arr_val=[] + practitioner.forEach(element => { - },{ - name: 'Dr. Indhu Mathi', - specialist: 'ORTHOPAEDICS', - year: '2 YRS EXP', - qualification: 'MBBS, MS', - payment: '800', - language: 'TAMIL, ENGILSH', - city: 'Apollo Hospital Chennai', - image:'assets/images/face2.jpg', - time: 'Available in 4 mins', - img:'assets/images/stethoscope.png' - },{ - name: 'Dr. Gaurav Kumar', - specialist: 'BREAST SURGERY', - year: '3 YRS EXP', - qualification: 'MBBS, MS', - payment: '800', - language: 'TAMIL, ENGILSH', - city: 'Apollo Hospital Chennai', - image:'assets/images/face3.jpg', - time: 'Available in 5 mins', - img:'assets/images/stethoscope.png' - },{ - name: 'Dr. Saloni Sinha', - specialist: 'CARDIOLOGY', - year: '4 YRS EXP', - qualification: 'MBBS, MS', - payment: '800', - language: 'TAMIL, ENGILSH', - city: 'Apollo Hospital Chennai', - image:'assets/images/face4.jpg', - time: 'Available in 6 mins', - img:'assets/images/stethoscope.png' - },{ - name: 'Dr. Padmaja', - specialist: 'DIABETOLOGY', - year: '5 YRS EXP', - qualification: 'MBBS, MS', - payment: '800', - language: 'TAMIL, ENGILSH', - city: 'Apollo Hospital Chennai', - image:'assets/images/face5.jpg', - time: 'Available in 7 mins', - img:'assets/images/stethoscope.png' - },{ - name: 'Dr. Pradeep ', - specialist: 'ENDOCRINOLOGY', - year: '6 YRS EXP', - qualification: 'MBBS, MS', - payment: '800', - language: 'TAMIL, ENGILSH', - city: 'Apollo Hospital Chennai', - image:'assets/images/face6.jpg', - time: 'Available in 8 mins', - img:'assets/images/stethoscope.png' + element.user.forEach(e => { + arr_val.push(e) + }); + + }); + + let filter = arr_val.filter(arr=>{return arr.role == "PRACTITIONER" && arr.busId =="abc123"}) + console.log(arr_val,filter) + this.consultants = filter; + // this.consultants = [{ + // name: 'Dr. Suganya', + // specialist: 'ENT', + // year: '1 YRS EXP', + // qualification: 'MBBS, MS', + // payment: '800', + // language: 'TAMIL, ENGILSH', + // city: 'Apollo Hospital Chennai', + // image:'assets/images/face1.jpg', + // time: 'Available in 3 mins', + // img:'assets/images/stethoscope.png' + + // },{ + // name: 'Dr. Indhu Mathi', + // specialist: 'ORTHOPAEDICS', + // year: '2 YRS EXP', + // qualification: 'MBBS, MS', + // payment: '800', + // language: 'TAMIL, ENGILSH', + // city: 'Apollo Hospital Chennai', + // image:'assets/images/face2.jpg', + // time: 'Available in 4 mins', + // img:'assets/images/stethoscope.png' + // },{ + // name: 'Dr. Gaurav Kumar', + // specialist: 'BREAST SURGERY', + // year: '3 YRS EXP', + // qualification: 'MBBS, MS', + // payment: '800', + // language: 'TAMIL, ENGILSH', + // city: 'Apollo Hospital Chennai', + // image:'assets/images/face3.jpg', + // time: 'Available in 5 mins', + // img:'assets/images/stethoscope.png' + // },{ + // name: 'Dr. Saloni Sinha', + // specialist: 'CARDIOLOGY', + // year: '4 YRS EXP', + // qualification: 'MBBS, MS', + // payment: '800', + // language: 'TAMIL, ENGILSH', + // city: 'Apollo Hospital Chennai', + // image:'assets/images/face4.jpg', + // time: 'Available in 6 mins', + // img:'assets/images/stethoscope.png' + // },{ + // name: 'Dr. Padmaja', + // specialist: 'DIABETOLOGY', + // year: '5 YRS EXP', + // qualification: 'MBBS, MS', + // payment: '800', + // language: 'TAMIL, ENGILSH', + // city: 'Apollo Hospital Chennai', + // image:'assets/images/face5.jpg', + // time: 'Available in 7 mins', + // img:'assets/images/stethoscope.png' + // },{ + // name: 'Dr. Pradeep ', + // specialist: 'ENDOCRINOLOGY', + // year: '6 YRS EXP', + // qualification: 'MBBS, MS', + // payment: '800', + // language: 'TAMIL, ENGILSH', + // city: 'Apollo Hospital Chennai', + // image:'assets/images/face6.jpg', + // time: 'Available in 8 mins', + // img:'assets/images/stethoscope.png' + // } + // ]; + } -]; + goToSlotBooking(){ - this.router.navigate(['/slot-booking']) + let URL = this.router.url; + console.log(URL) + // console.log(URL+"/"+data.randStr+"/practitioner") + this.router.navigate([URL+"/slot"]) + } } 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 new file mode 100644 index 0000000..4dada84 --- /dev/null +++ b/ng-seed/src/app/end-user/customer-info/customer-info.component.html @@ -0,0 +1,85 @@ + + + + Appointment + + +
+
+ +

Customer Information

+
+
+ + + Name is required + Limit exceed + + + + + Please enter a valid email address + + + Email is required + + +
+
+
+ + + Phone No is required + Limit exceed + +
+
+ +
+ verified +
+
+
+
+ + + +
+
+ +
+
+
+ + +
+
+
+ + + Address is required + Limit exceed + + + + State is required + Limit exceed + + + + City is required + Limit exceed + + + + City is required + Limit exceed + + +
+
+
+
+
+
+ diff --git a/ng-seed/src/app/end-user/customer-info/customer-info.component.scss b/ng-seed/src/app/end-user/customer-info/customer-info.component.scss new file mode 100644 index 0000000..0c6e9eb --- /dev/null +++ b/ng-seed/src/app/end-user/customer-info/customer-info.component.scss @@ -0,0 +1,7 @@ +.radius{ + border-radius: 10px !important; +} +mat-toolbar{ + background-color: #227f6e; + color:#fff; +} \ No newline at end of file diff --git a/ng-seed/src/app/end-user/customer-info/customer-info.component.spec.ts b/ng-seed/src/app/end-user/customer-info/customer-info.component.spec.ts new file mode 100644 index 0000000..9c128e0 --- /dev/null +++ b/ng-seed/src/app/end-user/customer-info/customer-info.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CustomerInfoComponent } from './customer-info.component'; + +describe('CustomerInfoComponent', () => { + let component: CustomerInfoComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ CustomerInfoComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(CustomerInfoComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng-seed/src/app/end-user/customer-info/customer-info.component.ts b/ng-seed/src/app/end-user/customer-info/customer-info.component.ts new file mode 100644 index 0000000..0eab10c --- /dev/null +++ b/ng-seed/src/app/end-user/customer-info/customer-info.component.ts @@ -0,0 +1,91 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, RequiredValidator, Validators } from '@angular/forms'; +import { Router } from '@angular/router'; +import { EndUserService } from '../end-user.service'; + + +@Component({ + selector: 'app-customer-info', + templateUrl: './customer-info.component.html', + styleUrls: ['./customer-info.component.scss'] +}) +export class CustomerInfoComponent implements OnInit { + form: FormGroup; + otpData: any = 0; + timeLeft: number = 0; + interval; + verifyOTP: any = 0; + constructor(private router: Router,private formBuilder: FormBuilder,public _cus:EndUserService) {} + + ngOnInit(): void { + this.form = new FormGroup({ + cusName: new FormControl('', [Validators.required]), + email: new FormControl('', [Validators.required, Validators.email,Validators.pattern( + '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$', + ),]), + address_1: new FormControl('', [Validators.maxLength(50)]), + city: new FormControl('', [Validators.maxLength(10)]), + state: new FormControl('', [Validators.maxLength(10)]), + pincode: new FormControl('',[Validators.maxLength(6)]), + phoneNo: new FormControl('', [Validators.required, Validators.maxLength(10)]), + }); + } + + public myError = (controlName: string, errorName: string) =>{ + return this.form.controls[controlName].hasError(errorName); + } + + submit(){ + console.log(this.form.value) + console.log('add') + let row_obj = this.form.value + console.log(row_obj) + let addFormData = { + cusName: row_obj.cusName, + email: row_obj.email, + address_1: row_obj.address_1, + phoneNo: row_obj.phoneNo, + pincode: row_obj.pincode, + state: row_obj.state, + city: row_obj.city, + }; + + this._cus.addCusDetails(addFormData).subscribe(res => { + if (res.status == 200) { + console.log(res) + let URL = this.router.url; + console.log(URL) + this.router.navigate([URL+"/pt"]) + } + }); + + } + + getOPT(event){ + this.otpData = event + this.timeLeft = 10; + this.interval = setInterval(() => { + if(this.timeLeft > 0) { + this.timeLeft--; + } else { + clearInterval(this.interval); + } + },1000) + } + + resendOTP() { + this.timeLeft = 10; + this.interval = setInterval(() => { + if(this.timeLeft > 0) { + this.timeLeft--; + } else { + clearInterval(this.interval); + } + },1000) + } + + verify(event){ + this.verifyOTP = event + } + +} 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 3485eff..3b17276 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 @@ -1,7 +1,10 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; +import { BookingSummaryComponent } from './booking-summary/booking-summary.component'; import { CentersListComponent } from './business-centers/centers-list.component'; import { ConsultantsListComponent } from './consultants/consultants-list.component'; +import { CustomerInfoComponent } from './customer-info/customer-info.component'; +import { PaymentComponent } from './payment/payment.component'; import { SearchCategoryComponent } from './search-category/search-category.component'; import { ServiceListComponent } from './service-list-details/service-list.component'; import { SlotBookingDetailsComponent } from './slot-booking/slot-booking-details.component'; @@ -28,6 +31,39 @@ const routes: Routes = [ path: 'services', component: ServiceListComponent }, + { + path: 'service/:randstr', + component: ServiceListComponent + }, + { + path: 'consultant/:randstr', + component: ConsultantsListComponent + }, + { + path: 'busniness/:randstr', + component: ServiceListComponent + }, + { + path: 'busniness/:randstr/:randstrs/practitioner', + component: ConsultantsListComponent + }, + { + path: 'busniness/:randstr/:randstrs/practitioner/slot', + component: SlotBookingDetailsComponent + }, + { + path: 'busniness/:randstr/:randstrs/practitioner/slot/cus', + component: CustomerInfoComponent + }, + { + path: 'busniness/:randstr/:randstrs/practitioner/slot/cus/pt', + component: PaymentComponent + }, + { + path: 'busniness/:randstr/:randstrs/practitioner/slot/cus/pt/bts', + component: BookingSummaryComponent + }, + // { // path: 'calendar-list', // component: CalendarListComponent diff --git a/ng-seed/src/app/end-user/end-user.module.ts b/ng-seed/src/app/end-user/end-user.module.ts index d9c661e..279d670 100644 --- a/ng-seed/src/app/end-user/end-user.module.ts +++ b/ng-seed/src/app/end-user/end-user.module.ts @@ -10,8 +10,11 @@ import { ServiceListComponent } from './service-list-details/service-list.compon import { SearchCategoryComponent } from './search-category/search-category.component'; import { CentersListComponent } from './business-centers/centers-list.component'; import { ConsultantsListComponent } from './consultants/consultants-list.component'; -import { DialogBoxComponent } from './service-list-details/dialog-box/dialog-box.component'; -import { ConsultantsDetailsComponent } from './consultants/consultants-details/consultants-details.component'; + +import { EndUserService } from './end-user.service'; +import { PaymentComponent } from './payment/payment.component'; +import { CustomerInfoComponent } from './customer-info/customer-info.component'; +import { BookingSummaryComponent } from './booking-summary/booking-summary.component'; @NgModule({ @@ -21,15 +24,17 @@ import { ConsultantsDetailsComponent } from './consultants/consultants-details/c SearchCategoryComponent, ConsultantsListComponent, CentersListComponent, - DialogBoxComponent, - ConsultantsDetailsComponent - ], + PaymentComponent,CustomerInfoComponent, BookingSummaryComponent + ], imports: [ CommonModule, EndUserRoutingModule, DemoMaterialModule, NgScrollbarModule, SharedModule + ], + providers:[ + EndUserService ] }) export class EndUserModule { } 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 79fc490..4785160 100644 --- a/ng-seed/src/app/end-user/end-user.service.ts +++ b/ng-seed/src/app/end-user/end-user.service.ts @@ -1,9 +1,57 @@ +import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { environment } from 'environments/environment'; +import { Observable } from 'rxjs'; +import { catchError } from 'rxjs/operators'; @Injectable({ providedIn: 'root' }) export class EndUserService { - constructor() { } + +private apiUrl = environment.apiEndpoint; + constructor(private _http: HttpClient) { } + + getServicesListDetails(): Observable { + console.log('IN') + return this._http.get(this.apiUrl + "getServicesDetails ") + // .pipe( + // catchError(this.handleError('role', [])) + // ) + } + + addFormDetails(addParams): Observable { + return this._http.post(this.apiUrl + 'CreateService', addParams) + + } + getcusServicesMapDetails(Params): Observable { + return this._http.post(this.apiUrl + 'getcusServicesMapDetails', Params) + + } + + getBusinessListDetails(): Observable{ + return this._http.get(this.apiUrl + "businessDetailList") + .pipe( + catchError(this.handleError('role', [])) + ) + } + + getUsersListDetails(): Observable { + console.log('IN') + return this._http.get(this.apiUrl + "getusers") + // .pipe( + // catchError(this.handleError('role', [])) + // ) + } + addCusDetails(addParams): Observable { + return this._http.post(this.apiUrl + 'CreateCustomers', addParams) + // .pipe( + // catchError(this.handleError('role', [])) + // ) + } + + handleError(arg0: string, arg1: undefined[]): (err: any, caught: Observable) => import("rxjs").ObservableInput { + throw new Error('Method not implemented.'); + } } diff --git a/ng-seed/src/app/end-user/payment/payment.component.html b/ng-seed/src/app/end-user/payment/payment.component.html new file mode 100644 index 0000000..f2e3dee --- /dev/null +++ b/ng-seed/src/app/end-user/payment/payment.component.html @@ -0,0 +1,42 @@ + + Appointment + + +
+
+ +

Payment By

+ Credit/Debit Cards + +
+
+ + + Name is required + + + + + Name is required + Limit exceed + + + + Name is required + Limit exceed + + + + Name is required + Limit exceed + + +
+
+
+
+
+
+ + + diff --git a/ng-seed/src/app/end-user/payment/payment.component.scss b/ng-seed/src/app/end-user/payment/payment.component.scss new file mode 100644 index 0000000..444cdbc --- /dev/null +++ b/ng-seed/src/app/end-user/payment/payment.component.scss @@ -0,0 +1,4 @@ +mat-toolbar{ + background-color: #227f6e; + color:#fff; +} \ No newline at end of file diff --git a/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.spec.ts b/ng-seed/src/app/end-user/payment/payment.component.spec.ts similarity index 56% rename from ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.spec.ts rename to ng-seed/src/app/end-user/payment/payment.component.spec.ts index 68d1642..315b6d6 100644 --- a/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.spec.ts +++ b/ng-seed/src/app/end-user/payment/payment.component.spec.ts @@ -1,20 +1,20 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { AddUserComponent } from './add-user.component'; +import { PaymentComponent } from './payment.component'; -describe('AddUserComponent', () => { - let component: AddUserComponent; - let fixture: ComponentFixture; +describe('PaymentComponent', () => { + let component: PaymentComponent; + let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ AddUserComponent ] + declarations: [ PaymentComponent ] }) .compileComponents(); }); beforeEach(() => { - fixture = TestBed.createComponent(AddUserComponent); + fixture = TestBed.createComponent(PaymentComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/ng-seed/src/app/end-user/payment/payment.component.ts b/ng-seed/src/app/end-user/payment/payment.component.ts new file mode 100644 index 0000000..4497246 --- /dev/null +++ b/ng-seed/src/app/end-user/payment/payment.component.ts @@ -0,0 +1,35 @@ +import { Component, OnInit } from '@angular/core'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; +import { Router } from '@angular/router'; + +@Component({ + selector: 'app-payment', + templateUrl: './payment.component.html', + styleUrls: ['./payment.component.scss'] +}) +export class PaymentComponent implements OnInit { + form: FormGroup; + constructor(private router:Router) { } + + ngOnInit(): void { + this.form = new FormGroup({ + cardName: new FormControl('', [Validators.required]), + cardNo: new FormControl('', [Validators.required, Validators.maxLength(16)]), + cvv: new FormControl('', [Validators.required, Validators.maxLength(3)]), + expiryDate: new FormControl('', [Validators.required]), + }); + } + + public myError = (controlName: string, errorName: string) =>{ + return this.form.controls[controlName].hasError(errorName); + } + + submit(){ + console.log(this.form.value) + + let URL = this.router.url; + console.log(URL) + this.router.navigate([URL+"/bts"]) + } + +} diff --git a/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.html b/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.html deleted file mode 100644 index ac1eff8..0000000 --- a/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.html +++ /dev/null @@ -1,20 +0,0 @@ -
{{action}} Services -
-
-
- - - - ServiceName is required - Limit exceed - - - Sure to delete {{local_data.servicesName}}? - -
-
- - -
-
\ No newline at end of file diff --git a/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.scss b/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.scss deleted file mode 100644 index c50ea44..0000000 --- a/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.scss +++ /dev/null @@ -1,11 +0,0 @@ -.button{ - // float: right; - margin-bottom: 1rem; - background-color: #ffff; - margin-top: -1rem; - // margin-left: 6rem; - float: right; -} -.mat-pane{ - width: 20rem; -} \ No newline at end of file diff --git a/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.ts b/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.ts deleted file mode 100644 index ffbbd48..0000000 --- a/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { Component, Inject, OnInit, Optional } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { Router } from '@angular/router'; -export interface UsersData { - servicesName: string; - id: number; -} - -@Component({ - selector: 'app-add-service', - templateUrl: './add-service.component.html', - styleUrls: ['./add-service.component.scss'] -}) -export class AddServiceComponent implements OnInit { - - form: FormGroup; - local_data:any; - action:string; - constructor(private router: Router,private formBuilder: FormBuilder, - public dialogRef: MatDialogRef, - @Optional() @Inject(MAT_DIALOG_DATA) public data: UsersData) { - console.log(data); - this.local_data = {...data}; - this.action = this.local_data.action; - } - get f(){ - return this.form.controls; - } - -close() { - this.dialogRef.close(); -} -closeDialog(){ - this.dialogRef.close({event:'Cancel'}); -} - -ngOnInit() { - this.form = new FormGroup({ - servicesName: new FormControl('', [Validators.required, Validators.maxLength(20)]), - }); - this.form.patchValue(this.local_data) - } - - public myError = (controlName: string, errorName: string) =>{ - return this.form.controls[controlName].hasError(errorName); - } - - submit(){ - console.log(this.form.value); - let tmp = this.form.value - tmp.serviceId = this.local_data.serviceId - this.dialogRef.close({event:this.action,data:tmp}); - console.log(this.form.value); - console.log(this.action,this.local_data) - } - -} diff --git a/ng-seed/src/app/end-user/service-list-details/service-list.component.html b/ng-seed/src/app/end-user/service-list-details/service-list.component.html index 81290c3..0c037c3 100644 --- a/ng-seed/src/app/end-user/service-list-details/service-list.component.html +++ b/ng-seed/src/app/end-user/service-list-details/service-list.component.html @@ -1,3 +1,8 @@ + + Appointment +

{{full_data[0].business[0].busName}}

+
+

Service List

@@ -21,12 +26,14 @@
- {{serviceListDetails.servicesName}} + {{serviceListDetails.servicesName}} + + @@ -34,3 +41,10 @@
+ + +
+

+ © 2021 Venba Information Technology Pvt Ltd. All Rights Reserved +

+
diff --git a/ng-seed/src/app/end-user/service-list-details/service-list.component.scss b/ng-seed/src/app/end-user/service-list-details/service-list.component.scss index 09a98ff..ca41b07 100644 --- a/ng-seed/src/app/end-user/service-list-details/service-list.component.scss +++ b/ng-seed/src/app/end-user/service-list-details/service-list.component.scss @@ -113,3 +113,15 @@ $main-color: #f44336; ::ng-deep .mat-form-field-appearance-fill .mat-form-field-flex { background-color: #fff0 !important; } +mat-toolbar{ + background-color: #227f6e; + color:#fff; +} + +footer { + background-color: #d1d1d1; + height:50px; + width: 100%; + position: absolute; + bottom: 0; + } 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 7583986..ebfe868 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 @@ -1,9 +1,10 @@ import { Component, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatTableDataSource } from '@angular/material/table'; +import { Router } from '@angular/router'; +import { AddServiceComponent } from 'app/appoinment/service-list-details/add-service/add-service.component'; import Swal from 'sweetalert2'; -import { AddServiceComponent } from '../add-service/add-service.component'; -import { ApiServiceService } from '../service-api-services/api-service.service'; +import { EndUserService } from '../end-user.service'; @Component({ selector: 'app-service-list', @@ -22,9 +23,11 @@ export class ServiceListComponent implements OnInit { id: number; serviceId: number; public filterdata = null; + servicesList_array:any =[]; public servicesList:any = new MatTableDataSource(); + full_data: any=[]; - constructor(public _api:ApiServiceService, public dialog: MatDialog) { } + constructor(public _api:EndUserService, public dialog: MatDialog,public enduser:EndUserService, private router: Router,) { } ngOnInit(): void { @@ -46,10 +49,51 @@ export class ServiceListComponent implements OnInit { } getServicesList() { + + 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.enduser.getcusServicesMapDetails(params).subscribe(res => { + if (res.status == 200) { + console.log(res) + this.full_data = res['data'] + let tmp =[]; + localStorage.setItem('cusServiceData',JSON.stringify(res['data'])) + res['data'].forEach(element => { + // tmp.push(element.service) + element.service.forEach(e => { + this.servicesList_array.push(e) + }); + + + }); + console.log(tmp, this.servicesList_array) + this.servicesList_array + + let result = this.servicesList_array.filter((obj, index, self) => + index === self.findIndex((t) => ( + t.serviceId === obj.serviceId + )) + ); + + console.log(result) + this.servicesList = result + // this.businessList = res.data; + } + }); //this._pd.getTabStatusPdDetails(this.tabStatus) this._api.getServicesListDetails().subscribe(res => { if (res.status == 200) { - this.servicesList = res.data; + // this.servicesList = res.data; // console.log(this.servicesList) // this.dataSource = res.data.length; // console.log(this.dataSource) @@ -165,5 +209,12 @@ let updatevalue = { serviceId: row_obj.serviceId, // alert(error.html_format); }); } + goto(data){ + let URL = this.router.url; + console.log(URL,data) + console.log(URL+"/"+data.randStr+"/practitioner") + this.router.navigate([URL+"/"+data.randStr+"/practitioner"]) + + } } 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 fc4de51..00db1e7 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 @@ -1,5 +1,9 @@ + + Appointment + +
-
+

Slot Availability

@@ -27,8 +31,8 @@ - - + +
@@ -87,6 +91,7 @@
- +
- \ No newline at end of file + + \ No newline at end of file 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 272a80c..d4f416d 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 @@ -1,4 +1,4 @@ -$color_red_orange_approx: #4caf50; +$color_red_orange_approx: #107c14; $white: #fff; .button{ margin-bottom: 1rem; @@ -46,4 +46,9 @@ h6{ color: #0087ba; font-weight: 600; border-radius: 10px; - } \ No newline at end of file + } + + mat-toolbar{ + background-color: #227f6e; + color:#fff; +} \ No newline at end of file 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 c6f5de7..1494404 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 @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { FormControl, FormGroup, Validators } from '@angular/forms'; +import { Router } from '@angular/router'; @Component({ selector: 'app-slot-booking-details', @@ -9,6 +10,8 @@ import { FormControl, FormGroup, Validators } from '@angular/forms'; export class SlotBookingDetailsComponent implements OnInit { form: FormGroup; local_data:any; + element: HTMLElement; + slot_array:any=[]; selected: Date | null; name = 'Angular'; date = new Date(); @@ -25,7 +28,7 @@ export class SlotBookingDetailsComponent implements OnInit { {workspace: 'test 2'}, {workspace: 'test 3'}, ]; - constructor() { } + constructor(private router:Router,) { } ngOnInit(): void { @@ -37,8 +40,30 @@ console.log(this.local_data, this.selects) // this.form.controls['note'].setValue('Sample') this.form.patchValue(this.local_data) } - submit(){ - console.log(this.form.value); - } + // submit(){ + // console.log(this.form.value); + // } + + toggleActive(event:any,param:any){ + // debugger; + // event.preventDefault(); + + if(this.element !== undefined){ + this.element.style.backgroundColor = "#658f9b"; + + } + var target = event.currentTarget; + target.style.backgroundColor = "#0c8f00"; + console.log(param) + this.slot_array.push(param) + } + + + submit(){ + console.log( this.slot_array) + let URL = this.router.url; + console.log(URL) + this.router.navigate([URL+"/cus"]) + } }