crmbonus-component-wake 1.0.31 → 1.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-modal_4.cjs.entry.js +6 -6
- package/dist/cjs/app-modal_4.cjs.entry.js.map +1 -1
- package/dist/cjs/crm-bonus-note.cjs.entry.js +26 -0
- package/dist/cjs/crm-bonus-note.cjs.entry.js.map +1 -0
- package/dist/cjs/crm-bonus.cjs.entry.js +29 -6
- package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -1
- package/dist/cjs/crmbonus-component-wake.cjs.js +1 -1
- package/dist/cjs/{crmbonus.service-8412ddbf.js → crmbonus.service-e6b51638.js} +8 -1
- package/dist/cjs/crmbonus.service-e6b51638.js.map +1 -0
- package/dist/cjs/giftback-finish_3.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/loading-spinner.cjs.entry.js +1 -1
- package/dist/cjs/pedido-finalizado.cjs.entry.js +2 -2
- package/dist/cjs/phone-input-mask.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/crm-bonus/crm-bonus.css +12 -2
- package/dist/collection/components/crm-bonus/crm-bonus.js +28 -4
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -1
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +4 -4
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js.map +1 -1
- package/dist/collection/components/loading-spinner/loading-spinner.js +1 -1
- package/dist/collection/components/modal/app-modal.js +1 -1
- package/dist/collection/components/note/crm-bonus-note.css +34 -0
- package/dist/collection/components/note/crm-bonus-note.js +29 -0
- package/dist/collection/components/note/crm-bonus-note.js.map +1 -0
- package/dist/collection/components/pedido/pedido.js +1 -1
- package/dist/collection/components/phone/phone-input-mask.js +1 -1
- package/dist/collection/services/crmbonus.service.js +7 -0
- package/dist/collection/services/crmbonus.service.js.map +1 -1
- package/dist/components/app-modal.js +1 -1
- package/dist/components/crm-bonus-form.js +1 -1
- package/dist/components/crm-bonus-note.d.ts +11 -0
- package/dist/components/crm-bonus-note.js +42 -0
- package/dist/components/crm-bonus-note.js.map +1 -0
- package/dist/components/crm-bonus.js +39 -15
- package/dist/components/crm-bonus.js.map +1 -1
- package/dist/components/giftback-finish.js +1 -1
- package/dist/components/giftback-pin.js +1 -1
- package/dist/components/giftback-progress.js +1 -1
- package/dist/components/loading-spinner.js +1 -1
- package/dist/components/{p-374de9ae.js → p-39df4263.js} +8 -1
- package/dist/components/p-39df4263.js.map +1 -0
- package/dist/components/{p-09bc92e2.js → p-4c2f324f.js} +2 -2
- package/dist/components/{p-09bc92e2.js.map → p-4c2f324f.js.map} +1 -1
- package/dist/components/{p-bad9f0ec.js → p-6a629b94.js} +3 -3
- package/dist/components/{p-bad9f0ec.js.map → p-6a629b94.js.map} +1 -1
- package/dist/components/{p-13b9e80b.js → p-af4650fb.js} +3 -3
- package/dist/components/{p-13b9e80b.js.map → p-af4650fb.js.map} +1 -1
- package/dist/components/{p-db0aa2d4.js → p-b1a8e30d.js} +2 -2
- package/dist/components/{p-db0aa2d4.js.map → p-b1a8e30d.js.map} +1 -1
- package/dist/components/{p-19a2f475.js → p-c4a9f453.js} +4 -4
- package/dist/components/p-c4a9f453.js.map +1 -0
- package/dist/components/{p-5753850f.js → p-cbade307.js} +2 -2
- package/dist/components/{p-5753850f.js.map → p-cbade307.js.map} +1 -1
- package/dist/components/{p-d67754e0.js → p-cf18373a.js} +4 -4
- package/dist/components/{p-d67754e0.js.map → p-cf18373a.js.map} +1 -1
- package/dist/components/{p-7aff1ad5.js → p-d04e8a4e.js} +2 -2
- package/dist/components/{p-7aff1ad5.js.map → p-d04e8a4e.js.map} +1 -1
- package/dist/components/{p-2e9efe46.js → p-e0fe93e9.js} +8 -8
- package/dist/components/p-e0fe93e9.js.map +1 -0
- package/dist/components/pedido-finalizado.js +2 -2
- package/dist/components/phone-cancel-input.js +1 -1
- package/dist/components/phone-input-mask.js +1 -1
- package/dist/components/phone-input.js +1 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/p-0521617e.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-0521617e.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-9399d79f.entry.js → p-2fdbb9ec.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-374de9ae.js → p-39df4263.js} +2 -2
- package/dist/crmbonus-component-wake/p-39df4263.js.map +1 -0
- package/dist/crmbonus-component-wake/p-61fafdba.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-61fafdba.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-3024dc0b.entry.js → p-8c44a0a5.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-3f336c1d.entry.js → p-ae916fdb.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-8a5448aa.entry.js → p-cf8e81f9.entry.js} +2 -2
- package/dist/crmbonus-component-wake/p-f6dd48cc.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-f6dd48cc.entry.js.map +1 -0
- package/dist/esm/app-modal_4.entry.js +6 -6
- package/dist/esm/app-modal_4.entry.js.map +1 -1
- package/dist/esm/crm-bonus-note.entry.js +22 -0
- package/dist/esm/crm-bonus-note.entry.js.map +1 -0
- package/dist/esm/crm-bonus.entry.js +29 -6
- package/dist/esm/crm-bonus.entry.js.map +1 -1
- package/dist/esm/crmbonus-component-wake.js +1 -1
- package/dist/esm/{crmbonus.service-053a9e38.js → crmbonus.service-d2bfcb1d.js} +8 -1
- package/dist/esm/crmbonus.service-d2bfcb1d.js.map +1 -0
- package/dist/esm/giftback-finish_3.entry.js +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loading-spinner.entry.js +1 -1
- package/dist/esm/pedido-finalizado.entry.js +2 -2
- package/dist/esm/phone-input-mask.entry.js +1 -1
- package/dist/types/components/crm-bonus/crm-bonus.d.ts +3 -1
- package/dist/types/components/crm-bonus-form/crm-bonus-form.d.ts +1 -1
- package/dist/types/components/note/crm-bonus-note.d.ts +5 -0
- package/dist/types/components.d.ts +15 -2
- package/dist/types/services/crmbonus.service.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/crmbonus.service-8412ddbf.js.map +0 -1
- package/dist/components/p-19a2f475.js.map +0 -1
- package/dist/components/p-2e9efe46.js.map +0 -1
- package/dist/components/p-374de9ae.js.map +0 -1
- package/dist/crmbonus-component-wake/p-36107050.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-36107050.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-374de9ae.js.map +0 -1
- package/dist/crmbonus-component-wake/p-6aa00d0b.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-6aa00d0b.entry.js.map +0 -1
- package/dist/esm/crmbonus.service-053a9e38.js.map +0 -1
- /package/dist/crmbonus-component-wake/{p-9399d79f.entry.js.map → p-2fdbb9ec.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-3024dc0b.entry.js.map → p-8c44a0a5.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-3f336c1d.entry.js.map → p-ae916fdb.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-8a5448aa.entry.js.map → p-cf8e81f9.entry.js.map} +0 -0
@@ -14,7 +14,7 @@ const LoadingSpinner = class {
|
|
14
14
|
this.color = '#0078d7';
|
15
15
|
}
|
16
16
|
render() {
|
17
|
-
return (index.h("div", { key: '
|
17
|
+
return (index.h("div", { key: 'bf8c1b0ae13f857499905cba4a56f6bc787e7caf', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
|
18
18
|
}
|
19
19
|
};
|
20
20
|
LoadingSpinner.style = LoadingSpinnerStyle0;
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
const index = require('./index-52d8a075.js');
|
6
|
-
const crmbonus_service = require('./crmbonus.service-
|
6
|
+
const crmbonus_service = require('./crmbonus.service-e6b51638.js');
|
7
7
|
|
8
8
|
const Pedido = class {
|
9
9
|
constructor(hostRef) {
|
@@ -27,7 +27,7 @@ const Pedido = class {
|
|
27
27
|
}
|
28
28
|
}
|
29
29
|
render() {
|
30
|
-
return (index.h("div", { key: '
|
30
|
+
return (index.h("div", { key: '40fe48d94feaeb62c7c6e5b870b8653f5e714084' }));
|
31
31
|
}
|
32
32
|
};
|
33
33
|
|
@@ -35,7 +35,7 @@ const PhoneInputMask = class {
|
|
35
35
|
return this.phone;
|
36
36
|
}
|
37
37
|
render() {
|
38
|
-
return (index.h("input", { key: '
|
38
|
+
return (index.h("input", { key: 'aa853aac4a5d7f890de79cc5127f2b9c8494243d', disabled: this.disabled, id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
|
39
39
|
}
|
40
40
|
};
|
41
41
|
PhoneInputMask.style = PhoneInputMaskStyle0;
|
@@ -9,6 +9,7 @@
|
|
9
9
|
"components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js",
|
10
10
|
"components/loading-spinner/loading-spinner.js",
|
11
11
|
"components/modal/app-modal.js",
|
12
|
+
"components/note/crm-bonus-note.js",
|
12
13
|
"components/pedido/pedido.js",
|
13
14
|
"components/phone/phone-input-mask.js"
|
14
15
|
],
|
@@ -5,7 +5,7 @@
|
|
5
5
|
.container-button {
|
6
6
|
/* max-width: 100%; */
|
7
7
|
cursor: pointer;
|
8
|
-
padding:
|
8
|
+
padding: 5px 5px 5px 14px;
|
9
9
|
/* display: flex; */
|
10
10
|
}
|
11
11
|
|
@@ -20,9 +20,13 @@ margin-bottom: 20px; */
|
|
20
20
|
margin-bottom: 20px;
|
21
21
|
}
|
22
22
|
|
23
|
+
.section-cart-crm {
|
24
|
+
margin-top: 10px;
|
25
|
+
}
|
26
|
+
|
23
27
|
.section-cart-crm p {
|
24
28
|
padding: 0;
|
25
|
-
margin:
|
29
|
+
margin: 0px 0px 0px 15px;
|
26
30
|
}
|
27
31
|
|
28
32
|
.button {
|
@@ -74,4 +78,10 @@ margin-bottom: 20px; */
|
|
74
78
|
border-color: #00162e;
|
75
79
|
width: 30%;
|
76
80
|
color: #fff;
|
81
|
+
}
|
82
|
+
|
83
|
+
.message-alert {
|
84
|
+
font-family: sans-serif;
|
85
|
+
color: #df4d4d;
|
86
|
+
margin-top: 5px;
|
77
87
|
}
|
@@ -20,6 +20,7 @@ export class CrmBonus {
|
|
20
20
|
this.message = undefined;
|
21
21
|
this.phone = undefined;
|
22
22
|
this.canCancel = false;
|
23
|
+
this.amountCancel = undefined;
|
23
24
|
this.sent = undefined;
|
24
25
|
}
|
25
26
|
async componentWillLoad() {
|
@@ -31,6 +32,12 @@ export class CrmBonus {
|
|
31
32
|
this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);
|
32
33
|
console.log('user', this.customer);
|
33
34
|
}
|
35
|
+
const amount = localStorage.getItem(this.cartId);
|
36
|
+
console.log('amount', amount);
|
37
|
+
if (amount) {
|
38
|
+
this.canCancel = true;
|
39
|
+
this.amountCancel = amount;
|
40
|
+
}
|
34
41
|
}
|
35
42
|
catch (error) {
|
36
43
|
console.log('info customer');
|
@@ -62,12 +69,28 @@ export class CrmBonus {
|
|
62
69
|
handleCloseModal() {
|
63
70
|
this.showModal = false;
|
64
71
|
}
|
65
|
-
save() {
|
66
|
-
localStorage.setItem(
|
72
|
+
save(amount) {
|
73
|
+
localStorage.setItem(this.cartId, amount.toString());
|
74
|
+
this.canCancel = true;
|
75
|
+
this.amountCancel = amount.toString();
|
76
|
+
}
|
77
|
+
async cancel() {
|
78
|
+
this.message = "";
|
79
|
+
this.loading = true;
|
80
|
+
try {
|
81
|
+
await this.crmBonusService.cancel(this.cartId, this.storeName);
|
82
|
+
this.canCancel = false;
|
83
|
+
}
|
84
|
+
catch (error) {
|
85
|
+
this.message = "Não consegui cancelar o bônus, tente novamente!";
|
86
|
+
}
|
87
|
+
finally {
|
88
|
+
this.loading = false;
|
89
|
+
}
|
67
90
|
}
|
68
91
|
render() {
|
69
|
-
return (h("div", { key: '
|
70
|
-
: h("phone-input", { value: this.customer.phone, sendPin: (phone) => { this.sendPin(phone); }, loading: this.loading })), h("app-modal", { key: '
|
92
|
+
return (h("div", { key: '0392d18435b29da7594c5ddec8dca0a5a2c892f6', class: "section-cart-crm" }, h("p", { key: '7f5cb65fe1ebce8397d5d6c8d3d13d09ad55d8db', class: "text-left fbits-responsive-carrinho-desconto-texto" }, "Giftback"), h("div", { key: '82922b373a5c6d0eb72d59826c5b10425fa9fb81', class: "container-button" }, this.canCancel ? h("phone-cancel-input", { value: this.amountCancel, sendPin: () => { this.cancel(); }, loading: this.loading })
|
93
|
+
: h("phone-input", { value: this.customer.phone, sendPin: (phone) => { this.sendPin(phone); }, loading: this.loading })), h("p", { key: '113c2653a276730fd3ecd675f50a0f147c656620', class: "message-alert" }, this.message), h("app-modal", { key: 'ffda850ab8dc0534e56f868554eaaa794b168427', isOpen: this.showModal, modalTitle: `Giftback`, onModalClosed: () => (this.showModal = false) }, h("crm-bonus-form", { key: '3b3493173363fd799f26b37e6d94f9455e19f2bf', saveStore: (amount) => this.save(amount), ref: ref => this.crmBonusRef = ref, sent: this.sent, phone: this.phone, cancel: () => this.handleCloseModal(), storeName: this.storeName, products: this.buildProducts(), cartId: this.cartId, customer: this.customer }))));
|
71
94
|
}
|
72
95
|
static get is() { return "crm-bonus"; }
|
73
96
|
static get encapsulation() { return "shadow"; }
|
@@ -163,6 +186,7 @@ export class CrmBonus {
|
|
163
186
|
"message": {},
|
164
187
|
"phone": {},
|
165
188
|
"canCancel": {},
|
189
|
+
"amountCancel": {},
|
166
190
|
"sent": {}
|
167
191
|
};
|
168
192
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"crm-bonus.js","sourceRoot":"","sources":["../../../../src/components/crm-bonus/crm-bonus.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,MAAM,OAAO,QAAQ;;QAEX,oBAAe,GAAoB,IAAI,eAAe,EAAE,CAAC;yBAInC,KAAK;;;;;;wBAOJ;YAC7B,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,EAAE;SACV;uBAE2B,KAAK;;;yBAGH,KAAK
|
1
|
+
{"version":3,"file":"crm-bonus.js","sourceRoot":"","sources":["../../../../src/components/crm-bonus/crm-bonus.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,MAAM,OAAO,QAAQ;;QAEX,oBAAe,GAAoB,IAAI,eAAe,EAAE,CAAC;yBAInC,KAAK;;;;;;wBAOJ;YAC7B,SAAS,EA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,CAAC,IAAI,CAAC,WAAW,GAAG,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAI,CAClR,CACR,CACP,CAAA;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, State, h } from '@stencil/core';\nimport { IProduct, IProductWake, ICustomer } from '../../dto/validate.pin.bonus';\nimport { CrmBonusService } from '../../services/crmbonus.service';\nimport { IPinSent } from '../../components';\nimport { StepFormEnum } from '../../contants';\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n shadow: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n private crmBonusRef: HTMLCrmBonusFormElement;\n\n @State() showModal: boolean = false;\n @Prop({ attribute: 'userid' }) userId: number;\n @Prop({ attribute: 'storename' }) storeName;\n @Prop({ attribute: 'products' }) productsInString: string;\n @Prop({ attribute: 'cartid' }) cartId;\n\n @State() products: Array<IProductWake>;\n @State() customer: ICustomer = {\n birthDate: \"\",\n document: \"\",\n name: \"\",\n phone: \"\"\n };\n\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: number;\n @State() canCancel: boolean = false;\n @State() amountCancel: string;\n @State() sent: IPinSent;\n\n\n async componentWillLoad() {\n await this.handleLoad();\n }\n\n async handleLoad() {\n try {\n if (this.userId) {\n this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);\n console.log('user', this.customer);\n }\n\n const amount = localStorage.getItem(this.cartId);\n console.log('amount', amount)\n\n if (amount) {\n this.canCancel = true;\n this.amountCancel = amount;\n }\n\n } catch (error) {\n console.log('info customer')\n }\n this.products = JSON.parse(this.productsInString);\n }\n\n public async sendPin(phone: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n this.sent = await this.crmBonusService.sendPin(this.phone, this.storeName);;\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n buildProducts(): IProduct[] {\n return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), variantId: product.ProdutoVarianteId, qtd: product.Quantidade }))\n }\n\n handleCloseModal() {\n this.showModal = false;\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n this.canCancel = true;\n this.amountCancel = amount.toString()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId, this.storeName);\n this.canCancel = false;\n } catch (error) {\n this.message = \"Não consegui cancelar o bônus, tente novamente!\"\n } finally {\n this.loading = false;\n }\n }\n\n render() {\n return (\n <div class=\"section-cart-crm\">\n <p class=\"text-left fbits-responsive-carrinho-desconto-texto\">Giftback</p>\n <div class=\"container-button\">\n {/* <img src={logo} onClick={() => (this.showModal = true)} /> */}\n {\n this.canCancel ? <phone-cancel-input value={this.amountCancel} sendPin={() => { this.cancel() }} loading={this.loading} />\n : <phone-input value={this.customer.phone} sendPin={(phone) => { this.sendPin(phone) }} loading={this.loading} />\n }\n </div>\n <p class=\"message-alert\" >{this.message}</p>\n <app-modal\n isOpen={this.showModal}\n modalTitle={`Giftback`}\n onModalClosed={() => (this.showModal = false)}\n >\n <crm-bonus-form saveStore={(amount: number) => this.save(amount)} ref={ref => this.crmBonusRef = ref} sent={this.sent} phone={this.phone} cancel={() => this.handleCloseModal()} storeName={this.storeName} products={this.buildProducts()} cartId={this.cartId} customer={this.customer} />\n </app-modal>\n </div>\n )\n }\n}\n"]}
|
@@ -57,7 +57,7 @@ export class CrmBonusForm {
|
|
57
57
|
try {
|
58
58
|
await this.reserve(amount);
|
59
59
|
this.step = StepFormEnum.STEP_APPLY;
|
60
|
-
this.saveStore();
|
60
|
+
this.saveStore(amount);
|
61
61
|
}
|
62
62
|
catch (error) {
|
63
63
|
this.message = "ocorreu um error ao solicitar a aplicação do bonus! tente novamente";
|
@@ -79,7 +79,7 @@ export class CrmBonusForm {
|
|
79
79
|
this.cancel();
|
80
80
|
}
|
81
81
|
render() {
|
82
|
-
return (h(Host, { key: '
|
82
|
+
return (h(Host, { key: '5498ff56b7041d92bf76a31cd8f0d631b989a968' }, this.step === StepFormEnum.STEP_PIN && h("giftback-pin", { key: '1d7b7a077cf859f64d5215eccbdf3b18a030ccb4', cancel: () => this.handleCancel(), sent: this.sent, validate: (data) => this.validateBonus(data), loading: this.loading }), this.step === StepFormEnum.STEP_RESERVE && h("giftback-progress", { key: 'c98f204305d87a64229d8af2316c4dfc9d07ec08', loading: this.loading, cancel: () => this.handleCancel(), bonus: this.bonus, reserve: (amountRedeemed) => this.reserveApply(amountRedeemed) }), this.step === StepFormEnum.STEP_APPLY && h("giftback-finish", { key: '0f7c19a8c5b8ce92566c3de1e68d771dba87c0c8' }), h("p", { key: '8993849d1175c0edb8e8107dd5edc6c011cfe2e6', class: "message-error" }, this.message)));
|
83
83
|
}
|
84
84
|
static get is() { return "crm-bonus-form"; }
|
85
85
|
static get encapsulation() { return "shadow"; }
|
@@ -241,8 +241,8 @@ export class CrmBonusForm {
|
|
241
241
|
"type": "unknown",
|
242
242
|
"mutable": false,
|
243
243
|
"complexType": {
|
244
|
-
"original": "() => void",
|
245
|
-
"resolved": "() => void",
|
244
|
+
"original": "(amount: number) => void",
|
245
|
+
"resolved": "(amount: number) => void",
|
246
246
|
"references": {}
|
247
247
|
},
|
248
248
|
"required": false,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"crm-bonus-form.js","sourceRoot":"","sources":["../../../../src/components/crm-bonus-form/crm-bonus-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,MAAM,OAAO,YAAY;;QAEb,oBAAe,GAAoB,IAAI,eAAe,EAAE,CAAC;;;;wBAKnC;YAC1B,KAAK,EAAE,EAAE;YACT,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,EAAE;SACX;;;;;;uBAS2B,KAAK;oBAET,YAAY,CAAC,YAAY;;;;IAOjD,KAAK,CAAC,OAAO,CAAC,IAAkB;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IACpB,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,GAAW;;QAClC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,MAAM,OAAO,GAAwB;YACjC,GAAG,EAAE,GAAG;YACR,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YAChC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO;YAC1B,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM;YACzB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SAC1B,CAAA;QAED,IAAI,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YAElF,OAAO,CAAC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AAO,EAAE,CAAC,cAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,GAAI;YACrN,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,UAAU,IAAI,yEAAmB;YAC7D,0DAAG,KAAK,EAAC,eAAe,IAAE,IAAI,CAAC,OAAO,CAAK,CACxC,CACV,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Host, Method, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent';\n\n@Component({\n tag: 'crm-bonus-form',\n styleUrl: 'crm-bonus-form.css',\n shadow: true\n})\nexport class CrmBonusForm {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer = {\n phone: \"\",\n birthDate: \"\",\n document: \"\",\n name: \"\"\n };\n @Prop() sent: IPinSent;\n @Prop() stepNext: StepFormEnum;\n @Prop() phone: number;\n\n @Prop() saveStore: (amount: number) => void;\n\n @Prop() cancel: () => void;\n\n @State() loading: boolean = false;\n\n @State() step: number = StepFormEnum.STEP_RESERVE;\n\n @State() message: string;\n\n @State() bonus: IBonus;\n\n @Method()\n async setStep(step: StepFormEnum) {\n this.step = step\n }\n\n public async validateBonus(pin: string) {\n this.loading = true;\n this.message = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.phone.toString(),\n loja_id: this.sent.storeId,\n user_id: this.sent.userId,\n cartId: this.cartId,\n products: this.products\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload, this.storeName);\n\n console.log('[this.bonus]', this.bonus);\n this.step = StepFormEnum.STEP_RESERVE;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false;\n }\n console.log('payload', payload)\n }\n\n public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n\n this.step = StepFormEnum.STEP_APPLY;\n\n this.saveStore(amount);\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n } finally {\n this.loading = false;\n }\n }\n\n public async reserve(amount: number) {\n await this.crmBonusService.reserve({\n redeemed_bonus: amount,\n cart_id: this.cartId,\n ticket: this.cartId,\n gross_value: this.bonus.totalValue,\n }, this.storeName);\n }\n\n public handleCancel() {\n this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n render() {\n return (\n <Host>\n {/* {this.step === StepFormEnum.STEP_PHONE && <phone-input value={this.customer.phone} sendPin={(phone) => this.sendPin(phone)} loading={this.loading} />} */}\n {this.step === StepFormEnum.STEP_PIN && <giftback-pin cancel={() => this.handleCancel()} sent={this.sent} validate={(data) => this.validateBonus(data)} loading={this.loading} />}\n\n {this.step === StepFormEnum.STEP_RESERVE && <giftback-progress loading={this.loading} cancel={() => this.handleCancel()} bonus={this.bonus} reserve={(amountRedeemed: number) => this.reserveApply(amountRedeemed)} />}\n {this.step === StepFormEnum.STEP_APPLY && <giftback-finish />}\n <p class=\"message-error\">{this.message}</p>\n </Host>\n )\n }\n}"]}
|
package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js
CHANGED
@@ -2,7 +2,7 @@ import { h } from "@stencil/core";
|
|
2
2
|
import success from "../../../crm-bonus/assets/svg/success-svgrepo-com.svg";
|
3
3
|
export class GiftbackFinish {
|
4
4
|
render() {
|
5
|
-
return (h("div", { key: '
|
5
|
+
return (h("div", { key: 'e72f82799146a6e94acbdd62324e07cdf9f77009', class: "message-finish" }, h("img", { key: '46e2436a3dbe4745225c3b9674e6bf6c299ad63e', src: success, width: 80 }), h("p", { key: '270e42050956f7f3d1ae9b90f314211fa310f797' }, "Legal! O B\u00F4nus ser\u00E1 aplicado na sua compra.")));
|
6
6
|
}
|
7
7
|
static get is() { return "giftback-finish"; }
|
8
8
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js
CHANGED
@@ -30,7 +30,7 @@ export class GiftbackPin {
|
|
30
30
|
}
|
31
31
|
}
|
32
32
|
render() {
|
33
|
-
return (h("div", { key: '
|
33
|
+
return (h("div", { key: '7fe6a9f55ca436ecfcc20f106c1efeddd8387490', class: "form-container-pin" }, h("div", { key: 'aece84fab5ecf94ce5ca90fd1912623dd3c1b9b8' }, h("p", { key: '5134dd8eb3478f59dcfcdca6612e885b76578cba' }, "Insira o PIN de 4 d\u00EDgitos enviado por SMS."), h("div", { key: '8855be06a09925746a5b18323726dd67ec73d7c3', class: "pin-container" }, this.pin.map((_, index) => (h("input", { type: "text", maxLength: 1, value: this.pin[index], onInput: (event) => this.handleInput(event, index) }))))), h("div", { key: '1c5523feb6c9dafbfddd5388170de5fea7627f62', class: "footer-button" }, h("button", { key: '8506cd68998d4ecb76f8a8a262373605a06827de', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: '4dda0af894ad5849ba27d3a4f6c15c80d6c984ae', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePin() }, !this.loading ? "Enviar" : h("loading-spinner", { size: "15px", color: "#fff" })))));
|
34
34
|
}
|
35
35
|
static get is() { return "giftback-pin"; }
|
36
36
|
static get encapsulation() { return "shadow"; }
|
@@ -26,7 +26,7 @@ export class GiftbackProgress {
|
|
26
26
|
}
|
27
27
|
render() {
|
28
28
|
const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;
|
29
|
-
return (h("div", { key: '
|
29
|
+
return (h("div", { key: 'c2fb3f6a887887e197b55e951dbf50054e27e77a', class: "giftback-container" }, h("p", { key: '1d08aaaa1d260f3938e472e95b1e194be50c3987' }, "Voc\u00EA possui at\u00E9 ", h("strong", { key: '99d39bc977a41c9d098c812b61ae41c25342f65c' }, "R$ ", this.bonus.totalBonus.toFixed(2)), " de Giftback nessa compra!"), h("p", { key: '68fc8504eabfdf6e9e873780bb6863521a683e58', class: "validity" }, "V\u00E1lido at\u00E9: ", new Date(this.bonus.firstValidityDate).toLocaleDateString('pt-Br')), h("p", { key: 'fe4c8804f8d577e530330050cfae9c33c2be36d7' }, "Voc\u00EA est\u00E1 utilizando ", h("strong", { key: 'd1d2a6ad0ca1da77e5a4ab9a595af74a11fb9862' }, "R$ ", this.usedValue.toFixed(2)), " nessa compra"), h("div", { key: 'b0eac608016c3136a344c03d456355d7ffcc8dfc', class: "progress-container" }, h("span", { key: 'a88626a3f0d0109fca8b593da05e76f54eb69e28' }, "R$ 0"), h("input", { key: '5d19e34becada60c728f9fce1fa67eede16b7844', disabled: true, type: "range", min: "0", step: "0.01", max: this.bonus.totalBonus, value: this.usedValue, onInput: (event) => this.handleSliderChange(event) }), h("span", { key: '31f0b18eff1ffbd2fb86941653beacad567514ca' }, "R$ ", this.bonus.totalBonus.toFixed(2))), h("p", { key: '5f278047d5bb21282890de0304bc2e8addf8ea43', class: "remaining" }, "Faltam ", h("strong", { key: 'fa220ca91d366eb5e5eec4bf7e94ace4584b0dbe' }, "R$ ", remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)), " para utilizar o valor total do Giftback."), h("div", { key: '248c3376e92b8daab0c821e79e083ef6f44bff9e', class: "footer-button-giftback" }, h("button", { key: 'fe612e24a59abed7ef27e6a0425d40efaad218c2', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: '6f86a5b1eeedf01c9eabe9313fdf7b00dc264e96', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.handleReserve(this.usedValue) }, !this.loading ? "Aplicar" : h("loading-spinner", { size: "10px", color: "#fff" })))));
|
30
30
|
}
|
31
31
|
static get is() { return "giftback-progress"; }
|
32
32
|
static get encapsulation() { return "shadow"; }
|
@@ -10,7 +10,7 @@ export class PhoneInput {
|
|
10
10
|
await this.sendPin(phone);
|
11
11
|
}
|
12
12
|
render() {
|
13
|
-
return (h("div", { key: '
|
13
|
+
return (h("div", { key: '8deb65295383b9a14e1ac5c3050ce2cab709c208', class: "form-container" }, h("phone-input-mask", { key: 'd5c9b2fb84b166c67fdfa653f4d0194818d7ae54', initialValue: this.value, ref: ref => this.phoneInputMask = ref }), h("button", { key: 'cf65564923d078b226f168eb1fc476be5c3719c8', class: `btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "validar" : h("loading-spinner", { size: "11px", color: "#fff" }))));
|
14
14
|
}
|
15
15
|
static get is() { return "phone-input"; }
|
16
16
|
static get properties() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"phone.input.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/phone/phone.input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKnD,MAAM,OAAO,UAAU;;;;;;IAQnB,KAAK,CAAC,aAAa;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,gBAAgB;YACvB,yEAAkB,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,GAAG,GAAG,GAAI;YACrF,+DAAQ,KAAK,EAAE,0BAA0B,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,IAE/H,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEvE,CACP,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-input'\n})\nexport class PhoneInput {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() sendPin: Function;\n @Prop() loading: boolean;\n @Prop() value: string;\n\n async validatePhone() {\n const phone = await this.phoneInputMask.getPhone();\n await this.sendPin(phone);\n }\n\n render() {\n return (\n <div class=\"form-container\">\n <phone-input-mask initialValue={this.value} ref={ref => this.phoneInputMask = ref} />\n <button class={`btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"validar\" : <loading-spinner size=\"
|
1
|
+
{"version":3,"file":"phone.input.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/phone/phone.input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKnD,MAAM,OAAO,UAAU;;;;;;IAQnB,KAAK,CAAC,aAAa;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,gBAAgB;YACvB,yEAAkB,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,GAAG,GAAG,GAAI;YACrF,+DAAQ,KAAK,EAAE,0BAA0B,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,IAE/H,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEvE,CACP,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-input'\n})\nexport class PhoneInput {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() sendPin: Function;\n @Prop() loading: boolean;\n @Prop() value: string;\n\n async validatePhone() {\n const phone = await this.phoneInputMask.getPhone();\n await this.sendPin(phone);\n }\n\n render() {\n return (\n <div class=\"form-container\">\n <phone-input-mask initialValue={this.value} ref={ref => this.phoneInputMask = ref} />\n <button class={`btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"validar\" : <loading-spinner size=\"11px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"]}
|
package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js
CHANGED
@@ -10,7 +10,7 @@ export class PhoneCancelInput {
|
|
10
10
|
await this.sendPin(phone);
|
11
11
|
}
|
12
12
|
render() {
|
13
|
-
return (h("div", { key: '
|
13
|
+
return (h("div", { key: 'ca3f5e2e996e26c520bb1bbaa14eb176e89c74a1', class: "form-container" }, h("phone-input-mask", { key: 'fc2a5d692b1bf5ada9180bb721c167c799a51aa2', initialValue: `Valor aplicado R$ ${this.value}`, ref: ref => this.phoneInputMask = ref, disabled: true }), h("button", { key: '96c5c22f187420cc47a393c787f4a9f3a8a9eab9', class: `btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "Cancelar" : h("loading-spinner", { size: "11px", color: "#fff" }))));
|
14
14
|
}
|
15
15
|
static get is() { return "phone-cancel-input"; }
|
16
16
|
static get properties() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"phone.cancel.input.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKnD,MAAM,OAAO,gBAAgB;;;;;;IAQzB,KAAK,CAAC,aAAa;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,gBAAgB;YACvB,yEAAkB,YAAY,EAAE,
|
1
|
+
{"version":3,"file":"phone.cancel.input.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKnD,MAAM,OAAO,gBAAgB;;;;;;IAQzB,KAAK,CAAC,aAAa;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,gBAAgB;YACvB,yEAAkB,YAAY,EAAE,qBAAqB,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,GAAG,GAAG,EAAE,QAAQ,EAAE,IAAI,GAAI;YAC5H,+DAAQ,KAAK,EAAE,0BAA0B,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,IAE/H,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAExE,CACP,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-cancel-input'\n})\nexport class PhoneCancelInput {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() sendPin: Function;\n @Prop() loading: boolean;\n @Prop() value: string;\n\n async validatePhone() {\n const phone = await this.phoneInputMask.getPhone();\n await this.sendPin(phone);\n }\n\n render() {\n return (\n <div class=\"form-container\">\n <phone-input-mask initialValue={`Valor aplicado R$ ${this.value}`} ref={ref => this.phoneInputMask = ref} disabled={true} />\n <button class={`btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"Cancelar\" : <loading-spinner size=\"11px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"]}
|
@@ -5,7 +5,7 @@ export class LoadingSpinner {
|
|
5
5
|
this.color = '#0078d7';
|
6
6
|
}
|
7
7
|
render() {
|
8
|
-
return (h("div", { key: '
|
8
|
+
return (h("div", { key: 'bf8c1b0ae13f857499905cba4a56f6bc787e7caf', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
|
9
9
|
}
|
10
10
|
static get is() { return "loading-spinner"; }
|
11
11
|
static get encapsulation() { return "shadow"; }
|
@@ -8,7 +8,7 @@ export class AppModal {
|
|
8
8
|
this.modalClosed.emit();
|
9
9
|
}
|
10
10
|
render() {
|
11
|
-
return (h("div", { key: '
|
11
|
+
return (h("div", { key: 'e3c7da4a633b1a76df31358e39512952eca70c26', class: `modal-backdrop ${this.isOpen ? 'visible' : ''}` }, h("div", { key: '56f58320520a06e6ec4f5d585b47f930e01adbee', class: "modal" }, h("div", { key: '58d9092422c8c4e158154ae6b6b4fbafe5be5642', class: "modal-header" }, h("h3", { key: '98f9827b88a2c2341525afd58454c8b1ee13062c' }, this.modalTitle), h("button", { key: 'd14b1edd1fdb612d1037e4f0831a801f6a042f86', class: "close-button", onClick: () => this.closeModal() }, "\u00D7")), h("div", { key: 'ddcee9b749070bb130a27750009afca8558eca2e', class: "modal-body" }, h("slot", { key: 'aeda676e81150e4ab0bca1c6ffedc19c441553ac' })))));
|
12
12
|
}
|
13
13
|
static get is() { return "app-modal"; }
|
14
14
|
static get encapsulation() { return "shadow"; }
|
@@ -0,0 +1,34 @@
|
|
1
|
+
.note-container {
|
2
|
+
border: 1px solid #dddddd;
|
3
|
+
padding-left: 15px;
|
4
|
+
padding-right: 15px;
|
5
|
+
}
|
6
|
+
|
7
|
+
.note-container .back-cart {
|
8
|
+
display: flex;
|
9
|
+
text-align: center;
|
10
|
+
}
|
11
|
+
|
12
|
+
.note-title {
|
13
|
+
font-weight: 700;
|
14
|
+
height: 2em;
|
15
|
+
line-height: 2em;
|
16
|
+
text-align: left;
|
17
|
+
border-radius: 3px;
|
18
|
+
color: #333;
|
19
|
+
margin-bottom: 1.4em;
|
20
|
+
}
|
21
|
+
|
22
|
+
.note-description {
|
23
|
+
font-family: Arial;
|
24
|
+
color: #6d6d5f;
|
25
|
+
padding: 0;
|
26
|
+
margin: 0 auto;
|
27
|
+
}
|
28
|
+
|
29
|
+
.back-cart {
|
30
|
+
font-size: .9em;
|
31
|
+
color: #337ab7;
|
32
|
+
text-decoration: none;
|
33
|
+
cursor: pointer;
|
34
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
export class CrmBonusNote {
|
3
|
+
constructor() {
|
4
|
+
this.url = undefined;
|
5
|
+
}
|
6
|
+
componentWillLoad() {
|
7
|
+
this.url = window.location.origin;
|
8
|
+
}
|
9
|
+
render() {
|
10
|
+
return (h("div", { key: '24f15c5c816f9e9b2b7d29b5ccb5379857b21d7e', class: "note-container" }, h("p", { key: '2fe785edd0bb7d880782191ac5763c47789194a0', class: "note-title" }, "Gift back"), h("p", { key: '726b0303b6ac7284f88b981716ee0748f9e03c11', class: "note-description" }, "Volte ao carrinho e confira se voc\u00EA tem Giftback para aplicar na sua compra!"), h("a", { key: 'f42fc1a08784ffdf5c55dc4833c4047b35f93ff5', class: "back-cart", href: this.url }, "Voltar ao carrinho")));
|
11
|
+
}
|
12
|
+
static get is() { return "crm-bonus-note"; }
|
13
|
+
static get originalStyleUrls() {
|
14
|
+
return {
|
15
|
+
"$": ["crm-bonus-note.css"]
|
16
|
+
};
|
17
|
+
}
|
18
|
+
static get styleUrls() {
|
19
|
+
return {
|
20
|
+
"$": ["crm-bonus-note.css"]
|
21
|
+
};
|
22
|
+
}
|
23
|
+
static get states() {
|
24
|
+
return {
|
25
|
+
"url": {}
|
26
|
+
};
|
27
|
+
}
|
28
|
+
}
|
29
|
+
//# sourceMappingURL=crm-bonus-note.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"crm-bonus-note.js","sourceRoot":"","sources":["../../../../src/components/note/crm-bonus-note.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAMpD,MAAM,OAAO,YAAY;;;;IAKrB,iBAAiB;QACb,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IACtC,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,gBAAgB;YACvB,0DAAG,KAAK,EAAC,YAAY,gBAEjB;YAEJ,0DAAG,KAAK,EAAC,kBAAkB,wFAEvB;YAEJ,0DAAG,KAAK,EAAC,WAAW,EAAC,IAAI,EAAE,IAAI,CAAC,GAAG,yBAE/B,CACF,CACT,CAAA;IACL,CAAC;;;;;;;;;;;CACJ","sourcesContent":["import { Component, State, h } from \"@stencil/core\";\n\n@Component({\n tag: 'crm-bonus-note',\n styleUrl: 'crm-bonus-note.css'\n})\nexport class CrmBonusNote {\n\n @State() url: string\n\n\n componentWillLoad() {\n this.url = window.location.origin;\n }\n\n render() {\n return (\n <div class=\"note-container\">\n <p class=\"note-title\">\n Gift back\n </p>\n\n <p class=\"note-description\">\n Volte ao carrinho e confira se você tem Giftback para aplicar na sua compra!\n </p>\n\n <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a>\n </div>\n )\n }\n}"]}
|
@@ -21,7 +21,7 @@ export class Pedido {
|
|
21
21
|
}
|
22
22
|
}
|
23
23
|
render() {
|
24
|
-
return (h("div", { key: '
|
24
|
+
return (h("div", { key: '40fe48d94feaeb62c7c6e5b870b8653f5e714084' }));
|
25
25
|
}
|
26
26
|
static get is() { return "pedido-finalizado"; }
|
27
27
|
static get properties() {
|
@@ -26,7 +26,7 @@ export class PhoneInputMask {
|
|
26
26
|
return this.phone;
|
27
27
|
}
|
28
28
|
render() {
|
29
|
-
return (h("input", { key: '
|
29
|
+
return (h("input", { key: 'aa853aac4a5d7f890de79cc5127f2b9c8494243d', disabled: this.disabled, id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
|
30
30
|
}
|
31
31
|
static get is() { return "phone-input-mask"; }
|
32
32
|
static get encapsulation() { return "shadow"; }
|
@@ -38,5 +38,12 @@ export class CrmBonusService {
|
|
38
38
|
const response = await this.axiosInstance.post("/api/crm-bonus/redeem-bonus", payload, { headers: { store } });
|
39
39
|
return response.data;
|
40
40
|
}
|
41
|
+
async cancel(cartId, store) {
|
42
|
+
const response = await this.axiosInstance.post("/api/crm-bonus/cancel-bonus", {
|
43
|
+
num_pedido: cartId,
|
44
|
+
used_bonus: true
|
45
|
+
}, { headers: { store } });
|
46
|
+
return response.data;
|
47
|
+
}
|
41
48
|
}
|
42
49
|
//# sourceMappingURL=crmbonus.service.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"crmbonus.service.js","sourceRoot":"","sources":["../../../src/services/crmbonus.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAK7C,MAAM,OAAO,eAAe;IAGxB;QACI,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC;YAC9B,OAAO,EAAE,iBAAiB;YAC1B,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,QAAQ,EAAE,kBAAkB;aAC7B;SACF,CAAC,CAAC;IACT,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,MAAc,EAAE,KAAa;QAC3C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,mBAAmB,KAAK,aAAa,MAAM,EAAE,EAAG,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAA;QAClJ,OAAO,CAA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QAC7C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,6BAA6B,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAC/G,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;CACJ","sourcesContent":["import axios, { AxiosInstance } from 'axios';\nimport { CRM_BONUS_API_URL } from '../../env'\nimport { IPinSent } from '../dto/pin.sent';\nimport { IBonus, IProccesPinBonusDto, IReserveDTO } from '../dto/validate.pin.bonus';\nimport { UpdateOrderDTO } from '../dto/update.order.dto';\n\nexport class CrmBonusService {\n private axiosInstance: AxiosInstance;\n\n constructor() {\n this.axiosInstance = axios.create({\n baseURL: CRM_BONUS_API_URL,\n headers: {\n 'Content-Type': 'application/json',\n 'accept': 'application/json',\n },\n });\n }\n\n async getCustomer(userId: number, store: string) {\n const response = await this.axiosInstance.get(`/api/wake/store/${store}/customer/${userId}`, { headers: { 'Content-Type': 'application/json' } })\n console.log('response.data', response.data)\n return response.data\n }\n\n async updateOrder(updateOrderDTO: UpdateOrderDTO){\n const response = await this.axiosInstance.put(`/api/carts/update_cart/${updateOrderDTO.cartId}`, \n { \n orderId: updateOrderDTO.orderId,\n cartIdCrm: updateOrderDTO.cartIdCrm\n }, { headers: { 'Content-Type': 'application/json' } })\n\n console.log('response', response.data)\n \n }\n\n async sendPin(phone: number, store: string): Promise<IPinSent> {\n const response = await this.axiosInstance.post(\"/api/crm-bonus/send-pin\", { celular: phone, nome: \"giftback\" }, { headers: { store } });\n return {\n storeId: response.data.store_id,\n userId: response.data.user_id\n }\n }\n\n async validatePinBonus(payload: IProccesPinBonusDto, store: string): Promise<IBonus> {\n console.log('[validatePinBonus]', payload);\n\n const response = await this.axiosInstance.post(\"/api/crm-bonus/process-pin-bonus\", payload, { headers: { store } })\n\n return response.data;\n }\n\n async reserve(payload: IReserveDTO, store: string) {\n const response = await this.axiosInstance.post(\"/api/crm-bonus/redeem-bonus\", payload, { headers: { store } });\n return response.data;\n }\n}"]}
|
1
|
+
{"version":3,"file":"crmbonus.service.js","sourceRoot":"","sources":["../../../src/services/crmbonus.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAK7C,MAAM,OAAO,eAAe;IAGxB;QACI,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC;YAC9B,OAAO,EAAE,iBAAiB;YAC1B,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,QAAQ,EAAE,kBAAkB;aAC7B;SACF,CAAC,CAAC;IACT,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,MAAc,EAAE,KAAa;QAC3C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,mBAAmB,KAAK,aAAa,MAAM,EAAE,EAAG,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAA;QAClJ,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;QAC3C,OAAO,QAAQ,CAAC,IAAI,CAAA;IACxB,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,cAA8B;QAC5C,MAAM,QAAQ,GAAI,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,0BAA0B,cAAc,CAAC,MAAM,EAAE,EAChG;YACI,OAAO,EAAE,cAAc,CAAC,OAAO;YAC/B,SAAS,EAAE,cAAc,CAAC,SAAS;SACtC,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAA;QAEvD,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;IAE1C,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,KAAa,EAAE,KAAa;QACtC,MAAM,Q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URL } from '../../env'\nimport { IPinSent } from '../dto/pin.sent';\nimport { IBonus, IProccesPinBonusDto, IReserveDTO } from '../dto/validate.pin.bonus';\nimport { UpdateOrderDTO } from '../dto/update.order.dto';\n\nexport class CrmBonusService {\n private axiosInstance: AxiosInstance;\n\n constructor() {\n this.axiosInstance = axios.create({\n baseURL: CRM_BONUS_API_URL,\n headers: {\n 'Content-Type': 'application/json',\n 'accept': 'application/json',\n },\n });\n }\n\n async getCustomer(userId: number, store: string) {\n const response = await this.axiosInstance.get(`/api/wake/store/${store}/customer/${userId}`, { headers: { 'Content-Type': 'application/json' } })\n console.log('response.data', response.data)\n return response.data\n }\n\n async updateOrder(updateOrderDTO: UpdateOrderDTO){\n const response = await this.axiosInstance.put(`/api/carts/update_cart/${updateOrderDTO.cartId}`, \n { \n orderId: updateOrderDTO.orderId,\n cartIdCrm: updateOrderDTO.cartIdCrm\n }, { headers: { 'Content-Type': 'application/json' } })\n\n console.log('response', response.data)\n \n }\n\n async sendPin(phone: number, store: string): Promise<IPinSent> {\n const response = await this.axiosInstance.post(\"/api/crm-bonus/send-pin\", { celular: phone, nome: \"giftback\" }, { headers: { store } });\n return {\n storeId: response.data.store_id,\n userId: response.data.user_id\n }\n }\n\n async validatePinBonus(payload: IProccesPinBonusDto, store: string): Promise<IBonus> {\n console.log('[validatePinBonus]', payload);\n\n const response = await this.axiosInstance.post(\"/api/crm-bonus/process-pin-bonus\", payload, { headers: { store } })\n\n return response.data;\n }\n\n async reserve(payload: IReserveDTO, store: string) {\n const response = await this.axiosInstance.post(\"/api/crm-bonus/redeem-bonus\", payload, { headers: { store } });\n return response.data;\n }\n\n async cancel(cartId: string, store: string) {\n const response = await this.axiosInstance.post(\"/api/crm-bonus/cancel-bonus\", {\n num_pedido: cartId,\n used_bonus: true\n }, { headers: { store } });\n return response.data;\n }\n}"]}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
2
|
+
|
3
|
+
interface CrmBonusNote extends Components.CrmBonusNote, HTMLElement {}
|
4
|
+
export const CrmBonusNote: {
|
5
|
+
prototype: CrmBonusNote;
|
6
|
+
new (): CrmBonusNote;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* Used to define this component and all nested components recursively.
|
10
|
+
*/
|
11
|
+
export const defineCustomElement: () => void;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-faf7103e.js';
|
2
|
+
|
3
|
+
const crmBonusNoteCss = ".note-container{border:1px solid #dddddd;padding-left:15px;padding-right:15px}.note-container .back-cart{display:flex;text-align:center}.note-title{font-weight:700;height:2em;line-height:2em;text-align:left;border-radius:3px;color:#333;margin-bottom:1.4em}.note-description{font-family:Arial;color:#6d6d5f;padding:0;margin:0 auto}.back-cart{font-size:.9em;color:#337ab7;text-decoration:none;cursor:pointer}";
|
4
|
+
const CrmBonusNoteStyle0 = crmBonusNoteCss;
|
5
|
+
|
6
|
+
const CrmBonusNote$1 = /*@__PURE__*/ proxyCustomElement(class CrmBonusNote extends H {
|
7
|
+
constructor() {
|
8
|
+
super();
|
9
|
+
this.__registerHost();
|
10
|
+
this.url = undefined;
|
11
|
+
}
|
12
|
+
componentWillLoad() {
|
13
|
+
this.url = window.location.origin;
|
14
|
+
}
|
15
|
+
render() {
|
16
|
+
return (h("div", { key: '24f15c5c816f9e9b2b7d29b5ccb5379857b21d7e', class: "note-container" }, h("p", { key: '2fe785edd0bb7d880782191ac5763c47789194a0', class: "note-title" }, "Gift back"), h("p", { key: '726b0303b6ac7284f88b981716ee0748f9e03c11', class: "note-description" }, "Volte ao carrinho e confira se voc\u00EA tem Giftback para aplicar na sua compra!"), h("a", { key: 'f42fc1a08784ffdf5c55dc4833c4047b35f93ff5', class: "back-cart", href: this.url }, "Voltar ao carrinho")));
|
17
|
+
}
|
18
|
+
static get style() { return CrmBonusNoteStyle0; }
|
19
|
+
}, [0, "crm-bonus-note", {
|
20
|
+
"url": [32]
|
21
|
+
}]);
|
22
|
+
function defineCustomElement$1() {
|
23
|
+
if (typeof customElements === "undefined") {
|
24
|
+
return;
|
25
|
+
}
|
26
|
+
const components = ["crm-bonus-note"];
|
27
|
+
components.forEach(tagName => { switch (tagName) {
|
28
|
+
case "crm-bonus-note":
|
29
|
+
if (!customElements.get(tagName)) {
|
30
|
+
customElements.define(tagName, CrmBonusNote$1);
|
31
|
+
}
|
32
|
+
break;
|
33
|
+
} });
|
34
|
+
}
|
35
|
+
defineCustomElement$1();
|
36
|
+
|
37
|
+
const CrmBonusNote = CrmBonusNote$1;
|
38
|
+
const defineCustomElement = defineCustomElement$1;
|
39
|
+
|
40
|
+
export { CrmBonusNote, defineCustomElement };
|
41
|
+
|
42
|
+
//# sourceMappingURL=crm-bonus-note.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"crm-bonus-note.js","mappings":";;AAAA,MAAM,eAAe,GAAG,wZAAwZ,CAAC;AACjb,2BAAe,eAAe;;MCKjBA,cAAY;;;;;;IAKrB,iBAAiB;QACb,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;KACrC;IAED,MAAM;QACF,QACI,4DAAK,KAAK,EAAC,gBAAgB,IACvB,0DAAG,KAAK,EAAC,YAAY,gBAEjB,EAEJ,0DAAG,KAAK,EAAC,kBAAkB,wFAEvB,EAEJ,0DAAG,KAAK,EAAC,WAAW,EAAC,IAAI,EAAE,IAAI,CAAC,GAAG,yBAE/B,CACF,EACT;KACJ;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CrmBonusNote"],"sources":["src/components/note/crm-bonus-note.css?tag=crm-bonus-note","src/components/note/crm-bonus-note.tsx"],"sourcesContent":[".note-container {\n border: 1px solid #dddddd;\n padding-left: 15px;\n padding-right: 15px;\n}\n\n.note-container .back-cart {\n display: flex;\n text-align: center;\n} \n\n.note-title {\n font-weight: 700;\n height: 2em;\n line-height: 2em;\n text-align: left;\n border-radius: 3px;\n color: #333;\n margin-bottom: 1.4em;\n}\n\n.note-description {\n font-family: Arial;\n color: #6d6d5f;\n padding: 0;\n margin: 0 auto;\n}\n\n.back-cart {\n font-size: .9em;\n color: #337ab7;\n text-decoration: none;\n cursor: pointer; \n}","import { Component, State, h } from \"@stencil/core\";\n\n@Component({\n tag: 'crm-bonus-note',\n styleUrl: 'crm-bonus-note.css'\n})\nexport class CrmBonusNote {\n\n @State() url: string\n\n\n componentWillLoad() {\n this.url = window.location.origin;\n }\n\n render() {\n return (\n <div class=\"note-container\">\n <p class=\"note-title\">\n Gift back\n </p>\n\n <p class=\"note-description\">\n Volte ao carrinho e confira se você tem Giftback para aplicar na sua compra!\n </p>\n\n <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a>\n </div>\n )\n }\n}"],"version":3}
|