customer, slot, upload profile

This commit is contained in:
Surendiran 2023-05-25 18:19:44 +05:30
parent 8607f2aa21
commit 1df4e8b746
16 changed files with 194 additions and 37 deletions

View File

@ -14,10 +14,10 @@
</mat-option>
</mat-select>
</mat-form-field>
<mat-button-toggle-group name="fontStyle" aria-label="Font Style">
<!-- <mat-button-toggle-group name="fontStyle" aria-label="Font Style">
<mat-button-toggle value="List">List</mat-button-toggle>
<mat-button-toggle value="Calender" (click)="onClickCalender()">Calender</mat-button-toggle>
</mat-button-toggle-group>
</mat-button-toggle-group> -->
<!-- <a><i style="font-size:24px" class="fa" (click)="onClickCalender()">&#xf073;</i></a> -->
<button mat-button (click)="openDialog('Add',{})" class="button">Add Appointment</button>

View File

@ -89,7 +89,7 @@ $tem-color : #217e69;
// // height: auto!important;
// }
::ng-deep .mat-dialog-content {
max-height: 75vh!important;
max-height: unset !important;
overflow: unset!important;
// overflow: hidden!important;
}

View File

@ -75,9 +75,11 @@
<button type="button" mat-raised-button (click)="goToSlotBooking2()" style="background-color: #7fffd400;box-shadow: none;color:#fff" ><mat-icon style="cursor: pointer;">keyboard_arrow_left</mat-icon></button><span style="width: 150px;text-align: center;">{{check(days) | date:'longDate'}}</span><button mat-raised-button type="button" (click)="goToSlotBooking()" *ngIf="clicks < advanced_slot_days" style="background-color: #7fffd400;box-shadow: none;color:#fff" ><mat-icon style="cursor: pointer;">keyboard_arrow_right</mat-icon></button>
</div>
<div class="innerdivs2" >
<ng-scrollbar class="scrollHV2" *ngIf="slots.length != 0">
<button type="button" *ngFor="let slot of slots;let i=index" mat-raised-button mat-button-sm class="mr-1 mt-1 hoverButton" [ngClass]="{'primary':slotIndex != i && checkSlotDur(slot,i)==1,'clickedSlot':slotIndex == i && checkSlotDur(slot,i)==1 }" (click)="toggleActive($event,slot,i)"><span *ngIf="checkSlotDur(slot,i)==1">{{slot | date:'shortTime'}}</span></button>
</ng-scrollbar>
<div *ngIf="slots.length != 0" [ngStyle]="{ 'height.px': slots.length * 12 }">
<!-- <ng-scrollbar class="scrollHV2" *ngIf="slots.length != 0"> -->
<button type="button" *ngFor="let slot of slots;let i=index" mat-raised-button mat-button-sm class="mr-1 mt-1 hoverButton" [ngClass]="{'primary':slotIndex != i && checkSlotDur(slot,i)==1,'clickedSlot':slotIndex == i && checkSlotDur(slot,i)==1 }" (click)="toggleActive($event,slot,i)"><span *ngIf="checkSlotDur(slot,i)==1">{{slot | date:'shortTime'}}</span></button>
<!-- </ng-scrollbar> -->
</div>
<div *ngIf="slots.length == 0">
<div fxLayout="row" class="flexCard">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center center">
@ -125,22 +127,24 @@
</mat-select>
</mat-form-field>
<div class="notes">
<!-- <div class="notes">
<input type="checkbox" id="scales" name="scales" checked>
<label for="scales">Send notifications for customer</label>
</div>
</div> -->
<!-- <img class="image" [src]="url" height="50">
<input type='file' (change)="onSelectFile($event)" formControlName="image"> -->
<ng-template #elseTemplate>
Sure to delete <b>{{local_data.cusName}}</b>?
</ng-template>
</div>
</ng-scrollbar>
<div mat-dialog-actions>
<div mat-dialog-actions>
<button mat-button type="submit" class="mat-green" mat-raised-button >{{action}}</button>
<button mat-button type="button" (click)="closeDialog()" >Cancel</button>
</div>
</div>
</ng-scrollbar>
</form>
<ng-template #elseTemplate>
Sure to delete <b>{{local_data.cusName}}</b>?
</ng-template>
<notifier-container></notifier-container>

View File

@ -89,7 +89,7 @@ $tem-color : #217e69;
// // height: auto!important;
// }
::ng-deep .mat-dialog-content {
max-height: 75vh!important;
max-height: unset !important;
overflow: unset!important;
// overflow: hidden!important;
}
@ -97,7 +97,7 @@ $tem-color : #217e69;
overflow: hidden!important;
}
.scrollHV {
height: calc(100vh - 190px);
height: calc(100vh - 85px);
}
.scrollHV2 {
height: calc(100vh - 462px);

View File

@ -48,8 +48,9 @@
}
}
::ng-deep .mat-dialog-content {
max-height: 170vh !important;
overflow: hidden!important;
max-height: unset !important;
overflow: unset!important;
// overflow: hidden!important;
}
::ng-deep .mat-dialog-container{
overflow: hidden!important;

View File

@ -48,8 +48,9 @@
}
}
::ng-deep .mat-dialog-content {
max-height: 170vh !important;
overflow: hidden!important;
max-height: unset !important;
overflow: unset!important;
// overflow: hidden!important;
}
::ng-deep .mat-dialog-container{
overflow: hidden!important;

View File

@ -48,9 +48,12 @@
}
}
::ng-deep .mat-dialog-content {
max-height: 170vh!important;
max-height: unset !important;
overflow: unset!important;
// overflow: hidden!important;
}
::ng-deep .mat-dialog-container{
overflow: hidden!important;
}
.scrollHV {
height: calc(100vh - 150px);

View File

@ -1,5 +1,5 @@
<h3>Customer Details</h3>
<h3>Booking Details</h3>
<mat-form-field style="width:30%">
<mat-label>Filter</mat-label>
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Type Here" #input>

View File

@ -25,12 +25,12 @@
box-shadow:none!important;
}
::ng-deep .mat-dialog-content {
max-height: 75vh!important;
overflow: unset!important;
// overflow: hidden!important;
max-height: unset !important;
overflow: unset!important;
// overflow: hidden!important;
}
::ng-deep .mat-dialog-container{
overflow: hidden!important;
overflow: hidden!important;
}
.scrollHV {
height: calc(100vh - 83px);

View File

@ -35,10 +35,10 @@
<mat-error *ngIf="!form.get('email')?.errors?.required && (form.get('email')?.errors?.pattern)">
Please enter a valid email address
</mat-error>
<!-- <mat-error *ngIf="myError('email', 'required')">email is required</mat-error> -->
<mat-error *ngIf="form.get('email')?.invalid && (form.get('email')?.dirty || form.get('email')?.touched) && form.get('email')?.errors?.required">
<mat-error *ngIf="myError('email', 'required')">email is required</mat-error>
<!-- <mat-error *ngIf="form.get('email')?.invalid && (form.get('email')?.dirty || form.get('email')?.touched) && form.get('email')?.errors?.required">
Email is required
</mat-error>
</mat-error> -->
</mat-form-field>
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" class="p-gap" fxLayoutAlign="center center">

View File

@ -48,6 +48,7 @@ export class DoctorProfileComponent implements OnInit {
console.log('booked', res);
if(res.length>0){
localStorage.setItem('busId',res[0].business[0].busId)
localStorage.setItem('busName',res[0].business[0].busName)
localStorage.setItem('logo',res[0].business[0].logo)
this.bookedAppointment = res[0].user[0]

View File

@ -82,6 +82,7 @@ export class ServiceListComponent implements OnInit {
this.full_data = res['data']
console.log(this.full_data)
this.full_data[0].business[0].busName
localStorage.setItem('busId',this.full_data[0].business[0].busId)
localStorage.setItem('busName',this.full_data[0].business[0].busName)
localStorage.setItem('currency',this.full_data[0].business[0].currency)
localStorage.setItem('logo',this.full_data[0].business[0].logo)

View File

@ -20,10 +20,23 @@
<div class="user-pro-wrap">
<div class="user-profile-thumb text-center">
<div class="user-i">
<img *ngIf="getUserData.role == 'SADMIN'" src="assets/images/userpic.png" class="rad-full mb-1" width="100" height="100" alt="">
<div class="profilepic">
<img *ngIf="getUserData.role == 'SADMIN'" src="assets/images/userpic.png" class="rad-full mb-1" width="100" height="100" alt="">
<img *ngIf="getUserData.role != 'SADMIN'" [src]="getUserData.logo != '' ? image_view(getUserData.logo) : 'assets/images/userpic.png'" class="rad-full mb-1" width="100" height="100" alt="">
<input (change)="onSelectFile($event)" type="file" #fileInput accept="image/*" style="display: none" />
<!-- <img class="profilepic__image" src="https://images.unsplash.com/photo-1510227272981-87123e259b17?ixlib=rb-0.3.5&q=80&fm=jpg&crop=faces&fit=crop&h=200&w=200&s=3759e09a5b9fbe53088b23c615b6312e" width="150" height="150" alt="Profibild" /> -->
<div class="profilepic__content">
<span class="profilepic__icon" (click)="openFileInput()"><mat-icon>camera_alt</mat-icon></span>
</div>
</div>
<div> <span class="hed-span text-capitalize">{{getUserData.userName}}</span></div>
<div> <span class="sub-span text-capitalize">- {{roleName}}</span></div>
<!-- <img *ngIf="getUserData.role == 'SADMIN'" src="assets/images/userpic.png" class="rad-full mb-1" width="100" height="100" alt="">
<img *ngIf="getUserData.role != 'SADMIN'" [src]="getUserData.logo != '' ? image_view(getUserData.logo) : 'assets/images/userpic.png'" class="rad-full mb-1" width="100" height="100" alt="">
<mat-icon class="profilepic__icon">camera</mat-icon>
<div> <span class="hed-span text-capitalize">{{getUserData.userName}}</span></div>
<div> <span class="sub-span text-capitalize">- {{roleName}}</span></div>
<div> <span class="sub-span text-capitalize">- {{roleName}}</span></div> -->
</div>
</div>
<!-- <div class="most-used text-center">
@ -586,4 +599,6 @@
</mat-card-content>
</mat-card>
<!-- /Demo Purposes Only -->
</div>
</div>
<notifier-container></notifier-container>

View File

@ -1,4 +1,4 @@
import { Component, OnInit, OnDestroy, ViewChild, HostListener } from '@angular/core';
import { Component, OnInit, OnDestroy, ViewChild, HostListener, ElementRef } from '@angular/core';
import { Router, NavigationEnd } from '@angular/router';
import { MenuItems } from '../../shared/menu-items/menu-items';
import { HorizontalMenuItems } from '../../shared/menu-items/horizontal-menu-items';
@ -13,6 +13,9 @@ PerfectScrollbarComponent, PerfectScrollbarDirective } from 'ngx-perfect-scrollb
import { RoleMenuItemsPipe } from '../role-menu-items.pipe';
import { ConsultantService } from 'app/appoinment/consultant-setting/consultant-service/consultant.service';
import { environment } from 'environments/environment';
import { NotifierService } from 'angular-notifier';
import { BusinessService } from 'app/appoinment/business/business-service/business.service';
import { UserService } from 'app/appoinment/user/user-service/user.service';
@Component({
selector: 'app-layout',
@ -54,11 +57,14 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
getUserData: any = [];
userLength: any = [];
roleName: any;
constructor(public _con:ConsultantService,private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService ) {
// fileInput: HTMLInputElement;
@ViewChild('fileInput') uploadImage;
formData: any=[];
constructor(public _use:UserService,public _bus:BusinessService,private notifierService: NotifierService,public _con:ConsultantService,private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService ) {
const browserLang: string = translate.getBrowserLang();
translate.use(browserLang.match(/en|fr/) ? browserLang : 'en');
this.getUser = localStorage.getItem('user_role')
this.formData= new FormData();
}
//08/02/2023
@ -93,7 +99,10 @@ users() {
}
openFileInput() {
console.log('in')
this.uploadImage.nativeElement.click();
}
getUserDetails(){
let userID = localStorage.getItem('user_id')
console.log('in')
@ -266,5 +275,71 @@ users() {
localStorage.clear();
this.router.navigate(['/authentication/login']);
}
onSelectFile(event) {
console.log(event)
console.log(event.target.files[0])
let fileType = event.target.files[0]
if(fileType.type == 'image/png' || fileType.type == 'image/jpg' || fileType.type == 'image/jpeg'){
if(event.target.files[0].size > 2097152){
this.notifierService.notify('warning', 'Image size is too Larger');
}else {
const file = event.target.files[0];
console.log(file)
// return;
// if(event != null){
// // this.imageViewStatus = true
// }
// this.form['value'].logo = [event.target.files[0]]
// if (event.target.files && event.target.files[0]) {
// var reader = new FileReader();
// reader.readAsDataURL(event.target.files[0]);
// reader.onload = (event) => {
// this.url = event.target.result;
// console.log(this.url)
// }
// }
let user_id = localStorage.getItem('user_id')
// let busUserID = this.getUserData.BusinessDetails[0].id
this.formData = []
this.formData= new FormData();
this.formData.append('image', file, file.name);
this.formData.append('logo', '1');
this.formData.append('id',user_id)
// this.formData.append('isActive','1')
// this.formData.append('id',user_id)
console.log(this.formData)
// let user_role = localStorage.getItem('user_role')
// let service
// if(user_role == 'BIZADMIN'){
// console.log('BIZADMIN',busUserID)
// this.formData.append('id',busUserID)
// service = this._bus
// }else {
// console.log('oThers')
// this.formData.append('id',user_id)
// service = this._use
// }
this._use.addFormDetails(this.formData).subscribe(res => {
if (res.status == 200) {
this.notifierService.notify('success', 'Profile Updated Successfully');
this.getUserDetails()
}
else{
console.log(res.message)
// this.notifierService.notify('success', 'You are awesome! I mean it!');
this.notifierService.notify('warning', res.message);
}
})
}
} else {
this.notifierService.notify('warning', 'Invalid File)');
this.notifierService.notify('warning', 'Upload Supported File Like (png,jpg and jpeg)');
}
// this.formData.append('file', file, file.name);
}
}

View File

@ -9,8 +9,64 @@ $hover-icon-color:#2393db;
.radius-round {
border-radius: $border-radius-base;
}
// .profilepic {
// position: relative;
// width: 125px;
// height: 125px;
// border-radius: 50%;
// overflow: hidden;
// background-color: #111;
// }
.profilepic:hover .profilepic__content {
opacity: 1;
}
.profilepic:hover .rad-full {
opacity: .5;
}
.rad-full {
object-fit: cover;
opacity: 1;
transition: opacity .2s ease-in-out;
}
.profilepic__content {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: white;
opacity: 0;
transition: opacity .2s ease-in-out;
}
.profilepic__icon {
color: white;
padding-bottom: 60px;
cursor: pointer;
}
.fas {
font-size: 20px;
}
.profilepic__text {
text-transform: uppercase;
font-size: 12px;
width: 50%;
text-align: center;
}
.rad-full{
border-radius: 100%;
height: 100px !important;
width: 100px !important;
}
.radius-circle {
border-radius: 50%;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 15 KiB