diff --git a/src/app/components/auth/auth.module.ts b/src/app/components/auth/auth.module.ts index bd3148e..fe8670a 100644 --- a/src/app/components/auth/auth.module.ts +++ b/src/app/components/auth/auth.module.ts @@ -1,5 +1,7 @@ import { NgModule } from "@angular/core"; import { CommonModule } from "@angular/common"; +import { environment } from "../../../environments/environment"; +import firebase from 'firebase/compat/app'; import { AuthRoutingModule } from "./auth-routing.module"; import { LoginComponent } from "./login/login.component"; @@ -15,6 +17,8 @@ import { SendEmailComponent } from './send-email/send-email.component'; import { EmailVerifiedComponent } from './email-verified/email-verified.component'; import { EmailNotVerifiedComponent } from './email-not-verified/email-not-verified.component'; +firebase.initializeApp(environment.firebaseConfig); + @NgModule({ declarations: [LoginComponent, SignupComponent, ForbiddenComponent, ResetPasswordComponent, SendEmailComponent, EmailVerifiedComponent, EmailNotVerifiedComponent], imports: [ @@ -24,6 +28,6 @@ import { EmailNotVerifiedComponent } from './email-not-verified/email-not-verifi CarouselModule, SharedModule, NgbModule, - FormsModule], + FormsModule] }) export class AuthModule { } diff --git a/src/app/components/auth/login/login.component.html b/src/app/components/auth/login/login.component.html index b656482..f82fad1 100644 --- a/src/app/components/auth/login/login.component.html +++ b/src/app/components/auth/login/login.component.html @@ -147,13 +147,15 @@
-
- -->
-
diff --git a/src/app/components/auth/signup/signup.component.html b/src/app/components/auth/signup/signup.component.html index dc15cec..64b23f5 100644 --- a/src/app/components/auth/signup/signup.component.html +++ b/src/app/components/auth/signup/signup.component.html @@ -21,12 +21,12 @@
- - * Họ và tên
- +
Vui lòng không được bỏ trống @@ -61,7 +62,8 @@
- +
Vui lòng không được bỏ trống @@ -78,7 +80,8 @@
- +
Vui lòng không được bỏ @@ -92,9 +95,9 @@
-
- +
+
Vui lòng không được bỏ @@ -103,6 +106,25 @@ đa 10 số
+
+ +
+
+ +
+
+ + +
+
+ +
+
+
+
+
@@ -111,8 +133,8 @@
- +
@@ -124,15 +146,14 @@
-
-
- +
- +
Vui lòng không được bỏ @@ -152,8 +173,10 @@
- + @@ -166,12 +189,12 @@
-
+
- @@ -191,7 +214,7 @@
- @@ -218,8 +241,9 @@
- + @@ -274,11 +298,11 @@
- - +
-
+ @@ -23,14 +23,15 @@ - + - + -
Phương thức Trạng thái Số tiền
{{ order.orderTrackingNumber }} {{ order.orderTime }}{{ order.user.fullName }}{{ order.user.fullName + }} {{ order?.shipper?.user?.fullName }} {{ order.total | currency : "VND" }} +
diff --git a/src/app/components/sales/scam-orders/scam-orders.component.scss b/src/app/components/sales/scam-orders/scam-orders.component.scss index e69de29..8b1c6b2 100644 --- a/src/app/components/sales/scam-orders/scam-orders.component.scss +++ b/src/app/components/sales/scam-orders/scam-orders.component.scss @@ -0,0 +1,63 @@ +th, +td { + text-align: center; +} + +.modal-change-status { + + // width: 1000px; + .modal-confirm-text { + text-align: center; + padding: 20px 8px; + font-weight: 600; + } + + .modal-select-option { + display: flex; + justify-content: center; + align-items: center; + margin-bottom: 20px; + + select { + padding: 12px 20px; + } + } + + .modal-btn-option { + width: 100%; + display: flex; + justify-content: space-around; + align-items: center; + padding-bottom: 20px; + + .width-btn { + width: 110px; + } + } +} + +.modal-confirm-delete { + + // width: 1000px; + .modal-confirm-text { + text-align: center; + padding: 20px 8px; + font-weight: 600; + } + + .modal-btn-option { + width: 100%; + display: flex; + justify-content: space-around; + align-items: center; + padding-bottom: 20px; + + .width-btn { + width: 110px; + } + } +} + +.modal-confirm-text { + font-weight: 600; +} \ No newline at end of file diff --git a/src/app/components/sales/scam-orders/scam-orders.component.ts b/src/app/components/sales/scam-orders/scam-orders.component.ts index 4fb44c4..1ea813f 100644 --- a/src/app/components/sales/scam-orders/scam-orders.component.ts +++ b/src/app/components/sales/scam-orders/scam-orders.component.ts @@ -57,52 +57,13 @@ export class ScamOrdersComponent { ngOnInit() { this.userService.getUserByToken(this.token).subscribe((userInfo) => { this.loggedRole = userInfo.userRole; - if (this.loggedRole != 'ROLE_ADMIN') { - this.isShop = true; - this.shopId = userInfo.shopId - } this.listOrder(); }) } listOrder() { - if (this.isShop) { - this.orderService.getOrdersByShopId(this.shopId, this.thePageNumber - 1, this.thePageSize, this.sortBy, this.sortDir) - .subscribe(this.processResult()); - - this.shipperService.findFreeShopShipper(this.shopId).subscribe((shippers) => { - this.shippers = shippers; - }) - } - else { - this.orderService - .getOrdersPagination(this.thePageNumber - 1, this.thePageSize, this.sortBy, this.sortDir) - .subscribe(this.processResult()); - } - - this.refreshTimeout = setTimeout(() => { - this.refreshOrder(); - }, this.refreshInterval); - } - - refreshOrder() { - if (this.isShop) { - this.orderService.getOrdersByShopId(this.shopId, this.thePageNumber - 1, this.thePageSize, this.sortBy, this.sortDir) - .subscribe(this.refreshResult()); - - this.shipperService.findFreeShopShipper(this.shopId).subscribe((shippers) => { - this.shippers = shippers; - }) - } - else { - this.orderService - .getOrdersPagination(this.thePageNumber - 1, this.thePageSize, this.sortBy, this.sortDir) - .subscribe(this.refreshResult()); - } - - this.refreshTimeout = setTimeout(() => { - this.refreshOrder(); - }, this.refreshInterval); + this.orderService.findOrderByStatus('REJECT_DELIVERY', this.thePageNumber - 1, this.thePageSize, this.sortBy, this.sortDir) + .subscribe(this.processResult()); } searchOrder() { @@ -117,6 +78,7 @@ export class ScamOrdersComponent { processResult() { return (data: any) => { + console.log(data) this.orders = data.orders; this.thePageNumber = data.page.pageNo + 1; this.thePageSize = data.page.pageSize; @@ -125,18 +87,6 @@ export class ScamOrdersComponent { }; } - refreshResult() { - return (data: any) => { - this.orders = data.orders; - this.thePageNumber = data.page.pageNo + 1; - this.thePageSize = data.page.pageSize; - this.theTotalElements = data.page.totalElements; - if (this.totalOrders != this.theTotalElements) { - this.totalOrders = this.theTotalElements; - } - }; - } - // Change status order modal openStatusModal(confirmBoxChangeStatus: TemplateRef, userId: number, orderId: number, shipper: Shipper) { this.isHaveShipper = false; diff --git a/src/app/shared/service/auth.service.ts b/src/app/shared/service/auth.service.ts index 0298392..05cf836 100644 --- a/src/app/shared/service/auth.service.ts +++ b/src/app/shared/service/auth.service.ts @@ -36,6 +36,10 @@ export class AuthService { return this.httpClient.post(this.baseUrl + `/check`, userDto); } + checkIdentifiedCode(code: string) { + return this.httpClient.get(this.baseUrl + `/check?code=${code}`); + } + checkEmailInDB(email: string) { return this.httpClient.get(this.baseUrl + `/check-email?email=${email}`) } diff --git a/src/app/shared/service/firebase.service.ts b/src/app/shared/service/firebase.service.ts index a140187..eba55aa 100644 --- a/src/app/shared/service/firebase.service.ts +++ b/src/app/shared/service/firebase.service.ts @@ -50,7 +50,7 @@ export class FirebaseService { if (!response.user.emailVerified) { response.user.sendEmailVerification(); this.router.navigate(['/auth/email-not-verified']); - resolve(false); // trả về false nếu email chưa được xác thực + resolve(true); // trả về false nếu email chưa được xác thực } else { response.user.getIdToken().then((token: string) => { this.token = token; diff --git a/src/app/shared/service/order.service.ts b/src/app/shared/service/order.service.ts index 25063b6..7540098 100644 --- a/src/app/shared/service/order.service.ts +++ b/src/app/shared/service/order.service.ts @@ -61,6 +61,10 @@ export class OrderService { findOrdersByTrackingNumber(trackingNumber: string, thePage: number, thePageSize: number, sortBy: string, sortDir: string) { return this.httpClient.get(this.orderUrl + `/search?trackingNumber=${trackingNumber}&pageNo=${thePage}&pageSize=${thePageSize}&sortBy=${sortBy}&sortDir=${sortDir}`); } + + findOrderByStatus(status: string, thePage: number, thePageSize: number, sortBy: string, sortDir: string) { + return this.httpClient.get(this.orderUrl + `/get?status=${status}`); + } } interface GetResponseOrders { diff --git a/src/assets/images/resize-bg.png b/src/assets/images/resize-bg.png new file mode 100644 index 0000000..8d56924 Binary files /dev/null and b/src/assets/images/resize-bg.png differ diff --git a/src/environments/environment.ts b/src/environments/environment.ts index f0a7c9e..7fc9ca9 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,8 +4,8 @@ export const environment = { production: false, - // foodOrderingBaseApiUrl: 'http://localhost:8080/api', - foodOrderingBaseApiUrl: 'https://foodify-backend-production.up.railway.app/api', + foodOrderingBaseApiUrl: 'http://localhost:8080/api', + // foodOrderingBaseApiUrl: 'https://foodify-backend-production.up.railway.app/api', firebaseConfig: { apiKey: 'AIzaSyAZFFIuXkbgdp2F-Em4CK2z8kVJ2L4p_UU', authDomain: 'foodify-55954.firebaseapp.com',