22 changed files with 259 additions and 59 deletions
Split View
Diff Options
-
BINShopify-Cart.rar
-
2Shopify-Cart/src/main/resources/application.properties
-
6ShopifyUI/proxy.conf.json
-
2ShopifyUI/src/app/app-routing.module.ts
-
4ShopifyUI/src/app/auth/login/login.component.html
-
4ShopifyUI/src/app/auth/sign-up/sign-up.component.html
-
13ShopifyUI/src/app/components/cart/cart.component.html
-
6ShopifyUI/src/app/components/home/home.component.html
-
43ShopifyUI/src/app/components/orders/orders.component.css
-
71ShopifyUI/src/app/components/orders/orders.component.html
-
33ShopifyUI/src/app/components/orders/orders.component.ts
-
2ShopifyUI/src/app/components/payments/payments.component.html
-
19ShopifyUI/src/app/components/payments/payments.component.ts
-
8ShopifyUI/src/app/components/product-detail/product-detail.component.html
-
30ShopifyUI/src/app/components/product-detail/product-detail.component.ts
-
6ShopifyUI/src/app/components/products/products.component.html
-
24ShopifyUI/src/app/components/products/products.component.ts
-
5ShopifyUI/src/app/components/userprofile/userprofile.component.css
-
6ShopifyUI/src/app/components/userprofile/userprofile.component.html
-
11ShopifyUI/src/app/model/order.model.ts
-
17ShopifyUI/src/app/service/order.service.ts
-
6ShopifyUI/src/styles.css
@ -1,14 +1,14 @@ |
|||
{ |
|||
"/api1": { |
|||
"target": "http://10.3.117.22:8001", |
|||
"target": "http://10.3.117.30:8001", |
|||
"secure": false |
|||
}, |
|||
"/api2": { |
|||
"target": "http://10.3.117.22:8002", |
|||
"target": "http://10.3.117.30:8002", |
|||
"secure": false |
|||
}, |
|||
"/api3": { |
|||
"target": "http://10.3.117.22:8003", |
|||
"target": "http://10.3.117.30:8004", |
|||
"secure": false |
|||
} |
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
.orders { |
|||
margin: 0px auto; |
|||
} |
|||
|
|||
.orderHeading h1 { |
|||
font-size: 3em; |
|||
} |
|||
.order{ |
|||
color: #1B4F72; |
|||
padding: 12px; |
|||
border: 1px solid lightgray; |
|||
} |
|||
|
|||
.data { |
|||
overflow-x: hidden; |
|||
overflow-y: scroll; |
|||
height: 520px; |
|||
border: 1px solid lightgray; |
|||
} |
|||
|
|||
.dataheading { |
|||
overflow-x: hidden; |
|||
overflow-y: scroll; |
|||
background-color: #1B4F72; |
|||
padding: 12px; |
|||
} |
|||
|
|||
.nd { |
|||
background-color: #F39C12; |
|||
padding: 6px; |
|||
border-radius: 20px; |
|||
color: white; |
|||
} |
|||
|
|||
.d { |
|||
background-color: #27AE60; |
|||
color: white; |
|||
} |
|||
|
|||
.dc { |
|||
background-color: #E74C3C; |
|||
color: white; |
|||
} |
|||
@ -1 +1,70 @@ |
|||
<p>orders works!</p> |
|||
<div class="row navbar text-right"> |
|||
<div class="col-1"></div> |
|||
<div class="col-5"> |
|||
<h2>Shopify</h2> |
|||
</div> |
|||
<div class="col-1"> |
|||
<a routerLink="/home"><i class="bi bi-house"></i></a> |
|||
</div> |
|||
<div class="col-1"> |
|||
<a routerLink="/products"><i class="bi bi-box-seam"></i></a> |
|||
</div> |
|||
<div class="col-1"> |
|||
<a routerLink="/cart/{{uid}}"><i class="bi bi-cart3"></i> {{cartNo}}</a> |
|||
</div> |
|||
<div class="col-3 loginbtn"> |
|||
<ng-container *ngIf="authcode == null;then loginmsg else logoutmsg"></ng-container> |
|||
<ng-template #logoutmsg> |
|||
<div ngbDropdown class="d-inline-block"> |
|||
<button class="btn dropBtn" id="dropdownBasic1" ngbDropdownToggle><i class="bi bi-person"></i>Welcome {{username}}</button> |
|||
<div ngbDropdownMenu aria-labelledby="dropdownBasic1"> |
|||
<button ngbDropdownItem disabled class="usernameBtn">Hello {{username}}</button> |
|||
<hr> |
|||
<button ngbDropdownItem routerLink="/personalDetails/{{uid}}"><i class="bi bi-person-circle"></i> Personal details</button> |
|||
<button ngbDropdownItem routerLink="/orders/{{uid}}" class="activeBtn"><i class="bi bi-box"></i> Orders</button> |
|||
<button ngbDropdownItem (click)="onLogout()"><i class="bi bi-box-arrow-right"></i> Logout</button> |
|||
</div> |
|||
</div> |
|||
</ng-template> |
|||
<ng-template #loginmsg> |
|||
<a routerLink="/login">Login To Continue</a> |
|||
</ng-template> |
|||
</div> |
|||
<div class="col-1"></div> |
|||
</div> |
|||
<br><br> |
|||
<div class="row"> |
|||
<div class="col-12 text-center orderHeading"> |
|||
<h1 style="color: #1B4F72;">MY ORDERS</h1> |
|||
</div> |
|||
</div> |
|||
<br><br> |
|||
<div class="row"> |
|||
<div class="col-10 orders"> |
|||
<div class="row dataheading text-center"> |
|||
<div class="col-2"><h6>Order Id</h6></div> |
|||
<div class="col-2"><h6>Order Number</h6></div> |
|||
<div class="col-2"><h6>Product Name</h6></div> |
|||
<div class="col-2"><h6>Quantity</h6></div> |
|||
<div class="col-2"><h6>Price</h6></div> |
|||
<div class="col-2"><h6>Order Status</h6></div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-10 orders data"> |
|||
<div *ngFor='let o of orders'> |
|||
<div class="row order text-center align-items-center"> |
|||
<div class="col-2">{{o.id}}</div> |
|||
<div class="col-2">{{o.orderNumber}}</div> |
|||
<div class="col-2">{{o.productName}}</div> |
|||
<div class="col-2">{{o.quantity}}</div> |
|||
<div class="col-2">{{o.price}}</div> |
|||
<div class="col-2 nd" *ngIf="o.status == 'Not Delivered'">{{o.status}}</div> |
|||
<div class="col-2 d" *ngIf="o.status == 'Delivered'">{{o.status}}</div> |
|||
<div class="col-2 dc" *ngIf="o.status == 'Cancelled'">{{o.status}}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<br><br><br> |
|||
@ -0,0 +1,11 @@ |
|||
export class Order { |
|||
id?: number; |
|||
quantity?: number; |
|||
price?: number; |
|||
status?: string; |
|||
orderNumber?: number; |
|||
userId?: number; |
|||
productId?: number; |
|||
username?: string; |
|||
productName?: string; |
|||
} |
|||
@ -1,9 +1,24 @@ |
|||
import { HttpClient } from '@angular/common/http'; |
|||
import { Injectable } from '@angular/core'; |
|||
import { Observable } from 'rxjs'; |
|||
import { Order } from '../model/order.model'; |
|||
|
|||
@Injectable({ |
|||
providedIn: 'root' |
|||
}) |
|||
export class OrderService { |
|||
|
|||
constructor() { } |
|||
path:String = "http://localhost:59279/api3"; |
|||
|
|||
constructor(private httpClient:HttpClient) { } |
|||
|
|||
public postOrder(uid:number, order:Order): Observable<any> { |
|||
let order_post_api = this.path + "/order/" + uid; |
|||
return this.httpClient.post<any>(order_post_api,order); |
|||
} |
|||
|
|||
public getOrderByUser(uid:number): Observable<Order[]> { |
|||
let order_get_api = this.path + "/order/" + uid; |
|||
return this.httpClient.get<Order[]>(order_get_api); |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue