Compare commits
16 Commits
develop
...
fad2e1c0a8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fad2e1c0a8 | ||
| 206b4a5c6a | |||
| 71d0592778 | |||
|
|
f059f5cca1 | ||
|
|
bbb5d68af1 | ||
|
|
4f5e2e5944 | ||
| d76c18614d | |||
|
|
9ddfc33514 | ||
| e7bc050b2e | |||
|
|
e89895b07b | ||
|
|
c366a55c15 | ||
|
|
afd6b453d7 | ||
|
|
eee589174e | ||
|
|
47945c9b54 | ||
|
|
1c5652dae6 | ||
| 1f5ab7b133 |
@@ -7,4 +7,4 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: portal
|
||||
image: 172.35.0.216:3000/simplifique/vendaweb-portal:b8cda80
|
||||
image: 172.35.0.216:3000/simplifique/vendaweb-portal:206b4a5
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<app-header-admin></app-header-admin>
|
||||
<div class="d-flex flex-column wrapper">
|
||||
<div class="loading-overlay" *ngIf="(loading$ | async) || (updating$ | async)">
|
||||
<div class="loading-content">
|
||||
<kendo-loader type="converging-spinner" themeColor="primary" size="large"></kendo-loader>
|
||||
<div class="mt-2">Carregando dados do pedido...</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container cart-container my-4">
|
||||
<!-- Primeira Linha -->
|
||||
<!-- <div class="row mb-3">
|
||||
@@ -854,7 +860,7 @@
|
||||
<span *ngIf="!isLoadingPreOrder" class="text-btn-order">Fechar orçamento</span>
|
||||
</button> -->
|
||||
|
||||
<button *ngIf="!isLoadingPreOrder" kendoButton class="btn-order w-100"
|
||||
<button *ngIf="!isLoadingPreOrder" kendoButton class="btn-pre-order w-100"
|
||||
(click)="showConfirmation()" [disabled]="isLoadingPreOrder" [icon]="loadingIconOrder">
|
||||
<span class="text-btn-order">Fechar orçamento</span>
|
||||
</button>
|
||||
@@ -933,7 +939,7 @@
|
||||
message="{{ messageConfirmation }}" textButtonConfirmation="{{ textButtonConfirmation }}"
|
||||
textButtonCancel="{{ textButtonCancel }}" (resultEvent)="confirmChangePaymentPlan($event)"></app-confirmation>
|
||||
|
||||
<app-discount-item-sales *ngIf="showDiscountItem" opened="showDiscountItem" title="{{ titleMessage }}"
|
||||
<app-discount-item-sales *ngIf="showDiscountItem" opened="showDiscountItem" title="Desconto por Item"
|
||||
textButtonConfirmation="{{ textButtonConfirmation }}" textButtonCancel="{{ textButtonCancel }}"
|
||||
[shoppingItem]="itemSelect" (resultEvent)="returnDiscountItem($event)"></app-discount-item-sales>
|
||||
|
||||
|
||||
@@ -991,6 +991,26 @@ kendo-treeview:hover {
|
||||
}
|
||||
}
|
||||
|
||||
.loading-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: rgba(255, 255, 255, 0.7);
|
||||
z-index: 9999;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.loading-content {
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
color: #2d2e83;
|
||||
}
|
||||
|
||||
/* Responsividade para desktops maiores (largura > 1200px) */
|
||||
@media (min-width: 1200px) {
|
||||
.card-resume {
|
||||
|
||||
@@ -278,7 +278,7 @@ export class CartSalesComponent
|
||||
) { }
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
this.loadShopping();
|
||||
//this.loadShopping();
|
||||
}
|
||||
|
||||
ngAfterViewInit(): void { }
|
||||
@@ -326,18 +326,9 @@ export class CartSalesComponent
|
||||
}
|
||||
}
|
||||
|
||||
loadShopping() {
|
||||
this.shoppingSubscription = this.shopping$.subscribe((data) => {
|
||||
this.shopping = data;
|
||||
if (this.shopping !== null) {
|
||||
this.totalWeight = data.totpeso;
|
||||
this.loadFormOrder();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getTaxValue() {
|
||||
const taxDelivery = JSON.parse(localStorage.getItem('taxDelivery'));
|
||||
if (!this.formResumeOrder) return 0;
|
||||
const taxValue = Number.parseFloat(
|
||||
this.formResumeOrder.get('taxValue').value
|
||||
);
|
||||
@@ -345,19 +336,25 @@ export class CartSalesComponent
|
||||
return taxDelivery != null ? taxDelivery.taxValue : taxValue;
|
||||
}
|
||||
|
||||
loadFormOrder() {
|
||||
this.subscriptionShopping = this.shopping$.subscribe((data) => {
|
||||
loadFormOrder(data?: Shopping) {
|
||||
if (!data && this.shopping) {
|
||||
data = this.shopping;
|
||||
}
|
||||
if (!data) return;
|
||||
|
||||
const taxDelivery = JSON.parse(localStorage.getItem('taxDelivery'));
|
||||
this.formResumeOrder = this.fb.group({
|
||||
taxValue: [
|
||||
taxDelivery.taxValue > 0 ? taxDelivery.taxValue.toFixed(2) : '0',
|
||||
],
|
||||
discount: [data.vldesconto > 0 ? data.vldesconto.toFixed(2) : '0,00'],
|
||||
carrierId: [taxDelivery.carrierId],
|
||||
deliveryTaxId: [taxDelivery.deliveryTaxId],
|
||||
});
|
||||
if (this.formResumeOrder) {
|
||||
this.formResumeOrder.patchValue({
|
||||
taxValue:
|
||||
taxDelivery != null && taxDelivery.taxValue > 0
|
||||
? taxDelivery.taxValue.toFixed(2)
|
||||
: '0',
|
||||
discount: data.vldesconto > 0 ? data.vldesconto.toFixed(2) : '0,00',
|
||||
carrierId: taxDelivery != null ? taxDelivery.carrierId : 0,
|
||||
deliveryTaxId: taxDelivery != null ? taxDelivery.deliveryTaxId : 0,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.userForm = this.fb.group({
|
||||
@@ -449,6 +446,7 @@ export class CartSalesComponent
|
||||
taxValue: new FormControl(this.cartData.taxValue.toFixed(2), []),
|
||||
discount: new FormControl(this.cartData.discountValue.toFixed(2), []),
|
||||
carrierId: new FormControl(this.cartData.carrierId, []),
|
||||
deliveryTaxId: new FormControl(0, []),
|
||||
});
|
||||
this.formPayment = this.fb.group({
|
||||
invoiceStore: new FormControl(null),
|
||||
@@ -499,7 +497,7 @@ export class CartSalesComponent
|
||||
this.shopping = data;
|
||||
if (this.shopping !== null) {
|
||||
this.totalWeight = data.totpeso;
|
||||
this.loadFormOrder();
|
||||
this.loadFormOrder(data);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1432,10 +1430,10 @@ export class CartSalesComponent
|
||||
let carrierId = 0;
|
||||
if (taxValue >= 0) {
|
||||
deliveryTaxId = Number.parseFloat(
|
||||
this.formResumeOrder.get('deliveryTaxId').value
|
||||
this.formResumeOrder.get('deliveryTaxId') ? this.formResumeOrder.get('deliveryTaxId').value : 0
|
||||
);
|
||||
carrierId = Number.parseFloat(
|
||||
this.formResumeOrder.get('carrierId').value
|
||||
this.formResumeOrder.get('carrierId') ? this.formResumeOrder.get('carrierId').value : 0
|
||||
);
|
||||
}
|
||||
const order: OrderDeliveryTax = {
|
||||
@@ -1446,7 +1444,6 @@ export class CartSalesComponent
|
||||
};
|
||||
localStorage.setItem('taxDelivery', JSON.stringify(order));
|
||||
this.loadFormOrder();
|
||||
this.loadShopping();
|
||||
|
||||
/* this.store.dispatch(new UpdateDeliveryTaxAction(order));
|
||||
this.updating$.subscribe((update) => {
|
||||
@@ -2146,10 +2143,10 @@ export class CartSalesComponent
|
||||
);
|
||||
let percentOrder = (discountValue / orderValue) * 100;
|
||||
console.log('Percentual do pedido: ' + percentOrder);
|
||||
if (this.percentSeller < percentOrder) {
|
||||
this.openedAuthUser = true;
|
||||
return;
|
||||
}
|
||||
// if (this.percentSeller < percentOrder) {
|
||||
// this.openedAuthUser = true;
|
||||
// return;
|
||||
// }
|
||||
if (discountValue <= 0.01) {
|
||||
percentOrder = 0;
|
||||
}
|
||||
@@ -2159,8 +2156,9 @@ export class CartSalesComponent
|
||||
idUserAuth: this.authService.getUser(),
|
||||
};
|
||||
this.store.dispatch(new ApplyDiscountOrderAction(order));
|
||||
this.store.dispatch(new LoadShoppingAction(this.shoppingService.getCart()));
|
||||
// this.store.dispatch(new LoadShoppingAction(this.shoppingService.getCart())); // Reloader moved to Effect
|
||||
this.loadFormOrder();
|
||||
this.calculateTaxDelivery(true);
|
||||
}
|
||||
|
||||
applyDiscountOrder() {
|
||||
@@ -2249,6 +2247,7 @@ export class CartSalesComponent
|
||||
this.showInformation = true;
|
||||
return;
|
||||
}
|
||||
this.loadFormOrder();
|
||||
}
|
||||
|
||||
calcDiscountOrderValue() {
|
||||
@@ -2591,6 +2590,7 @@ export class CartSalesComponent
|
||||
priorityDelivery: priorityDelivery,
|
||||
};
|
||||
|
||||
console.log('dataDeliveryTax', JSON.stringify(dataDeliveryTax));
|
||||
this.shoppingService.calculateDeliveryTax(dataDeliveryTax).subscribe(
|
||||
(result) => {
|
||||
this.dataDeliveryTax = result;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { ActionsLayout } from '@progress/kendo-angular-dialog';
|
||||
import { Observable, Subscription } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
import { AuthService } from 'src/app/auth/services/auth.service';
|
||||
import { ResultApi } from 'src/app/models/result-api.model';
|
||||
import { UserAuth } from 'src/app/models/user-auth.model';
|
||||
@@ -107,30 +107,28 @@ export class DiscountItemSalesComponent implements OnInit {
|
||||
|
||||
async confirmDiscount() {
|
||||
let discount = Number.parseFloat(this.formDiscountItem.get('discount').value);
|
||||
console.log('discount', discount);
|
||||
const discountValue = Number.parseFloat(this.formDiscountItem.get('discountValue').value);
|
||||
const salePrice = Number.parseFloat((this.shoppingItem.listPrice - discountValue).toFixed(2));
|
||||
|
||||
if (this.percentSeller < discount) {
|
||||
this.openedAuthUser = true;
|
||||
return;
|
||||
}
|
||||
// if (this.percentSeller < discount) {
|
||||
// this.openedAuthUser = true;
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (discountValue <= 0.01) {
|
||||
discount = 0;
|
||||
}
|
||||
|
||||
this.shoppingItem.discount = discount;
|
||||
this.shoppingItem.discountValue = discountValue;
|
||||
this.shoppingItem.price = salePrice;
|
||||
this.shoppingItem.userDiscount = this.authService.getUser();
|
||||
this.store.dispatch(new UpdatePriceItemAction(this.shoppingItem));
|
||||
this.updating$.pipe(
|
||||
map((updating) => {
|
||||
if (!updating) {
|
||||
console.log('shoppingItem', JSON.stringify(this.shoppingItem));
|
||||
const updateItem = { ...this.shoppingItem };
|
||||
updateItem.discount = discount;
|
||||
updateItem.discountValue = discountValue;
|
||||
updateItem.price = salePrice;
|
||||
updateItem.userDiscount = this.authService.getUser();
|
||||
this.store.dispatch(new UpdatePriceItemAction(updateItem));
|
||||
this.resultEvent.emit(true);
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
async returnAuthUser(userAuth: any) {
|
||||
this.openedAuthUser = false;
|
||||
@@ -149,13 +147,7 @@ export class DiscountItemSalesComponent implements OnInit {
|
||||
updateItem.price = salePrice;
|
||||
updateItem.userDiscount = userAuth.id;
|
||||
this.store.dispatch(new UpdatePriceItemAction(updateItem));
|
||||
this.updating$.subscribe(
|
||||
(updating) => {
|
||||
if (!updating) {
|
||||
this.resultEvent.emit(true);
|
||||
}
|
||||
}
|
||||
);
|
||||
} else {
|
||||
console.log('Não localizou o id.');
|
||||
}
|
||||
|
||||
@@ -1,35 +1,24 @@
|
||||
<div class="container-fluid">
|
||||
<form class="k-form" [formGroup]="formDiscount">
|
||||
<fieldset>
|
||||
<legend>Dados do pedido</legend>
|
||||
<legend>Dados do pedido xxx</legend>
|
||||
|
||||
<label class="k-form-field">
|
||||
<span>Valor dos produtos</span>
|
||||
<kendo-numerictextbox
|
||||
[spinners]="false"
|
||||
[readonly]="true"
|
||||
[value]="orderValue"
|
||||
formControlName="value"
|
||||
>
|
||||
<kendo-numerictextbox [spinners]="false" [readonly]="true" [value]="orderValue" formControlName="value">
|
||||
</kendo-numerictextbox>
|
||||
</label>
|
||||
|
||||
<div class="">
|
||||
<label class="k-form-field">
|
||||
<span>% Desconto desejado</span>
|
||||
<kendo-numerictextbox
|
||||
formControlName="discount"
|
||||
[spinners]="false"
|
||||
>
|
||||
<kendo-numerictextbox formControlName="discount" [spinners]="false">
|
||||
<kendo-formerror>Error: Percentual acima do permitido para o usuário.</kendo-formerror>
|
||||
</kendo-numerictextbox>
|
||||
</label>
|
||||
<label class="k-form-field">
|
||||
<span>Valor do desconto</span>
|
||||
<kendo-numerictextbox
|
||||
formControlName="discountValue"
|
||||
[spinners]="false"
|
||||
>
|
||||
<kendo-numerictextbox formControlName="discountValue" [spinners]="false">
|
||||
<kendo-formerror>Error: Percentual acima do permitido para o usuário.</kendo-formerror>
|
||||
</kendo-numerictextbox>
|
||||
</label>
|
||||
@@ -37,12 +26,8 @@
|
||||
|
||||
<label class="k-form-field">
|
||||
<span>Valor do pedido com desconto</span>
|
||||
<kendo-numerictextbox
|
||||
formcontrolName="valueWithDiscount"
|
||||
[spinners]="false"
|
||||
[readonly]="true"
|
||||
[value]="orderWithDiscount"
|
||||
>
|
||||
<kendo-numerictextbox formcontrolName="valueWithDiscount" [spinners]="false" [readonly]="true"
|
||||
[value]="orderWithDiscount">
|
||||
</kendo-numerictextbox>
|
||||
</label>
|
||||
|
||||
@@ -60,12 +45,7 @@
|
||||
<fieldset>
|
||||
<kendo-formfield>
|
||||
<kendo-label [for]="email" text="Email"></kendo-label>
|
||||
<kendo-textbox
|
||||
formControlName="email"
|
||||
[clearButton]="true"
|
||||
#email
|
||||
required
|
||||
></kendo-textbox>
|
||||
<kendo-textbox formControlName="email" [clearButton]="true" #email required></kendo-textbox>
|
||||
|
||||
<!--kendo-formerror *ngIf="formDiscount.controls.formUser.email.errors?.required"
|
||||
>Erro: Email é obrigatório</kendo-formerror
|
||||
@@ -77,13 +57,7 @@
|
||||
|
||||
<kendo-formfield class="mt-2">
|
||||
<kendo-label [for]="password" text="Senha"></kendo-label>
|
||||
<input
|
||||
kendoTextBox
|
||||
type="password"
|
||||
placeholder="Password"
|
||||
#password
|
||||
formControlName="password"
|
||||
/>
|
||||
<input kendoTextBox type="password" placeholder="Password" #password formControlName="password" />
|
||||
|
||||
<kendo-formerror>Error: Password is required</kendo-formerror>
|
||||
</kendo-formfield>
|
||||
@@ -92,7 +66,8 @@
|
||||
|
||||
|
||||
<div class="k-actions k-actions-end">
|
||||
<button type="button" [disabled]="!formDiscount.valid" class="k-button" (click)="closeMsgDiscount()">Cancel</button>
|
||||
<button type="button" [disabled]="!formDiscount.valid" class="k-button"
|
||||
(click)="closeMsgDiscount()">Cancel</button>
|
||||
<button type="button" class="k-button k-primary" (click)="confirmDiscount()">Submit</button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -43,13 +43,13 @@ export class DiscountOrderComponent implements OnInit, OnDestroy {
|
||||
discountValue: [(this.orderValue - this.orderWithDiscount),
|
||||
Validators.compose([Validators.required])],
|
||||
valueWithDiscount: [this.orderWithDiscount, [Validators.required]],
|
||||
formUser: this.formBuilder.group({
|
||||
email: new FormControl(null, Validators.required),
|
||||
password: new FormControl(null, Validators.required),
|
||||
}),
|
||||
formGroup: this.formBuilder.group({
|
||||
userAuth: new FormControl(null, Validators.required),
|
||||
}),
|
||||
// formUser: this.formBuilder.group({
|
||||
// email: new FormControl(null, Validators.required),
|
||||
// password: new FormControl(null, Validators.required),
|
||||
// }),
|
||||
// formGroup: this.formBuilder.group({
|
||||
// userAuth: new FormControl(null, Validators.required),
|
||||
// }),
|
||||
});
|
||||
this.formDiscount.valueChanges.subscribe(f => {
|
||||
this.percent = this.formDiscount.get('discount').value;
|
||||
@@ -84,18 +84,16 @@ export class DiscountOrderComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
confirmDiscount() {
|
||||
const domain = '@jurunense.com.br';
|
||||
|
||||
this.submitForm.emit(this.formDiscount);
|
||||
return;
|
||||
|
||||
let email = this.formDiscount.get('formUser.email').value;
|
||||
|
||||
// Remover domínio se já estiver presente
|
||||
if (email.toLowerCase().endsWith(domain)) {
|
||||
email = email.substring(0, email.length - domain.length);
|
||||
}
|
||||
|
||||
const emailUpperCase = (email + domain).toUpperCase();
|
||||
const emailUpperCase = email.toUpperCase();
|
||||
const passwordUpperCase = this.formDiscount.get('formUser.password').value.toUpperCase();
|
||||
|
||||
if (this.discountAuthorization < this.percent) {
|
||||
// if (this.discountAuthorization < this.percent) {
|
||||
if (this.formDiscount.controls.formGroup.get('userAuth').value) {
|
||||
this.SubscriptionAuth = this.authService.authenticate({
|
||||
email: emailUpperCase,
|
||||
@@ -126,42 +124,42 @@ export class DiscountOrderComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
this.close();
|
||||
}
|
||||
// } else {
|
||||
// this.close();
|
||||
// }
|
||||
}
|
||||
|
||||
getAuthorization() {
|
||||
return this.formDiscount.controls.formGroup.get('userAuth').value;
|
||||
return false; //this.formDiscount.controls.formGroup.get('userAuth').value;
|
||||
}
|
||||
|
||||
validationUser() {
|
||||
this.formDiscount.markAllAsTouched();
|
||||
if (this.formDiscount.valid) {
|
||||
// this.loadingIcon = 'loading';
|
||||
this.authService.authenticate({
|
||||
email: this.formDiscount.get('formUser.email').value,
|
||||
password: this.formDiscount.get('formUser.password').value
|
||||
})
|
||||
.subscribe((res: ResultApi) => {
|
||||
console.log(res);
|
||||
if (res.success) {
|
||||
this.discountAuthorization = res.data.discountPercent;
|
||||
return this.discountAuthorization;
|
||||
// this.loadingIcon = '';
|
||||
} else {
|
||||
// this.loadingIcon = '';
|
||||
// this.showErrorMessage(res.message);
|
||||
return this.discountAuthorization;
|
||||
}
|
||||
}, err => {
|
||||
return this.discountAuthorization;
|
||||
// this.loadingIcon = '';
|
||||
// this.showErrorMessage('Erro ao processar sua requisição,
|
||||
// tente novamente e caso persista o erro contacte o departamento de TI.');
|
||||
});
|
||||
return this.discountAuthorization;
|
||||
}
|
||||
// if (this.formDiscount.valid) {
|
||||
// // this.loadingIcon = 'loading';
|
||||
// this.authService.authenticate({
|
||||
// email: this.formDiscount.get('formUser.email').value,
|
||||
// password: this.formDiscount.get('formUser.password').value
|
||||
// })
|
||||
// .subscribe((res: ResultApi) => {
|
||||
// console.log(res);
|
||||
// if (res.success) {
|
||||
// this.discountAuthorization = res.data.discountPercent;
|
||||
// return this.discountAuthorization;
|
||||
// // this.loadingIcon = '';
|
||||
// } else {
|
||||
// // this.loadingIcon = '';
|
||||
// // this.showErrorMessage(res.message);
|
||||
// return this.discountAuthorization;
|
||||
// }
|
||||
// }, err => {
|
||||
// return this.discountAuthorization;
|
||||
// // this.loadingIcon = '';
|
||||
// // this.showErrorMessage('Erro ao processar sua requisição,
|
||||
// // tente novamente e caso persista o erro contacte o departamento de TI.');
|
||||
// });
|
||||
// return this.discountAuthorization;
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
</button>
|
||||
<div *ngIf="isMobileMenuOpen" class="mobile-menu-items shadow-sm">
|
||||
<button class="dropdown-item w-100" (click)="openNewOrder()">Novo pedido</button>
|
||||
<button class="dropdown-item w-100" (click)="openDashTodaysale()">Dashboard Venda dia</button>
|
||||
<button class="dropdown-item w-100" (click)="openDashSeller()">Dashboard Vendedor</button>
|
||||
<!-- <button class="dropdown-item w-100" (click)="openDashTodaysale()">Dashboard Venda dia</button>
|
||||
<button class="dropdown-item w-100" (click)="openDashSeller()">Dashboard Vendedor</button>-->
|
||||
<button class="dropdown-item w-100" (click)="openOrders()">Pedidos de venda</button>
|
||||
<button class="dropdown-item w-100" (click)="openProductOrder()">Produtos Vendidos</button>
|
||||
<button class="dropdown-item w-100" (click)="openClose(true)">Orçamentos pendentes</button>
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-12 mt-3 mt-md-0">
|
||||
<label>
|
||||
<span class="d-block">CPF / CNPJ</span>
|
||||
<span class="d-block">CPF / CNPJ ou</span>
|
||||
<span class="d-block">Código do Cliente</span>
|
||||
<kendo-textbox formControlName="document" placeholder="Informe o CPF ou CNPJ do cliente"></kendo-textbox>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@@ -98,7 +98,10 @@ export class ShoppingEffects {
|
||||
mergeMap(
|
||||
(data) => this.shoppingService.updatePriceItemShopping(data.payload)
|
||||
.pipe(
|
||||
map(() => new UpdatePriceItemSuccessAction(data.payload)),
|
||||
mergeMap(() => [
|
||||
new UpdatePriceItemSuccessAction(data.payload),
|
||||
new LoadShoppingAction(data.payload.idCart)
|
||||
]),
|
||||
catchError(error => of(new UpdatePriceItemFailureAction(error)))
|
||||
)
|
||||
)
|
||||
@@ -110,7 +113,10 @@ export class ShoppingEffects {
|
||||
mergeMap(
|
||||
(data) => this.shoppingService.applyDiscountOrder(data.payload)
|
||||
.pipe(
|
||||
map((items) => new ApplyDiscountOrderSuccessAction(items)),
|
||||
mergeMap((items) => [
|
||||
new ApplyDiscountOrderSuccessAction(items),
|
||||
new LoadShoppingAction(data.payload.id)
|
||||
]),
|
||||
catchError(error => of(new ApplyDiscountOrderFailureAction(error)))
|
||||
)
|
||||
)
|
||||
@@ -122,7 +128,10 @@ export class ShoppingEffects {
|
||||
mergeMap(
|
||||
(data) => this.shoppingService.updateQuantityItemShopping(data.payload)
|
||||
.pipe(
|
||||
map(() => new UpdateQuantityItemSuccessAction(data.payload)),
|
||||
mergeMap(() => [
|
||||
new UpdateQuantityItemSuccessAction(data.payload),
|
||||
new LoadShoppingAction(data.payload.idCart)
|
||||
]),
|
||||
catchError(error => of(new UpdateQuantityItemFailureAction(error)))
|
||||
)
|
||||
)
|
||||
@@ -134,7 +143,10 @@ export class ShoppingEffects {
|
||||
mergeMap(
|
||||
(data) => this.shoppingService.deleteItemShopping(data.payload)
|
||||
.pipe(
|
||||
map((result) => new DeleteItemSuccessAction(result)),
|
||||
mergeMap((result) => [
|
||||
new DeleteItemSuccessAction(result),
|
||||
new LoadShoppingAction(localStorage.getItem('cart'))
|
||||
]),
|
||||
catchError(error => of(new DeleteItemFailureAction(error)))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export const environment = {
|
||||
production: true,
|
||||
// url: 'http://10.1.1.124:8065/api/v1/',
|
||||
// url: 'http://172.35.0.217:32619/api/v1/',
|
||||
url: 'https://api.vendaweb.simplifiquehc.com.br/api/v1/',
|
||||
// url: 'http://vendaweb.jurunense.com.br/api/v1/',
|
||||
URL_PIX: 'http://10.1.1.205:8078/api/v1/',
|
||||
|
||||
Reference in New Issue
Block a user