瀏覽代碼

Prototype For vendor app

master
kj1352 5 年之前
父節點
當前提交
1df49b534c
共有 3 個文件被更改,包括 21 次插入13 次删除
  1. +8
    -3
      src/app/dashboard/dashboard.component.ts
  2. +9
    -6
      src/app/orders/orders.component.ts
  3. +4
    -4
      src/app/widgets-holder/widgets-holder.component.html

+ 8
- 3
src/app/dashboard/dashboard.component.ts 查看文件

@@ -31,9 +31,14 @@ export class DashboardComponent implements OnInit {
this.orderService.getOrders().then((data) => { this.orderService.getOrders().then((data) => {
this.orderList = data; this.orderList = data;


this.orderList = this.orderList.filter((order) => {
return order.orderstatus;
});
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");
}); });


+ 9
- 6
src/app/orders/orders.component.ts 查看文件

@@ -60,13 +60,16 @@ export class OrdersComponent implements OnInit {
this.orderService.getOrders().then((data) => { this.orderService.getOrders().then((data) => {
this.orderList = data; this.orderList = data;


this.orderList = this.orderList.filter((order) => {
return order.orderstatus;
});
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 = this.orderList.filter((order) => {
return order.orderstatus;
});
this.tempOrderList = JSON.parse(JSON.stringify(this.orderList));
}, () => { }, () => {
alert("Error getting the orders"); alert("Error getting the orders");
}); });


+ 4
- 4
src/app/widgets-holder/widgets-holder.component.html 查看文件

@@ -1,10 +1,10 @@
<section class="nav-bar"> <section class="nav-bar">
<img src="assets/logo.svg" alt="Logo"> <img src="assets/logo.svg" alt="Logo">
<nav> <nav>
<a [ngClass]="{'active' : selected_nav === 'faq'}"
(click)="selected_nav = 'faq'"> FAQ's </a>
<a [ngClass]="{'active' : selected_nav === 'support'}"
(click)="selected_nav = 'support'"> Support </a>
<a [ngClass]="{'active' : selected_nav.name === 'faq'}"
(click)="selected_nav.name = 'faq'"> FAQ's </a>
<a [ngClass]="{'active' : selected_nav.name === 'support'}"
(click)="selected_nav.name = 'support'"> Support </a>
<button class="rect-button" (click)="logout()"> Logout </button> <button class="rect-button" (click)="logout()"> Logout </button>
</nav> </nav>
</section> </section>


Loading…
取消
儲存