Commit af095a74 by amalk

Merge branch 'master' into amal

parents 01b00457 c556e615
......@@ -742,7 +742,7 @@ export class DashboardComponent implements OnInit {
}
scheduleNow(mechanic_id,cost){
this.wizardData['mechanic_id'] = mechanic_id;
this.wizardData['mechanic_id'] = mechanic_id+':'+cost;
if(!this.loginDetails){
this.routeToIndex();
......
......@@ -445,7 +445,7 @@ export class IndexComponent implements OnInit {
}
scheduleNow(mechanic_id,cost){
this.wizardData['mechanic_id'] = mechanic_id;
this.wizardData['mechanic_id'] = mechanic_id+':'+cost;
if(!this.loginDetails){
this.autoSchedule = true;
......
......@@ -42,12 +42,6 @@ export class AddaddressComponent implements OnInit {
}
ngOnInit() {
this.prdtData = JSON.parse(this.webService.getLocalStorageItem('productDetails'));
this.subjectService.getLoginData().subscribe(loginData => {
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
});
this.checkProductId(this.prdtData['product_id']);
this.route.params.subscribe(val => {
this.route.queryParams.subscribe(params => {
this.address_id = params['address_id'];
......@@ -56,6 +50,9 @@ export class AddaddressComponent implements OnInit {
if(this.address_id != ''){
this.getUserAddressById(this.address_id);
}
this.checkUserLogin();
this.checkProductId();
this.buildAddressForm();
}
......@@ -72,14 +69,34 @@ export class AddaddressComponent implements OnInit {
});
}
checkProductId(product_id){
if(product_id > 0){
this.product_id = product_id;
// checkProductId(product_id){
// if(product_id > 0){
// this.product_id = product_id;
// }else{
// this.goToPage('purchaseHome','');
// }
// }
checkProductId(){
this.prdtData = JSON.parse(this.webService.getLocalStorageItem('productDetails'));
if(this.prdtData && this.prdtData['product_id'] > 0){
this.product_id = this.prdtData['product_id'];
}else{
this.goToPage('purchaseHome','');
}
}
checkUserLogin(){
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
if(!this.loginDetails){
this.goToPage('purchaseHome','');
}
this.subjectService.getLoginData().subscribe(loginData => {
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
});
}
addressFormSubmit(data){
if(this.addaddressForm.invalid){
return false;
......
......@@ -25,7 +25,7 @@
</ng-template>
<div class="row">
<div class="col-md-6">
<h2>$ {{prdtData.total_amount}}</h2>
<h2 *ngIf="prdtData">$ {{prdtData.total_amount}}</h2>
<!-- <h5>Delivery expected by Thur 1 May 2019</h5> -->
</div>
......
......@@ -42,7 +42,7 @@ export class AddressComponent implements OnInit {
checkProductId(){
this.prdtData = JSON.parse(this.webService.getLocalStorageItem('productDetails'));
console.log(this.prdtData)
if(this.prdtData && this.prdtData['product_id'] > 0){
this.product_id = this.prdtData['product_id'];
}else{
......
......@@ -2,107 +2,39 @@
<div class="container-fluid">
<app-searchbar>
</app-searchbar>
<div class="loader_overlay" *ngIf="loader"></div>
<div class="myorder_wrapper">
<ul>
<li>
<ul *ngIf="cartData;else noCart" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false" style="max-height: 700px; overflow: scroll">
<li *ngFor="let cart of cartData">
<div class="row">
<div class="col-md-6">
<div class="auto_part_container">
<img src="/assets/images/asset_product.png">
<img src="{{imageServer + cart.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div>
<div class="auto_part_detail">
<h2>Apollo Amazer 4G Tubeless 4 Wheeler</h2>
<h3>Audi Q7</h3>
<h2>{{cart.product_name}}</h2>
<h3>{{cart.short_description}}</h3>
<div class="others">
<h4><div>Color</div><span>Black</span></h4>
<h4><div>Quantity</div><span>1</span></h4>
<h4><div>Brand</div><span>{{cart.brand_name}}</span></h4>
<!-- <h4><div>Quantity</div><span>1</span></h4> -->
</div>
<h4>Quantity</h4>
<div class="counter_wrapper">
<div class="count_btn" (click)="minus()">-</div>
<div class="counter_value">{{this.count}}</div>
<div class="count_btn" (click)="add()">+</div>
<div class="count_btn" (click)="minus(cart.cart_id)">-</div>
<!-- <div class="counter_value">{{this.count}}</div> -->
<div class="counter_value">{{cartQuantity[cart.cart_id]['quantity']}}</div>
<div class="count_btn" (click)="add(cart.cart_id)">+</div>
</div>
</div>
<div class="clear"></div>
</div>
<div class="col-md-6">
<div class="price_details">
<div class="remove">Remove</div>
<h5>$ 3,200</h5>
<h4>Delivery expected by Thu, Apr 25th 2019<br>
</h4><br>
<button class="purchase_btn">Purchase</button>
<div class="clear"></div>
</div>
</div>
</div>
</li>
<li>
<div class="row">
<div class="col-md-6">
<div class="auto_part_container">
<img src="/assets/images/asset_product.png">
</div>
<div class="auto_part_detail">
<h2>Apollo Amazer 4G Tubeless 4 Wheeler</h2>
<h3>Audi Q7</h3>
<div class="others">
<h4><div>Color</div><span>Black</span></h4>
<h4><div>Quantity</div><span>1</span></h4>
</div>
<h4>Quantity</h4>
<div class="counter_wrapper">
<div class="count_btn" (click)="minus()">-</div>
<div class="counter_value">{{this.count}}</div>
<div class="count_btn" (click)="add()">+</div>
</div>
</div>
<div class="clear"></div>
</div>
<div class="col-md-6">
<div class="price_details">
<div class="remove">Remove</div>
<h5>$ 3,200</h5>
<h4>Delivery expected by Thu, Apr 25th 2019<br>
</h4><br>
<button class="purchase_btn">Purchase</button>
<div class="clear"></div>
</div>
</div>
</div>
</li>
<li>
<div class="row">
<div class="col-md-6">
<div class="auto_part_container">
<img src="/assets/images/asset_product.png">
</div>
<div class="auto_part_detail">
<h2>Apollo Amazer 4G Tubeless 4 Wheeler</h2>
<h3>Audi Q7</h3>
<div class="others">
<h4><div>Color</div><span>Black</span></h4>
<h4><div>Quantity</div><span>1</span></h4>
</div>
<h4>Quantity</h4>
<div class="counter_wrapper">
<div class="count_btn" (click)="minus()">-</div>
<div class="counter_value">{{this.count}}</div>
<div class="count_btn" (click)="add()">+</div>
</div>
</div>
<div class="clear"></div>
</div>
<div class="col-md-6">
<div class="price_details">
<div class="remove">Remove</div>
<h5>$ 3,200</h5>
<h4>Delivery expected by Thu, Apr 25th 2019<br>
</h4><br>
<button class="purchase_btn">Purchase</button>
<div class="remove" (click)="cnfRemoveProduct(cart.cart_id)">Remove</div>
<h5>$ {{cartQuantity[cart.cart_id]['total_amount']}}</h5>
<!-- <h4>Delivery expected by Thu, Apr 25th 2019<br>
</h4> --><br>
<button class="purchase_btn" (click)="buyProduct(cart.product_id,cartQuantity[cart.cart_id]['total_amount'],cart.cart_id,cartQuantity[cart.cart_id]['quantity'],cart.amount)">Purchase</button>
<div class="clear"></div>
</div>
......@@ -110,405 +42,69 @@
</div>
</li>
</ul>
<ng-template #noCart>
No Data Found
</ng-template>
</div>
</div>
<div class="bottom_product_list">
<h4>Audi Q7 <span>( Similar Results )</span></h4>
<ngx-carousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()">
<ngx-tile NgxCarouselItem>
<li (click)="goToPage('productdetails')">
<div class="loader_overlay" *ngIf="trend_loader"></div>
<h4>Trending Products</h4>
<ngx-carousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()" *ngIf="trendingProductData">
<ngx-tile NgxCarouselItem *ngFor="let prdt of trendingProductData">
<li (click)="latestPrdtDtls(prdt.product_id)">
<div class="inner_div_product">
<div class="product_wrapper">
<img src="/assets/images/asset_product.png">
<img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div>
<h5>JK Victory Wheelers type</h5>
<p>265/65 R17, Tubeless</p>
<div class="star_ratting">
<h5>{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p>
<div class="star_ratting prevent-click">
<fieldset class="rating">
<input type="radio" id="star5" name="rating" value="5" /><label class = "full" for="star5" title="Awesome - 5 stars"></label>
<input type="radio" id="star4half" name="rating" value="4 and a half" /><label class="half" for="star4half" title="Pretty good - 4.5 stars"></label>
<input type="radio" id="star4" name="rating" value="4" /><label class = "full" for="star4" title="Pretty good - 4 stars"></label>
<input type="radio" id="star3half" name="rating" value="3 and a half" /><label class="half" for="star3half" title="Meh - 3.5 stars"></label>
<input type="radio" id="star3" name="rating" value="3" /><label class = "full" for="star3" title="Meh - 3 stars"></label>
<input type="radio" id="star2half" name="rating" value="2 and a half" /><label class="half" for="star2half" title="Kinda bad - 2.5 stars"></label>
<input type="radio" id="star2" name="rating" value="2" /><label class = "full" for="star2" title="Kinda bad - 2 stars"></label>
<input type="radio" id="star1half" name="rating" value="1 and a half" /><label class="half" for="star1half" title="Meh - 1.5 stars"></label>
<input type="radio" id="star1" name="rating" value="1" /><label class = "full" for="star1" title="Sucks big time - 1 star"></label>
<input type="radio" id="starhalf" name="rating" value="half" /><label class="half" for="starhalf" title="Sucks big time - 0.5 stars"></label>
<input type="radio" [checked]="(prdt.rating >= 4.75) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_5'" [attr.name]="'thirdStarName_'+prdt.product_id" value="5" /><label class = "full" for="thirdStar5"></label>
<input type="radio" [checked]="(prdt.rating >= 4.25 && prdt.rating < 4.75) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_4half'" [attr.name]="'thirdStarName_'+prdt.product_id" value="4.5" /><label class="half" for="thirdStar4half"></label>
<input type="radio" [checked]="(prdt.rating >= 3.75 && prdt.rating < 4.25) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_4'" [attr.name]="'thirdStarName_'+prdt.product_id" value="4" /><label class = "full" for="thirdStar4"></label>
<input type="radio" [checked]="(prdt.rating >= 3.25 && prdt.rating < 3.75) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_3half'" [attr.name]="'thirdStarName_'+prdt.product_id" value="3.5" /><label class="half" for="thirdStar3half"></label>
<input type="radio" [checked]="(prdt.rating >= 2.75 && prdt.rating < 3.25) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_3'" [attr.name]="'thirdStarName_'+prdt.product_id" value="3" /><label class = "full" for="thirdStar3"></label>
<input type="radio" [checked]="(prdt.rating >= 2.25 && prdt.rating < 2.75) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_2half'" [attr.name]="'thirdStarName_'+prdt.product_id" value="2.5" /><label class="half" for="thirdStar2half"></label>
<input type="radio" [checked]="(prdt.rating >= 1.75 && prdt.rating < 2.25) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_2'" [attr.name]="'thirdStarName_'+prdt.product_id" value="2" /><label class = "full" for="thirdStar2"></label>
<input type="radio" [checked]="(prdt.rating >= 1.25 && prdt.rating < 1.75) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_1half'" [attr.name]="'thirdStarName_'+prdt.product_id" value="1.5" /><label class="half" for="thirdStar1half"></label>
<input type="radio" [checked]="(prdt.rating >= 0.75 && prdt.rating < 1.25) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_1'" [attr.name]="'thirdStarName_'+prdt.product_id" value="1" /><label class = "full" for="thirdStar1"></label>
<input type="radio" [checked]="(prdt.rating < 0.75 && prdt.rating >= 0.25) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_half'" [attr.name]="'thirdStarName_'+prdt.product_id" value="0.5" /><label class="half" for="thirdStarhalf"></label>
</fieldset>
<span class="floatRight">$320</span>
<span class="floatRight">$ {{prdt.amount}}</span>
<div class="clear"></div>
<p>21 Reviews</p>
<p>{{(prdt.reviews > 0)?prdt.reviews+' Reviews':'Be the first one to review.'}}</p>
</div>
</div>
</li>
</ngx-tile>
<ngx-tile NgxCarouselItem>
<li (click)="goToPage('productdetails')">
<div class="inner_div_product">
<div class="product_wrapper">
<img src="/assets/images/asset_product.png">
</div>
<h5>JK Victory Wheelers type</h5>
<p>265/65 R17, Tubeless</p>
<div class="star_ratting">
<fieldset class="rating">
<input type="radio" id="star5" name="rating" value="5" /><label class = "full" for="star5" title="Awesome - 5 stars"></label>
<input type="radio" id="star4half" name="rating" value="4 and a half" /><label class="half" for="star4half" title="Pretty good - 4.5 stars"></label>
<input type="radio" id="star4" name="rating" value="4" /><label class = "full" for="star4" title="Pretty good - 4 stars"></label>
<input type="radio" id="star3half" name="rating" value="3 and a half" /><label class="half" for="star3half" title="Meh - 3.5 stars"></label>
<input type="radio" id="star3" name="rating" value="3" /><label class = "full" for="star3" title="Meh - 3 stars"></label>
<input type="radio" id="star2half" name="rating" value="2 and a half" /><label class="half" for="star2half" title="Kinda bad - 2.5 stars"></label>
<input type="radio" id="star2" name="rating" value="2" /><label class = "full" for="star2" title="Kinda bad - 2 stars"></label>
<input type="radio" id="star1half" name="rating" value="1 and a half" /><label class="half" for="star1half" title="Meh - 1.5 stars"></label>
<input type="radio" id="star1" name="rating" value="1" /><label class = "full" for="star1" title="Sucks big time - 1 star"></label>
<input type="radio" id="starhalf" name="rating" value="half" /><label class="half" for="starhalf" title="Sucks big time - 0.5 stars"></label>
</fieldset>
<span class="floatRight">$320</span>
<div class="clear"></div>
<p>21 Reviews</p>
</div>
</div>
</li>
</ngx-tile>
<ngx-tile NgxCarouselItem>
<li (click)="goToPage('productdetails')">
<div class="inner_div_product">
<div class="product_wrapper">
<img src="/assets/images/asset_product.png">
</div>
<h5>JK Victory Wheelers type</h5>
<p>265/65 R17, Tubeless</p>
<div class="star_ratting">
<fieldset class="rating">
<input type="radio" id="star5" name="rating" value="5" /><label class = "full" for="star5" title="Awesome - 5 stars"></label>
<input type="radio" id="star4half" name="rating" value="4 and a half" /><label class="half" for="star4half" title="Pretty good - 4.5 stars"></label>
<input type="radio" id="star4" name="rating" value="4" /><label class = "full" for="star4" title="Pretty good - 4 stars"></label>
<input type="radio" id="star3half" name="rating" value="3 and a half" /><label class="half" for="star3half" title="Meh - 3.5 stars"></label>
<input type="radio" id="star3" name="rating" value="3" /><label class = "full" for="star3" title="Meh - 3 stars"></label>
<input type="radio" id="star2half" name="rating" value="2 and a half" /><label class="half" for="star2half" title="Kinda bad - 2.5 stars"></label>
<input type="radio" id="star2" name="rating" value="2" /><label class = "full" for="star2" title="Kinda bad - 2 stars"></label>
<input type="radio" id="star1half" name="rating" value="1 and a half" /><label class="half" for="star1half" title="Meh - 1.5 stars"></label>
<input type="radio" id="star1" name="rating" value="1" /><label class = "full" for="star1" title="Sucks big time - 1 star"></label>
<input type="radio" id="starhalf" name="rating" value="half" /><label class="half" for="starhalf" title="Sucks big time - 0.5 stars"></label>
</fieldset>
<span class="floatRight">$320</span>
<div class="clear"></div>
<p>21 Reviews</p>
</div>
</div>
</li>
</ngx-tile>
<ngx-tile NgxCarouselItem>
<li (click)="goToPage('productdetails')">
<div class="inner_div_product">
<div class="product_wrapper">
<img src="/assets/images/asset_product.png">
</div>
<h5>JK Victory Wheelers type</h5>
<p>265/65 R17, Tubeless</p>
<div class="star_ratting">
<fieldset class="rating">
<input type="radio" id="star5" name="rating" value="5" /><label class = "full" for="star5" title="Awesome - 5 stars"></label>
<input type="radio" id="star4half" name="rating" value="4 and a half" /><label class="half" for="star4half" title="Pretty good - 4.5 stars"></label>
<input type="radio" id="star4" name="rating" value="4" /><label class = "full" for="star4" title="Pretty good - 4 stars"></label>
<input type="radio" id="star3half" name="rating" value="3 and a half" /><label class="half" for="star3half" title="Meh - 3.5 stars"></label>
<input type="radio" id="star3" name="rating" value="3" /><label class = "full" for="star3" title="Meh - 3 stars"></label>
<input type="radio" id="star2half" name="rating" value="2 and a half" /><label class="half" for="star2half" title="Kinda bad - 2.5 stars"></label>
<input type="radio" id="star2" name="rating" value="2" /><label class = "full" for="star2" title="Kinda bad - 2 stars"></label>
<input type="radio" id="star1half" name="rating" value="1 and a half" /><label class="half" for="star1half" title="Meh - 1.5 stars"></label>
<input type="radio" id="star1" name="rating" value="1" /><label class = "full" for="star1" title="Sucks big time - 1 star"></label>
<input type="radio" id="starhalf" name="rating" value="half" /><label class="half" for="starhalf" title="Sucks big time - 0.5 stars"></label>
</fieldset>
<span class="floatRight">$320</span>
<div class="clear"></div>
<p>21 Reviews</p>
</div>
</div>
</li>
</ngx-tile>
<ngx-tile NgxCarouselItem>
<li (click)="goToPage('productdetails')">
<div class="inner_div_product">
<div class="product_wrapper">
<img src="/assets/images/asset_product.png">
</div>
<h5>JK Victory Wheelers type</h5>
<p>265/65 R17, Tubeless</p>
<div class="star_ratting">
<fieldset class="rating">
<input type="radio" id="star5" name="rating" value="5" /><label class = "full" for="star5" title="Awesome - 5 stars"></label>
<input type="radio" id="star4half" name="rating" value="4 and a half" /><label class="half" for="star4half" title="Pretty good - 4.5 stars"></label>
<input type="radio" id="star4" name="rating" value="4" /><label class = "full" for="star4" title="Pretty good - 4 stars"></label>
<input type="radio" id="star3half" name="rating" value="3 and a half" /><label class="half" for="star3half" title="Meh - 3.5 stars"></label>
<input type="radio" id="star3" name="rating" value="3" /><label class = "full" for="star3" title="Meh - 3 stars"></label>
<input type="radio" id="star2half" name="rating" value="2 and a half" /><label class="half" for="star2half" title="Kinda bad - 2.5 stars"></label>
<input type="radio" id="star2" name="rating" value="2" /><label class = "full" for="star2" title="Kinda bad - 2 stars"></label>
<input type="radio" id="star1half" name="rating" value="1 and a half" /><label class="half" for="star1half" title="Meh - 1.5 stars"></label>
<input type="radio" id="star1" name="rating" value="1" /><label class = "full" for="star1" title="Sucks big time - 1 star"></label>
<input type="radio" id="starhalf" name="rating" value="half" /><label class="half" for="starhalf" title="Sucks big time - 0.5 stars"></label>
</fieldset>
<span class="floatRight">$320</span>
<div class="clear"></div>
<p>21 Reviews</p>
</div>
</div>
</li>
</ngx-tile>
<ngx-tile NgxCarouselItem>
<li (click)="goToPage('productdetails')">
<div class="inner_div_product">
<div class="product_wrapper">
<img src="/assets/images/asset_product.png">
</div>
<h5>JK Victory Wheelers type</h5>
<p>265/65 R17, Tubeless</p>
<div class="star_ratting">
<fieldset class="rating">
<input type="radio" id="star5" name="rating" value="5" /><label class = "full" for="star5" title="Awesome - 5 stars"></label>
<input type="radio" id="star4half" name="rating" value="4 and a half" /><label class="half" for="star4half" title="Pretty good - 4.5 stars"></label>
<input type="radio" id="star4" name="rating" value="4" /><label class = "full" for="star4" title="Pretty good - 4 stars"></label>
<input type="radio" id="star3half" name="rating" value="3 and a half" /><label class="half" for="star3half" title="Meh - 3.5 stars"></label>
<input type="radio" id="star3" name="rating" value="3" /><label class = "full" for="star3" title="Meh - 3 stars"></label>
<input type="radio" id="star2half" name="rating" value="2 and a half" /><label class="half" for="star2half" title="Kinda bad - 2.5 stars"></label>
<input type="radio" id="star2" name="rating" value="2" /><label class = "full" for="star2" title="Kinda bad - 2 stars"></label>
<input type="radio" id="star1half" name="rating" value="1 and a half" /><label class="half" for="star1half" title="Meh - 1.5 stars"></label>
<input type="radio" id="star1" name="rating" value="1" /><label class = "full" for="star1" title="Sucks big time - 1 star"></label>
<input type="radio" id="starhalf" name="rating" value="half" /><label class="half" for="starhalf" title="Sucks big time - 0.5 stars"></label>
</fieldset>
<span class="floatRight">$320</span>
<div class="clear"></div>
<p>21 Reviews</p>
</div>
</div>
</li>
</ngx-tile>
<ngx-tile NgxCarouselItem>
<li (click)="goToPage('productdetails')">
<div class="inner_div_product">
<div class="product_wrapper">
<img src="/assets/images/asset_product.png">
</div>
<h5>JK Victory Wheelers type</h5>
<p>265/65 R17, Tubeless</p>
<div class="star_ratting">
<fieldset class="rating">
<input type="radio" id="star5" name="rating" value="5" /><label class = "full" for="star5" title="Awesome - 5 stars"></label>
<input type="radio" id="star4half" name="rating" value="4 and a half" /><label class="half" for="star4half" title="Pretty good - 4.5 stars"></label>
<input type="radio" id="star4" name="rating" value="4" /><label class = "full" for="star4" title="Pretty good - 4 stars"></label>
<input type="radio" id="star3half" name="rating" value="3 and a half" /><label class="half" for="star3half" title="Meh - 3.5 stars"></label>
<input type="radio" id="star3" name="rating" value="3" /><label class = "full" for="star3" title="Meh - 3 stars"></label>
<input type="radio" id="star2half" name="rating" value="2 and a half" /><label class="half" for="star2half" title="Kinda bad - 2.5 stars"></label>
<input type="radio" id="star2" name="rating" value="2" /><label class = "full" for="star2" title="Kinda bad - 2 stars"></label>
<input type="radio" id="star1half" name="rating" value="1 and a half" /><label class="half" for="star1half" title="Meh - 1.5 stars"></label>
<input type="radio" id="star1" name="rating" value="1" /><label class = "full" for="star1" title="Sucks big time - 1 star"></label>
<input type="radio" id="starhalf" name="rating" value="half" /><label class="half" for="starhalf" title="Sucks big time - 0.5 stars"></label>
</fieldset>
<span class="floatRight">$320</span>
<div class="clear"></div>
<p>21 Reviews</p>
</div>
</div>
</li>
</ngx-tile>
<ngx-tile NgxCarouselItem>
<li (click)="goToPage('productdetails')">
<div class="inner_div_product">
<div class="product_wrapper">
<img src="/assets/images/asset_product.png">
</div>
<h5>JK Victory Wheelers type</h5>
<p>265/65 R17, Tubeless</p>
<div class="star_ratting">
<fieldset class="rating">
<input type="radio" id="star5" name="rating" value="5" /><label class = "full" for="star5" title="Awesome - 5 stars"></label>
<input type="radio" id="star4half" name="rating" value="4 and a half" /><label class="half" for="star4half" title="Pretty good - 4.5 stars"></label>
<input type="radio" id="star4" name="rating" value="4" /><label class = "full" for="star4" title="Pretty good - 4 stars"></label>
<input type="radio" id="star3half" name="rating" value="3 and a half" /><label class="half" for="star3half" title="Meh - 3.5 stars"></label>
<input type="radio" id="star3" name="rating" value="3" /><label class = "full" for="star3" title="Meh - 3 stars"></label>
<input type="radio" id="star2half" name="rating" value="2 and a half" /><label class="half" for="star2half" title="Kinda bad - 2.5 stars"></label>
<input type="radio" id="star2" name="rating" value="2" /><label class = "full" for="star2" title="Kinda bad - 2 stars"></label>
<input type="radio" id="star1half" name="rating" value="1 and a half" /><label class="half" for="star1half" title="Meh - 1.5 stars"></label>
<input type="radio" id="star1" name="rating" value="1" /><label class = "full" for="star1" title="Sucks big time - 1 star"></label>
<input type="radio" id="starhalf" name="rating" value="half" /><label class="half" for="starhalf" title="Sucks big time - 0.5 stars"></label>
</fieldset>
<span class="floatRight">$320</span>
<div class="clear"></div>
<p>21 Reviews</p>
</div>
</div>
</li>
</ngx-tile>
<ngx-tile NgxCarouselItem>
<li (click)="goToPage('productdetails')">
<div class="inner_div_product">
<div class="product_wrapper">
<img src="/assets/images/asset_product.png">
</div>
<h5>JK Victory Wheelers type</h5>
<p>265/65 R17, Tubeless</p>
<div class="star_ratting">
<fieldset class="rating">
<input type="radio" id="star5" name="rating" value="5" /><label class = "full" for="star5" title="Awesome - 5 stars"></label>
<input type="radio" id="star4half" name="rating" value="4 and a half" /><label class="half" for="star4half" title="Pretty good - 4.5 stars"></label>
<input type="radio" id="star4" name="rating" value="4" /><label class = "full" for="star4" title="Pretty good - 4 stars"></label>
<input type="radio" id="star3half" name="rating" value="3 and a half" /><label class="half" for="star3half" title="Meh - 3.5 stars"></label>
<input type="radio" id="star3" name="rating" value="3" /><label class = "full" for="star3" title="Meh - 3 stars"></label>
<input type="radio" id="star2half" name="rating" value="2 and a half" /><label class="half" for="star2half" title="Kinda bad - 2.5 stars"></label>
<input type="radio" id="star2" name="rating" value="2" /><label class = "full" for="star2" title="Kinda bad - 2 stars"></label>
<input type="radio" id="star1half" name="rating" value="1 and a half" /><label class="half" for="star1half" title="Meh - 1.5 stars"></label>
<input type="radio" id="star1" name="rating" value="1" /><label class = "full" for="star1" title="Sucks big time - 1 star"></label>
<input type="radio" id="starhalf" name="rating" value="half" /><label class="half" for="starhalf" title="Sucks big time - 0.5 stars"></label>
</fieldset>
<span class="floatRight">$320</span>
<div class="clear"></div>
<p>21 Reviews</p>
</div>
</div>
</li>
</ngx-tile>
<ngx-tile NgxCarouselItem>
<li (click)="goToPage('productdetails')">
<div class="inner_div_product">
<div class="product_wrapper">
<img src="/assets/images/asset_product.png">
</div>
<h5>JK Victory Wheelers type</h5>
<p>265/65 R17, Tubeless</p>
<div class="star_ratting">
<fieldset class="rating">
<input type="radio" id="star5" name="rating" value="5" /><label class = "full" for="star5" title="Awesome - 5 stars"></label>
<input type="radio" id="star4half" name="rating" value="4 and a half" /><label class="half" for="star4half" title="Pretty good - 4.5 stars"></label>
<input type="radio" id="star4" name="rating" value="4" /><label class = "full" for="star4" title="Pretty good - 4 stars"></label>
<input type="radio" id="star3half" name="rating" value="3 and a half" /><label class="half" for="star3half" title="Meh - 3.5 stars"></label>
<input type="radio" id="star3" name="rating" value="3" /><label class = "full" for="star3" title="Meh - 3 stars"></label>
<input type="radio" id="star2half" name="rating" value="2 and a half" /><label class="half" for="star2half" title="Kinda bad - 2.5 stars"></label>
<input type="radio" id="star2" name="rating" value="2" /><label class = "full" for="star2" title="Kinda bad - 2 stars"></label>
<input type="radio" id="star1half" name="rating" value="1 and a half" /><label class="half" for="star1half" title="Meh - 1.5 stars"></label>
<input type="radio" id="star1" name="rating" value="1" /><label class = "full" for="star1" title="Sucks big time - 1 star"></label>
<input type="radio" id="starhalf" name="rating" value="half" /><label class="half" for="starhalf" title="Sucks big time - 0.5 stars"></label>
</fieldset>
<span class="floatRight">$320</span>
<div class="clear"></div>
<p>21 Reviews</p>
</div>
</div>
</li>
</ngx-tile>
<ngx-tile NgxCarouselItem>
<li (click)="goToPage('productdetails')">
<div class="inner_div_product">
<div class="product_wrapper">
<img src="/assets/images/asset_product.png">
</div>
<h5>JK Victory Wheelers type</h5>
<p>265/65 R17, Tubeless</p>
<div class="star_ratting">
<fieldset class="rating">
<input type="radio" id="star5" name="rating" value="5" /><label class = "full" for="star5" title="Awesome - 5 stars"></label>
<input type="radio" id="star4half" name="rating" value="4 and a half" /><label class="half" for="star4half" title="Pretty good - 4.5 stars"></label>
<input type="radio" id="star4" name="rating" value="4" /><label class = "full" for="star4" title="Pretty good - 4 stars"></label>
<input type="radio" id="star3half" name="rating" value="3 and a half" /><label class="half" for="star3half" title="Meh - 3.5 stars"></label>
<input type="radio" id="star3" name="rating" value="3" /><label class = "full" for="star3" title="Meh - 3 stars"></label>
<input type="radio" id="star2half" name="rating" value="2 and a half" /><label class="half" for="star2half" title="Kinda bad - 2.5 stars"></label>
<input type="radio" id="star2" name="rating" value="2" /><label class = "full" for="star2" title="Kinda bad - 2 stars"></label>
<input type="radio" id="star1half" name="rating" value="1 and a half" /><label class="half" for="star1half" title="Meh - 1.5 stars"></label>
<input type="radio" id="star1" name="rating" value="1" /><label class = "full" for="star1" title="Sucks big time - 1 star"></label>
<input type="radio" id="starhalf" name="rating" value="half" /><label class="half" for="starhalf" title="Sucks big time - 0.5 stars"></label>
</fieldset>
<span class="floatRight">$320</span>
<div class="clear"></div>
<p>21 Reviews</p>
</div>
</div>
</li>
</ngx-tile>
<ngx-tile NgxCarouselItem>
<li (click)="goToPage('productdetails')">
<div class="inner_div_product">
<div class="product_wrapper">
<img src="/assets/images/asset_product.png">
</div>
<h5>JK Victory Wheelers type</h5>
<p>265/65 R17, Tubeless</p>
<div class="star_ratting">
<fieldset class="rating">
<input type="radio" id="star5" name="rating" value="5" /><label class = "full" for="star5" title="Awesome - 5 stars"></label>
<input type="radio" id="star4half" name="rating" value="4 and a half" /><label class="half" for="star4half" title="Pretty good - 4.5 stars"></label>
<input type="radio" id="star4" name="rating" value="4" /><label class = "full" for="star4" title="Pretty good - 4 stars"></label>
<input type="radio" id="star3half" name="rating" value="3 and a half" /><label class="half" for="star3half" title="Meh - 3.5 stars"></label>
<input type="radio" id="star3" name="rating" value="3" /><label class = "full" for="star3" title="Meh - 3 stars"></label>
<input type="radio" id="star2half" name="rating" value="2 and a half" /><label class="half" for="star2half" title="Kinda bad - 2.5 stars"></label>
<input type="radio" id="star2" name="rating" value="2" /><label class = "full" for="star2" title="Kinda bad - 2 stars"></label>
<input type="radio" id="star1half" name="rating" value="1 and a half" /><label class="half" for="star1half" title="Meh - 1.5 stars"></label>
<input type="radio" id="star1" name="rating" value="1" /><label class = "full" for="star1" title="Sucks big time - 1 star"></label>
<input type="radio" id="starhalf" name="rating" value="half" /><label class="half" for="starhalf" title="Sucks big time - 0.5 stars"></label>
</fieldset>
<span class="floatRight">$320</span>
<div class="clear"></div>
<p>21 Reviews</p>
</div>
<button NgxCarouselPrev class='leftRs'>&lt;</button>
<button NgxCarouselNext class='rightRs'>&gt;</button>
</ngx-carousel>
</div>
</li>
</ngx-tile>
<ngx-tile NgxCarouselItem>
<li (click)="goToPage('productdetails')">
<div class="inner_div_product">
<div class="product_wrapper">
<img src="/assets/images/asset_product.png">
</div>
<!-- Confirm Modal PopUp-->
<button #confirmModal class="hide" data-toggle="modal" data-target="#confirm">Add Vehicle</button>
<div class="modal" id="confirm" >
<div class="modal-dialog modal-full">
<div class="modal-content background_transparent">
<div class="modal-body quote_modal">
<div class="confirm_modal_content">
<div class="login_modal_inner">
<div class="login_success">
<h4>Do You Want to Confirm ?</h4>
</div>
<h5>JK Victory Wheelers type</h5>
<p>265/65 R17, Tubeless</p>
<div class="star_ratting">
<fieldset class="rating">
<input type="radio" id="star5" name="rating" value="5" /><label class = "full" for="star5" title="Awesome - 5 stars"></label>
<input type="radio" id="star4half" name="rating" value="4 and a half" /><label class="half" for="star4half" title="Pretty good - 4.5 stars"></label>
<input type="radio" id="star4" name="rating" value="4" /><label class = "full" for="star4" title="Pretty good - 4 stars"></label>
<input type="radio" id="star3half" name="rating" value="3 and a half" /><label class="half" for="star3half" title="Meh - 3.5 stars"></label>
<input type="radio" id="star3" name="rating" value="3" /><label class = "full" for="star3" title="Meh - 3 stars"></label>
<input type="radio" id="star2half" name="rating" value="2 and a half" /><label class="half" for="star2half" title="Kinda bad - 2.5 stars"></label>
<input type="radio" id="star2" name="rating" value="2" /><label class = "full" for="star2" title="Kinda bad - 2 stars"></label>
<input type="radio" id="star1half" name="rating" value="1 and a half" /><label class="half" for="star1half" title="Meh - 1.5 stars"></label>
<input type="radio" id="star1" name="rating" value="1" /><label class = "full" for="star1" title="Sucks big time - 1 star"></label>
<input type="radio" id="starhalf" name="rating" value="half" /><label class="half" for="starhalf" title="Sucks big time - 0.5 stars"></label>
</fieldset>
<span class="floatRight">$320</span>
<div class="clear"></div>
<p>21 Reviews</p>
<div class="row">
<div class="col-md-12 textCenter">
<button class="btn btn-success" data-dismiss="modal" (click)="confirmCallBack(confirmCallBak,confirmParam)">Yes</button>
<button class="btn btn-danger" data-dismiss="modal">No</button>
</div>
</div>
</li>
</ngx-tile>
<ngx-tile NgxCarouselItem>
<li (click)="goToPage('productdetails')">
<div class="inner_div_product">
<div class="product_wrapper">
<img src="/assets/images/asset_product.png">
</div>
<h5>JK Victory Wheelers type</h5>
<p>265/65 R17, Tubeless</p>
<div class="star_ratting">
<fieldset class="rating">
<input type="radio" id="star5" name="rating" value="5" /><label class = "full" for="star5" title="Awesome - 5 stars"></label>
<input type="radio" id="star4half" name="rating" value="4 and a half" /><label class="half" for="star4half" title="Pretty good - 4.5 stars"></label>
<input type="radio" id="star4" name="rating" value="4" /><label class = "full" for="star4" title="Pretty good - 4 stars"></label>
<input type="radio" id="star3half" name="rating" value="3 and a half" /><label class="half" for="star3half" title="Meh - 3.5 stars"></label>
<input type="radio" id="star3" name="rating" value="3" /><label class = "full" for="star3" title="Meh - 3 stars"></label>
<input type="radio" id="star2half" name="rating" value="2 and a half" /><label class="half" for="star2half" title="Kinda bad - 2.5 stars"></label>
<input type="radio" id="star2" name="rating" value="2" /><label class = "full" for="star2" title="Kinda bad - 2 stars"></label>
<input type="radio" id="star1half" name="rating" value="1 and a half" /><label class="half" for="star1half" title="Meh - 1.5 stars"></label>
<input type="radio" id="star1" name="rating" value="1" /><label class = "full" for="star1" title="Sucks big time - 1 star"></label>
<input type="radio" id="starhalf" name="rating" value="half" /><label class="half" for="starhalf" title="Sucks big time - 0.5 stars"></label>
</fieldset>
<span class="floatRight">$320</span>
<div class="clear"></div>
<p>21 Reviews</p>
</div>
</div>
</li>
</ngx-tile>
<button NgxCarouselPrev class='leftRs'>&lt;</button>
<button NgxCarouselNext class='rightRs'>&gt;</button>
</ngx-carousel>
</div>
</div>
</div>
\ No newline at end of file
......@@ -3,6 +3,9 @@
width:100%;
ul{
padding:0px;
&::-webkit-scrollbar {
display: none;
}
li{
list-style: none;
background: #fff;
......
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import { NgxCarousel } from 'ngx-carousel';
import { WebService } from '../../provider/web.service';
import { ImageStorage } from '../../../environments/server.config';
import { Router,ActivatedRoute } from '@angular/router';
@Component({
......@@ -9,32 +11,175 @@ import { Router,ActivatedRoute } from '@angular/router';
})
export class CartComponent implements OnInit {
count:any;
loginDetails:any;
loader:boolean;
cartData:any;
page :number = 1;
total_page :number = 1;
imageServer: any;
trend_loader:boolean;
trendingProductData:any;
product_data:any;
cartQuantity :any[] = new Array();
confirmParam: string = '';
confirmCallBak: string = '';
@ViewChild("confirmModal") public confirmModalRef: ElementRef;
public carouselTile: NgxCarousel;
constructor(
private router : Router,
private route : ActivatedRoute
private route : ActivatedRoute,
public webService : WebService
) {
this.count = 0;
this.count = 1;
this.loader = true;
this.imageServer = ImageStorage;
this.trend_loader = true;
}
add(){
this.count = this.count + 1;
add(cart_id: number){
if(this.cartQuantity[cart_id] && this.cartQuantity[cart_id]['quantity'] < 15){
this.cartQuantity[cart_id]['quantity'] = this.cartQuantity[cart_id]['quantity']+1;
this.cartQuantity[cart_id]['total_amount'] = this.cartQuantity[cart_id]['amount']*this.cartQuantity[cart_id]['quantity'];
}
}
minus(){
this.count = this.count - 1;
if(this.count < 0){
this.count = 0;
minus(cart_id: number){
if(this.cartQuantity[cart_id] && this.cartQuantity[cart_id]['quantity'] > 1){
this.cartQuantity[cart_id]['quantity'] = this.cartQuantity[cart_id]['quantity']-1;
this.cartQuantity[cart_id]['total_amount'] = this.cartQuantity[cart_id]['amount']*this.cartQuantity[cart_id]['quantity'];
}
}
ngOnInit() {
this.checkUserLogin();
this.getCartData();
this.trendingProducts();
this.carouselTile = {grid: {xs: 1, sm: 2 , md: 4, lg: 8, all: 0},slide: 1, speed: 400,point: { visible: false },load: 2, touch: true, easing: 'ease'}
}
checkUserLogin(){
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
if(!this.loginDetails){
this.goToPage('purchaseHome','');
}
}
getCartData(){
if(!this.loginDetails || !this.loginDetails.customer_id){
return false;
}
this.loader = true;
this.webService.post_data('getCartData',{'customer_id':this.loginDetails.customer_id,'page':this.page}).subscribe(response => {
if(response.status == 'success'){
this.cartData = response.data;
const thisObj = this;
let tempArr:any = Array();
this.cartData.forEach(function(data,key) {
tempArr[data.cart_id] = {'quantity':+data.quantity,'amount':data.amount,'total_amount':data.quantity*data.amount};
});
thisObj.cartQuantity = tempArr;
}else{
this.cartData = false;
}
this.loader = false;
})
}
trendingProducts(){
this.trend_loader = true;
this.webService.post_data('getTrendingPrdts',{'page':this.page}).subscribe(response => {
if(response.status == 'success'){
this.trendingProductData = response.data;
} else {
this.trendingProductData = false;
}
this.trend_loader = false;
});
}
removeProduct(params){
this.page= 1;
this.loader = true;
this.webService.post_data('removeCartPrdt',params).subscribe(response => {
if(response.status == 'success'){
this.getCartData();
}
this.trend_loader = false;
});
}
cnfRemoveProduct(cartId){
if(cartId < 0){
return false;
}
this.showConfirmPopUp('removeProduct',{'cart_id':cartId});
}
showConfirmPopUp(fn_name: string, param: any){
if(fn_name === ''){
return false;
}
if(param){
param = JSON.stringify(param);
}
this.confirmParam = param;
this.confirmCallBak = fn_name;
this.confirmModalRef.nativeElement.click();
}
confirmCallBack(fn_name: string,param: string){
if(fn_name === '' || !this[fn_name]){
return false;
}
if(param !== ''){
param = JSON.parse(param);
this[fn_name](param);
} else {
this[fn_name]();
}
}
onScroll(){
if(this.total_page < this.page){
return false;
}
this.page += 1;
this.loader = true;
this.webService.post_data('getCartData',{'customer_id':this.loginDetails.customer_id,'page':this.page}).subscribe(response => {
if(response.status == 'success'){
let thisObj = this;
response.data.forEach(function(cartData,key) {
thisObj.cartData.push(cartData);
});
}
this.loader = false;
});
}
latestPrdtDtls(prdt_id){
this.goToPage('productdetails',{"product_id":prdt_id});
}
buyProduct(product_id,total_amount,cartId,quantity,amount){
if(cartId <= 0 || product_id <= 0 || total_amount <= 0 || quantity <= 0 || amount <= 0){
return false;
}
this.loader = true;
this.webService.post_data('removeCartPrdt',{'cart_id':cartId}).subscribe(response => {
if(response.status == 'success'){
this.product_data = {amount:amount,product_id:product_id,quantity:quantity,total_amount:total_amount};
this.webService.setLocalStorageItem('productDetails', JSON.stringify(this.product_data));
this.goToPage('address','');
}
this.loader = false;
});
}
goToPage(path,data=null){
this.router.navigateByUrl(path,{queryParams:data});
this.router.navigate([path],{queryParams: data});
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
......
......@@ -18,7 +18,7 @@
<!-- <h4><div>Color</div><span>Black</span></h4> -->
<h4><div>Quantity</div><span>{{book.quantity}}</span></h4>
</div>
<h4><span>{{book.format_order_id}}</span><strong (click)="trackOrder(book.transId)" *ngIf="(book.status == '2' || book.status == '3' || book.status == '4' || book.status == '5')">Track Order</strong></h4>
<h4 class="cpoint"><span>{{book.format_order_id}}</span><strong (click)="trackOrder(book.transId)" *ngIf="(book.status == '2' || book.status == '3' || book.status == '4' || book.status == '5')">Track Order</strong></h4>
<h4><div style="width:auto !important;">Ordered On</div><span>{{book.datetime | date: "EEE, MMMM dd, yyyy"}}</span></h4>
</div>
<div class="clear"></div>
......@@ -38,7 +38,7 @@
<h4 *ngIf = "book.status == '7'">
<div *ngIf="book.status == '7'">This item is Canceled</div>
</h4>
<div class="cancel" *ngIf="(book.status == '2' || book.status == '3'|| book.status == '4')" (click)="cancelOrder(book.order_id)">Cancel Item</div>
<div class="cancel cpoint" *ngIf="(book.status == '2' || book.status == '3'|| book.status == '4')" (click)="cnfCancelOrder(book.order_id)">Cancel Item</div>
<div class="clear"></div>
</div>
</div>
......@@ -60,7 +60,7 @@
<h5>{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p>
<div class="star_ratting">
<fieldset class="rating" *ngIf="prdt.rating > 0">
<fieldset class="rating prevent-click">
<input type="radio" [checked]="(prdt.rating >= 4.75) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_5'" [attr.name]="'thirdStarName_'+prdt.product_id" value="5" /><label class = "full" for="thirdStar5"></label>
<input type="radio" [checked]="(prdt.rating >= 4.25 && prdt.rating < 4.75) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_4half'" [attr.name]="'thirdStarName_'+prdt.product_id" value="4.5" /><label class="half" for="thirdStar4half"></label>
<input type="radio" [checked]="(prdt.rating >= 3.75 && prdt.rating < 4.25) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_4'" [attr.name]="'thirdStarName_'+prdt.product_id" value="4" /><label class = "full" for="thirdStar4"></label>
......@@ -70,11 +70,11 @@
<input type="radio" [checked]="(prdt.rating >= 1.75 && prdt.rating < 2.25) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_2'" [attr.name]="'thirdStarName_'+prdt.product_id" value="2" /><label class = "full" for="thirdStar2"></label>
<input type="radio" [checked]="(prdt.rating >= 1.25 && prdt.rating < 1.75) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_1half'" [attr.name]="'thirdStarName_'+prdt.product_id" value="1.5" /><label class="half" for="thirdStar1half"></label>
<input type="radio" [checked]="(prdt.rating >= 0.75 && prdt.rating < 1.25) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_1'" [attr.name]="'thirdStarName_'+prdt.product_id" value="1" /><label class = "full" for="thirdStar1"></label>
<input type="radio" [checked]="(prdt.rating < 0.75) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_half'" [attr.name]="'thirdStarName_'+prdt.product_id" value="0.5" /><label class="half" for="thirdStarhalf"></label>
<input type="radio" [checked]="(prdt.rating < 0.75 && prdt.rating >= 0.25) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_half'" [attr.name]="'thirdStarName_'+prdt.product_id" value="0.5" /><label class="half" for="thirdStarhalf"></label>
</fieldset>
<span class="floatRight">$ {{prdt.amount}}</span>
<div class="clear"></div>
<p>{{prdt.reviews}} Reviews</p>
<p>{{(prdt.reviews > 0)?prdt.reviews+' Reviews':'Be the first one to review.'}}</p>
</div>
</div>
</li>
......@@ -84,3 +84,27 @@
</ngx-carousel>
</div>
</div>
<!-- Confirm Modal PopUp-->
<button #confirmModal class="hide" data-toggle="modal" data-target="#confirm">Add Vehicle</button>
<div class="modal" id="confirm" >
<div class="modal-dialog modal-full">
<div class="modal-content background_transparent">
<div class="modal-body quote_modal">
<div class="confirm_modal_content">
<div class="login_modal_inner">
<div class="login_success">
<h4>Do You Want to Confirm ?</h4>
</div>
<div class="row">
<div class="col-md-12 textCenter">
<button class="btn btn-success" data-dismiss="modal" (click)="confirmCallBack(confirmCallBak,confirmParam)">Yes</button>
<button class="btn btn-danger" data-dismiss="modal">No</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import { NgxCarousel } from 'ngx-carousel';
import { WebService } from '../../provider/web.service';
import { ImageStorage } from '../../../environments/server.config';
......@@ -19,6 +19,10 @@ export class OrdersComponent implements OnInit {
imageServer: string;
trend_loader:boolean;
trendingProductData:any;
confirmParam: string = '';
confirmCallBak: string = '';
@ViewChild("confirmModal") public confirmModalRef: ElementRef;
public carouselTile: NgxCarousel;
......@@ -36,14 +40,20 @@ export class OrdersComponent implements OnInit {
this.checkUserLogin();
this.getMyOrders();
this.trendingProducts();
this.carouselTile = {grid: {xs: 1, sm: 2 , md: 4, lg: 8, all: 0},slide: 1, speed: 400,point: { visible: false },load: 2, touch: true, easing: 'ease'}
this.carouselTile = {grid: {xs: 1, sm: 2 , md: 4, lg: 8, all: 0},slide: 1, speed: 400,point: { visible: false },load: 2, touch: true, easing: 'ease', loop: true}
}
checkUserLogin(){
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
if(!this.loginDetails){
this.goToPage('purchaseHome','');
}
}
getMyOrders(){
if(!this.loginDetails){
this.goToPage('purchaseHome','');
}
this.loader = true;
this.webService.post_data('getMyOrders',{"customer_id":this.loginDetails.customer_id,'page':this.page}).subscribe(response => {
if(response.status == 'success'){
......@@ -78,12 +88,9 @@ export class OrdersComponent implements OnInit {
});
}
cancelOrder(odrId){
if(odrId < 0){
return false;
}
cancelOrder(params){
this.loader = true;
this.webService.post_data('cancelOrder',{"order_id":odrId}).subscribe(response => {
this.webService.post_data('cancelOrder',params).subscribe(response => {
if(response.status == 'success'){
this.getMyOrders();
}
......@@ -91,6 +98,37 @@ export class OrdersComponent implements OnInit {
})
}
cnfCancelOrder(odrId){
if(odrId < 0){
return false;
}
this.showConfirmPopUp('cancelOrder',{"order_id":odrId});
}
showConfirmPopUp(fn_name: string, param: any){
if(fn_name === ''){
return false;
}
if(param){
param = JSON.stringify(param);
}
this.confirmParam = param;
this.confirmCallBak = fn_name;
this.confirmModalRef.nativeElement.click();
}
confirmCallBack(fn_name: string,param: string){
if(fn_name === '' || !this[fn_name]){
return false;
}
if(param !== ''){
param = JSON.parse(param);
this[fn_name](param);
} else {
this[fn_name]();
}
}
trendingProducts(){
this.trend_loader = true;
this.webService.get_data('getTrendingPrdts').subscribe(response => {
......
......@@ -20,6 +20,8 @@
<div class="product_details">
<h1>{{productDetails.product_name}}</h1>
<h2>{{productDetails.short_description}}</h2>
<h4><div>Brand</div><span>{{productDetails.brand_name}}</span></h4>
<h4><div>Part ID</div><span>PRD152685425</span></h4>
<h3>$ {{productDetails.amount}}</h3>
<div class="rating_div" *ngIf="productDetails.rating">
<fieldset class="rating prevent-click">
......@@ -32,7 +34,7 @@
<input type="radio" [checked]="(productDetails.rating >= 1.75 && productDetails.rating < 2.25) ? 'true':''" id="firstStar2" name="firstRating" value="2" /><label class = "full" for="firstStar2"></label>
<input type="radio" [checked]="(productDetails.rating >= 1.25 && productDetails.rating < 1.75) ? 'true':''" id="firstStar1half" name="firstRating" value="1.5" /><label class="half" for="firstStar1half"></label>
<input type="radio" [checked]="(productDetails.rating >= 0.75 && productDetails.rating < 1.25) ? 'true':''" id="firstStar1" name="firstRating" value="1" /><label class = "full" for="firstStar1"></label>
<input type="radio" [checked]="(productDetails.rating < 0.75) ? 'true':''" id="firstStarhalf" name="firstRating" value="0.5" /><label class="half" for="firstStarhalf"></label>
<input type="radio" [checked]="(productDetails.rating < 0.75 && productDetails.rating >= 0.25) ? 'true':''" id="firstStarhalf" name="firstRating" value="0.5" /><label class="half" for="firstStarhalf"></label>
</fieldset>
<div class="clear"></div>
</div>
......@@ -46,8 +48,8 @@
<div class="count_btn" (click)="add()">+</div>
</div>
<div class="btn_bay">
<button class="btn_cart btn">Add to Cart</button>
<!-- <button class="btn_buy btn" (click)="goToPage('address')">Buy Now</button> -->
<button class="btn_cart btn" (click)="addToCart(productDetails.amount)" *ngIf="loginDetails && cartValue == '1'">Add to Cart</button>
<button class="btn_cart btn" (click)="goCart()" *ngIf="loginDetails && cartValue == '2'">Go to Cart</button>
<button class="btn_buy btn" (click)="buyProduct(productDetails.amount)">{{loginDetails?'Buy Now':'Login And Continue'}}</button>
</div>
</div>
......@@ -65,7 +67,7 @@
<input type="radio" [checked]="(productDetails.rating >= 1.75 && productDetails.rating < 2.25) ? 'true':''" id="secondStar2" name="secondRating" value="2" /><label class = "full" for="secondStar2"></label>
<input type="radio" [checked]="(productDetails.rating >= 1.25 && productDetails.rating < 1.75) ? 'true':''" id="secondStar1half" name="secondRating" value="1.5" /><label class="half" for="secondStar1half"></label>
<input type="radio" [checked]="(productDetails.rating >= 0.75 && productDetails.rating < 1.25) ? 'true':''" id="secondStar1" name="secondRating" value="1" /><label class = "full" for="secondStar1"></label>
<input type="radio" [checked]="(productDetails.rating < 0.75) ? 'true':''" id="secondStarhalf" name="secondRating" value="0.5" /><label class="half" for="secondStarhalf"></label>
<input type="radio" [checked]="(productDetails.rating < 0.75 && productDetails.rating >= 0.25) ? 'true':''" id="secondStarhalf" name="secondRating" value="0.5" /><label class="half" for="secondStarhalf"></label>
</fieldset>
<div class="clear"></div>
</div>
......@@ -90,7 +92,7 @@
<input type="radio" [checked]="(revws.rating >= 1.75 && revws.rating < 2.25) ? 'true':''" [attr.id]="'usrReviewId_'+revws.id+'_2'" [attr.name]="'usrReviewName_'+revws.id" value="2" /><label class = "full" for="secondStar2"></label>
<input type="radio" [checked]="(revws.rating >= 1.25 && revws.rating < 1.75) ? 'true':''" [attr.id]="'usrReviewId_'+revws.id+'_1half'" [attr.name]="'usrReviewName_'+revws.id" value="1.5" /><label class="half" for="secondStar1half"></label>
<input type="radio" [checked]="(revws.rating >= 0.75 && revws.rating < 1.25) ? 'true':''" [attr.id]="'usrReviewId_'+revws.id+'_1'" [attr.name]="'usrReviewName_'+revws.id" value="1" /><label class = "full" for="secondStar1"></label>
<input type="radio" [checked]="(revws.rating < 0.75) ? 'true':''" [attr.id]="'usrReviewId_'+revws.id+'_half'" [attr.name]="'usrReviewName_'+revws.id" value="0.5" /><label class="half" for="secondStarhalf"></label>
<input type="radio" [checked]="(revws.rating < 0.75 && revws.rating >= 0.25) ? 'true':''" [attr.id]="'usrReviewId_'+revws.id+'_half'" [attr.name]="'usrReviewName_'+revws.id" value="0.5" /><label class="half" for="secondStarhalf"></label>
</fieldset>
</div>
<div class="clear"></div>
......@@ -117,8 +119,8 @@
</div>
<h5>{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p>
<div class="star_ratting">
<fieldset class="rating" *ngIf="prdt.rating > 0">
<div class="star_ratting prevent-click">
<fieldset class="rating">
<input type="radio" [checked]="(prdt.rating >= 4.75) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_5'" [attr.name]="'thirdStarName_'+prdt.product_id" value="5" /><label class = "full" for="thirdStar5"></label>
<input type="radio" [checked]="(prdt.rating >= 4.25 && prdt.rating < 4.75) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_4half'" [attr.name]="'thirdStarName_'+prdt.product_id" value="4.5" /><label class="half" for="thirdStar4half"></label>
<input type="radio" [checked]="(prdt.rating >= 3.75 && prdt.rating < 4.25) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_4'" [attr.name]="'thirdStarName_'+prdt.product_id" value="4" /><label class = "full" for="thirdStar4"></label>
......@@ -128,11 +130,11 @@
<input type="radio" [checked]="(prdt.rating >= 1.75 && prdt.rating < 2.25) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_2'" [attr.name]="'thirdStarName_'+prdt.product_id" value="2" /><label class = "full" for="thirdStar2"></label>
<input type="radio" [checked]="(prdt.rating >= 1.25 && prdt.rating < 1.75) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_1half'" [attr.name]="'thirdStarName_'+prdt.product_id" value="1.5" /><label class="half" for="thirdStar1half"></label>
<input type="radio" [checked]="(prdt.rating >= 0.75 && prdt.rating < 1.25) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_1'" [attr.name]="'thirdStarName_'+prdt.product_id" value="1" /><label class = "full" for="thirdStar1"></label>
<input type="radio" [checked]="(prdt.rating < 0.75) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_half'" [attr.name]="'thirdStarName_'+prdt.product_id" value="0.5" /><label class="half" for="thirdStarhalf"></label>
<input type="radio" [checked]="(prdt.rating < 0.75 && prdt.rating >= 0.25) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_half'" [attr.name]="'thirdStarName_'+prdt.product_id" value="0.5" /><label class="half" for="thirdStarhalf"></label>
</fieldset>
<span class="floatRight">$ {{prdt.amount}}</span>
<div class="clear"></div>
<p>{{prdt.reviews}} Reviews</p>
<p>{{(prdt.reviews > 0)?prdt.reviews+' Reviews':'Be the first one to review.'}}</p>
</div>
</div>
</li>
......
......@@ -29,6 +29,7 @@ export class ProductdetailsComponent implements OnInit {
page: number = 1;
reviewArray:any = new Array();
total_page: number = 1;
cartValue :number = 1;
@ViewChild("indexLoginModal") loginModalRef: ElementRef;
......@@ -88,7 +89,7 @@ export class ProductdetailsComponent implements OnInit {
this.productDetails = response.data;
this.reviewArray = response.data.reviews.data;
this.total_page = response.data.reviews.meta.total_pages;
console.log(response.data)
this.cartValue = (this.productDetails.cart_id > 0) ? 2 : 1;
if(this.productDetails.images.length > 0){
thisObj.productDetails.images.forEach(function (data) {
image = thisObj.imageServer + data.image;
......@@ -146,6 +147,27 @@ export class ProductdetailsComponent implements OnInit {
this.goToPage('address','');
}
addToCart(amount){
if(!this.loginDetails){
this.loginModalRef.nativeElement.click();
return false;
}
this.loader=true;
this.product_data = {product_id:this.product_id,quantity:this.count,amount:this.count*amount,customer_id:this.loginDetails.customer_id};
this.webService.post_data('addToCart',this.product_data).subscribe(response => {
if(response.status == 'success'){
if(response.data > 0){
this.cartValue = 2;
}
}
this.loader = false;
});
}
goCart(){
this.goToPage('cart','');
}
latestPrdtDtls(prdt_id){
this.goToPage('productdetails',{"product_id":prdt_id});
}
......@@ -156,7 +178,7 @@ export class ProductdetailsComponent implements OnInit {
}
designModules(){
this.carouselTile = {grid: {xs: 1, sm: 2 , md: 4, lg: 8, all: 0},slide: 1, speed: 400,point: { visible: false },load: 2, touch: true, easing: 'ease'}
this.carouselTile = {grid: {xs: 1, sm: 2 , md: 4, lg: 8, all: 0},slide: 1, speed: 400,point: { visible: false },load: 2, touch: true, easing: 'ease', loop: true}
this.galleryOptions = [
{
width: '100%',
......
......@@ -54,7 +54,7 @@
<div class="search_list_header">
<div class="row">
<div class="col-md-8">
<p>Showing 1 -40 of 202 results for "Audi tyres"</p>
<p>Search Results</p>
</div>
<!-- <div class="col-md-4">
<select class="floatRight">
......@@ -76,7 +76,7 @@
<h5>{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p>
<div class="star_ratting">
<fieldset class="rating" *ngIf="prdt.rating > 0">
<fieldset class="rating prevent-click hide">
<input type="radio" [checked]="(prdt.rating >= 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_5'" [attr.name]="'usrReviewName_'+prdt.product_id" value="5" /><label class = "full" for="secondStar5"></label>
<input type="radio" [checked]="(prdt.rating >= 4.25 && prdt.rating < 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4.5" /><label class="half" for="secondStar4half"></label>
<input type="radio" [checked]="(prdt.rating >= 3.75 && prdt.rating < 4.25) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4" /><label class = "full" for="secondStar4"></label>
......@@ -86,7 +86,7 @@
<input type="radio" [checked]="(prdt.rating >= 1.75 && prdt.rating < 2.25) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_2'" [attr.name]="'usrReviewName_'+prdt.product_id" value="2" /><label class = "full" for="secondStar2"></label>
<input type="radio" [checked]="(prdt.rating >= 1.25 && prdt.rating < 1.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_1half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="1.5" /><label class="half" for="secondStar1half"></label>
<input type="radio" [checked]="(prdt.rating >= 0.75 && prdt.rating < 1.25) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_1'" [attr.name]="'usrReviewName_'+prdt.product_id" value="1" /><label class = "full" for="secondStar1"></label>
<input type="radio" [checked]="(prdt.rating < 0.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="0.5" /><label class="half" for="secondStarhalf"></label>
<input type="radio" [checked]="(prdt.rating < 0.75 && prdt.rating >= 0.25) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="0.5" /><label class="half" for="secondStarhalf"></label>
</fieldset>
<span class="floatRight">$ {{prdt.amount}}</span>
<div class="clear"></div>
......
......@@ -31,8 +31,8 @@ export class ProductlistComponent implements OnInit {
this.loader = true;
this.productArray = [];
this.filterParam = {"key":'',"brand_id":Array(),"minPrice":'',"maxPrice":'','page':1};
this.imageServer = ImageStorage;
route.params.subscribe(val => {
this.route.queryParams.subscribe(params => {
this.searchKey = params['key'];
......
......@@ -19,7 +19,7 @@
<h5>{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p>
<div class="star_ratting">
<fieldset class="rating" *ngIf="prdt.rating > 0">
<fieldset class="rating prevent-click">
<input type="radio" [checked]="(prdt.rating >= 4.75) ? 'true':''" [attr.id]="'usrStar_'+prdt.product_id+'_5'" [attr.name]="'usrStarName_'+prdt.product_id" value="5" /><label class = "full" for="secondStar5"></label>
<input type="radio" [checked]="(prdt.rating >= 4.25 && prdt.rating < 4.75) ? 'true':''" [attr.id]="'usrStar_'+prdt.product_id+'_4half'" [attr.name]="'usrStarName_'+prdt.product_id" value="4.5" /><label class="half" for="secondStar4half"></label>
<input type="radio" [checked]="(prdt.rating >= 3.75 && prdt.rating < 4.25) ? 'true':''" [attr.id]="'usrStar_'+prdt.product_id+'_4'" [attr.name]="'usrStarName_'+prdt.product_id" value="4" /><label class = "full" for="secondStar4"></label>
......@@ -29,11 +29,11 @@
<input type="radio" [checked]="(prdt.rating >= 1.75 && prdt.rating < 2.25) ? 'true':''" [attr.id]="'usrStar_'+prdt.product_id+'_2'" [attr.name]="'usrStarName_'+prdt.product_id" value="2" /><label class = "full" for="secondStar2"></label>
<input type="radio" [checked]="(prdt.rating >= 1.25 && prdt.rating < 1.75) ? 'true':''" [attr.id]="'usrStar_'+prdt.product_id+'_1half'" [attr.name]="'usrStarName_'+prdt.product_id" value="1.5" /><label class="half" for="secondStar1half"></label>
<input type="radio" [checked]="(prdt.rating >= 0.75 && prdt.rating < 1.25) ? 'true':''" [attr.id]="'usrStar_'+prdt.product_id+'_1'" [attr.name]="'usrStarName_'+prdt.product_id" value="1" /><label class = "full" for="secondStar1"></label>
<input type="radio" [checked]="(prdt.rating < 0.75) ? 'true':''" [attr.id]="'usrStar_'+prdt.product_id+'_half'" [attr.name]="'usrStarName_'+prdt.product_id" value="0.5" /><label class="half" for="secondStarhalf"></label>
<input type="radio" [checked]="(prdt.rating < 0.75 && prdt.rating >= 0.25) ? 'true':''" [attr.id]="'usrStar_'+prdt.product_id+'_half'" [attr.name]="'usrStarName_'+prdt.product_id" value="0.5" /><label class="half" for="secondStarhalf"></label>
</fieldset>
<span class="floatRight">$ {{prdt.amount}}</span>
<div class="clear"></div>
<p>{{prdt.reviews}} Reviews</p>
<p>{{(prdt.reviews > 0)?prdt.reviews+' Reviews':'Be the first one to review.'}}</p>
</div>
</div>
</li>
......@@ -60,7 +60,7 @@
<h5>{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p>
<div class="star_ratting">
<fieldset class="rating" *ngIf="prdt.rating > 0">
<fieldset class="rating prevent-click hide">
<input type="radio" [checked]="(prdt.rating >= 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_5'" [attr.name]="'usrReviewName_'+prdt.product_id" value="5" /><label class = "full" for="secondStar5"></label>
<input type="radio" [checked]="(prdt.rating >= 4.25 && prdt.rating < 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4.5" /><label class="half" for="secondStar4half"></label>
<input type="radio" [checked]="(prdt.rating >= 3.75 && prdt.rating < 4.25) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4" /><label class = "full" for="secondStar4"></label>
......@@ -70,11 +70,11 @@
<input type="radio" [checked]="(prdt.rating >= 1.75 && prdt.rating < 2.25) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_2'" [attr.name]="'usrReviewName_'+prdt.product_id" value="2" /><label class = "full" for="secondStar2"></label>
<input type="radio" [checked]="(prdt.rating >= 1.25 && prdt.rating < 1.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_1half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="1.5" /><label class="half" for="secondStar1half"></label>
<input type="radio" [checked]="(prdt.rating >= 0.75 && prdt.rating < 1.25) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_1'" [attr.name]="'usrReviewName_'+prdt.product_id" value="1" /><label class = "full" for="secondStar1"></label>
<input type="radio" [checked]="(prdt.rating < 0.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="0.5" /><label class="half" for="secondStarhalf"></label>
<input type="radio" [checked]="(prdt.rating < 0.75 && prdt.rating >= 0.25) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="0.5" /><label class="half" for="secondStarhalf"></label>
</fieldset>
<span class="floatRight">$ {{prdt.amount}}</span>
<div class="clear"></div>
<p>{{prdt.reviews}} Reviews</p>
<p>{{(prdt.reviews > 0)?prdt.reviews+' Reviews':'Be the first one to review.'}}</p>
</div>
</div>
</li>
......
......@@ -281,7 +281,7 @@
.star_ratting{
padding-top: 2px;
display: none;
span{
float: right;
color: #000000;
......
......@@ -76,7 +76,6 @@ export class SummaryComponent implements OnInit {
this.webService.post_data('SingleProductSearch',{'product_id':this.product_id}).subscribe(response => {
if(response.status == 'success'){
this.productDetails = response.data;
console.log(this.productDetails)
}else{
this.productDetails = false;
}
......
......@@ -99,9 +99,8 @@
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header" #ratingModal>
<button type="button" class="close" data-dismiss="modal">&times;</button>
<div class="modal-header">
<button type="button" #ratingModal class="close" data-dismiss="modal">&times;</button>
</div>
<div class="ratting_inner">
<div class="loader_overlay" *ngIf="loader_review"></div>
......
.purchase_wrapper{
.purchase_content_wrapper{
padding-top:115px;
.product_gallery{
background: #ffff;
padding:20px;
......
......@@ -126,7 +126,6 @@ export class TrackComponent implements OnInit {
const thisObj = this;
this.orderDetails = response.data;
this.userReviewed = (this.orderDetails.review_id <= 0 && (this.orderDetails.odr_status == '5' || this.orderDetails.odr_status == '6' || this.orderDetails.odr_status == '7'))?false:true;
console.log(this.userReviewed);
if(this.orderDetails.images.length > 0){
thisObj.orderDetails.images.forEach(function (data) {
image = thisObj.imageServer + data.image;
......
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