Merge branch 'muhsin' into 'master'
Muhsin
See merge request !41
Showing
<ion-app> | <ion-app> | ||
<ion-split-pane> | <ion-split-pane> | ||
<ion-menu> | <ion-menu> | ||
<ion-content> | <ion-content> | ||
<div class="side_menu_wrapper"> | <div class="side_menu_wrapper"> | ||
<ion-menu-toggle> | <ion-menu-toggle> | ||
<div class="top_banner"> | <div class="top_banner"> | ||
<div class="top_image"> | <div class="top_image"></div> | ||
<div class="top_detail"> | |||
<h4>John Doe</h4> | |||
<p>[email protected]</p> | |||
</div> | |||
<div class="clear"></div> | |||
</div> | |||
</ion-menu-toggle> | |||
<div class="sidemenu_list"> | |||
<ul> | |||
<ion-menu-toggle> | |||
<li (click)="vieworder('home')">Shop</li> | |||
</ion-menu-toggle> | |||
<li>About us</li> | |||
<ion-menu-toggle> | |||
<li (click)="vieworder('myorder')">View Order</li> | |||
</ion-menu-toggle> | |||
</div> | <div class="sub_menu"> | ||
<div class="top_detail" > | <ul *ngIf="categoryService.activecategories"> | ||
<h4>John Doe</h4> | <ion-menu-toggle> | ||
<p>[email protected]</p> | <li | ||
</div> | *ngFor="let category of categoryService.activecategories" | ||
<div class="clear"></div> | (click)="goToPage('catstorelist', category)" | ||
</div> | > | ||
</ion-menu-toggle> | {{ category.catName }} | ||
<div class="sidemenu_list"> | </li> | ||
<ul> | </ion-menu-toggle> | ||
<ion-menu-toggle> | <!-- <li>Women's Fashion</li> | ||
<li (click)="vieworder('home')">Shop</li> | |||
</ion-menu-toggle> | |||
<li>About us</li> | |||
<ion-menu-toggle> | |||
<li (click)="vieworder('myorder')">View Order</li> | |||
</ion-menu-toggle> | |||
<div class="sub_menu"> | |||
<ul *ngIf="categoryService.activecategories"> | |||
<ion-menu-toggle> | |||
<li *ngFor="let category of categoryService.activecategories" (click)="goToPage('catstorelist', category)">{{category.catName}}</li> | |||
</ion-menu-toggle> | |||
<!-- <li>Women's Fashion</li> | |||
<li>Features</li> | <li>Features</li> | ||
<li>Bags</li> | <li>Bags</li> | ||
<li>Shoes</li> | <li>Shoes</li> | ||
<li>Electronics</li> --> | <li>Electronics</li> --> | ||
</ul> | </ul> | ||
</div> | </div> | ||
<li>Complaints & Feedback</li> | <li>Complaints & Feedback</li> | ||
<li> | <li> | ||
<span class="floatLeft" (click)="authService.SignOut()">Logout</span> | <span class="floatLeft" (click)="authService.SignOut()" | ||
<span class="floatRight version">Version 0.1.0.2</span> | >Logout</span | ||
<div class="clear"></div> | > | ||
</li> | <span class="floatRight version">Version 0.1.0.2</span> | ||
</ul> | <div class="clear"></div> | ||
</div> | </li> | ||
</div> | </ul> | ||
</ion-content> | </div> | ||
</ion-menu> | </div> | ||
<ion-router-outlet main></ion-router-outlet> | </ion-content> | ||
</ion-split-pane> | </ion-menu> | ||
<ion-router-outlet main></ion-router-outlet> | |||
</ion-split-pane> | |||
</ion-app> | </ion-app> | ||
<div class="common_tab" [hidden]="getState()"> | <div class="common_tab" [hidden]="getState()"> | ||
<ul> | <ul> | ||
<li (click)="goToPage('home')"> | <li (click)="goToPage('home')"> | ||
<div class="icon_sec m1_icon" [class.m1_icon_act]="sec_active1" (click)="setActive1()"></div> | <div | ||
</li> | class="icon_sec m1_icon" | ||
<li (click)="goToPage('catagory')"> | [class.m1_icon_act]="sec_active1" | ||
<div class="icon_sec m2_icon" [class.m2_icon_act]="sec_active2" (click)="setActive2()"></div> | (click)="setActive1()" | ||
</li> | ></div> | ||
<li (click)="goToPage('catagory')"> | </li> | ||
<div class="icon_sec m3_icon" [class.m3_icon_act]="sec_active3" (click)="setActive3()"></div> | <li (click)="goToPage('catagory')"> | ||
</li> | <div | ||
<!-- <li (click)="goToPage('cart')"> | class="icon_sec m2_icon" | ||
[class.m2_icon_act]="sec_active2" | |||
(click)="setActive2()" | |||
></div> | |||
</li> | |||
<li (click)="goToPage('catagory')"> | |||
<div | |||
class="icon_sec m3_icon" | |||
[class.m3_icon_act]="sec_active3" | |||
(click)="setActive3()" | |||
></div> | |||
</li> | |||
<!-- <li (click)="goToPage('cart')"> | |||
<div class="icon_sec m4_icon" [class.m4_icon_act]="sec_active4" (click)="setActive4()"></div> | <div class="icon_sec m4_icon" [class.m4_icon_act]="sec_active4" (click)="setActive4()"></div> | ||
</li> --> | </li> --> | ||
<li (click)="goToPage('myorder')"> | <li (click)="goToPage('myorder')"> | ||
<div class="icon_sec m5_icon" [class.m5_icon_act]="sec_active5" (click)="setActive5()"></div> | <div | ||
</li> | class="icon_sec m5_icon" | ||
<li (click)="goToPage('profile')"> | [class.m5_icon_act]="sec_active5" | ||
<div class="icon_sec m6_icon" [class.m6_icon_act]="sec_active6" (click)="setActive6()"></div> | (click)="setActive5()" | ||
</li> | ></div> | ||
</ul> | </li> | ||
</div> | <li (click)="goToPage('profile')"> | ||
\ No newline at end of file | <div | ||
class="icon_sec m6_icon" | |||
[class.m6_icon_act]="sec_active6" | |||
(click)="setActive6()" | |||
></div> | |||
</li> | |||
</ul> | |||
</div> |
<div class="nav_header"> | <div class="nav_header"> | ||
<button class="nav_btn nav_back floatLeft" (click)="goBack()"> | <button class="nav_btn nav_back floatLeft" (click)="goBack()"> | ||
<img src="../assets/Group17_2.png"> | <img src="../assets/Group17_2.png" /> | ||
</button> | </button> | ||
<div class="nav_title floatLeft"> | <div class="nav_title floatLeft"> | ||
<h4>CHANGE DETAILS</h4> | <h4>CHANGE DETAILS</h4> | ||
</div> | </div> | ||
<div class="clear"></div> | <div class="clear"></div> | ||
</div> | </div> | ||
<ion-content> | <ion-content> | ||
<div class="login_wrapper"> | <div class="login_wrapper"> | ||
<div class="form_div"> | <form class="form_div" #updateForm="ngForm" novalidate> | ||
<div class="row"> | <div class="row"> | ||
<h6>Personal Details</h6> | <h6>Personal Details</h6> | ||
</div> | </div> | ||
<div class="row"> | <div class="row"> | ||
<input class="" type="text" placeholder="John Doe"> | <input | ||
</div> | name="name" | ||
<div class="row"> | required | ||
<input class="" type="mail" placeholder="[email protected]"> | class="" | ||
</div> | type="text" | ||
<div class="row"> | [(ngModel)]="updateData.name" | ||
<input class="" type="number" placeholder="+00 9851 5871 6985"> | placeholder="John Doe" | ||
</div> | #name="ngModel" | ||
<div class="row"> | /> | ||
<h6>Change Password</h6> | <div | ||
</div> | class="md-errors-spacer" | ||
<div class="row"> | [hidden]="name.valid || submitted == false" | ||
<input class="" type="password" placeholder="Current Password"> | class="ion-padding-start" | ||
</div> | > | ||
<div class="row"> | Name is required | ||
<input class="" type="password" placeholder="New Password"> | |||
</div> | |||
<div class="row"> | |||
<input class="" type="password" placeholder="Confirm Password"> | |||
</div> | |||
<div class="row"> | |||
<button class="login_btn">UPDATE</button> | |||
</div> | |||
</div> | </div> | ||
</div> | </div> | ||
</ion-content> | <div class="row"> | ||
\ No newline at end of file | <input | ||
required | |||
class="" | |||
name="emailId" | |||
type="mail" | |||
[(ngModel)]="updateData.emailId" | |||
placeholder="[email protected]" | |||
pattern="[a-zA-Z0-9.-_]{1,}@[a-zA-Z.-]{2,}[.]{1}[a-zA-Z]{2,}" | |||
#emailId="ngModel" | |||
/> | |||
<div | |||
class="md-errors-spacer" | |||
[hidden]="emailId.valid || submitted == false" | |||
> | |||
<div *ngIf="emailId.errors && emailId.errors.required"> | |||
Email is required | |||
</div> | |||
<div *ngIf="emailId.errors && emailId.errors.pattern"> | |||
Email is invalid | |||
</div> | |||
</div> | |||
</div> | |||
<div class="row"> | |||
<input | |||
required | |||
class="" | |||
name="phone" | |||
type="number" | |||
pattern="(\(+61\)|\+61|\(0[1-9]\)|0[1-9])?( ?-?[0-9]){6,9}" | |||
maxlength="10" | |||
[(ngModel)]="updateData.phone" | |||
placeholder="+00 9851 5871 6985" | |||
#phone="ngModel" | |||
/> | |||
<div | |||
class="md-errors-spacer" | |||
[hidden]="phone.valid || submitted == false" | |||
> | |||
<div *ngIf="phone.errors && phone.errors.required"> | |||
Phone number is required | |||
</div> | |||
<div *ngIf="phone.errors && phone.errors.pattern"> | |||
Phone is invalid | |||
</div> | |||
</div> | |||
</div> | |||
<div class="row"> | |||
<h6>Change Password</h6> | |||
</div> | |||
<div class="row"> | |||
<input class="" type="password" placeholder="Current Password" /> | |||
</div> | |||
<div class="row"> | |||
<input class="" type="password" placeholder="New Password" /> | |||
</div> | |||
<div class="row"> | |||
<input class="" type="password" placeholder="Confirm Password" /> | |||
</div> | |||
<div class="row"> | |||
<button class="login_btn" (click)="onFormSubmit(updateForm)"> | |||
UPDATE | |||
</button> | |||
</div> | |||
</form> | |||
</div> | |||
</ion-content> |
<div class="nav_header"> | <div class="nav_header"> | ||
<button class="nav_btn nav_back floatLeft" (click)="goBack()"> | <button class="nav_btn nav_back floatLeft" (click)="goBack()"> | ||
<img src="../assets/Group17_2.png"> | <img src="../assets/Group17_2.png" /> | ||
</button> | </button> | ||
<div class="nav_title floatLeft"> | <div class="nav_title floatLeft"></div> | ||
<button class="nav_btn nav_cart floatRight" (click)="goToPage('cart')"> | |||
<div class="not" *ngIf="cartService.carts"> | |||
{{cartService.carts.length}} | |||
</div> | </div> | ||
<button class="nav_btn nav_cart floatRight" (click)="goToPage('cart')"> | </button> | ||
<div class="not" *ngIf="cartService.carts">{{cartService.carts.length}}</div> | <div class="clear"></div> | ||
</button> | |||
<div class="clear"></div> | |||
</div> | </div> | ||
<ion-content> | <ion-content> | ||
<div class="product_detail_wrapper" *ngIf="product"> | <div class="product_detail_wrapper" *ngIf="product"> | ||
<div class="product_banner"> | <div class="product_banner"> | ||
<div [ngClass]="checkFavStatus(product.prodId)" (click)="changeFav(product.prodId)"></div> | <div | ||
<div class="featured_badge" *ngIf="product.featured">Featured</div> | [ngClass]="checkFavStatus(product.prodId)" | ||
<ion-slides pager="true" [options]="bannerOptions"> | (click)="changeFav(product.prodId)" | ||
<ion-slide> | ></div> | ||
<img [src]="product.image" onerror="this.src='../assets/[email protected]'"> | <div class="featured_badge" *ngIf="product.featured">Featured</div> | ||
</ion-slide> | <ion-slides pager="true" [options]="bannerOptions"> | ||
<ion-slide> | <ion-slide> | ||
<img [src]="product.image" onerror="this.src='../assets/[email protected]'"> | <img | ||
</ion-slide> | [src]="product.image" | ||
<ion-slide> | onerror="this.src='../assets/[email protected]'" | ||
<img [src]="product.image" onerror="this.src='../assets/[email protected]'"> | /> | ||
</ion-slide> | </ion-slide> | ||
</ion-slides> | <ion-slide> | ||
</div> | <img | ||
<div class="product_header"> | [src]="product.image" | ||
<ion-row> | onerror="this.src='../assets/[email protected]'" | ||
<ion-col size="8"> | /> | ||
<h3>{{product.prodName}}</h3> | </ion-slide> | ||
<p><strong><span><img src="../assets/Path61_2.png"></span>0</strong> {{product.category}}, {{product.subCate}} | <ion-slide> | ||
<br /> | <img | ||
<span *ngFor="let tag of product.tag">#{{tag}} </span> | [src]="product.image" | ||
</p> | onerror="this.src='../assets/[email protected]'" | ||
</ion-col> | /> | ||
<ion-col size="4"> | </ion-slide> | ||
<h5>A$ {{product.price}}</h5> | </ion-slides> | ||
<p><span class="offer" *ngIf="product.discount > 0">-{{product.discount}}%</span></p> | </div> | ||
</ion-col> | <div class="product_header"> | ||
</ion-row> | <ion-row> | ||
</div> | <ion-col size="8"> | ||
<h3>{{product.prodName}}</h3> | |||
<p> | |||
<strong | |||
><span><img src="../assets/Path61_2.png"/></span>0</strong | |||
> {{product.category}}, {{product.subCate}} | |||
<br /> | |||
<span *ngFor="let tag of product.tag">#{{tag}} </span> | |||
</p> | |||
</ion-col> | |||
<ion-col size="4"> | |||
<h5>A$ {{product.price}}</h5> | |||
<p> | |||
<span class="offer" *ngIf="product.discount > 0" | |||
>-{{product.discount}}%</span | |||
> | |||
</p> | |||
</ion-col> | |||
</ion-row> | |||
</div> | |||
<div class="product_div_content"> | <div class="product_div_content"> | ||
<h5>Color</h5> | <h5>Color</h5> | ||
<div class="size_div"> | <div class="size_div"> | ||
<ul *ngIf="product.size"> | <ul *ngIf="product.size"> | ||
<ion-slides pager="false" [options]="slideOpts"> | <ion-slides pager="false" [options]="slideOpts"> | ||
<ion-slide *ngFor="let color of product.color; let i = index"> | <ion-slide *ngFor="let color of product.color; let i = index"> | ||
<li> | <li> | ||
<button id="custom_check_button"> | <button id="custom_check_button"> | ||
<label> | <label> | ||
<input id="{{color}}" type="radio" name="color" value="{{color}}" | <input | ||
(click)="cartService.choose_color(color)" [checked]="i==0"> | id="{{color}}" | ||
<p>{{color}}</p> | type="radio" | ||
</label> | name="color" | ||
</button> | value="{{color}}" | ||
</li> | (click)="cartService.choose_color(color)" | ||
</ion-slide> | [checked]="i==0" | ||
</ion-slides> | /> | ||
</ul> | <p>{{color}}</p> | ||
</div> | </label> | ||
<h5>Size</h5> | </button> | ||
<div class="size_div"> | </li> | ||
<ul *ngIf="product.size"> | </ion-slide> | ||
<ion-slides pager="false" [options]="slideOpts"> | </ion-slides> | ||
<ion-slide *ngFor="let size of product.size; let i = index"> | </ul> | ||
<li> | </div> | ||
<button id="custom_check_button"> | <h5>Size</h5> | ||
<label> | <div class="size_div"> | ||
<input id="{{size}}" type="radio" name="services" value="{{size}}" | <ul *ngIf="product.size"> | ||
(click)="cartService.choose_size(size)" [checked]="i==0"> | <ion-slides pager="false" [options]="slideOpts"> | ||
<p>{{size}}</p> | <ion-slide *ngFor="let size of product.size; let i = index"> | ||
</label> | <li> | ||
</button> | <button id="custom_check_button"> | ||
</li> | <label> | ||
</ion-slide> | <input | ||
</ion-slides> | id="{{size}}" | ||
</ul> | type="radio" | ||
</div> | name="services" | ||
<!-- <h5>Color</h5> | value="{{size}}" | ||
(click)="cartService.choose_size(size)" | |||
[checked]="i==0" | |||
/> | |||
<p>{{size}}</p> | |||
</label> | |||
</button> | |||
</li> | |||
</ion-slide> | |||
</ion-slides> | |||
</ul> | |||
</div> | |||
<!-- <h5>Color</h5> | |||
<div class="color_div"> | <div class="color_div"> | ||
<ul> | <ul> | ||
<ion-slides pager="false" [options]="slideOpts"> | <ion-slides pager="false" [options]="slideOpts"> | ||
... | @@ -136,10 +168,9 @@ | ... | @@ -136,10 +168,9 @@ |
</ion-slides> | </ion-slides> | ||
</ul> | </ul> | ||
</div> --> | </div> --> | ||
<h5>Description</h5> | <h5>Description</h5> | ||
<p>{{product.prodDesc}} | <p>{{product.prodDesc}}</p> | ||
</p> | <!--<h5> | ||
<!--<h5> | |||
<span class="floatLeft">Reviews</span><span class="floatRight" (click)="goToPage('reviewlist')">MORE</span> | <span class="floatLeft">Reviews</span><span class="floatRight" (click)="goToPage('reviewlist')">MORE</span> | ||
<div class="clear"></div> | <div class="clear"></div> | ||
</h5> | </h5> | ||
... | @@ -203,38 +234,45 @@ | ... | @@ -203,38 +234,45 @@ |
</li> | </li> | ||
</ul> | </ul> | ||
</div> --> | </div> --> | ||
<h5 *ngIf="product.similar && product.similar.length > 0"> | <h5 *ngIf="product.similar && product.similar.length > 0"> | ||
<span class="floatLeft">Related Products</span><span class="floatRight" (click)="goToPage('productlist', data)">MORE</span> | <span class="floatLeft">Related Products</span | ||
<div class="clear"></div> | ><span class="floatRight" (click)="goToPage('productlist', data)" | ||
</h5> | >MORE</span | ||
<div class="related_product_slider"> | > | ||
<ul *ngIf="product.similar && product.similar.length > 0"> | <div class="clear"></div> | ||
<ion-slides pager="false" [options]="relatedProd"> | </h5> | ||
<ion-slide *ngFor="let similar of product.similar"> | <div class="related_product_slider"> | ||
<li (click)="viewProd(similar)"> | <ul *ngIf="product.similar && product.similar.length > 0"> | ||
<div class="product_image"> | <ion-slides pager="false" [options]="relatedProd"> | ||
<img [src]="similar.image" onerror="this.src='../assets/[email protected]'"> | <ion-slide *ngFor="let similar of product.similar"> | ||
<div [ngClass]="checkFavStatus(similar.prodId)" (click)="changeFav(similar.prodId)"> | <li (click)="viewProd(similar)"> | ||
</div> | <div class="product_image"> | ||
</div> | <img | ||
<h5>{{similar.prodName}}</h5> | [src]="similar.image" | ||
<p>{{similar.price}}</p> | onerror="this.src='../assets/[email protected]'" | ||
</li> | /> | ||
</ion-slide> | <div | ||
</ion-slides> | [ngClass]="checkFavStatus(similar.prodId)" | ||
</ul> | (click)="changeFav(similar.prodId)" | ||
</div> | ></div> | ||
</div> | </div> | ||
<h5>{{similar.prodName}}</h5> | |||
<p>{{similar.price}}</p> | |||
</li> | |||
</ion-slide> | |||
</ion-slides> | |||
</ul> | |||
</div> | |||
</div> | </div> | ||
</div> | |||
</ion-content> | </ion-content> | ||
<ion-footer> | <ion-footer> | ||
<div class="footer_div"> | <div class="footer_div"> | ||
<div class="footer_options"> | <div class="footer_options"> | ||
<button class="share"></button> | <button class="share"></button> | ||
<button class="fav"></button> | <button class="fav"></button> | ||
<button class="cart" (click)="buyNow(product,0)"></button> | <button class="cart" (click)="buyNow(product,0)"></button> | ||
</div> | |||
<div class="footer_btn" (click)="buyNow(product,1)">BUY NOW</div> | |||
</div> | </div> | ||
</ion-footer> | <div class="footer_btn" (click)="buyNow(product,1)">BUY NOW</div> | ||
\ No newline at end of file | </div> | ||
</ion-footer> |
<div class="nav_header"> | <div class="nav_header"> | ||
<ion-menu-toggle> | <ion-menu-toggle> | ||
<button class="nav_btn nav_menu floatLeft"> | <button class="nav_btn nav_menu floatLeft"></button> | ||
</button> | </ion-menu-toggle> | ||
</ion-menu-toggle> | <div class="nav_title floatLeft"> | ||
<div class="nav_title floatLeft"> | <img src="../../assets/Group [email protected]" /> | ||
<img src="../../assets/Group [email protected]"> | </div> | ||
</div> | <div class="clear"></div> | ||
<div class="clear"></div> | |||
</div> | </div> | ||
<ion-content> | <ion-content> | ||
<div class="profile_wrapper"> | <div class="profile_wrapper"> | ||
<div class="profile_banner"> | <div class="profile_banner"> | ||
<div class="profile_circle"> | <div class="profile_circle"> | ||
<div class="edit"></div> | <div class="edit"></div> | ||
</div> | </div> | ||
<h5>JOHN DOE</h5> | <h5>{{user && user.name}}</h5> | ||
<p>LOGOUT</p> | <p>LOGOUT</p> | ||
</div> | </div> | ||
<div class="account_wrapper"> | <div class="account_wrapper"> | ||
<div class="account_header"> | <div class="account_header"> | ||
<h5 class="floatLeft">ACCOUNT INFORMATION</h5> | <h5 class="floatLeft">ACCOUNT INFORMATION</h5> | ||
<span class="floatRight"><img src="../../assets/edit.png"></span> | <span | ||
<div class="clear"></div> | class="floatRight" | ||
</div> | (click)="goToPage('changedetails', user && user)" | ||
<div class="row"> | ><img src="../../assets/edit.png" | ||
<ion-row> | /></span> | ||
<ion-col class="textLeft p0"> | <div class="clear"></div> | ||
<p>Name<span>Verfied</span></p> | </div> | ||
</ion-col> | <div class="row"> | ||
<ion-col class="textRight p0"> | <ion-row> | ||
<h6>John Doe</h6> | <ion-col class="textLeft p0"> | ||
</ion-col> | <p> | ||
</ion-row> | Name<span | ||
</div> | >{{user && phoneVerified? "Verified": "Not Verified yet"}}</span | ||
<div class="row"> | > | ||
<ion-row> | </p> | ||
<ion-col class="textLeft p0"> | </ion-col> | ||
<p>Email<span>Not Verfied yet</span></p> | <ion-col class="textRight p0"> | ||
</ion-col> | <h6>{{user && user.name}}</h6> | ||
<ion-col class="textRight p0"> | </ion-col> | ||
<h6>[email protected]</h6> | </ion-row> | ||
</ion-col> | </div> | ||
</ion-row> | <div class="row"> | ||
</div> | <ion-row> | ||
<hr> | <ion-col class="textLeft p0"> | ||
<ion-row> | <p> | ||
<ion-col class="textLeft p0"> | Email<span | ||
<p>Wishlist</p> | >{{user && emailVerified? "Verified": "Not Verified yet"}}</span | ||
</ion-col> | > | ||
<ion-col class="textRight p0"> | </p> | ||
<h6>(3)</h6> | </ion-col> | ||
</ion-col> | <ion-col class="textRight p0"> | ||
</ion-row> | <h6>{{user && user.emailId}}</h6> | ||
<hr> | </ion-col> | ||
<ion-row> | </ion-row> | ||
<ion-col class="textLeft p0"> | </div> | ||
<p>Address</p> | <hr /> | ||
</ion-col> | <ion-row> | ||
<ion-col class="textRight p0"> | <ion-col class="textLeft p0"> | ||
<h6>(1)</h6> | <p>Wishlist</p> | ||
</ion-col> | </ion-col> | ||
</ion-row> | <ion-col class="textRight p0"> | ||
<hr> | <h6>(3)</h6> | ||
<ion-row> | </ion-col> | ||
<ion-col class="textLeft p0"> | </ion-row> | ||
<p>My Cards</p> | <hr /> | ||
</ion-col> | <ion-row> | ||
<ion-col class="textRight p0"> | <ion-col class="textLeft p0"> | ||
<h6> | <p>Address</p> | ||
<ion-icon name="arrow-forward"></ion-icon> | </ion-col> | ||
</h6> | <ion-col class="textRight p0"> | ||
</ion-col> | <h6>(1)</h6> | ||
</ion-row> | </ion-col> | ||
<hr> | </ion-row> | ||
<ion-row> | <hr /> | ||
<ion-col class="textLeft p0"> | <ion-row> | ||
<p>My Order</p> | <ion-col class="textLeft p0"> | ||
</ion-col> | <p>My Cards</p> | ||
<ion-col class="textRight p0"> | </ion-col> | ||
<h6> | <ion-col class="textRight p0"> | ||
<ion-icon name="arrow-forward"></ion-icon> | <h6> | ||
</h6> | <ion-icon name="arrow-forward"></ion-icon> | ||
</ion-col> | </h6> | ||
</ion-row> | </ion-col> | ||
<hr> | </ion-row> | ||
<ion-row> | <hr /> | ||
<ion-col class="textLeft p0"> | <ion-row> | ||
<p>Currency</p> | <ion-col class="textLeft p0"> | ||
</ion-col> | <p>My Order</p> | ||
<ion-col class="textRight p0"> | </ion-col> | ||
<h6> | <ion-col class="textRight p0"> | ||
<span>AUD</span> | <h6> | ||
</h6> | <ion-icon name="arrow-forward"></ion-icon> | ||
</ion-col> | </h6> | ||
</ion-row> | </ion-col> | ||
</ion-row> | |||
<hr /> | |||
<ion-row> | |||
</div> | <ion-col class="textLeft p0"> | ||
<p>Currency</p> | |||
</ion-col> | |||
<ion-col class="textRight p0"> | |||
<h6> | |||
<span>AUD</span> | |||
</h6> | |||
</ion-col> | |||
</ion-row> | |||
</div> | </div> | ||
</ion-content> | </div> | ||
\ No newline at end of file | </ion-content> |
import { Injectable } from '@angular/core'; | import { Injectable } from "@angular/core"; | ||
import { AngularFirestore, AngularFirestoreDocument, AngularFirestoreCollection } from '@angular/fire/firestore'; | import { | ||
import { Router, ActivatedRoute } from '@angular/router'; | AngularFirestore, | ||
import { Products } from './services/product'; | AngularFirestoreDocument, | ||
import { Cart, CartItem } from './services/cart'; | AngularFirestoreCollection | ||
import { ServiceService } from './service.service'; | } from "@angular/fire/firestore"; | ||
import * as firebase from 'firebase'; | import { Router, ActivatedRoute } from "@angular/router"; | ||
import { take } from 'rxjs/operators'; | import { Products } from "./services/product"; | ||
import { User } from './services/user'; | import { Cart, CartItem } from "./services/cart"; | ||
import { from } from 'rxjs'; | import { ServiceService } from "./service.service"; | ||
import * as firebase from "firebase"; | |||
import { take } from "rxjs/operators"; | |||
import { User } from "./services/user"; | |||
import { from } from "rxjs"; | |||
@Injectable({ | @Injectable({ | ||
providedIn: 'root' | providedIn: "root" | ||
}) | }) | ||
export class CartsService { | export class CartsService { | ||
size: string; | size: string; | ||
... | @@ -27,13 +31,13 @@ export class CartsService { | ... | @@ -27,13 +31,13 @@ export class CartsService { |
public router: Router, | public router: Router, | ||
public service: ServiceService | public service: ServiceService | ||
) { | ) { | ||
this.custId = ''; | this.custId = ""; | ||
this.carts = []; | this.carts = []; | ||
const users = this.service.get('user').then(data => { | const users = this.service.get("user").then(data => { | ||
if (data) { | if (data) { | ||
data = JSON.parse(data); | data = JSON.parse(data); | ||
this.custId = data.uid; | this.custId = data.uid; | ||
console.log(this.custId); | // console.log(this.custId); | ||
} | } | ||
}); | }); | ||
} | } | ||
... | @@ -42,30 +46,30 @@ export class CartsService { | ... | @@ -42,30 +46,30 @@ export class CartsService { |
this.prodId = product.prodId; | this.prodId = product.prodId; | ||
const prodRef = firebase | const prodRef = firebase | ||
.firestore() | .firestore() | ||
.collection('products') | .collection("products") | ||
.doc(this.prodId); | .doc(this.prodId); | ||
this.size = this.size === undefined ? product.size[0] : this.size; | this.size = this.size === undefined ? product.size[0] : this.size; | ||
this.color = this.color === undefined ? product.color[0] : this.color; | this.color = this.color === undefined ? product.color[0] : this.color; | ||
const cartRef: AngularFirestoreCollection<any> = this.afs.collection( | const cartRef: AngularFirestoreCollection<any> = this.afs.collection( | ||
'carts', | "carts", | ||
ref => | ref => | ||
ref | ref | ||
.where('size', '==', this.size) | .where("size", "==", this.size) | ||
.where('color', '==', this.color) | .where("color", "==", this.color) | ||
.where('custId', '==', this.custId) | .where("custId", "==", this.custId) | ||
.where('product', '==', prodRef) | .where("product", "==", prodRef) | ||
); | ); | ||
cartRef | cartRef | ||
.valueChanges() | .valueChanges() | ||
.pipe(take(1)) | .pipe(take(1)) | ||
.subscribe(value => { | .subscribe(value => { | ||
console.log(value); | // console.log(value); | ||
if (value.length === 0) { | if (value.length === 0) { | ||
product.image = | product.image = | ||
product.image === undefined | product.image === undefined | ||
? '../assets/[email protected]' | ? "../assets/[email protected]" | ||
: product.image; | : product.image; | ||
const cart: Cart = { | const cart: Cart = { | ||
color: this.color, | color: this.color, | ||
... | @@ -80,36 +84,36 @@ export class CartsService { | ... | @@ -80,36 +84,36 @@ export class CartsService { |
qty: 1, | qty: 1, | ||
size: this.size | size: this.size | ||
}; | }; | ||
console.log(cart); | // console.log(cart); | ||
this.afs | this.afs | ||
.collection('carts') | .collection("carts") | ||
.add(cart) | .add(cart) | ||
.then(docRef => { | .then(docRef => { | ||
const neworderId = docRef.id; | const neworderId = docRef.id; | ||
this.afs | this.afs | ||
.collection('carts') | .collection("carts") | ||
.doc(neworderId) | .doc(neworderId) | ||
.update({ cartId: docRef.id }) | .update({ cartId: docRef.id }) | ||
.then(() => { | .then(() => { | ||
console.log('Booking Successfully'); | // console.log('Booking Successfully'); | ||
document.body.scrollTop = document.documentElement.scrollTop = 0; | document.body.scrollTop = document.documentElement.scrollTop = 0; | ||
}); | }); | ||
}) | }) | ||
.catch(error => { | .catch(error => { | ||
console.error('Error adding document: ', error); | console.error("Error adding document: ", error); | ||
}); | }); | ||
} else { | } else { | ||
console.log(value); | // console.log(value); | ||
// alert('Item already added in the cart'); | // alert('Item already added in the cart'); | ||
const cartId = value[0].cartId; | const cartId = value[0].cartId; | ||
// tslint:disable-next-line:radix | // tslint:disable-next-line:radix | ||
const qty = parseInt(value[0].qty) + 1; | const qty = parseInt(value[0].qty) + 1; | ||
this.afs | this.afs | ||
.collection('carts') | .collection("carts") | ||
.doc(cartId) | .doc(cartId) | ||
.update({ qty: `${qty}` }) | .update({ qty: `${qty}` }) | ||
.then(() => { | .then(() => { | ||
console.log('Booking Successfully'); | // console.log('Booking Successfully'); | ||
document.body.scrollTop = document.documentElement.scrollTop = 0; | document.body.scrollTop = document.documentElement.scrollTop = 0; | ||
}); | }); | ||
} | } | ||
... | @@ -118,8 +122,8 @@ export class CartsService { | ... | @@ -118,8 +122,8 @@ export class CartsService { |
public async cartList() { | public async cartList() { | ||
const cartRef: AngularFirestoreCollection<any> = this.afs.collection( | const cartRef: AngularFirestoreCollection<any> = this.afs.collection( | ||
'carts', | "carts", | ||
ref => ref.where('custId', '==', this.custId) | ref => ref.where("custId", "==", this.custId) | ||
); | ); | ||
cartRef.valueChanges().subscribe(value => { | cartRef.valueChanges().subscribe(value => { | ||
this.carts = []; | this.carts = []; | ||
... | @@ -139,7 +143,7 @@ export class CartsService { | ... | @@ -139,7 +143,7 @@ export class CartsService { |
qty: item.qty, | qty: item.qty, | ||
size: item.size | size: item.size | ||
}; | }; | ||
console.log(item.price, item.qty); | // console.log(item.price, item.qty); | ||
if (item.price) { | if (item.price) { | ||
this.cartTotal += item.price * item.qty; | this.cartTotal += item.price * item.qty; | ||
} | } | ||
... | @@ -175,9 +179,9 @@ export class CartsService { | ... | @@ -175,9 +179,9 @@ export class CartsService { |
? this.carts[index].qty - 1 | ? this.carts[index].qty - 1 | ||
: this.carts[index].qty; | : this.carts[index].qty; | ||
this.carts[index].qty = qty; | this.carts[index].qty = qty; | ||
console.log(this.carts[index].qty); | // console.log(this.carts[index].qty); | ||
this.afs | this.afs | ||
.collection('carts') | .collection("carts") | ||
.doc(this.carts[index].cartId) | .doc(this.carts[index].cartId) | ||
.update({ | .update({ | ||
qty: this.carts[index].qty | qty: this.carts[index].qty | ||
... | @@ -189,7 +193,7 @@ export class CartsService { | ... | @@ -189,7 +193,7 @@ export class CartsService { |
this.cartTotal = 0; | this.cartTotal = 0; | ||
this.carts[index].qty = qty; | this.carts[index].qty = qty; | ||
this.afs | this.afs | ||
.collection('carts') | .collection("carts") | ||
.doc(this.carts[index].cartId) | .doc(this.carts[index].cartId) | ||
.update({ | .update({ | ||
qty: this.carts[index].qty | qty: this.carts[index].qty | ||
... | @@ -198,21 +202,19 @@ export class CartsService { | ... | @@ -198,21 +202,19 @@ export class CartsService { |
removeItem(index) { | removeItem(index) { | ||
this.afs | this.afs | ||
.collection('carts') | .collection("carts") | ||
.doc(this.carts[index].cartId) | .doc(this.carts[index].cartId) | ||
.delete(); | .delete(); | ||
} | } | ||
checkPromo(promoCode: string) { | checkPromo(promoCode: string) { | ||
console.log(promoCode); | // console.log(promoCode); | ||
const state = true; | const state = true; | ||
const promoRef: AngularFirestoreCollection<any> = this.afs.collection('promocode', ref => ref.where('promoCode', '==', promoCode) | const promoRef: AngularFirestoreCollection<any> = this.afs.collection( | ||
.where('status', '==', state)); | "promocode", | ||
ref => | |||
ref.where("promoCode", "==", promoCode).where("status", "==", state) | |||
); | |||
return promoRef.valueChanges(); | return promoRef.valueChanges(); | ||
} | } | ||
} | } |
src/config/services/slides.ts
0 → 100644
src/config/update.service.ts
0 → 100644
src/config/user.service.ts
0 → 100644
Please
register
or
sign in
to comment