crmbonus-component-wake 2.0.125 → 2.0.126
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/{esm → crmbonus-component-wake}/app-modal.entry.js +2 -3
- package/dist/crmbonus-component-wake/app-modal.entry.js.map +1 -0
- package/dist/{components/p-abbfbc98.js → crmbonus-component-wake/cart.helper-4e40ffa9.js} +3 -2
- package/dist/crmbonus-component-wake/cart.helper-4e40ffa9.js.map +1 -0
- package/dist/{esm/cart.helper-30a40560.js → crmbonus-component-wake/cart.helper-a921d7f9.js} +3 -2
- package/dist/crmbonus-component-wake/cart.helper-a921d7f9.js.map +1 -0
- package/dist/{components/p-2b3b8d6b.js → crmbonus-component-wake/countdown-timer.entry.js} +7 -27
- package/dist/crmbonus-component-wake/countdown-timer.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/crm-bonus-form.entry.js +4 -5
- package/dist/crmbonus-component-wake/{p-c23f3a07.entry.js.map → crm-bonus-form.entry.js.map} +1 -1
- package/dist/{esm → crmbonus-component-wake}/crm-bonus-note.entry.js +9 -10
- package/dist/crmbonus-component-wake/crm-bonus-note.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/crm-bonus.entry.js +8 -7
- package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/crm-button.entry.js +20 -0
- package/dist/crmbonus-component-wake/crm-button.entry.js.map +1 -0
- package/dist/{esm/crm-giftback-form_2.entry.js → crmbonus-component-wake/crm-giftback-form.entry.js} +12 -27
- package/dist/crmbonus-component-wake/crm-giftback-form.entry.js.map +1 -0
- package/dist/{components/p-58b97429.js → crmbonus-component-wake/crm-tooltip.entry.js} +8 -27
- package/dist/crmbonus-component-wake/crm-tooltip.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/crmbonus-component-wake.css +7 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +48 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
- package/dist/{esm/crmbonus.service-42fbd7fa.js → crmbonus-component-wake/crmbonus.service-67550994.js} +162 -90
- package/dist/crmbonus-component-wake/crmbonus.service-67550994.js.map +1 -0
- package/dist/{components/p-6eda79c3.js → crmbonus-component-wake/crmbonus.service-9f4c6fd7.js} +165 -93
- package/dist/crmbonus-component-wake/crmbonus.service-9f4c6fd7.js.map +1 -0
- package/dist/{components/p-b79c86a8.js → crmbonus-component-wake/giftback-finish.entry.js} +8 -25
- package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +1 -0
- package/dist/{components/p-2671d669.js → crmbonus-component-wake/giftback-info.entry.js} +12 -52
- package/dist/crmbonus-component-wake/giftback-info.entry.js.map +1 -0
- package/dist/{components/p-6186ddcc.js → crmbonus-component-wake/giftback-pin.entry.js} +8 -38
- package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +1 -0
- package/dist/{components/p-7c744cca.js → crmbonus-component-wake/giftback-progress.entry.js} +8 -37
- package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +1 -0
- package/dist/{esm/i18n-e8150dff.js → crmbonus-component-wake/i18n-11138a2c.js} +16 -1
- package/dist/{esm/i18n-e8150dff.js.map → crmbonus-component-wake/i18n-11138a2c.js.map} +1 -1
- package/dist/crmbonus-component-wake/index-d0fd1dc0.js +3039 -0
- package/dist/crmbonus-component-wake/index-d0fd1dc0.js.map +1 -0
- package/dist/crmbonus-component-wake/index.esm.js +12 -1
- package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/loading-container.entry.js +18 -0
- package/dist/crmbonus-component-wake/loading-container.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/loading-spinner.entry.js +2 -3
- package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +1 -0
- package/dist/{components/p-246a3e9d.js → crmbonus-component-wake/name-input.entry.js} +8 -37
- package/dist/crmbonus-component-wake/name-input.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/pedido-finalizado.entry.js +4 -4
- package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/phone-cancel-input.entry.js +1 -1
- package/dist/crmbonus-component-wake/phone-cancel-input.entry.js.map +1 -0
- package/dist/{components/p-6c546e48.js → crmbonus-component-wake/phone-form.entry.js} +8 -47
- package/dist/crmbonus-component-wake/phone-form.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/phone-input-mask.entry.js +2 -3
- package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/phone-input.entry.js +1 -1
- package/dist/crmbonus-component-wake/phone-input.entry.js.map +1 -0
- package/dist/{components/p-83a12a8f.js → crmbonus-component-wake/pin-form.entry.js} +9 -56
- package/dist/crmbonus-component-wake/pin-form.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +334 -0
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +1 -0
- package/dist/{collection/utils/utils.js → crmbonus-component-wake/utils-96cf9ae0.js} +8 -5
- package/dist/crmbonus-component-wake/utils-96cf9ae0.js.map +1 -0
- package/dist/types/home/darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/env.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/app-modal.cjs.entry.js +0 -28
- package/dist/cjs/app-modal.cjs.entry.js.map +0 -1
- package/dist/cjs/cart.helper-d4d8d619.js +0 -77
- package/dist/cjs/cart.helper-d4d8d619.js.map +0 -1
- package/dist/cjs/countdown-timer_2.cjs.entry.js +0 -63
- package/dist/cjs/countdown-timer_2.cjs.entry.js.map +0 -1
- package/dist/cjs/crm-bonus-form.cjs.entry.js +0 -104
- package/dist/cjs/crm-bonus-form.cjs.entry.js.map +0 -1
- package/dist/cjs/crm-bonus-note.cjs.entry.js +0 -101
- package/dist/cjs/crm-bonus-note.cjs.entry.js.map +0 -1
- package/dist/cjs/crm-bonus.cjs.entry.js +0 -247
- package/dist/cjs/crm-bonus.cjs.entry.js.map +0 -1
- package/dist/cjs/crm-giftback-form_2.cjs.entry.js +0 -253
- package/dist/cjs/crm-giftback-form_2.cjs.entry.js.map +0 -1
- package/dist/cjs/crm-tooltip_4.cjs.entry.js +0 -211
- package/dist/cjs/crm-tooltip_4.cjs.entry.js.map +0 -1
- package/dist/cjs/crmbonus-component-wake.cjs.js +0 -27
- package/dist/cjs/crmbonus-component-wake.cjs.js.map +0 -1
- package/dist/cjs/crmbonus.service-9067d00d.js +0 -3877
- package/dist/cjs/crmbonus.service-9067d00d.js.map +0 -1
- package/dist/cjs/giftback-finish_4.cjs.entry.js +0 -131
- package/dist/cjs/giftback-finish_4.cjs.entry.js.map +0 -1
- package/dist/cjs/i18n-f2a6f60e.js +0 -2219
- package/dist/cjs/i18n-f2a6f60e.js.map +0 -1
- package/dist/cjs/index-6054ed44.js +0 -21
- package/dist/cjs/index-6054ed44.js.map +0 -1
- package/dist/cjs/index-d11684bd.js +0 -1599
- package/dist/cjs/index-d11684bd.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -11
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/info.config.helper-c5d9f781.js +0 -16
- package/dist/cjs/info.config.helper-c5d9f781.js.map +0 -1
- package/dist/cjs/keys.storage-de7744aa.js +0 -17
- package/dist/cjs/keys.storage-de7744aa.js.map +0 -1
- package/dist/cjs/loader.cjs.js +0 -17
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/loading-spinner.cjs.entry.js +0 -24
- package/dist/cjs/loading-spinner.cjs.entry.js.map +0 -1
- package/dist/cjs/pedido-finalizado.cjs.entry.js +0 -39
- package/dist/cjs/pedido-finalizado.cjs.entry.js.map +0 -1
- package/dist/cjs/phone-cancel-input.cjs.entry.js +0 -25
- package/dist/cjs/phone-cancel-input.cjs.entry.js.map +0 -1
- package/dist/cjs/phone-input-mask.cjs.entry.js +0 -61
- package/dist/cjs/phone-input-mask.cjs.entry.js.map +0 -1
- package/dist/cjs/phone-input.cjs.entry.js +0 -25
- package/dist/cjs/phone-input.cjs.entry.js.map +0 -1
- package/dist/cjs/utils-e9413ee3.js +0 -25
- package/dist/cjs/utils-e9413ee3.js.map +0 -1
- package/dist/collection/assets/svg/info-circle-svgrepo-com.svg +0 -6
- package/dist/collection/assets/svg/money-dollars-svgrepo-com.svg +0 -6
- package/dist/collection/collection-manifest.json +0 -32
- package/dist/collection/components/button/crm-button.css +0 -22
- package/dist/collection/components/button/index.js +0 -76
- package/dist/collection/components/button/index.js.map +0 -1
- package/dist/collection/components/countdown-timer/countdown-timer.js +0 -81
- package/dist/collection/components/countdown-timer/countdown-timer.js.map +0 -1
- package/dist/collection/components/crm-bonus/assets/logo.svg +0 -18
- package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +0 -8
- package/dist/collection/components/crm-bonus/assets/svg/logo.svg +0 -18
- package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +0 -8
- package/dist/collection/components/crm-bonus/crm-bonus.css +0 -84
- package/dist/collection/components/crm-bonus/crm-bonus.js +0 -311
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +0 -19
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +0 -348
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +0 -10
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +0 -20
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +0 -70
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +0 -126
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +0 -110
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +0 -127
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.css +0 -108
- package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js +0 -110
- package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +0 -75
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +0 -75
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js.map +0 -1
- package/dist/collection/components/giftback-form/giftback-form.css +0 -75
- package/dist/collection/components/giftback-form/giftback-form.js +0 -410
- package/dist/collection/components/giftback-form/giftback-form.js.map +0 -1
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.css +0 -181
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +0 -221
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +0 -1
- package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js +0 -11
- package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js.map +0 -1
- package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js +0 -103
- package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js.map +0 -1
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.css +0 -84
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js +0 -197
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js.map +0 -1
- package/dist/collection/components/loading-container/loading-container.css +0 -47
- package/dist/collection/components/loading-container/loading-container.js +0 -43
- package/dist/collection/components/loading-container/loading-container.js.map +0 -1
- package/dist/collection/components/loading-spinner/loading-spinner.css +0 -17
- package/dist/collection/components/loading-spinner/loading-spinner.js +0 -63
- package/dist/collection/components/loading-spinner/loading-spinner.js.map +0 -1
- package/dist/collection/components/modal/app-modal.css +0 -45
- package/dist/collection/components/modal/app-modal.js +0 -83
- package/dist/collection/components/modal/app-modal.js.map +0 -1
- package/dist/collection/components/note/crm-bonus-note.css +0 -71
- package/dist/collection/components/note/crm-bonus-note.js +0 -117
- package/dist/collection/components/note/crm-bonus-note.js.map +0 -1
- package/dist/collection/components/pedido/pedido.js +0 -52
- package/dist/collection/components/pedido/pedido.js.map +0 -1
- package/dist/collection/components/phone/phone-input-mask.css +0 -40
- package/dist/collection/components/phone/phone-input-mask.js +0 -125
- package/dist/collection/components/phone/phone-input-mask.js.map +0 -1
- package/dist/collection/components/tooltip/crm-tooltip.css +0 -49
- package/dist/collection/components/tooltip/tooltip.js +0 -61
- package/dist/collection/components/tooltip/tooltip.js.map +0 -1
- package/dist/collection/contants/index.js +0 -16
- package/dist/collection/contants/index.js.map +0 -1
- package/dist/collection/contants/mocks.js +0 -28
- package/dist/collection/contants/mocks.js.map +0 -1
- package/dist/collection/dto/pin.sent.js +0 -2
- package/dist/collection/dto/pin.sent.js.map +0 -1
- package/dist/collection/dto/update.order.dto.js +0 -2
- package/dist/collection/dto/update.order.dto.js.map +0 -1
- package/dist/collection/dto/validate.pin.bonus.js +0 -5
- package/dist/collection/dto/validate.pin.bonus.js.map +0 -1
- package/dist/collection/helpers/build.payload.helper.js +0 -25
- package/dist/collection/helpers/build.payload.helper.js.map +0 -1
- package/dist/collection/helpers/cart.helper.js +0 -27
- package/dist/collection/helpers/cart.helper.js.map +0 -1
- package/dist/collection/helpers/info.config.helper.js +0 -11
- package/dist/collection/helpers/info.config.helper.js.map +0 -1
- package/dist/collection/helpers/time.helper.js +0 -12
- package/dist/collection/helpers/time.helper.js.map +0 -1
- package/dist/collection/i18n/i18n.js +0 -35
- package/dist/collection/i18n/i18n.js.map +0 -1
- package/dist/collection/index.js +0 -11
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/objectvalues/cart.wake.js +0 -46
- package/dist/collection/objectvalues/cart.wake.js.map +0 -1
- package/dist/collection/services/crmbonus.service.js +0 -118
- package/dist/collection/services/crmbonus.service.js.map +0 -1
- package/dist/collection/utils/keys.storage.js +0 -9
- package/dist/collection/utils/keys.storage.js.map +0 -1
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/app-modal.js +0 -46
- package/dist/components/app-modal.js.map +0 -1
- package/dist/components/countdown-timer.js +0 -8
- package/dist/components/countdown-timer.js.map +0 -1
- package/dist/components/crm-bonus-form.js +0 -165
- package/dist/components/crm-bonus-form.js.map +0 -1
- package/dist/components/crm-bonus-note.js +0 -139
- package/dist/components/crm-bonus-note.js.map +0 -1
- package/dist/components/crm-bonus.js +0 -337
- package/dist/components/crm-bonus.js.map +0 -1
- package/dist/components/crm-button.js +0 -8
- package/dist/components/crm-button.js.map +0 -1
- package/dist/components/crm-giftback-form.js +0 -8
- package/dist/components/crm-giftback-form.js.map +0 -1
- package/dist/components/crm-tooltip.js +0 -8
- package/dist/components/crm-tooltip.js.map +0 -1
- package/dist/components/giftback-finish.js +0 -8
- package/dist/components/giftback-finish.js.map +0 -1
- package/dist/components/giftback-info.js +0 -8
- package/dist/components/giftback-info.js.map +0 -1
- package/dist/components/giftback-pin.js +0 -8
- package/dist/components/giftback-pin.js.map +0 -1
- package/dist/components/giftback-progress.js +0 -8
- package/dist/components/giftback-progress.js.map +0 -1
- package/dist/components/index.js +0 -4
- package/dist/components/index.js.map +0 -1
- package/dist/components/loading-container.js +0 -8
- package/dist/components/loading-container.js.map +0 -1
- package/dist/components/loading-spinner.js +0 -8
- package/dist/components/loading-spinner.js.map +0 -1
- package/dist/components/name-input.js +0 -8
- package/dist/components/name-input.js.map +0 -1
- package/dist/components/p-11085d9b.js +0 -79
- package/dist/components/p-11085d9b.js.map +0 -1
- package/dist/components/p-246a3e9d.js.map +0 -1
- package/dist/components/p-2671d669.js.map +0 -1
- package/dist/components/p-2b3b8d6b.js.map +0 -1
- package/dist/components/p-3e84f78c.js +0 -1408
- package/dist/components/p-3e84f78c.js.map +0 -1
- package/dist/components/p-47f9da55.js +0 -46
- package/dist/components/p-47f9da55.js.map +0 -1
- package/dist/components/p-58b97429.js.map +0 -1
- package/dist/components/p-6186ddcc.js.map +0 -1
- package/dist/components/p-6c546e48.js.map +0 -1
- package/dist/components/p-6eda79c3.js.map +0 -1
- package/dist/components/p-75ba7b9a.js +0 -14
- package/dist/components/p-75ba7b9a.js.map +0 -1
- package/dist/components/p-7c744cca.js.map +0 -1
- package/dist/components/p-7cfea8fe.js +0 -19
- package/dist/components/p-7cfea8fe.js.map +0 -1
- package/dist/components/p-83a12a8f.js.map +0 -1
- package/dist/components/p-abbfbc98.js.map +0 -1
- package/dist/components/p-b79c86a8.js.map +0 -1
- package/dist/components/p-ba369e65.js +0 -21
- package/dist/components/p-ba369e65.js.map +0 -1
- package/dist/components/p-cc1ea33f.js +0 -36
- package/dist/components/p-cc1ea33f.js.map +0 -1
- package/dist/components/p-e18e11ae.js +0 -316
- package/dist/components/p-e18e11ae.js.map +0 -1
- package/dist/components/p-e8c19a64.js +0 -2217
- package/dist/components/p-e8c19a64.js.map +0 -1
- package/dist/components/p-f9aeffc1.js +0 -12
- package/dist/components/p-f9aeffc1.js.map +0 -1
- package/dist/components/p-fe9c3966.js +0 -39
- package/dist/components/p-fe9c3966.js.map +0 -1
- package/dist/components/pedido-finalizado.js +0 -54
- package/dist/components/pedido-finalizado.js.map +0 -1
- package/dist/components/phone-cancel-input.js +0 -55
- package/dist/components/phone-cancel-input.js.map +0 -1
- package/dist/components/phone-form.js +0 -8
- package/dist/components/phone-form.js.map +0 -1
- package/dist/components/phone-input-mask.js +0 -8
- package/dist/components/phone-input-mask.js.map +0 -1
- package/dist/components/phone-input.js +0 -55
- package/dist/components/phone-input.js.map +0 -1
- package/dist/components/pin-form.js +0 -8
- package/dist/components/pin-form.js.map +0 -1
- package/dist/crmbonus-component-wake/p-03b77c41.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-03b77c41.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-3d6152b1.js +0 -3
- package/dist/crmbonus-component-wake/p-3d6152b1.js.map +0 -1
- package/dist/crmbonus-component-wake/p-4fa63df0.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-4fa63df0.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-620ec1a3.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-620ec1a3.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-6eda79c3.js +0 -2
- package/dist/crmbonus-component-wake/p-6eda79c3.js.map +0 -1
- package/dist/crmbonus-component-wake/p-74206c91.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-74206c91.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-75ba7b9a.js +0 -2
- package/dist/crmbonus-component-wake/p-75ba7b9a.js.map +0 -1
- package/dist/crmbonus-component-wake/p-7b7fb354.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-7b7fb354.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-7cdb2c4a.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-7cdb2c4a.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-7cfea8fe.js +0 -2
- package/dist/crmbonus-component-wake/p-7cfea8fe.js.map +0 -1
- package/dist/crmbonus-component-wake/p-885fc30e.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-885fc30e.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-90716188.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-90716188.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-a33f7c24.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-a33f7c24.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-abbfbc98.js +0 -2
- package/dist/crmbonus-component-wake/p-abbfbc98.js.map +0 -1
- package/dist/crmbonus-component-wake/p-b7a8f915.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-b7a8f915.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-ba369e65.js +0 -2
- package/dist/crmbonus-component-wake/p-ba369e65.js.map +0 -1
- package/dist/crmbonus-component-wake/p-be3ddacc.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-be3ddacc.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-c23f3a07.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-e1255160.js +0 -2
- package/dist/crmbonus-component-wake/p-e1255160.js.map +0 -1
- package/dist/crmbonus-component-wake/p-e8c19a64.js +0 -2
- package/dist/crmbonus-component-wake/p-e8c19a64.js.map +0 -1
- package/dist/crmbonus-component-wake/p-f9aeffc1.js +0 -2
- package/dist/crmbonus-component-wake/p-f9aeffc1.js.map +0 -1
- package/dist/crmbonus-component-wake/p-fad20959.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-fad20959.entry.js.map +0 -1
- package/dist/env.js +0 -3
- package/dist/env.js.map +0 -1
- package/dist/esm/app-modal.entry.js.map +0 -1
- package/dist/esm/cart.helper-30a40560.js.map +0 -1
- package/dist/esm/countdown-timer_2.entry.js +0 -58
- package/dist/esm/countdown-timer_2.entry.js.map +0 -1
- package/dist/esm/crm-bonus-form.entry.js.map +0 -1
- package/dist/esm/crm-bonus-note.entry.js.map +0 -1
- package/dist/esm/crm-bonus.entry.js.map +0 -1
- package/dist/esm/crm-giftback-form_2.entry.js.map +0 -1
- package/dist/esm/crm-tooltip_4.entry.js +0 -204
- package/dist/esm/crm-tooltip_4.entry.js.map +0 -1
- package/dist/esm/crmbonus-component-wake.js +0 -22
- package/dist/esm/crmbonus-component-wake.js.map +0 -1
- package/dist/esm/crmbonus.service-42fbd7fa.js.map +0 -1
- package/dist/esm/giftback-finish_4.entry.js +0 -124
- package/dist/esm/giftback-finish_4.entry.js.map +0 -1
- package/dist/esm/index-e8724c8f.js +0 -1571
- package/dist/esm/index-e8724c8f.js.map +0 -1
- package/dist/esm/index.js +0 -3
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js +0 -13
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/loading-spinner.entry.js.map +0 -1
- package/dist/esm/pedido-finalizado.entry.js.map +0 -1
- package/dist/esm/phone-cancel-input.entry.js.map +0 -1
- package/dist/esm/phone-input-mask.entry.js.map +0 -1
- package/dist/esm/phone-input.entry.js.map +0 -1
- package/dist/esm/utils-d642b4db.js +0 -21
- package/dist/esm/utils-d642b4db.js.map +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- /package/dist/{esm → crmbonus-component-wake}/app-globals-0f993ce5.js +0 -0
- /package/dist/{esm → crmbonus-component-wake}/app-globals-0f993ce5.js.map +0 -0
- /package/dist/{esm → crmbonus-component-wake}/index-5b567099.js +0 -0
- /package/dist/{esm → crmbonus-component-wake}/index-5b567099.js.map +0 -0
- /package/dist/{esm → crmbonus-component-wake}/info.config.helper-42d9ddf9.js +0 -0
- /package/dist/{esm → crmbonus-component-wake}/info.config.helper-42d9ddf9.js.map +0 -0
- /package/dist/{esm → crmbonus-component-wake}/keys.storage-8c76fcd7.js +0 -0
- /package/dist/{esm → crmbonus-component-wake}/keys.storage-8c76fcd7.js.map +0 -0
@@ -1,311 +0,0 @@
|
|
1
|
-
import { h } from "@stencil/core";
|
2
|
-
import { CrmBonusService } from "../../services/crmbonus.service";
|
3
|
-
import { StepFormEnum } from "../../contants";
|
4
|
-
import i18next from "../../i18n/i18n";
|
5
|
-
import { buildProductsByWake } from "../../helpers/build.payload.helper";
|
6
|
-
import { getCart } from "../../helpers/cart.helper";
|
7
|
-
import { CartWake } from "../../objectvalues/cart.wake";
|
8
|
-
import { USED_KEY } from "../../utils/keys.storage";
|
9
|
-
export class CrmBonus {
|
10
|
-
constructor() {
|
11
|
-
this.crmBonusService = CrmBonusService.getInstance();
|
12
|
-
this.cart = undefined;
|
13
|
-
this.showModal = false;
|
14
|
-
this.cartWake = undefined;
|
15
|
-
this.customer = {
|
16
|
-
birthDate: "",
|
17
|
-
document: "",
|
18
|
-
name: "",
|
19
|
-
phone: ""
|
20
|
-
};
|
21
|
-
this.loading = false;
|
22
|
-
this.message = undefined;
|
23
|
-
this.phone = undefined;
|
24
|
-
this.canCancel = false;
|
25
|
-
this.amountCancel = undefined;
|
26
|
-
this.sent = undefined;
|
27
|
-
this.session = undefined;
|
28
|
-
this.loading_reprocess = false;
|
29
|
-
}
|
30
|
-
async resetBonus() {
|
31
|
-
console.log('[START RESET BONUS]!!!!!');
|
32
|
-
try {
|
33
|
-
await this.crmBonusRef.processBonus(this.buildProducts(), true);
|
34
|
-
console.log('[BONUS RESETADO]!!!!!');
|
35
|
-
}
|
36
|
-
catch (err) {
|
37
|
-
this.loading = false;
|
38
|
-
console.log('[error ao reprocessar bonous]');
|
39
|
-
await this.crmBonusRef.setStep(StepFormEnum.STEP_PHONE);
|
40
|
-
}
|
41
|
-
finally {
|
42
|
-
this.loading = false;
|
43
|
-
}
|
44
|
-
}
|
45
|
-
async setloading() {
|
46
|
-
this.loading_reprocess = !this.loading_reprocess;
|
47
|
-
}
|
48
|
-
async reprocess() {
|
49
|
-
this.loading_reprocess = true;
|
50
|
-
try {
|
51
|
-
const isUse = localStorage.getItem(USED_KEY);
|
52
|
-
if (!isUse)
|
53
|
-
return;
|
54
|
-
this.cartWake = await getCart();
|
55
|
-
await this.resetBonus();
|
56
|
-
}
|
57
|
-
catch (err) {
|
58
|
-
console.debug('[watchProducts]', err.message);
|
59
|
-
}
|
60
|
-
finally {
|
61
|
-
this.loading_reprocess = false;
|
62
|
-
}
|
63
|
-
}
|
64
|
-
// @Watch("productsInString")
|
65
|
-
// async watchProducts(newValue: string) {
|
66
|
-
// try {
|
67
|
-
// console.log('[update products list]');
|
68
|
-
// this.productsInString = newValue;
|
69
|
-
// await this.handleLoad();
|
70
|
-
// await this.resetBonus();
|
71
|
-
// } catch (err) {
|
72
|
-
// console.debug('[watchProducts]', err.message);
|
73
|
-
// }
|
74
|
-
// }
|
75
|
-
async componentWillLoad() {
|
76
|
-
i18next.changeLanguage(i18next.language);
|
77
|
-
await this.handleLoad();
|
78
|
-
await this.loadSession();
|
79
|
-
await this.loadConfigStore();
|
80
|
-
}
|
81
|
-
async loadConfigStore() {
|
82
|
-
await this.crmBonusService.getCustomization(this.cartWake.store.name);
|
83
|
-
}
|
84
|
-
async handleLoad() {
|
85
|
-
try {
|
86
|
-
this.cartWake = this.cart ? new CartWake(JSON.parse(this.cart)) : await getCart();
|
87
|
-
if (this.cartWake.user.id) {
|
88
|
-
this.customer = await this.crmBonusService.getCustomer(this.cartWake.user.id, this.cartWake.store.name);
|
89
|
-
console.log('customer', this.customer);
|
90
|
-
}
|
91
|
-
const amount = localStorage.getItem(this.cartWake.id);
|
92
|
-
if (amount) {
|
93
|
-
this.canCancel = true;
|
94
|
-
this.amountCancel = amount;
|
95
|
-
}
|
96
|
-
await this.buildAndGetProducts(this.cartWake.products);
|
97
|
-
}
|
98
|
-
catch (error) {
|
99
|
-
console.log('info customer');
|
100
|
-
}
|
101
|
-
}
|
102
|
-
async loadSession() {
|
103
|
-
this.session = await this.crmBonusService.getToken(this.cartWake.store.name);
|
104
|
-
setTimeout(() => {
|
105
|
-
this.loadSession();
|
106
|
-
}, 1500000);
|
107
|
-
}
|
108
|
-
async buildAndGetProducts(productsWake) {
|
109
|
-
const key = `bc-products:${this.cartWake.id}`;
|
110
|
-
const productsString = JSON.stringify(productsWake);
|
111
|
-
localStorage.setItem(key, productsString);
|
112
|
-
const products_in_cache = JSON.parse(localStorage.getItem(key));
|
113
|
-
const products = [];
|
114
|
-
for (const product_cart of productsWake) {
|
115
|
-
const [pro] = products_in_cache.filter(p => p.ProdutoVarianteId == product_cart.ProdutoVarianteId);
|
116
|
-
const [ajuste = { Valor: 0 }] = pro.Ajustes.filter(aj => aj.Tipo === "Formula");
|
117
|
-
if (pro) {
|
118
|
-
products.push(Object.assign(Object.assign({}, product_cart), { PrecoPor: pro.PrecoPor + (ajuste.Valor * -1), Quantidade: pro.Quantidade, Ajustes: pro.Ajustes }));
|
119
|
-
}
|
120
|
-
else {
|
121
|
-
products.push(product_cart);
|
122
|
-
}
|
123
|
-
}
|
124
|
-
this.cartWake.products = products; //cache_products ? JSON.parse(cache_products) : JSON.parse(this.productsInString);
|
125
|
-
}
|
126
|
-
async sendPin(phone) {
|
127
|
-
var _a, _b;
|
128
|
-
this.loading = true;
|
129
|
-
this.message = "";
|
130
|
-
try {
|
131
|
-
const _phone = phone.replace(/\D/g, '');
|
132
|
-
this.phone = Number(_phone);
|
133
|
-
this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.cartWake.store.name);
|
134
|
-
;
|
135
|
-
await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);
|
136
|
-
this.showModal = true;
|
137
|
-
}
|
138
|
-
catch (error) {
|
139
|
-
this.message = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message;
|
140
|
-
}
|
141
|
-
finally {
|
142
|
-
this.loading = false;
|
143
|
-
}
|
144
|
-
}
|
145
|
-
async sendPinName(customerName) {
|
146
|
-
var _a, _b;
|
147
|
-
this.loading = true;
|
148
|
-
this.message = "";
|
149
|
-
try {
|
150
|
-
this.customer.name = customerName;
|
151
|
-
this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.cartWake.store.name);
|
152
|
-
await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);
|
153
|
-
this.showModal = true;
|
154
|
-
}
|
155
|
-
catch (error) {
|
156
|
-
this.message = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message;
|
157
|
-
}
|
158
|
-
finally {
|
159
|
-
this.loading = false;
|
160
|
-
}
|
161
|
-
}
|
162
|
-
buildProducts() {
|
163
|
-
return buildProductsByWake(this.cartWake.products);
|
164
|
-
}
|
165
|
-
handleCloseModal() {
|
166
|
-
this.showModal = false;
|
167
|
-
}
|
168
|
-
save(amount) {
|
169
|
-
localStorage.setItem(this.cartWake.id, amount.toString());
|
170
|
-
this.canCancel = true;
|
171
|
-
this.amountCancel = amount.toString();
|
172
|
-
}
|
173
|
-
async cancel() {
|
174
|
-
this.message = "";
|
175
|
-
this.loading = true;
|
176
|
-
try {
|
177
|
-
await this.crmBonusService.cancel(this.cartWake.id);
|
178
|
-
this.canCancel = false;
|
179
|
-
localStorage.removeItem(this.cartWake.id);
|
180
|
-
}
|
181
|
-
catch (error) {
|
182
|
-
this.message = "Não consegui cancelar o bônus, tente novamente!";
|
183
|
-
}
|
184
|
-
finally {
|
185
|
-
this.loading = false;
|
186
|
-
}
|
187
|
-
}
|
188
|
-
async handleSendPin(phone) {
|
189
|
-
this.message = "";
|
190
|
-
if (!phone) {
|
191
|
-
this.message = "Informe seu telefone";
|
192
|
-
return;
|
193
|
-
}
|
194
|
-
this.customer.phone = phone;
|
195
|
-
const _phone = phone.replace(/\D/g, '');
|
196
|
-
this.phone = Number(_phone);
|
197
|
-
if (this.customer.name) {
|
198
|
-
return this.sendPin(phone);
|
199
|
-
}
|
200
|
-
await this.crmBonusRef.setStep(StepFormEnum.STEP_NAME);
|
201
|
-
this.showModal = true;
|
202
|
-
}
|
203
|
-
render() {
|
204
|
-
return (h("loading-container", { key: '6b39082e04d7cdcc88f689912b267e6bee379452', loading: this.loading_reprocess }, h("crm-giftback-form", { key: '9cb2b61470810eb3de370f2ab9fb3b50d59bff81', style: { position: "relative" }, ref: ref => this.crmBonusRef = ref, storeName: this.cartWake.store.name, products: this.buildProducts(), cartId: this.cartWake.id, customer: this.customer, loadProducts: () => this.buildProducts() })));
|
205
|
-
}
|
206
|
-
static get is() { return "crm-bonus"; }
|
207
|
-
static get encapsulation() { return "scoped"; }
|
208
|
-
static get originalStyleUrls() {
|
209
|
-
return {
|
210
|
-
"$": ["crm-bonus.css"]
|
211
|
-
};
|
212
|
-
}
|
213
|
-
static get styleUrls() {
|
214
|
-
return {
|
215
|
-
"$": ["crm-bonus.css"]
|
216
|
-
};
|
217
|
-
}
|
218
|
-
static get assetsDirs() { return ["assets"]; }
|
219
|
-
static get properties() {
|
220
|
-
return {
|
221
|
-
"cart": {
|
222
|
-
"type": "any",
|
223
|
-
"mutable": false,
|
224
|
-
"complexType": {
|
225
|
-
"original": "any",
|
226
|
-
"resolved": "any",
|
227
|
-
"references": {}
|
228
|
-
},
|
229
|
-
"required": false,
|
230
|
-
"optional": false,
|
231
|
-
"docs": {
|
232
|
-
"tags": [],
|
233
|
-
"text": ""
|
234
|
-
},
|
235
|
-
"attribute": "cart",
|
236
|
-
"reflect": false
|
237
|
-
}
|
238
|
-
};
|
239
|
-
}
|
240
|
-
static get states() {
|
241
|
-
return {
|
242
|
-
"showModal": {},
|
243
|
-
"cartWake": {},
|
244
|
-
"customer": {},
|
245
|
-
"loading": {},
|
246
|
-
"message": {},
|
247
|
-
"phone": {},
|
248
|
-
"canCancel": {},
|
249
|
-
"amountCancel": {},
|
250
|
-
"sent": {},
|
251
|
-
"session": {},
|
252
|
-
"loading_reprocess": {}
|
253
|
-
};
|
254
|
-
}
|
255
|
-
static get methods() {
|
256
|
-
return {
|
257
|
-
"resetBonus": {
|
258
|
-
"complexType": {
|
259
|
-
"signature": "() => Promise<void>",
|
260
|
-
"parameters": [],
|
261
|
-
"references": {
|
262
|
-
"Promise": {
|
263
|
-
"location": "global",
|
264
|
-
"id": "global::Promise"
|
265
|
-
}
|
266
|
-
},
|
267
|
-
"return": "Promise<void>"
|
268
|
-
},
|
269
|
-
"docs": {
|
270
|
-
"text": "",
|
271
|
-
"tags": []
|
272
|
-
}
|
273
|
-
},
|
274
|
-
"setloading": {
|
275
|
-
"complexType": {
|
276
|
-
"signature": "() => Promise<void>",
|
277
|
-
"parameters": [],
|
278
|
-
"references": {
|
279
|
-
"Promise": {
|
280
|
-
"location": "global",
|
281
|
-
"id": "global::Promise"
|
282
|
-
}
|
283
|
-
},
|
284
|
-
"return": "Promise<void>"
|
285
|
-
},
|
286
|
-
"docs": {
|
287
|
-
"text": "",
|
288
|
-
"tags": []
|
289
|
-
}
|
290
|
-
},
|
291
|
-
"reprocess": {
|
292
|
-
"complexType": {
|
293
|
-
"signature": "() => Promise<void>",
|
294
|
-
"parameters": [],
|
295
|
-
"references": {
|
296
|
-
"Promise": {
|
297
|
-
"location": "global",
|
298
|
-
"id": "global::Promise"
|
299
|
-
}
|
300
|
-
},
|
301
|
-
"return": "Promise<void>"
|
302
|
-
},
|
303
|
-
"docs": {
|
304
|
-
"text": "",
|
305
|
-
"tags": []
|
306
|
-
}
|
307
|
-
}
|
308
|
-
};
|
309
|
-
}
|
310
|
-
}
|
311
|
-
//# sourceMappingURL=crm-bonus.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"crm-bonus.js","sourceRoot":"","sources":["../../../../src/components/crm-bonus/crm-bonus.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,OAAO,MAAM,iBAAiB,CAAA;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAQpD,MAAM,OAAO,QAAQ;;QAEX,oBAAe,GAAoB,eAAe,CAAC,WAAW,EAAE,CAAC;;yBAM3C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B,CAAC;IAED,MAAM;QAEJ,OAAO,CACL,0EAAmB,OAAO,EAAE,IAAI,CAAC,iBAAiB;YAChD,0EACE,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,EAC/B,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,GAAG,GAAG,EAClC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EACnC,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,EAC9B,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,EACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,YAAY,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,GAExC,CACgB,CACrB,CAAA;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Method, 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\nimport i18next from '../../i18n/i18n'\nimport { buildProductsByWake } from '../../helpers/build.payload.helper';\nimport { getCart } from '../../helpers/cart.helper';\nimport { CartWake } from '../../objectvalues/cart.wake';\nimport { USED_KEY } from '../../utils/keys.storage';\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n scoped: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n private crmBonusRef: HTMLCrmGiftbackFormElement;\n\n @Prop() cart;\n\n @State() showModal: boolean = false;\n \n @State() cartWake: CartWake;\n \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 @State() session: string;\n @State() loading_reprocess = false;\n\n @Method()\n async resetBonus() {\n console.log('[START RESET BONUS]!!!!!');\n \n try {\n await this.crmBonusRef.processBonus(this.buildProducts(), true);\n console.log('[BONUS RESETADO]!!!!!');\n } catch (err) {\n\n this.loading = false;\n console.log('[error ao reprocessar bonous]');\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PHONE);\n } finally {\n this.loading = false;\n }\n }\n\n @Method()\n async setloading() {\n this.loading_reprocess = !this.loading_reprocess;\n }\n\n @Method()\n async reprocess() {\n this.loading_reprocess = true\n\n try {\n\n const isUse = localStorage.getItem(USED_KEY);\n\n if(!isUse) return;\n\n this.cartWake = await getCart();\n await this.resetBonus();\n } catch (err) {\n console.debug('[watchProducts]', err.message);\n } finally {\n this.loading_reprocess = false\n }\n }\n\n // @Watch(\"productsInString\")\n // async watchProducts(newValue: string) {\n // try {\n // console.log('[update products list]');\n // this.productsInString = newValue;\n // await this.handleLoad();\n\n // await this.resetBonus();\n // } catch (err) {\n // console.debug('[watchProducts]', err.message);\n // }\n // }\n\n async componentWillLoad() {\n i18next.changeLanguage(i18next.language);\n\n await this.handleLoad();\n\n await this.loadSession();\n await this.loadConfigStore()\n }\n\n async loadConfigStore() {\n await this.crmBonusService.getCustomization(this.cartWake.store.name);\n }\n\n async handleLoad() {\n try {\n\n this.cartWake = this.cart ? new CartWake(JSON.parse(this.cart)) : await getCart();\n\n if (this.cartWake.user.id) {\n this.customer = await this.crmBonusService.getCustomer(this.cartWake.user.id, this.cartWake.store.name);\n console.log('customer', this.customer);\n }\n\n const amount = localStorage.getItem(this.cartWake.id);\n\n if (amount) {\n this.canCancel = true;\n this.amountCancel = amount;\n }\n\n await this.buildAndGetProducts(this.cartWake.products);\n } catch (error) {\n console.log('info customer')\n }\n }\n\n async loadSession() {\n this.session = await this.crmBonusService.getToken(this.cartWake.store.name);\n\n setTimeout(() => {\n this.loadSession()\n }, 1500000)\n\n }\n\n async buildAndGetProducts(productsWake: IProductWake[]) {\n\n const key = `bc-products:${this.cartWake.id}`;\n\n const productsString = JSON.stringify(productsWake)\n\n localStorage.setItem(key, productsString);\n\n const products_in_cache = JSON.parse(localStorage.getItem(key));\n\n const products: Array<IProductWake> = []\n\n for (const product_cart of productsWake) {\n\n const [pro] = products_in_cache.filter(p => p.ProdutoVarianteId == product_cart.ProdutoVarianteId)\n\n const [ajuste = { Valor: 0 }] = pro.Ajustes.filter(aj => aj.Tipo === \"Formula\")\n\n if (pro) {\n products.push({\n ...product_cart,\n PrecoPor: pro.PrecoPor + (ajuste.Valor * -1),\n Quantidade: pro.Quantidade,\n Ajustes: pro.Ajustes\n })\n } else {\n products.push(product_cart)\n }\n\n }\n\n this.cartWake.products = products; //cache_products ? JSON.parse(cache_products) : JSON.parse(this.productsInString);\n\n }\n\n public async sendPin(phone: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n\n this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.cartWake.store.name);;\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n public async sendPinName(customerName: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n this.customer.name = customerName;\n\n this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.cartWake.store.name);\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n\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 buildProductsByWake(this.cartWake.products);\n }\n\n handleCloseModal() {\n this.showModal = false;\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartWake.id, 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.cartWake.id);\n this.canCancel = false;\n\n localStorage.removeItem(this.cartWake.id);\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 async handleSendPin(phone: string) {\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.customer.phone = phone;\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n\n if (this.customer.name) {\n return this.sendPin(phone)\n }\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_NAME);\n this.showModal = true;\n }\n\n render() {\n\n return (\n <loading-container loading={this.loading_reprocess} >\n <crm-giftback-form\n style={{ position: \"relative\" }}\n ref={ref => this.crmBonusRef = ref}\n storeName={this.cartWake.store.name}\n products={this.buildProducts()}\n cartId={this.cartWake.id}\n customer={this.customer}\n loadProducts={() => this.buildProducts()}\n\n />\n </loading-container>\n )\n }\n}\n"]}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
.form-container {
|
2
|
-
width: 100%;
|
3
|
-
display: flex;
|
4
|
-
justify-content: center;
|
5
|
-
justify-content: space-around;
|
6
|
-
}
|
7
|
-
|
8
|
-
.disabled {
|
9
|
-
opacity: 0.6;
|
10
|
-
cursor: not-allowed;
|
11
|
-
}
|
12
|
-
|
13
|
-
.message-error {
|
14
|
-
color: #d11111;
|
15
|
-
font-weight: bold;
|
16
|
-
font-family: Arial;
|
17
|
-
font-size: small;
|
18
|
-
margin-left: 16px;
|
19
|
-
}
|