crmbonus-component-wake 0.0.23 → 0.0.25
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/crmbonus-component-wake/app-modal.entry.js +1 -1
- package/dist/crmbonus-component-wake/crm-bonus-form.entry.js +2 -2
- package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +1 -1
- package/dist/crmbonus-component-wake/crm-bonus.entry.js +2 -2
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
- package/dist/crmbonus-component-wake/{crmbonus.service-04472105.js → crmbonus.service-5208f883.js} +6 -3
- package/dist/crmbonus-component-wake/crmbonus.service-5208f883.js.map +1 -0
- package/dist/crmbonus-component-wake/giftback-finish.entry.js +1 -1
- package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +1 -1
- package/dist/crmbonus-component-wake/giftback-pin.entry.js +1 -1
- package/dist/crmbonus-component-wake/giftback-progress.entry.js +1 -1
- package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +1 -1
- package/dist/crmbonus-component-wake/loading-spinner.entry.js +1 -1
- package/dist/crmbonus-component-wake/pedido-finalizado.entry.js +11 -3
- package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +1 -1
- package/dist/crmbonus-component-wake/phone-input-mask.entry.js +1 -1
- package/dist/crmbonus-component-wake/phone-input.entry.js +1 -1
- package/dist/types/components/pedido/pedido.d.ts +1 -0
- package/dist/types/components.d.ts +2 -0
- package/dist/types/dto/update.order.dto.d.ts +5 -0
- package/dist/types/services/crmbonus.service.d.ts +2 -1
- package/package.json +1 -1
- package/dist/crmbonus-component-wake/crmbonus.service-04472105.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"file":"giftback-progress.entry.esm.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,itCAAitC;;MCQhuC,gBAAgB;;;yBACI,CAAC;uBAEH,KAAK;qBAEC;YAC7B,UAAU,EAAE,CAAC;YACb,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,CAAC;YAClB,YAAY,EAAE,CAAC;YACf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AAK,EAAC,eAAe,EAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE,eAEzE,EAET,+DAAQ,KAAK,EAAE,UAAU,IAAI,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,IAE/G,CAAC,IAAI,CAAC,OAAO,GAAG,SAAS,GAAG,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEvE,CACP,CACJ,EACR;KACL;;;;;;","names":[],"sources":["src/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css?tag=giftback-progress&encapsulation=shadow","src/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.tsx"],"sourcesContent":[":host {\n display: flex;\n font-family: Arial, sans-serif;\n /* background-color: #f8f4eb; */\n border-radius: 10px;\n padding: 16px;\n /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */\n max-width: 100%;\n flex-direction: column;\n}\n\n.giftback-container {\n display: flex;\n flex-direction: column;\n}\n\n.giftback-container p {\n font-size: medium;\n}\n\nh3 {\n margin: 0 0 10px;\n font-size: 18px;\n}\n\np {\n margin: 5px 0;\n font-size: 14px;\n align-self: start;\n}\n\n.validity {\n font-size: 12px;\n color: #888;\n}\n\n.progress-container {\n display: flex;\n align-items: center;\n margin: 10px 0;\n}\n\nprogress-container span {\n font-size: 12px;\n color: #666;\n}\n\ninput[type='range'] {\n flex: 1;\n margin: 0 10px;\n appearance: none;\n background-color: #ccc;\n height: 6px;\n border-radius: 3px;\n outline: none;\n cursor: pointer;\n}\n\ninput[type='range']::-webkit-slider-thumb {\n appearance: none;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background-color: #555;\n cursor: pointer;\n}\n\n.remaining {\n font-weight: bold;\n font-size: 14px;\n color: #333;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.button-cancel {\n top: 50%;\n background-color: #ffffff;\n color: #1e1c1c;\n border: 1px solid gray;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.footer-button-giftback {\n display: flex;\n justify-content: space-between;\n margin-top: 14px;\n}","import { Component, h, State, Prop } from '@stencil/core';\nimport { IBonus } from '../../../../dto/validate.pin.bonus';\n\n@Component({\n tag: 'giftback-progress',\n styleUrl: 'giftback-progress.css',\n shadow: true,\n})\nexport class GiftbackProgress {\n @State() usedValue: number = 0;\n\n @Prop() loading: boolean = false;\n\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\"\n };\n\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n\n componentWillLoad() {\n this.usedValue = parseFloat(this.bonus.bonusBalance.toString());\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n }\n\n async handleReserve() {\n this.reserve(this.usedValue);\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n return (\n <div class=\"giftback-container\">\n <p>\n Você possui até <strong>R$ {this.bonus.totalBonus.toFixed(2)}</strong> de Giftback nessa compra!\n </p>\n <p class=\"validity\">Válido até: {new Date(this.bonus.firstValidityDate).toLocaleDateString('pt-Br')}</p>\n\n <p>Você está utilizando <strong>R$ {this.usedValue.toFixed(2)}</strong> nessa compra</p>\n\n <div class=\"progress-container\">\n <span>R$ 0</span>\n <input\n disabled\n type=\"range\"\n min=\"0\"\n step=\"0.01\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n onInput={(event) => this.handleSliderChange(event)}\n />\n <span>R$ {this.bonus.totalBonus.toFixed(2)}</span>\n </div>\n\n <p class=\"remaining\">\n Faltam <strong>R$ {remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)}</strong> para utilizar o valor total do Giftback.\n </p>\n\n <div class=\"footer-button-giftback\">\n\n <button class=\"button-cancel\" disabled={this.loading} onClick={() => this.cancel()}>\n Cancelar\n </button>\n\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.handleReserve()}>\n {\n !this.loading ? \"Aplicar\" : <loading-spinner size=\"10px\" color=\"#fff\" />\n }\n </button>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
@@ -9,7 +9,7 @@ const LoadingSpinner = class {
|
|
9
9
|
this.color = '#0078d7';
|
10
10
|
}
|
11
11
|
render() {
|
12
|
-
return (h("div", { key: '
|
12
|
+
return (h("div", { key: '64422c854f9952036214f378594aeaafa6fb6358', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
|
13
13
|
}
|
14
14
|
};
|
15
15
|
LoadingSpinner.style = loadingSpinnerCss;
|
@@ -1,21 +1,29 @@
|
|
1
1
|
import { r as registerInstance, h } from './index-f557ce7c.js';
|
2
|
-
import { C as CrmBonusService } from './crmbonus.service-
|
2
|
+
import { C as CrmBonusService } from './crmbonus.service-5208f883.js';
|
3
3
|
|
4
4
|
const Pedido = class {
|
5
5
|
constructor(hostRef) {
|
6
6
|
registerInstance(this, hostRef);
|
7
7
|
this.cartId = undefined;
|
8
8
|
this.orderId = undefined;
|
9
|
+
this.metadadoString = undefined;
|
9
10
|
}
|
10
11
|
async componentWillLoad() {
|
12
|
+
console.log('this.metadadoString', this.metadadoString);
|
13
|
+
const metadado = this.metadadoString ? JSON.parse(this.metadadoString) : { id: null };
|
11
14
|
console.log('this.cartId', this.cartId);
|
12
15
|
console.log('this.orderid', this.orderId);
|
16
|
+
console.log('metadadoid', metadado);
|
13
17
|
if (this.cartId && this.orderId) {
|
14
|
-
await new CrmBonusService().updateOrder(
|
18
|
+
await new CrmBonusService().updateOrder({
|
19
|
+
cartId: this.cartId,
|
20
|
+
orderId: this.orderId,
|
21
|
+
cartIdCrm: metadado.id
|
22
|
+
});
|
15
23
|
}
|
16
24
|
}
|
17
25
|
render() {
|
18
|
-
return (h("div", { key: '
|
26
|
+
return (h("div", { key: '8ab7e23b2d5049e7755bd77bcae2e1efc7ac0a9b' }));
|
19
27
|
}
|
20
28
|
};
|
21
29
|
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"pedido-finalizado.entry.esm.js","mappings":";;;MAMa,MAAM
|
1
|
+
{"file":"pedido-finalizado.entry.esm.js","mappings":";;;MAMa,MAAM;;;;;;;IAMf,MAAM,iBAAiB;QACnB,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAA;QACvD,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;QAEtF,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAA;QAEnC,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE;YAC7B,MAAM,IAAI,eAAe,EAAE,CAAC,WAAW,CAAC;gBACpC,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,OAAO,EAAG,IAAI,CAAC,OAAO;gBACtB,SAAS,EAAE,QAAQ,CAAC,EAAE;aACzB,CAAC,CAAC;SACN;KACJ;IAED,MAAM;QACF,QACI,6DAAW,EACd;KACJ;;;;;","names":[],"sources":["src/components/pedido/pedido.tsx"],"sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\n\n@Component({\n tag: \"pedido-finalizado\"\n})\nexport class Pedido {\n\n @Prop({ attribute: \"cartid\" }) cartId: string;\n @Prop({ attribute: \"orderid\" }) orderId: number;\n @Prop({ attribute: \"metadado\" }) metadadoString: string;\n\n async componentWillLoad() {\n console.log('this.metadadoString', this.metadadoString)\n const metadado = this.metadadoString ? JSON.parse(this.metadadoString) : { id: null };\n\n console.log('this.cartId', this.cartId);\n console.log('this.orderid', this.orderId);\n console.log('metadadoid', metadado)\n\n if (this.cartId && this.orderId) {\n await new CrmBonusService().updateOrder({\n cartId: this.cartId,\n orderId: this.orderId,\n cartIdCrm: metadado.id\n });\n }\n }\n\n render() {\n return (\n <div></div>\n )\n }\n}"],"version":3}
|
@@ -29,7 +29,7 @@ const PhoneInputMask = class {
|
|
29
29
|
return this.phone;
|
30
30
|
}
|
31
31
|
render() {
|
32
|
-
return (h("input", { key: '
|
32
|
+
return (h("input", { key: '34c3bb422a5db3bcbd220b9d5a62301e226d2b77', id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
|
33
33
|
}
|
34
34
|
};
|
35
35
|
PhoneInputMask.style = phoneInputMaskCss;
|
@@ -12,7 +12,7 @@ const PhoneInput = class {
|
|
12
12
|
await this.sendPin(phone);
|
13
13
|
}
|
14
14
|
render() {
|
15
|
-
return (h("div", { key: '
|
15
|
+
return (h("div", { key: '8abefe232fb7aaf4a85386938986e342f1172abc', class: "form-container" }, h("phone-input-mask", { key: '5a5c76640ef498949816c31648aa575526a7c73f', initialValue: this.value, ref: ref => this.phoneInputMask = ref }), h("button", { key: '3e8b57884ed0db217170d690306516ce65a9fa30', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "validar" : h("loading-spinner", { size: "25px", color: "#fff" }))));
|
16
16
|
}
|
17
17
|
};
|
18
18
|
|
@@ -47,6 +47,7 @@ export namespace Components {
|
|
47
47
|
}
|
48
48
|
interface PedidoFinalizado {
|
49
49
|
"cartId": string;
|
50
|
+
"metadadoString": string;
|
50
51
|
"orderId": number;
|
51
52
|
}
|
52
53
|
interface PhoneInput {
|
@@ -187,6 +188,7 @@ declare namespace LocalJSX {
|
|
187
188
|
}
|
188
189
|
interface PedidoFinalizado {
|
189
190
|
"cartId"?: string;
|
191
|
+
"metadadoString"?: string;
|
190
192
|
"orderId"?: number;
|
191
193
|
}
|
192
194
|
interface PhoneInput {
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import { IPinSent } from '../dto/pin.sent';
|
2
2
|
import { IBonus, IProccesPinBonusDto, IReserveDTO } from '../dto/validate.pin.bonus';
|
3
|
+
import { UpdateOrderDTO } from '../dto/update.order.dto';
|
3
4
|
export declare class CrmBonusService {
|
4
5
|
private axiosInstance;
|
5
6
|
constructor();
|
6
7
|
getCustomer(userId: number, store: string): Promise<any>;
|
7
|
-
updateOrder(
|
8
|
+
updateOrder(updateOrderDTO: UpdateOrderDTO): Promise<void>;
|
8
9
|
sendPin(phone: number, store: string): Promise<IPinSent>;
|
9
10
|
validatePinBonus(payload: IProccesPinBonusDto, store: string): Promise<IBonus>;
|
10
11
|
reserve(payload: IReserveDTO, store: string): Promise<any>;
|