| @@ -1,16 +1,16 @@ | |||||
| favicon.ico,1607952081261,a2aee5309d0b59b9b66384ccc3969a07fab1b320d0bf76f1b25047a051d7f774 | |||||
| index.html,1607952099256,1600639386bd54cc450463a5cc55597445fccb9e3f9d648c2214c6ebb6b9d3fe | |||||
| 3rdpartylicenses.txt,1607952081259,ba218377b44a5ec62b8d85472da773a88893601972bd99ccb0e927d7010da809 | |||||
| polyfills-es2015.5b10b8fd823b6392f1fd.js,1607952083361,82b136c9661df6035797722901e849107a79cb4d2f601cf1d37bef50bf748c25 | |||||
| runtime-es2015.c5fa8325f89fc516600b.js,1607952082316,c4aa0a348c0dcf9c6af4b7b3f066d0599bcec97472ed96ab232c8dceb70607cb | |||||
| runtime-es5.c5fa8325f89fc516600b.js,1607952082746,c4aa0a348c0dcf9c6af4b7b3f066d0599bcec97472ed96ab232c8dceb70607cb | |||||
| assets/logo.svg,1607952081261,7ce7bfefb18eaba9717f40992e0f44e7aa9aea1a12c385621f87e550d07507b5 | |||||
| styles.d5b1b1107483ebf486f9.css,1607952081260,f105151fbf96b2f8a51c918ba20bb6e553186903ed6e42a8d2405bb43ccb4a26 | |||||
| ionicons.96f1c901c087fb64019f.woff2,1607952081259,93a6cfdb340efa15a711b1aa8524031b6f2aa68a912521fc1b97880e5f970ddd | |||||
| ionicons.99b863497156d4478ec3.woff,1607952081260,cdce2111340a0888bf32c15491ab0feba340e289ff213793c5fc7bd82fcbe91f | |||||
| ionicons.a558ac78b554eefa1817.eot,1607952081260,1762cb70efe1ff2613db43496a2fc11a3216530411af2ceebc0707dc2a1d4ac4 | |||||
| ionicons.ef4a9f280b0e411ddf6c.ttf,1607952081260,f26df0ae0db088693c50cd143bb3391ba2b45f4ee35770fc5d4254dac2510492 | |||||
| polyfills-es5.3e8196928d184a6e5319.js,1607952092335,9bc51b1036e9ce398e58dbccf906d1152d01b1ea2811ab35288d653f9d2e7fea | |||||
| ionicons.d659209138fc7c28c23a.svg,1607952081261,e1f9cd1e9b409c9625989f870db98037c1104b45c8b8c9ab00d1b17a3474427f | |||||
| main-es2015.4e59cac2fd134ac532c3.js,1607952099233,6b07282589db823c2b91afd0bddb0b01085c5f62eb146b47711ae219d8a465b8 | |||||
| main-es5.4e59cac2fd134ac532c3.js,1607952097145,6f537c4dd2d7c019c63fc321260c6453dd5eb2b2e0a2b22d5c0eb63fa34654d0 | |||||
| index.html,1607955821208,60de4522b6b8c0d0e10ae63ab72002576ca944ae40d05d405ed322a51b614968 | |||||
| favicon.ico,1607955804241,a2aee5309d0b59b9b66384ccc3969a07fab1b320d0bf76f1b25047a051d7f774 | |||||
| 3rdpartylicenses.txt,1607955804240,ba218377b44a5ec62b8d85472da773a88893601972bd99ccb0e927d7010da809 | |||||
| runtime-es2015.c5fa8325f89fc516600b.js,1607955804597,c4aa0a348c0dcf9c6af4b7b3f066d0599bcec97472ed96ab232c8dceb70607cb | |||||
| runtime-es5.c5fa8325f89fc516600b.js,1607955804598,c4aa0a348c0dcf9c6af4b7b3f066d0599bcec97472ed96ab232c8dceb70607cb | |||||
| polyfills-es2015.5b10b8fd823b6392f1fd.js,1607955804587,82b136c9661df6035797722901e849107a79cb4d2f601cf1d37bef50bf748c25 | |||||
| assets/logo.svg,1607955804244,7ce7bfefb18eaba9717f40992e0f44e7aa9aea1a12c385621f87e550d07507b5 | |||||
| styles.d5b1b1107483ebf486f9.css,1607955804241,f105151fbf96b2f8a51c918ba20bb6e553186903ed6e42a8d2405bb43ccb4a26 | |||||
| ionicons.96f1c901c087fb64019f.woff2,1607955804240,93a6cfdb340efa15a711b1aa8524031b6f2aa68a912521fc1b97880e5f970ddd | |||||
| polyfills-es5.3e8196928d184a6e5319.js,1607955804592,9bc51b1036e9ce398e58dbccf906d1152d01b1ea2811ab35288d653f9d2e7fea | |||||
| ionicons.99b863497156d4478ec3.woff,1607955804240,cdce2111340a0888bf32c15491ab0feba340e289ff213793c5fc7bd82fcbe91f | |||||
| ionicons.a558ac78b554eefa1817.eot,1607955804241,1762cb70efe1ff2613db43496a2fc11a3216530411af2ceebc0707dc2a1d4ac4 | |||||
| ionicons.ef4a9f280b0e411ddf6c.ttf,1607955804243,f26df0ae0db088693c50cd143bb3391ba2b45f4ee35770fc5d4254dac2510492 | |||||
| ionicons.d659209138fc7c28c23a.svg,1607955804245,e1f9cd1e9b409c9625989f870db98037c1104b45c8b8c9ab00d1b17a3474427f | |||||
| main-es5.a5a5560ec9c669276956.js,1607955819010,4e6e93cb10ec5ce236dac7f189529c70149f8a4d7e14169f0559bb9591d72b56 | |||||
| main-es2015.a5a5560ec9c669276956.js,1607955821159,d444ffcf380e411995065ffec7b4c42f7a2d0725a4eca44393038be0251bb216 | |||||
| @@ -1,17 +0,0 @@ | |||||
| [debug] [2020-12-14T14:23:53.698Z] ---------------------------------------------------------------------- | |||||
| [debug] [2020-12-14T14:23:53.700Z] Command: /usr/local/bin/firebase /Users/kj1352/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/bin/firebase deploy | |||||
| [debug] [2020-12-14T14:23:53.701Z] CLI Version: 8.19.0 | |||||
| [debug] [2020-12-14T14:23:53.701Z] Platform: darwin | |||||
| [debug] [2020-12-14T14:23:53.701Z] Node Version: v12.18.1 | |||||
| [debug] [2020-12-14T14:23:53.712Z] Time: Mon Dec 14 2020 19:53:53 GMT+0530 (India Standard Time) | |||||
| [debug] [2020-12-14T14:23:53.713Z] ---------------------------------------------------------------------- | |||||
| [debug] [2020-12-14T14:23:53.713Z] | |||||
| [debug] [2020-12-14T14:23:53.729Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"] | |||||
| [debug] [2020-12-14T14:23:53.730Z] > authorizing via signed-in user | |||||
| [debug] [2020-12-14T14:23:53.730Z] [iam] checking project vendor-app-20 for permissions ["firebase.projects.get","firebasehosting.sites.update"] | |||||
| [debug] [2020-12-14T14:23:53.736Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"] | |||||
| [debug] [2020-12-14T14:23:53.737Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token | |||||
| <request body omitted> | |||||
| [debug] [2020-12-14T14:23:53.957Z] <<< HTTP RESPONSE 200 {"expires":"Mon, 01 Jan 1990 00:00:00 GMT","pragma":"no-cache","cache-control":"no-cache, no-store, max-age=0, must-revalidate","date":"Mon, 14 Dec 2020 14:23:54 GMT","content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","server":"scaffolding on HTTPServer2","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"} | |||||
| [debug] [2020-12-14T14:23:53.978Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/vendor-app-20:testIamPermissions | |||||
| {"permissions":["firebase.projects.get","firebasehosting.sites.update"]} | |||||
| @@ -63,7 +63,7 @@ | |||||
| <ul class="pending-orders" *ngIf="getFilteredOrders('pending').length > 0"> | <ul class="pending-orders" *ngIf="getFilteredOrders('pending').length > 0"> | ||||
| <div class="heading"> | <div class="heading"> | ||||
| <header> Pending Orders: </header> | <header> Pending Orders: </header> | ||||
| <a> View All </a> | |||||
| <a (click)="goToOrdersPage('pending')"> View All </a> | |||||
| </div> | </div> | ||||
| <li *ngFor="let order of getFilteredOrders('pending')"> | <li *ngFor="let order of getFilteredOrders('pending')"> | ||||
| <div class="info"> | <div class="info"> | ||||
| @@ -9,40 +9,71 @@ import * as moment from 'moment'; | |||||
| styleUrls: ['./dashboard.component.scss'] | styleUrls: ['./dashboard.component.scss'] | ||||
| }) | }) | ||||
| export class DashboardComponent implements OnInit { | export class DashboardComponent implements OnInit { | ||||
| filterOptions: Array<IFilterOption>; | |||||
| filterOptions: Array<IFilterOption> = [{ | |||||
| name: 'Yesterday', | |||||
| id: 'yesterday' | |||||
| }, { | |||||
| name: 'Today', | |||||
| id: 'today' | |||||
| }]; | |||||
| orderList: any = []; | orderList: any = []; | ||||
| orderStatus: any = []; | orderStatus: any = []; | ||||
| @Output() dashboardEvents = new EventEmitter(); | @Output() dashboardEvents = new EventEmitter(); | ||||
| profile_type: string; | |||||
| profile_info: any; | |||||
| constructor( | constructor( | ||||
| private orderService: OrderService | private orderService: OrderService | ||||
| ) { } | ) { } | ||||
| ngOnInit() { | ngOnInit() { | ||||
| this.filterOptions = [{ | |||||
| name: 'Yesterday', | |||||
| id: 'yesterday' | |||||
| }, { | |||||
| name: 'Today', | |||||
| id: 'today' | |||||
| }]; | |||||
| this.orderService.getOrders().then((data) => { | |||||
| this.orderList = data; | |||||
| for (let i = 0; i < this.orderList.length; i += 1) { | |||||
| if (!this.orderList[i].orderstatus) { | |||||
| this.orderList[i].orderstatus = { | |||||
| orderStatus: "", | |||||
| orderstatus_id: 6 | |||||
| this.calculateOrders(); | |||||
| } | |||||
| calculateOrders() { | |||||
| this.profile_type = localStorage.current_login_type; | |||||
| if (this.profile_type === 'VENDOR') { | |||||
| this.profile_info = JSON.parse(localStorage.vendor_info); | |||||
| this.orderService.getOrders().then((data) => { | |||||
| this.orderList = data; | |||||
| for (let i = 0; i < this.orderList.length; i += 1) { | |||||
| if (!this.orderList[i].orderstatus) { | |||||
| this.orderList[i].orderstatus = { | |||||
| orderStatus: "", | |||||
| orderstatus_id: 6 | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | |||||
| }, () => { | |||||
| alert("Error getting the orders"); | |||||
| }); | |||||
| } | |||||
| }, () => { | |||||
| alert("Error getting the orders"); | |||||
| }); | |||||
| } else if (this.profile_type === 'OUTLET') { | |||||
| this.profile_info = JSON.parse(localStorage.outlet_info); | |||||
| this.orderService.getOrdersForOutlet(this.profile_info.outlet_id).then((data) => { | |||||
| this.orderList = data; | |||||
| for (let i = 0; i < this.orderList.length; i += 1) { | |||||
| if (!this.orderList[i].orderstatus) { | |||||
| this.orderList[i].orderstatus = { | |||||
| orderStatus: "", | |||||
| orderstatus_id: 6 | |||||
| } | |||||
| } | |||||
| } | |||||
| }, () => { | |||||
| alert("Error getting the orders"); | |||||
| }); | |||||
| } | |||||
| } | |||||
| getFormattedDate(date: any, format: string) { | getFormattedDate(date: any, format: string) { | ||||
| return moment(date).format(format); | return moment(date).format(format); | ||||
| @@ -14,6 +14,13 @@ | |||||
| <input type="password" placeholder="Enter Password" [(ngModel)]="credentials.password"> | <input type="password" placeholder="Enter Password" [(ngModel)]="credentials.password"> | ||||
| </div> | </div> | ||||
| <div class="input-holder"> | |||||
| <label> Login Type </label> | |||||
| <select [(ngModel)]="credentials.login_type"> | |||||
| <option *ngFor="let type of login_types" [value]="type"> {{ type }} </option> | |||||
| </select> | |||||
| </div> | |||||
| <button class="rect-button" (click)="requestAuthentication()"> Login </button> | <button class="rect-button" (click)="requestAuthentication()"> Login </button> | ||||
| <p *ngIf="errorMessage" class="error"> {{ errorMessage }} </p> | <p *ngIf="errorMessage" class="error"> {{ errorMessage }} </p> | ||||
| @@ -34,7 +34,7 @@ | |||||
| padding-left: 5px; | padding-left: 5px; | ||||
| } | } | ||||
| input { | |||||
| input, select { | |||||
| height: 40px; | height: 40px; | ||||
| width: 100%; | width: 100%; | ||||
| display: block; | display: block; | ||||
| @@ -9,11 +9,15 @@ import { AuthService } from '../services/auth.service'; | |||||
| }) | }) | ||||
| export class LoginComponent implements OnInit { | export class LoginComponent implements OnInit { | ||||
| credentials = { | credentials = { | ||||
| username: 'ramsesrh', | |||||
| username: 'suresh', | |||||
| password: '123456789', | password: '123456789', | ||||
| login_type: "vendor" | |||||
| login_type: "OUTLET" | |||||
| }; | }; | ||||
| // ramsesrh | |||||
| login_types = ['VENDOR', 'OUTLET']; | |||||
| errorMessage: string = ''; | errorMessage: string = ''; | ||||
| constructor( | constructor( | ||||
| @@ -26,8 +30,16 @@ export class LoginComponent implements OnInit { | |||||
| requestAuthentication() { | requestAuthentication() { | ||||
| this.authService.authenticateUser(this.credentials).then((data: any) => { | this.authService.authenticateUser(this.credentials).then((data: any) => { | ||||
| localStorage.vendor_token = data.access_Token; | |||||
| localStorage.vendor_info = JSON.stringify(data); | |||||
| localStorage.current_login_type = this.credentials.login_type; | |||||
| localStorage.token = data.access_Token; | |||||
| localStorage.user_info = JSON.stringify(data['User Info']); | |||||
| if (this.credentials.login_type === 'VENDOR') { | |||||
| localStorage.vendor_info = JSON.stringify(data['Info Info']); | |||||
| } else { | |||||
| localStorage.outlet_info = JSON.stringify(data['Outlet Info']); | |||||
| } | |||||
| this.router.navigate(['shop-details']); | this.router.navigate(['shop-details']); | ||||
| }, (err: any) => { | }, (err: any) => { | ||||
| this.errorMessage = 'Please check your credentials'; | this.errorMessage = 'Please check your credentials'; | ||||
| @@ -1,5 +1,5 @@ | |||||
| <div class="widget-heading-holder"> | <div class="widget-heading-holder"> | ||||
| <header> Order List </header> | |||||
| <header> Order List ({{ getFilteredOrders(filterOption.orderstatus_id).length }}) </header> | |||||
| <div class="filter-container"> | <div class="filter-container"> | ||||
| <div class="selector-container"> | <div class="selector-container"> | ||||
| @@ -23,6 +23,8 @@ export class OrdersComponent implements OnInit { | |||||
| }; | }; | ||||
| @Input() params: any; | @Input() params: any; | ||||
| profile_type: any; | |||||
| profile_info: any; | |||||
| constructor( | constructor( | ||||
| private orderService: OrderService | private orderService: OrderService | ||||
| @@ -56,23 +58,14 @@ export class OrdersComponent implements OnInit { | |||||
| }; | }; | ||||
| } | } | ||||
| } | } | ||||
| this.calculateOrders(); | |||||
| } | |||||
| this.orderService.getOrders().then((data) => { | |||||
| this.orderList = data; | |||||
| for (let i = 0; i < this.orderList.length; i += 1) { | |||||
| if (!this.orderList[i].orderstatus) { | |||||
| this.orderList[i].orderstatus = { | |||||
| orderStatus: "", | |||||
| orderstatus_id: 6 | |||||
| } | |||||
| } | |||||
| } | |||||
| this.tempOrderList = JSON.parse(JSON.stringify(this.orderList)); | |||||
| }, () => { | |||||
| alert("Error getting the orders"); | |||||
| }); | |||||
| calculateOrders() { | |||||
| this.profile_type = localStorage.current_login_type; | |||||
| this.orderService.getallOrderStatus().then((data: any) => { | this.orderService.getallOrderStatus().then((data: any) => { | ||||
| this.orderStatus = data; | this.orderStatus = data; | ||||
| @@ -82,9 +75,61 @@ export class OrdersComponent implements OnInit { | |||||
| orderstatus_id: 0 | orderstatus_id: 0 | ||||
| }); | }); | ||||
| }, () => { | }, () => { | ||||
| alert("Error getting the order statuses"); | |||||
| this.orderStatus = [{ | |||||
| orderstatus_id: 6, | |||||
| orderStatus: 'Pending', | |||||
| }, { | |||||
| orderstatus_id: 3, | |||||
| orderStatus: 'Delivered', | |||||
| }, { | |||||
| orderstatus_id: 1, | |||||
| orderStatus: 'Confirmed', | |||||
| }]; | |||||
| }); | }); | ||||
| } | |||||
| if (this.profile_type === 'VENDOR') { | |||||
| this.profile_info = JSON.parse(localStorage.vendor_info); | |||||
| this.orderService.getOrders().then((data) => { | |||||
| this.orderList = data; | |||||
| for (let i = 0; i < this.orderList.length; i += 1) { | |||||
| if (!this.orderList[i].orderstatus) { | |||||
| this.orderList[i].orderstatus = { | |||||
| orderStatus: "", | |||||
| orderstatus_id: 6 | |||||
| } | |||||
| } | |||||
| } | |||||
| this.tempOrderList = JSON.parse(JSON.stringify(this.orderList)); | |||||
| }, () => { | |||||
| alert("Error getting the orders"); | |||||
| }); | |||||
| } else if (this.profile_type === 'OUTLET') { | |||||
| this.profile_info = JSON.parse(localStorage.outlet_info); | |||||
| this.orderService.getOrdersForOutlet(this.profile_info.outlet_id).then((data) => { | |||||
| this.orderList = data; | |||||
| for (let i = 0; i < this.orderList.length; i += 1) { | |||||
| if (!this.orderList[i].orderstatus) { | |||||
| this.orderList[i].orderstatus = { | |||||
| orderStatus: "", | |||||
| orderstatus_id: 6 | |||||
| } | |||||
| } | |||||
| } | |||||
| this.tempOrderList = JSON.parse(JSON.stringify(this.orderList)); | |||||
| }, () => { | |||||
| alert("Error getting the orders"); | |||||
| }); | |||||
| } | |||||
| } | |||||
| getFormattedDate(date: any, format: string) { | getFormattedDate(date: any, format: string) { | ||||
| return moment(date).format(format); | return moment(date).format(format); | ||||
| @@ -15,18 +15,29 @@ export class OrderService { | |||||
| headers: new HttpHeaders({ | headers: new HttpHeaders({ | ||||
| 'Access-Control-Allow-Origin': '*', | 'Access-Control-Allow-Origin': '*', | ||||
| 'Content-Type': 'application/json', | 'Content-Type': 'application/json', | ||||
| 'Authorization': 'Bearer ' + localStorage.vendor_token | |||||
| 'Authorization': 'Bearer ' + localStorage.token | |||||
| }) | }) | ||||
| }; | }; | ||||
| return this.http.get(URL + '/api/maioraservice/orders/getallOrders/', httpOptions).toPromise(); | return this.http.get(URL + '/api/maioraservice/orders/getallOrders/', httpOptions).toPromise(); | ||||
| } | } | ||||
| getOrdersForOutlet(id: string | number) { | |||||
| const httpOptions = { | |||||
| headers: new HttpHeaders({ | |||||
| 'Access-Control-Allow-Origin': '*', | |||||
| 'Content-Type': 'application/json', | |||||
| 'Authorization': 'Bearer ' + localStorage.token | |||||
| }) | |||||
| }; | |||||
| return this.http.get(URL + '/api/maioraservice/order/v1/outlet_id/' + id.toString() + '/', httpOptions).toPromise(); | |||||
| } | |||||
| getallOrderStatus() { | getallOrderStatus() { | ||||
| const httpOptions = { | const httpOptions = { | ||||
| headers: new HttpHeaders({ | headers: new HttpHeaders({ | ||||
| 'Access-Control-Allow-Origin': '*', | 'Access-Control-Allow-Origin': '*', | ||||
| 'Content-Type': 'application/json', | 'Content-Type': 'application/json', | ||||
| 'Authorization': 'Bearer ' + localStorage.vendor_token | |||||
| 'Authorization': 'Bearer ' + localStorage.token | |||||
| }) | }) | ||||
| }; | }; | ||||
| return this.http.get(URL + '/api/maioraservice/orders/getallOrderStatus', httpOptions).toPromise(); | return this.http.get(URL + '/api/maioraservice/orders/getallOrderStatus', httpOptions).toPromise(); | ||||
| @@ -38,7 +49,7 @@ export class OrderService { | |||||
| headers: new HttpHeaders({ | headers: new HttpHeaders({ | ||||
| 'Access-Control-Allow-Origin': '*', | 'Access-Control-Allow-Origin': '*', | ||||
| 'Content-Type': 'application/json', | 'Content-Type': 'application/json', | ||||
| 'Authorization': 'Bearer ' + localStorage.vendor_token | |||||
| 'Authorization': 'Bearer ' + localStorage.token | |||||
| }) | }) | ||||
| }; | }; | ||||
| return this.http.get(URL + '/api/maioraservice/orders/getorders/user_id/' + uid + '/', httpOptions).toPromise(); | return this.http.get(URL + '/api/maioraservice/orders/getorders/user_id/' + uid + '/', httpOptions).toPromise(); | ||||
| @@ -49,7 +60,7 @@ export class OrderService { | |||||
| headers: new HttpHeaders({ | headers: new HttpHeaders({ | ||||
| 'Access-Control-Allow-Origin': '*', | 'Access-Control-Allow-Origin': '*', | ||||
| 'Content-Type': 'application/json', | 'Content-Type': 'application/json', | ||||
| 'Authorization': 'Bearer ' + localStorage.vendor_token | |||||
| 'Authorization': 'Bearer ' + localStorage.token | |||||
| }) | }) | ||||
| }; | }; | ||||
| return this.http.put(URL + '/api/maioraservice/orders/v1/update', data , httpOptions).toPromise(); | return this.http.put(URL + '/api/maioraservice/orders/v1/update', data , httpOptions).toPromise(); | ||||
| @@ -12,12 +12,20 @@ | |||||
| <div class="container"> | <div class="container"> | ||||
| <section class="side-navigation"> | <section class="side-navigation"> | ||||
| <section class="user-info"> | |||||
| <section class="user-info" *ngIf="profile_type === 'VENDOR'"> | |||||
| <img> | <img> | ||||
| <div class="name"> {{ vendor_info.vendorName }} </div> | |||||
| <div class="other-info"> Vendor ID: {{ vendor_info.vendor_Id }} </div> | |||||
| <div class="other-info"> {{ vendor_info.outlet.length }} Outlets </div> | |||||
| <div class="other-info"> Average Rating: 4.0 <i class="icon ion-ios-star"></i> </div> | |||||
| <div class="name"> {{ profile_info.vendorName }} </div> | |||||
| <div class="other-info"> Vendor ID: {{ profile_info.vendor_Id }} </div> | |||||
| <div class="other-info"> {{ profile_info.outlet.length }} Outlets </div> | |||||
| <div class="other-info"> Average Rating: 3 <i class="icon ion-ios-star"></i> </div> | |||||
| </section> | |||||
| <section class="user-info" *ngIf="profile_type === 'OUTLET'"> | |||||
| <img> | |||||
| <div class="name"> {{ profile_info.outlet_name }} </div> | |||||
| <div class="other-info"> Outlet ID: {{ profile_info.outlet_id }} </div> | |||||
| <div class="other-info"> {{ profile_info.menuitems.length }} Menu Items </div> | |||||
| <div class="other-info"> Average Rating: {{ profile_info.rating }} <i class="icon ion-ios-star"></i> </div> | |||||
| </section> | </section> | ||||
| <ul> | <ul> | ||||
| @@ -27,16 +35,16 @@ | |||||
| <li [ngClass]="{'active' : selected_nav.name === 'orders'}" (click)="selected_nav.name = 'orders'"> | <li [ngClass]="{'active' : selected_nav.name === 'orders'}" (click)="selected_nav.name = 'orders'"> | ||||
| <i class="icon ion-ios-cube"></i> <label> Orders </label> | <i class="icon ion-ios-cube"></i> <label> Orders </label> | ||||
| </li> | </li> | ||||
| <li [ngClass]="{'active' : selected_nav.name === 'items'}" (click)="selected_nav.name = 'items'"> | |||||
| <li *ngIf="profile_type === 'VENDOR'" [ngClass]="{'active' : selected_nav.name === 'items'}" (click)="selected_nav.name = 'items'"> | |||||
| <i class="icon ion-ios-clipboard"></i> <label> Menu Items & Offers </label> | <i class="icon ion-ios-clipboard"></i> <label> Menu Items & Offers </label> | ||||
| </li> | </li> | ||||
| <li [ngClass]="{'active' : selected_nav.name === 'schedule'}" (click)="selected_nav.name = 'schedule'"> | |||||
| <li *ngIf="profile_type === 'VENDOR'" [ngClass]="{'active' : selected_nav.name === 'schedule'}" (click)="selected_nav.name = 'schedule'"> | |||||
| <i class="icon ion-ios-calendar"></i> <label> Shop Schedules </label> | <i class="icon ion-ios-calendar"></i> <label> Shop Schedules </label> | ||||
| </li> | </li> | ||||
| <li [ngClass]="{'active' : selected_nav.name === 'profile'}" (click)="selected_nav.name = 'profile'"> | |||||
| <li *ngIf="profile_type === 'VENDOR'" [ngClass]="{'active' : selected_nav.name === 'profile'}" (click)="selected_nav.name = 'profile'"> | |||||
| <i class="icon ion-ios-person"></i> <label> Profile </label> | <i class="icon ion-ios-person"></i> <label> Profile </label> | ||||
| </li> | </li> | ||||
| <li [ngClass]="{'active' : selected_nav.name === 'settings'}" (click)="selected_nav.name = 'settings'"> | |||||
| <li *ngIf="profile_type === 'VENDOR'" [ngClass]="{'active' : selected_nav.name === 'settings'}" (click)="selected_nav.name = 'settings'"> | |||||
| <i class="icon ion-ios-cog"></i> <label> Settings </label> | <i class="icon ion-ios-cog"></i> <label> Settings </label> | ||||
| </li> | </li> | ||||
| <li [ngClass]="{'active' : selected_nav.name === 'more'}" (click)="selected_nav.name = 'more'"> | <li [ngClass]="{'active' : selected_nav.name === 'more'}" (click)="selected_nav.name = 'more'"> | ||||
| @@ -14,15 +14,24 @@ export class WidgetsHolderComponent implements OnInit { | |||||
| name: 'dashboard', | name: 'dashboard', | ||||
| params: '' | params: '' | ||||
| }; | }; | ||||
| vendor_info: any; | |||||
| profile_info: any; | |||||
| profile_type: string; | |||||
| constructor( | constructor( | ||||
| private router: Router | private router: Router | ||||
| ) { } | ) { } | ||||
| ngOnInit() { | ngOnInit() { | ||||
| let data = JSON.parse(localStorage.vendor_info); | |||||
| this.vendor_info = data['Info Info']; | |||||
| this.profile_type = localStorage.current_login_type; | |||||
| if (this.profile_type === 'VENDOR') { | |||||
| this.profile_info = JSON.parse(localStorage.vendor_info); | |||||
| } else if (this.profile_type === 'OUTLET') { | |||||
| this.profile_info = JSON.parse(localStorage.outlet_info); | |||||
| } else { | |||||
| this.router.navigate(['/login']); | |||||
| } | |||||
| } | } | ||||
| getNavPage(page: string) { | getNavPage(page: string) { | ||||