Commit a9417761 authored by prumde's avatar prumde

Updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174270 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6cb16f83
...@@ -70,7 +70,7 @@ import { HostUrlService } from './host-url.service'; ...@@ -70,7 +70,7 @@ import { HostUrlService } from './host-url.service';
import reducer from './ecm-store/reducers'; import reducer from './ecm-store/reducers';
import {CartActions, CategoryActions, SubCategoryActions, ItemActions, LocationActions, WishListActions, MenuActions,ProfileActions, AdressAction, ReviewAction, SavedCardAction} from './ecm-store/actions'; import {CartActions, CategoryActions, SubCategoryActions, ItemActions, LocationActions, WishListActions, MenuActions,ProfileActions, AdressAction, ReviewAction, SavedCardAction} from './ecm-store/actions';
import {CartEffects, CategoryEffects, SubCategoryEffects, ItemEffects, WishlistEffects, MenuEffects,ProfileEffects, AddressEffects, ReviewsEffects, SavedCardEffects} from './ecm-store/effects'; import {CartEffects, CategoryEffects, SubCategoryEffects, ItemEffects, WishlistEffects, MenuEffects,ProfileEffects, AddressEffects, ReviewsEffects, SavedCardEffects} from './ecm-store/effects';
import { EcmPanelComponent, ECMDialog } from './ecm-view/ecm-panel/ecm-panel.component'; import { EcmPanelComponent } from './ecm-view/ecm-panel/ecm-panel.component';
import { UserProfileComponent, ProfileEditor, ProfileScreenComponent } from './user-profile'; import { UserProfileComponent, ProfileEditor, ProfileScreenComponent } from './user-profile';
import { UserAddressComponent, AddressEditor, AddressScreenComponent } from './user-address'; import { UserAddressComponent, AddressEditor, AddressScreenComponent } from './user-address';
...@@ -146,7 +146,6 @@ const appRoutes: Routes = [ ...@@ -146,7 +146,6 @@ const appRoutes: Routes = [
RatingComponent, RatingComponent,
EcmWishListComponent, EcmWishListComponent,
EcmPanelComponent, EcmPanelComponent,
ECMDialog,
UserProfileComponent, UserProfileComponent,
UserAddressComponent, UserAddressComponent,
UserCardComponent, UserCardComponent,
...@@ -221,8 +220,8 @@ const appRoutes: Routes = [ ...@@ -221,8 +220,8 @@ const appRoutes: Routes = [
EcmHandicraftComponent, EcmHandicraftComponent,
EcmCelebrationComponent, EcmCelebrationComponent,
EcmTrainingComponent, EcmTrainingComponent,
ECMConfirmDialog, ECMConfirmDialog
ECMDialog
], ],
schemas:[CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], schemas:[CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
bootstrap: [AppComponent] bootstrap: [AppComponent]
......
...@@ -258,6 +258,7 @@ md-card { ...@@ -258,6 +258,7 @@ md-card {
color: #fff; color: #fff;
font-weight: 700; font-weight: 700;
margin: 0 12px; margin: 0 12px;
margin-left: 0px;
} }
.save-button { .save-button {
...@@ -412,6 +413,7 @@ md-card { ...@@ -412,6 +413,7 @@ md-card {
box-shadow: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12); box-shadow: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12);
background: white; background: white;
margin: 10px; margin: 10px;
height: 50px;
} }
.mat-vertical-content-container.mat-stepper-vertical-line::BEFORE { .mat-vertical-content-container.mat-stepper-vertical-line::BEFORE {
...@@ -444,9 +446,17 @@ md-card { ...@@ -444,9 +446,17 @@ md-card {
.cod-order { .cod-order {
padding-left: 45px; padding-left: 45px;
} }
.email-data {
padding-left: 200px;
/* margin-left: 232px; */
color: rgba(68, 61, 61, 0.88);
font-size: 15px;
}
.mat-vertical-content-container {
display: none !important;
}
......
...@@ -5,17 +5,18 @@ ...@@ -5,17 +5,18 @@
<div class="medium-8 columns"> <div class="medium-8 columns">
<md-vertical-stepper #stepper [linear]="true"> <md-vertical-stepper #stepper >
<md-step [stepControl]="loginFormGroup"> <md-step [stepControl]="loginFormGroup">
<ng-template mdStepLabel class="panel-selected"> <ng-template mdStepLabel class="panel-selected">
Login Login <span *ngIf="userData" class = "email-data"> {{userData?.EMAIL_ID}}</span>
</ng-template> </ng-template>
<ng-container *ngTemplateOutlet="loginPage"></ng-container> <ng-container *ngTemplateOutlet="loginPage"></ng-container>
<div> <!-- <button style="float: right;margin: 10px;" md-button mdStepperNext>Next</button>-->
<button style="float: right;margin: 10px;" md-button mdStepperNext>Next</button> <form [formGroup]="loginFormGroup">
</div> <input required type="hidden" formControlName="userData" [(ngModel)]="userData">
</form>
</md-step> </md-step>
<md-step [stepControl]="addressFormGroup"> <md-step [stepControl]="addressFormGroup">
...@@ -99,24 +100,11 @@ ...@@ -99,24 +100,11 @@
</div> </div>
<ng-template #loginPage> <ng-template #loginPage >
<form [formGroup]="loginFormGroup">
<div class="username-field"> <button *ngIf = "!userData" md-button class="login-button" (click)="userAction();">
<md-form-field> Login to continue
<input mdInput required formControlName="username" id="username" name="username" [placeholder]="'User Name'" [required]="true" type="text"> </button>
</md-form-field>
</div>
<div class="password-field">
<md-form-field>
<input mdInput required formControlName="password" id="password" name="password" [placeholder]="'Password'" [required]="true" type="text">
</md-form-field>
</div>
<button md-button class="login-button">
Login
</button>
</form>
</ng-template> </ng-template>
<ng-template #reviewOrder> <ng-template #reviewOrder>
...@@ -234,4 +222,6 @@ ...@@ -234,4 +222,6 @@
</button> </button>
</ng-template> </ng-template>
<ecm-panel #ecmPanel>
</ecm-panel>
import { Component, OnInit, ViewChild, ElementRef, Input, Output, EventEmitter } from '@angular/core'; import { Component, OnInit, ViewChild, ElementRef, Input, Output, EventEmitter ,DoCheck ,AfterViewInit, AfterViewChecked} from '@angular/core';
import { FormBuilder, Validators,NgForm,NgModel,FormGroup } from '@angular/forms'; import { FormBuilder, Validators,NgForm,NgModel,FormGroup } from '@angular/forms';
import { ItemDetail } from '../../ecm-model/product-detail-model'; import { ItemDetail } from '../../ecm-model/product-detail-model';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
...@@ -18,6 +18,7 @@ import { Address } from '../../user-address/address-manager/address.model'; ...@@ -18,6 +18,7 @@ import { Address } from '../../user-address/address-manager/address.model';
import { Item } from '../../ecm-model/product-model'; import { Item } from '../../ecm-model/product-model';
import { CardScreenComponent } from '../../user-card/card-manager/card-screen/card-screen.component'; import { CardScreenComponent } from '../../user-card/card-manager/card-screen/card-screen.component';
import { AddressScreenComponent } from '../../user-address/address-manager/address-screen/address-screen.component'; import { AddressScreenComponent } from '../../user-address/address-manager/address-screen/address-screen.component';
import { EcmPanelComponent } from '../ecm-panel/ecm-panel.component';
@Component( { @Component( {
selector: 'ecm-checkout', selector: 'ecm-checkout',
...@@ -26,7 +27,7 @@ import { AddressScreenComponent } from '../../user-address/address-manager/addre ...@@ -26,7 +27,7 @@ import { AddressScreenComponent } from '../../user-address/address-manager/addre
providers:[EcmCheckoutService] providers:[EcmCheckoutService]
}) })
export class EcmCheckoutComponent implements OnInit { export class EcmCheckoutComponent implements OnInit ,DoCheck {
@ViewChild('userForm') currentForm: NgForm; @ViewChild('userForm') currentForm: NgForm;
@Input() unAuthorized: boolean = false; @Input() unAuthorized: boolean = false;
...@@ -39,6 +40,9 @@ export class EcmCheckoutComponent implements OnInit { ...@@ -39,6 +40,9 @@ export class EcmCheckoutComponent implements OnInit {
@ViewChild( 'cardScreen' ) child: CardScreenComponent; @ViewChild( 'cardScreen' ) child: CardScreenComponent;
@ViewChild('addrAddScreen') addScreen: AddressScreenComponent; @ViewChild('addrAddScreen') addScreen: AddressScreenComponent;
@ViewChild('stepper') stepper: MatVerticalStepper; @ViewChild('stepper') stepper: MatVerticalStepper;
@ViewChild( 'ecmPanel' ) ecmPanel: EcmPanelComponent;
redirect : boolean = false;
cardList; cardList;
newCard: Card = new Card(); newCard: Card = new Card();
selectedPaymntOpt; selectedPaymntOpt;
...@@ -61,6 +65,8 @@ export class EcmCheckoutComponent implements OnInit { ...@@ -61,6 +65,8 @@ export class EcmCheckoutComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.store.dispatch(this.addressActions.loadAddress());
this.store.dispatch(this.cardActions.loadSavedCards());
window.scrollTo(0,0); window.scrollTo(0,0);
this.createUserData(); this.createUserData();
this.getCartItems(); this.getCartItems();
...@@ -84,12 +90,12 @@ export class EcmCheckoutComponent implements OnInit { ...@@ -84,12 +90,12 @@ export class EcmCheckoutComponent implements OnInit {
this.stepper.selectionChange.subscribe( this.stepper.selectionChange.subscribe(
selected => { selected => {
this.selectedStep = selected; this.selectedStep = selected;
console.log("selected step",selected);
} }
); );
this.loginFormGroup = this._formBuilder.group({ this.loginFormGroup = this._formBuilder.group({
username: ['', Validators.required], userData: ['', Validators.required]
password: ['', Validators.required]
}); });
this.addressFormGroup = this._formBuilder.group({ this.addressFormGroup = this._formBuilder.group({
address: ['', Validators.required] address: ['', Validators.required]
...@@ -220,7 +226,9 @@ export class EcmCheckoutComponent implements OnInit { ...@@ -220,7 +226,9 @@ export class EcmCheckoutComponent implements OnInit {
if ( userInfo !== 'undefined' && userInfo !== null && userInfo !== 'null' ) if ( userInfo !== 'undefined' && userInfo !== null && userInfo !== 'null' )
{ {
this.userData = JSON.parse( userInfo ); this.userData = JSON.parse( userInfo );
this.selectedStep = 1;
this.store.dispatch(this.addressActions.loadAddress());
this.store.dispatch(this.cardActions.loadSavedCards());
} }
else else
{ {
...@@ -229,26 +237,6 @@ export class EcmCheckoutComponent implements OnInit { ...@@ -229,26 +237,6 @@ export class EcmCheckoutComponent implements OnInit {
console.log( 'ECMHeaderComponent getUserInfo ::' + userInfo + ' \n this.userData :: ' + this.userData ); console.log( 'ECMHeaderComponent getUserInfo ::' + userInfo + ' \n this.userData :: ' + this.userData );
} }
step;
setStep(index: number) {
this.step = index;
}
resetStep(index: number){
if(this.step == index){
this.step = undefined;
}
}
checkStep(index: number){
if(index == this.step){
return true;
}else {
return false;
}
}
onAddNew(address: Address) onAddNew(address: Address)
{ {
let lineNo = this.getMaxLineNo(); let lineNo = this.getMaxLineNo();
...@@ -275,7 +263,53 @@ export class EcmCheckoutComponent implements OnInit { ...@@ -275,7 +263,53 @@ export class EcmCheckoutComponent implements OnInit {
console.log('maxLineno--',maxLineNo); console.log('maxLineno--',maxLineNo);
return maxLineNo + 1; return maxLineNo + 1;
} }
userAction() {
//show overlay with user-option
if ( this.userData )
{
this.ecmPanel.open({ type: 'overlay', option: 'USER_OPT', top:'0px', left: '0px', width:'100%', height: '100%' });
}
else
{
this.ecmPanel.open({ type: 'overlay', option: 'SIGNIN_OPT', top:'0px', left: '0px', width:'100%', height: '100%' });
}
if ( this.userData )
{
//show sidepanel with user-option
this.ecmPanel.open({ type: 'inplace', option: 'USER_OPT', top:'65px', left: '', right: '20px', width:'300px', height: '400px' });
}
else
{
//show overlay with sign-in-option
this.ecmPanel.open({ type: 'overlay', option: 'SIGNIN_OPT', top:'100px', left: 'calc( 50% - 375px / 2 )', width:'375px', height: '535px' });
}
}
ngDoCheck()
{
console.log("Checking ecm-checkout" ,this.redirect,this.userData ,this.stepper);
//already logged in
if( this.userData && !this.redirect)
{
console.log('stepper--',this.stepper._steps,this.stepper.selectedIndex);
if(this.stepper._steps && this.stepper.selectedIndex == 0)
{
this.stepper.next();
console.log('stepper-- ATFER SET',this.stepper , this.stepper.selectedIndex);
this.redirect = true;
}
}
//already not logged in
else if(!this.userData){
this.createUserData();
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment