|
|
|
@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'; |
|
|
|
import { Location } from '@angular/common'; |
|
|
|
import { MallService } from '../services/mall.service'; |
|
|
|
import { Router } from '@angular/router'; |
|
|
|
import { ToastController } from '@ionic/angular'; |
|
|
|
import { OrderService } from '../services/order.service'; |
|
|
|
import * as moment from 'moment'; |
|
|
|
|
|
|
|
export type ICart = { |
|
|
|
@@ -40,7 +40,7 @@ export class CartPage implements OnInit { |
|
|
|
constructor( |
|
|
|
private location: Location, |
|
|
|
private router: Router, |
|
|
|
public toastController: ToastController, |
|
|
|
private orderService: OrderService, |
|
|
|
private mallService: MallService |
|
|
|
) { } |
|
|
|
|
|
|
|
@@ -236,4 +236,12 @@ export class CartPage implements OnInit { |
|
|
|
return total; |
|
|
|
} |
|
|
|
|
|
|
|
placeOrder() { |
|
|
|
this.orderService.createOrder(this.userCart).then((resp) => { |
|
|
|
console.log(resp); |
|
|
|
}, (err) => { |
|
|
|
console.log(err); |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
} |