Commit 613e15c2 authored by prumde's avatar prumde

Updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174145 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c427b60f
...@@ -41,12 +41,7 @@ export class EcmOutingComponent implements OnInit, EcmTemplateInterface { ...@@ -41,12 +41,7 @@ export class EcmOutingComponent implements OnInit, EcmTemplateInterface {
this.route.params.subscribe( params => { this.route.params.subscribe( params => {
this.itemCode = params['key']; this.itemCode = params['key'];
}); });
console.log("The items for outing " + this.itemDetail.itemDetailData.itemDetail2.actionPerformed);
this.actionPerformed = this.itemDetail.itemDetailData.itemDetail2.actionPerformed;
this.activityPerformed = this.itemDetail.itemDetailData.itemDetail2.activityPerformed;
this.transPortFacility = this.itemDetail.itemDetailData.itemDetail2.transportFacility;
this.thingsToCarry = this.itemDetail.itemDetailData.itemDetail2.thingsToCarry;
this.itemDetailpath =this.itemDetail.itemDetailData.itemDetail2
this.myCity = localStorage.getItem('mycity') this.myCity = localStorage.getItem('mycity')
} }
......
...@@ -36,11 +36,11 @@ export class EcmSigninComponent implements OnInit { ...@@ -36,11 +36,11 @@ export class EcmSigninComponent implements OnInit {
} }
register() { register() {
alert( "register" ); window.open("/ibase/E12Registration/jsp/Registration.jsp");
} }
forgot() { forgot() {
alert( "forgot" ); console.log( "Not Implemented Yet" );
} }
login() { login() {
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<!-- <span class="ecm-View" style="cursor: pointer;position: absolute;">ViewAll ( {{cartItemsDetail.length}} )</span> --> <!-- <span class="ecm-View" style="cursor: pointer;position: absolute;">ViewAll ( {{cartItemsDetail.length}} )</span> -->
</div> </div>
<!-- <button md-raised-button class="button medium-btn-checkout" style="background: mediumvioletred; color:#fff;" >Checkout</button> --> <!-- <button md-raised-button class="button medium-btn-checkout" style="background: mediumvioletred; color:#fff;" >Checkout</button> -->
<button md-button class="checkout-button" [routerLink]="['/check-out']">Checkout</button> <button md-button class="checkout-button" [routerLink]="['/checkout']">Checkout</button>
</div> </div>
</ng-template> </ng-template>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="row checkout-page"> <div class="row checkout-page">
<form #userForm="ngForm" (ngSubmit)="onSubmit()"> <form #userForm="ngForm" (ngSubmit)="onSubmit(userForm.value)">
<div class="medium-7 columns"> <div class="medium-7 columns">
<md-card> <md-card>
...@@ -14,14 +14,14 @@ ...@@ -14,14 +14,14 @@
<span class="form-group"> <span class="form-group">
<md-input-container class="userEmail"> <md-input-container class="userEmail">
<input type="email" mdInput placeholder="Email" class="form-control" required name="email" #emailRef="ngModel" [(ngModel)]="email"> <input type="email" mdInput placeholder="Email" class="form-control" required name="email" #emailRef="ngModel" [(ngModel)]="email">
<md-error *ngIf="emailRef.errors && emailRef.dirty" class="">Email required</md-error> <md-error *ngIf="emailRef.errors && emailRef.dirty">Email required</md-error>
</md-input-container></span> </md-input-container></span>
<span class="form-group"> <span class="form-group">
<md-input-container class="userInfo"> <md-input-container class="userInfo">
<input type="number" mdInput placeholder="Phone Number" id="phone" class="form-control" required minlength="10" maxlength="10" name="phone" #phoneRef="ngModel" [(ngModel)]="phone"> <input type="number" mdInput placeholder="Phone Number" id="phone" class="form-control" required minlength="10" maxlength="10" name="phone" #phoneRef="ngModel" [(ngModel)]="phone">
<md-error *ngIf="phoneRef.errors && phoneRef.dirty" class="">Phone Number required</md-error> <md-error *ngIf="phoneRef.errors && phoneRef.dirty">Phone Number required</md-error>
</md-input-container> </md-input-container>
</span> </span></table> </span> </span></table>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<span> <span>
<md-input-container class="userAdress"> <md-input-container class="userAdress">
<input required minlength="10" maxlength="100" mdInput placeholder="Address" [(ngModel)]="billAddress" #addressRef="ngModel" name="billAddress"> <input required minlength="10" maxlength="100" mdInput placeholder="Address" [(ngModel)]="billAddress" #addressRef="ngModel" name="billAddress">
<md-error *ngIf="addressRef.errors && addressRef.dirty" class="">Address required</md-error> <md-error *ngIf="addressRef.dirty && addressRef.errors">Address required</md-error>
</md-input-container></span> </md-input-container></span>
<span> <span>
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
<span class="cvv"> <span class="cvv">
<md-input-container class="cvv-input"> <md-input-container class="cvv-input">
<input required type="number" mdInput placeholder="cvv" #cvvRef="ngModel" [(ngModel)]="cvv" name="cvv"> <input required type="number" mdInput placeholder="cvv" #cvvRef="ngModel" [(ngModel)]="cvv" name="cvv">
<md-error *ngIf="cvvRef.errors && cvvRef.dirty" class="">Zip/Postalcode required</md-error> <md-error *ngIf="cvvRef.errors && cvvRef.dirty" class="">cvv required</md-error>
</md-input-container> </md-input-container>
</span> </span>
</div> </div>
...@@ -162,29 +162,20 @@ ...@@ -162,29 +162,20 @@
</div> </div>
<div class="medium-5 columns"> <div *ngIf="cartItemsDetail" class="medium-5 columns">
<md-card> <md-card>
<div class="orderSummary"> <div class="orderSummary">
<table> <table>
<tr> <tr>
<th class="order-summary-title">Order Summary</th> <th class="order-summary-title">Order Summary</th>
</tr> </tr>
<tr> <tr *ngFor="let item of cartItemsDetail">
<td class="item-name">Indigenous Handicrafts Incredible Applique Work Red Cotton Bed Cover</td> <td class="item-name">{{item.shDescr}}</td>
<td class="item-cost">₹ 500</td> <td class="item-cost">₹ {{item.costRate}}</td>
</tr>
<tr>
<td class="item-name">Indigenous Handicrafts Incredible Applique Work Red Cotton Bed Cover</td>
<td class="item-cost">₹ 500</td>
</tr> </tr>
<tr>
<td class="item-name">Tie & Dye Black Cotton Reversible Double AC Quilt or Quilted Bed Cover</td>
<td class="item-cost">₹ 500</td>
</tr>
<tr> <tr>
<td class="total">Total</td> <td class="total">Total</td>
<td class="total-price">1500</td> <td class="total-price">{{totalPrice}}</td>
</tr> </tr>
</table> </table>
......
import { Component, OnInit, ViewChild, ElementRef, Input, Output, EventEmitter } from '@angular/core'; import { Component, OnInit, ViewChild, ElementRef, Input, Output, EventEmitter } from '@angular/core';
import { FormBuilder, Validators,NgForm } from '@angular/forms'; import { FormBuilder, Validators,NgForm } from '@angular/forms';
import { EcmCartService } from '../ecm-cart/ecm-cart.service';
import { Item } from '../../ecm-model/product-model';
@Component( { @Component( {
selector: 'ecm-checkout', selector: 'ecm-checkout',
...@@ -11,33 +13,14 @@ export class EcmCheckoutComponent implements OnInit { ...@@ -11,33 +13,14 @@ export class EcmCheckoutComponent implements OnInit {
@ViewChild('userForm') currentForm: NgForm; @ViewChild('userForm') currentForm: NgForm;
userForm: NgForm; userForm: NgForm;
shippingCountry;
shippingAddress;
shippingCity;
shippingState;
shippingZipCode;
billingCountry;
billAddress;
billingCity;
billingState;
billingZipCode;
checked = false; checked = false;
selectedMonth; cartItemsDetail: Item[];
selectedYear; totalPrice:number = 0;
phone;
email;
cardHolder;
cardNumber;
cvv;
countries; countries;
months; months;
years; years;
constructor(private formBuilder: FormBuilder) { constructor(private formBuilder: FormBuilder, public cartService: EcmCartService) {
this.countries = [ this.countries = [
{ viewValue: 'India' }, { viewValue: 'India' },
{ viewValue: 'UAE' }, { viewValue: 'UAE' },
...@@ -69,10 +52,35 @@ export class EcmCheckoutComponent implements OnInit { ...@@ -69,10 +52,35 @@ export class EcmCheckoutComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.getCartItems();
} }
onSubmit() { onSubmit(data) {
alert("Form Submitted"); alert("Form Submitted");
console.log("User Email:[" +data.email +"]");
}
getCartItems() {
this.cartService.getCartItems().subscribe(
cartItemsDetail => {
this.cartItemsDetail = cartItemsDetail;
console.log( 'comp cartItemsDetail[' + JSON.stringify( cartItemsDetail ) + '] \n this.cartItemsDetail[' + this.cartItemsDetail.length + ']' );
if ( this.cartItemsDetail ) {
this.getTotalPrice();
console.log( "the total Price is" + this.totalPrice );
}
},
error => {
let errorMessage = <any>error;
console.log( 'comp errorMessage[' + errorMessage + ']' );
});
}
getTotalPrice() {
this.cartItemsDetail.forEach(( item, i ) => {
this.totalPrice = this.totalPrice + parseFloat( item.costRate );
console.log('Total Price Is'+item.costRate);
});
} }
} }
......
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