feat: enhance order submission flow and UI improvements
- Updated categories component to improve loading state and category display. - Modified order section to handle payment submission with event payload. - Refactored payment form dialog to emit order response on successful payment. - Adjusted order response model to enforce required fields. - Improved root component layout and added success dialog for order submission. - Enhanced sale invoice card component to use new TSP API methods. - Updated API routes for sale invoices to reflect TSP changes. - Improved user interface for business activities and partners sections. - Added card shadow styling for better visual hierarchy. - Introduced new order submitted dialog component for post-order actions. - Cleaned up console logs and improved code readability across components.
This commit is contained in:
@@ -3,6 +3,7 @@ import { NativeBridgeService } from '@/core/services';
|
||||
import { ToastService } from '@/core/services/toast.service';
|
||||
import { LayoutService } from '@/layout/service/layout.service';
|
||||
import { PageLoadingComponent } from '@/shared/components/page-loading.component';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import {
|
||||
AfterViewInit,
|
||||
Component,
|
||||
@@ -34,6 +35,7 @@ import { PosMainMenuSidebarComponent } from './mainMenuSidebar/main-menu-sidebar
|
||||
Button,
|
||||
PosMainMenuSidebarComponent,
|
||||
Menu,
|
||||
CommonModule,
|
||||
],
|
||||
})
|
||||
export class PosLayoutComponent implements AfterViewInit {
|
||||
@@ -84,6 +86,10 @@ export class PosLayoutComponent implements AfterViewInit {
|
||||
placeholderLogo = images.placeholders.logo;
|
||||
|
||||
now = new Date();
|
||||
private touchStartY = 0;
|
||||
private pulling = false;
|
||||
pullDistance = signal(0);
|
||||
readonly pullThreshold = 80;
|
||||
|
||||
getData() {
|
||||
this.posProfileStore.getData().subscribe({
|
||||
@@ -101,24 +107,6 @@ export class PosLayoutComponent implements AfterViewInit {
|
||||
this.getData();
|
||||
}
|
||||
|
||||
doPay() {
|
||||
// this.nativeBridgeService.pay({
|
||||
// amount: 10_000,
|
||||
// id: '1',
|
||||
// });
|
||||
this.nativeBridgeService.print({
|
||||
title: 'salam',
|
||||
items: [
|
||||
{
|
||||
label: 'مجموع قیمت',
|
||||
value: '10_000',
|
||||
},
|
||||
],
|
||||
});
|
||||
// @ts-ignore
|
||||
// window.NativeBridge.pay(12312, 'test');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.layoutService.changeIsFullPage(true);
|
||||
this.getData();
|
||||
@@ -137,7 +125,33 @@ export class PosLayoutComponent implements AfterViewInit {
|
||||
this.layoutService.setTopbarEndSlot(null);
|
||||
}
|
||||
|
||||
refresh() {
|
||||
window.location.reload();
|
||||
onTouchStart(event: TouchEvent) {
|
||||
if (window.scrollY > 0 || event.touches.length !== 1) return;
|
||||
this.touchStartY = event.touches[0].clientY;
|
||||
this.pulling = true;
|
||||
}
|
||||
|
||||
onTouchMove(event: TouchEvent) {
|
||||
if (!this.pulling) return;
|
||||
const delta = event.touches[0].clientY - this.touchStartY;
|
||||
if (delta <= 0) {
|
||||
this.pullDistance.set(0);
|
||||
return;
|
||||
}
|
||||
|
||||
const damped = Math.min(delta * 0.5, 140);
|
||||
this.pullDistance.set(damped);
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
onTouchEnd() {
|
||||
if (!this.pulling) return;
|
||||
const shouldRefresh = this.pullDistance() >= this.pullThreshold;
|
||||
this.pulling = false;
|
||||
this.pullDistance.set(0);
|
||||
if (shouldRefresh) {
|
||||
this.layoutService.changeIsFullPage(true);
|
||||
this.getData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user