crmbonus-component-wake 2.0.128 → 2.0.129
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-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/app-modal.cjs.entry.js +28 -0
- package/dist/cjs/app-modal.cjs.entry.js.map +1 -0
- package/dist/cjs/cart.helper-d4d8d619.js +77 -0
- package/dist/cjs/cart.helper-d4d8d619.js.map +1 -0
- package/dist/cjs/countdown-timer_2.cjs.entry.js +63 -0
- package/dist/cjs/countdown-timer_2.cjs.entry.js.map +1 -0
- package/dist/cjs/crm-bonus-form.cjs.entry.js +104 -0
- package/dist/cjs/crm-bonus-form.cjs.entry.js.map +1 -0
- package/dist/cjs/crm-bonus-note.cjs.entry.js +101 -0
- package/dist/cjs/crm-bonus-note.cjs.entry.js.map +1 -0
- package/dist/cjs/crm-bonus.cjs.entry.js +249 -0
- package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -0
- package/dist/cjs/crm-giftback-form_2.cjs.entry.js +253 -0
- package/dist/{crmbonus-component-wake/crm-giftback-form.entry.js.map → cjs/crm-giftback-form_2.cjs.entry.js.map} +1 -1
- package/dist/cjs/crm-tooltip_4.cjs.entry.js +211 -0
- package/dist/cjs/crm-tooltip_4.cjs.entry.js.map +1 -0
- package/dist/cjs/crmbonus-component-wake.cjs.js +27 -0
- package/dist/cjs/crmbonus-component-wake.cjs.js.map +1 -0
- package/dist/cjs/crmbonus.service-9067d00d.js +3877 -0
- package/dist/cjs/crmbonus.service-9067d00d.js.map +1 -0
- package/dist/cjs/giftback-finish_4.cjs.entry.js +131 -0
- package/dist/cjs/giftback-finish_4.cjs.entry.js.map +1 -0
- package/dist/cjs/i18n-f2a6f60e.js +2219 -0
- package/dist/cjs/i18n-f2a6f60e.js.map +1 -0
- package/dist/cjs/index-6054ed44.js +21 -0
- package/dist/cjs/index-6054ed44.js.map +1 -0
- package/dist/cjs/index-d11684bd.js +1599 -0
- package/dist/cjs/index-d11684bd.js.map +1 -0
- package/dist/cjs/index.cjs.js +11 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/info.config.helper-c5d9f781.js +16 -0
- package/dist/cjs/info.config.helper-c5d9f781.js.map +1 -0
- package/dist/cjs/keys.storage-de7744aa.js +17 -0
- package/dist/cjs/keys.storage-de7744aa.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/loading-spinner.cjs.entry.js +24 -0
- package/dist/cjs/loading-spinner.cjs.entry.js.map +1 -0
- package/dist/cjs/pedido-finalizado.cjs.entry.js +39 -0
- package/dist/cjs/pedido-finalizado.cjs.entry.js.map +1 -0
- package/dist/cjs/phone-cancel-input.cjs.entry.js +25 -0
- package/dist/cjs/phone-cancel-input.cjs.entry.js.map +1 -0
- package/dist/cjs/phone-input-mask.cjs.entry.js +61 -0
- package/dist/cjs/phone-input-mask.cjs.entry.js.map +1 -0
- package/dist/cjs/phone-input.cjs.entry.js +25 -0
- package/dist/cjs/phone-input.cjs.entry.js.map +1 -0
- package/dist/cjs/utils-e9413ee3.js +25 -0
- package/dist/cjs/utils-e9413ee3.js.map +1 -0
- package/dist/collection/assets/svg/info-circle-svgrepo-com.svg +6 -0
- package/dist/collection/assets/svg/money-dollars-svgrepo-com.svg +6 -0
- package/dist/collection/collection-manifest.json +32 -0
- package/dist/collection/components/button/crm-button.css +22 -0
- package/dist/collection/components/button/index.js +76 -0
- package/dist/collection/components/button/index.js.map +1 -0
- package/dist/collection/components/countdown-timer/countdown-timer.js +81 -0
- package/dist/collection/components/countdown-timer/countdown-timer.js.map +1 -0
- package/dist/collection/components/crm-bonus/assets/logo.svg +18 -0
- package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +8 -0
- package/dist/collection/components/crm-bonus/assets/svg/logo.svg +18 -0
- package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +8 -0
- package/dist/collection/components/crm-bonus/crm-bonus.css +84 -0
- package/dist/collection/components/crm-bonus/crm-bonus.js +313 -0
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +19 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +348 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +10 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +20 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +70 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +126 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +110 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +127 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.css +108 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js +110 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +75 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +75 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js.map +1 -0
- package/dist/collection/components/giftback-form/giftback-form.css +75 -0
- package/dist/collection/components/giftback-form/giftback-form.js +410 -0
- package/dist/collection/components/giftback-form/giftback-form.js.map +1 -0
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.css +181 -0
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +221 -0
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +1 -0
- package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js +11 -0
- package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js.map +1 -0
- package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js +103 -0
- package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js.map +1 -0
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.css +84 -0
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js +197 -0
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js.map +1 -0
- package/dist/collection/components/loading-container/loading-container.css +47 -0
- package/dist/collection/components/loading-container/loading-container.js +43 -0
- package/dist/collection/components/loading-container/loading-container.js.map +1 -0
- package/dist/collection/components/loading-spinner/loading-spinner.css +17 -0
- package/dist/collection/components/loading-spinner/loading-spinner.js +63 -0
- package/dist/collection/components/loading-spinner/loading-spinner.js.map +1 -0
- package/dist/collection/components/modal/app-modal.css +45 -0
- package/dist/collection/components/modal/app-modal.js +83 -0
- package/dist/collection/components/modal/app-modal.js.map +1 -0
- package/dist/collection/components/note/crm-bonus-note.css +71 -0
- package/dist/collection/components/note/crm-bonus-note.js +117 -0
- package/dist/collection/components/note/crm-bonus-note.js.map +1 -0
- package/dist/collection/components/pedido/pedido.js +52 -0
- package/dist/collection/components/pedido/pedido.js.map +1 -0
- package/dist/collection/components/phone/phone-input-mask.css +40 -0
- package/dist/collection/components/phone/phone-input-mask.js +125 -0
- package/dist/collection/components/phone/phone-input-mask.js.map +1 -0
- package/dist/collection/components/tooltip/crm-tooltip.css +49 -0
- package/dist/collection/components/tooltip/tooltip.js +61 -0
- package/dist/collection/components/tooltip/tooltip.js.map +1 -0
- package/dist/collection/contants/index.js +16 -0
- package/dist/collection/contants/index.js.map +1 -0
- package/dist/collection/contants/mocks.js +28 -0
- package/dist/collection/contants/mocks.js.map +1 -0
- package/dist/collection/dto/pin.sent.js +2 -0
- package/dist/collection/dto/pin.sent.js.map +1 -0
- package/dist/collection/dto/update.order.dto.js +2 -0
- package/dist/collection/dto/update.order.dto.js.map +1 -0
- package/dist/collection/dto/validate.pin.bonus.js +5 -0
- package/dist/collection/dto/validate.pin.bonus.js.map +1 -0
- package/dist/collection/helpers/build.payload.helper.js +25 -0
- package/dist/collection/helpers/build.payload.helper.js.map +1 -0
- package/dist/collection/helpers/cart.helper.js +27 -0
- package/dist/collection/helpers/cart.helper.js.map +1 -0
- package/dist/collection/helpers/info.config.helper.js +11 -0
- package/dist/collection/helpers/info.config.helper.js.map +1 -0
- package/dist/collection/helpers/time.helper.js +12 -0
- package/dist/collection/helpers/time.helper.js.map +1 -0
- package/dist/collection/i18n/i18n.js +35 -0
- package/dist/collection/i18n/i18n.js.map +1 -0
- package/dist/collection/index.js +11 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/objectvalues/cart.wake.js +46 -0
- package/dist/collection/objectvalues/cart.wake.js.map +1 -0
- package/dist/collection/services/crmbonus.service.js +118 -0
- package/dist/collection/services/crmbonus.service.js.map +1 -0
- package/dist/collection/utils/keys.storage.js +9 -0
- package/dist/collection/utils/keys.storage.js.map +1 -0
- package/dist/{crmbonus-component-wake/utils-96cf9ae0.js → collection/utils/utils.js} +5 -8
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/app-modal.js +46 -0
- package/dist/components/app-modal.js.map +1 -0
- package/dist/components/countdown-timer.js +8 -0
- package/dist/components/countdown-timer.js.map +1 -0
- package/dist/components/crm-bonus-form.js +165 -0
- package/dist/components/crm-bonus-form.js.map +1 -0
- package/dist/components/crm-bonus-note.js +139 -0
- package/dist/components/crm-bonus-note.js.map +1 -0
- package/dist/components/crm-bonus.js +339 -0
- package/dist/components/crm-bonus.js.map +1 -0
- package/dist/components/crm-button.js +8 -0
- package/dist/components/crm-button.js.map +1 -0
- package/dist/components/crm-giftback-form.js +8 -0
- package/dist/components/crm-giftback-form.js.map +1 -0
- package/dist/components/crm-tooltip.js +8 -0
- package/dist/components/crm-tooltip.js.map +1 -0
- package/dist/components/giftback-finish.js +8 -0
- package/dist/components/giftback-finish.js.map +1 -0
- package/dist/components/giftback-info.js +8 -0
- package/dist/components/giftback-info.js.map +1 -0
- package/dist/components/giftback-pin.js +8 -0
- package/dist/components/giftback-pin.js.map +1 -0
- package/dist/components/giftback-progress.js +8 -0
- package/dist/components/giftback-progress.js.map +1 -0
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/loading-container.js +8 -0
- package/dist/components/loading-container.js.map +1 -0
- package/dist/components/loading-spinner.js +8 -0
- package/dist/components/loading-spinner.js.map +1 -0
- package/dist/components/name-input.js +8 -0
- package/dist/components/name-input.js.map +1 -0
- package/dist/components/p-11085d9b.js +79 -0
- package/dist/components/p-11085d9b.js.map +1 -0
- package/dist/{crmbonus-component-wake/name-input.entry.js → components/p-246a3e9d.js} +37 -8
- package/dist/components/p-246a3e9d.js.map +1 -0
- package/dist/{crmbonus-component-wake/giftback-info.entry.js → components/p-2671d669.js} +52 -12
- package/dist/components/p-2671d669.js.map +1 -0
- package/dist/{crmbonus-component-wake/countdown-timer.entry.js → components/p-2b3b8d6b.js} +27 -7
- package/dist/components/p-2b3b8d6b.js.map +1 -0
- package/dist/components/p-3e84f78c.js +1408 -0
- package/dist/components/p-3e84f78c.js.map +1 -0
- package/dist/components/p-47f9da55.js +46 -0
- package/dist/components/p-47f9da55.js.map +1 -0
- package/dist/components/p-5443db37.js +316 -0
- package/dist/components/p-5443db37.js.map +1 -0
- package/dist/{crmbonus-component-wake/crm-tooltip.entry.js → components/p-58b97429.js} +27 -8
- package/dist/components/p-58b97429.js.map +1 -0
- package/dist/{crmbonus-component-wake/giftback-pin.entry.js → components/p-6186ddcc.js} +38 -8
- package/dist/components/p-6186ddcc.js.map +1 -0
- package/dist/{crmbonus-component-wake/phone-form.entry.js → components/p-6c546e48.js} +47 -8
- package/dist/components/p-6c546e48.js.map +1 -0
- package/dist/{crmbonus-component-wake/crmbonus.service-9f4c6fd7.js → components/p-6eda79c3.js} +93 -165
- package/dist/components/p-6eda79c3.js.map +1 -0
- package/dist/components/p-75ba7b9a.js +14 -0
- package/dist/components/p-75ba7b9a.js.map +1 -0
- package/dist/{crmbonus-component-wake/giftback-progress.entry.js → components/p-7c744cca.js} +37 -8
- package/dist/components/p-7c744cca.js.map +1 -0
- package/dist/components/p-7cfea8fe.js +19 -0
- package/dist/components/p-7cfea8fe.js.map +1 -0
- package/dist/{crmbonus-component-wake/pin-form.entry.js → components/p-83a12a8f.js} +56 -9
- package/dist/components/p-83a12a8f.js.map +1 -0
- package/dist/{crmbonus-component-wake/cart.helper-4e40ffa9.js → components/p-abbfbc98.js} +2 -3
- package/dist/components/p-abbfbc98.js.map +1 -0
- package/dist/{crmbonus-component-wake/giftback-finish.entry.js → components/p-b79c86a8.js} +25 -8
- package/dist/components/p-b79c86a8.js.map +1 -0
- package/dist/components/p-ba369e65.js +21 -0
- package/dist/components/p-ba369e65.js.map +1 -0
- package/dist/components/p-cc1ea33f.js +36 -0
- package/dist/components/p-cc1ea33f.js.map +1 -0
- package/dist/{crmbonus-component-wake/i18n-11138a2c.js → components/p-e8c19a64.js} +1 -16
- package/dist/components/p-e8c19a64.js.map +1 -0
- package/dist/components/p-f9aeffc1.js +12 -0
- package/dist/components/p-f9aeffc1.js.map +1 -0
- package/dist/components/p-fe9c3966.js +39 -0
- package/dist/components/p-fe9c3966.js.map +1 -0
- package/dist/components/pedido-finalizado.js +54 -0
- package/dist/components/pedido-finalizado.js.map +1 -0
- package/dist/components/phone-cancel-input.js +55 -0
- package/dist/components/phone-cancel-input.js.map +1 -0
- package/dist/components/phone-form.js +8 -0
- package/dist/components/phone-form.js.map +1 -0
- package/dist/components/phone-input-mask.js +8 -0
- package/dist/components/phone-input-mask.js.map +1 -0
- package/dist/components/phone-input.js +55 -0
- package/dist/components/phone-input.js.map +1 -0
- package/dist/components/pin-form.js +8 -0
- package/dist/components/pin-form.js.map +1 -0
- package/dist/crmbonus-component-wake/crmbonus-component-wake.css +1 -7
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -48
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/index.esm.js +1 -12
- package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/p-03b77c41.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-03b77c41.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-3d6152b1.js +3 -0
- package/dist/crmbonus-component-wake/p-3d6152b1.js.map +1 -0
- package/dist/crmbonus-component-wake/p-620ec1a3.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-620ec1a3.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-6eda79c3.js +2 -0
- package/dist/crmbonus-component-wake/p-6eda79c3.js.map +1 -0
- package/dist/crmbonus-component-wake/p-74206c91.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-74206c91.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-75ba7b9a.js +2 -0
- package/dist/crmbonus-component-wake/p-75ba7b9a.js.map +1 -0
- package/dist/crmbonus-component-wake/p-7b7fb354.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-7b7fb354.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-7cfea8fe.js +2 -0
- package/dist/crmbonus-component-wake/p-7cfea8fe.js.map +1 -0
- package/dist/crmbonus-component-wake/p-885fc30e.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-885fc30e.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-8df3f949.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-8df3f949.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-90716188.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-90716188.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-a33f7c24.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-a33f7c24.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-abbfbc98.js +2 -0
- package/dist/crmbonus-component-wake/p-abbfbc98.js.map +1 -0
- package/dist/crmbonus-component-wake/p-b7a8f915.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-b7a8f915.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-ba369e65.js +2 -0
- package/dist/crmbonus-component-wake/p-ba369e65.js.map +1 -0
- package/dist/crmbonus-component-wake/p-be3ddacc.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-be3ddacc.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-c23f3a07.entry.js +2 -0
- package/dist/crmbonus-component-wake/{crm-bonus-form.entry.js.map → p-c23f3a07.entry.js.map} +1 -1
- package/dist/crmbonus-component-wake/p-e1255160.js +2 -0
- package/dist/crmbonus-component-wake/p-e1255160.js.map +1 -0
- package/dist/crmbonus-component-wake/p-e8bd92d1.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-e8bd92d1.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-e8c19a64.js +2 -0
- package/dist/crmbonus-component-wake/p-e8c19a64.js.map +1 -0
- package/dist/crmbonus-component-wake/p-f9aeffc1.js +2 -0
- package/dist/crmbonus-component-wake/p-f9aeffc1.js.map +1 -0
- package/dist/crmbonus-component-wake/p-fad20959.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-fad20959.entry.js.map +1 -0
- package/dist/env.js +3 -0
- package/dist/env.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/app-modal.entry.js +3 -2
- package/dist/esm/app-modal.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake/cart.helper-a921d7f9.js → esm/cart.helper-30a40560.js} +2 -3
- package/dist/esm/cart.helper-30a40560.js.map +1 -0
- package/dist/esm/countdown-timer_2.entry.js +58 -0
- package/dist/esm/countdown-timer_2.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/crm-bonus-form.entry.js +5 -4
- package/dist/esm/crm-bonus-form.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/crm-bonus-note.entry.js +10 -9
- package/dist/esm/crm-bonus-note.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/crm-bonus.entry.js +8 -7
- package/dist/esm/crm-bonus.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake/crm-giftback-form.entry.js → esm/crm-giftback-form_2.entry.js} +26 -11
- package/dist/esm/crm-giftback-form_2.entry.js.map +1 -0
- package/dist/esm/crm-tooltip_4.entry.js +204 -0
- package/dist/esm/crm-tooltip_4.entry.js.map +1 -0
- package/dist/esm/crmbonus-component-wake.js +22 -0
- package/dist/esm/crmbonus-component-wake.js.map +1 -0
- package/dist/{crmbonus-component-wake/crmbonus.service-67550994.js → esm/crmbonus.service-42fbd7fa.js} +90 -162
- package/dist/esm/crmbonus.service-42fbd7fa.js.map +1 -0
- package/dist/esm/giftback-finish_4.entry.js +124 -0
- package/dist/esm/giftback-finish_4.entry.js.map +1 -0
- package/dist/esm/i18n-e8150dff.js +2217 -0
- package/dist/{crmbonus-component-wake/i18n-11138a2c.js.map → esm/i18n-e8150dff.js.map} +1 -1
- package/dist/esm/index-e8724c8f.js +1571 -0
- package/dist/esm/index-e8724c8f.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/loading-spinner.entry.js +3 -2
- package/dist/esm/loading-spinner.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/pedido-finalizado.entry.js +4 -4
- package/dist/esm/pedido-finalizado.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/phone-cancel-input.entry.js +1 -1
- package/dist/esm/phone-cancel-input.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/phone-input-mask.entry.js +3 -2
- package/dist/esm/phone-input-mask.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/phone-input.entry.js +1 -1
- package/dist/esm/phone-input.entry.js.map +1 -0
- package/dist/esm/utils-d642b4db.js +21 -0
- package/dist/esm/utils-d642b4db.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +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/crmbonus-component-wake/app-modal.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/cart.helper-4e40ffa9.js.map +0 -1
- package/dist/crmbonus-component-wake/cart.helper-a921d7f9.js.map +0 -1
- package/dist/crmbonus-component-wake/countdown-timer.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crm-bonus-note.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crm-button.entry.js +0 -20
- package/dist/crmbonus-component-wake/crm-button.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crm-tooltip.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crmbonus.service-67550994.js.map +0 -1
- package/dist/crmbonus-component-wake/crmbonus.service-9f4c6fd7.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-info.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/index-d0fd1dc0.js +0 -3039
- package/dist/crmbonus-component-wake/index-d0fd1dc0.js.map +0 -1
- package/dist/crmbonus-component-wake/loading-container.entry.js +0 -18
- package/dist/crmbonus-component-wake/loading-container.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/name-input.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/phone-cancel-input.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/phone-form.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/phone-input.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/pin-form.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +0 -334
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +0 -1
- package/dist/crmbonus-component-wake/utils-96cf9ae0.js.map +0 -1
- /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js +0 -0
- /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js.map +0 -0
- /package/dist/{crmbonus-component-wake → esm}/index-5b567099.js +0 -0
- /package/dist/{crmbonus-component-wake → esm}/index-5b567099.js.map +0 -0
- /package/dist/{crmbonus-component-wake → esm}/info.config.helper-42d9ddf9.js +0 -0
- /package/dist/{crmbonus-component-wake → esm}/info.config.helper-42d9ddf9.js.map +0 -0
- /package/dist/{crmbonus-component-wake → esm}/keys.storage-8c76fcd7.js +0 -0
- /package/dist/{crmbonus-component-wake → esm}/keys.storage-8c76fcd7.js.map +0 -0
@@ -0,0 +1,313 @@
|
|
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
|
+
console.log('[handleLoad]', this.cartWake);
|
88
|
+
if (this.cartWake.user.id) {
|
89
|
+
this.customer = await this.crmBonusService.getCustomer(this.cartWake.user.id, this.cartWake.store.name);
|
90
|
+
console.log('customer', this.customer);
|
91
|
+
}
|
92
|
+
const amount = localStorage.getItem(this.cartWake.id);
|
93
|
+
if (amount) {
|
94
|
+
this.canCancel = true;
|
95
|
+
this.amountCancel = amount;
|
96
|
+
}
|
97
|
+
await this.buildAndGetProducts(this.cartWake.products);
|
98
|
+
}
|
99
|
+
catch (error) {
|
100
|
+
console.log('info customer');
|
101
|
+
}
|
102
|
+
}
|
103
|
+
async loadSession() {
|
104
|
+
this.session = await this.crmBonusService.getToken(this.cartWake.store.name);
|
105
|
+
setTimeout(() => {
|
106
|
+
this.loadSession();
|
107
|
+
}, 1500000);
|
108
|
+
}
|
109
|
+
async buildAndGetProducts(productsWake) {
|
110
|
+
console.log('productsWake', productsWake);
|
111
|
+
const key = `bc-products:${this.cartWake.id}`;
|
112
|
+
const productsString = JSON.stringify(productsWake);
|
113
|
+
localStorage.setItem(key, productsString);
|
114
|
+
const products_in_cache = JSON.parse(localStorage.getItem(key));
|
115
|
+
const products = [];
|
116
|
+
for (const product_cart of productsWake) {
|
117
|
+
const [pro] = products_in_cache.filter(p => p.ProdutoVarianteId == product_cart.ProdutoVarianteId);
|
118
|
+
const [ajuste = { Valor: 0 }] = pro.Ajustes.filter(aj => aj.Tipo === "Formula");
|
119
|
+
if (pro) {
|
120
|
+
products.push(Object.assign(Object.assign({}, product_cart), { PrecoPor: pro.PrecoPor + (ajuste.Valor * -1), Quantidade: pro.Quantidade, Ajustes: pro.Ajustes }));
|
121
|
+
}
|
122
|
+
else {
|
123
|
+
products.push(product_cart);
|
124
|
+
}
|
125
|
+
}
|
126
|
+
this.cartWake.products = products; //cache_products ? JSON.parse(cache_products) : JSON.parse(this.productsInString);
|
127
|
+
}
|
128
|
+
async sendPin(phone) {
|
129
|
+
var _a, _b;
|
130
|
+
this.loading = true;
|
131
|
+
this.message = "";
|
132
|
+
try {
|
133
|
+
const _phone = phone.replace(/\D/g, '');
|
134
|
+
this.phone = Number(_phone);
|
135
|
+
this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.cartWake.store.name);
|
136
|
+
;
|
137
|
+
await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);
|
138
|
+
this.showModal = true;
|
139
|
+
}
|
140
|
+
catch (error) {
|
141
|
+
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;
|
142
|
+
}
|
143
|
+
finally {
|
144
|
+
this.loading = false;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
async sendPinName(customerName) {
|
148
|
+
var _a, _b;
|
149
|
+
this.loading = true;
|
150
|
+
this.message = "";
|
151
|
+
try {
|
152
|
+
this.customer.name = customerName;
|
153
|
+
this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.cartWake.store.name);
|
154
|
+
await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);
|
155
|
+
this.showModal = true;
|
156
|
+
}
|
157
|
+
catch (error) {
|
158
|
+
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;
|
159
|
+
}
|
160
|
+
finally {
|
161
|
+
this.loading = false;
|
162
|
+
}
|
163
|
+
}
|
164
|
+
buildProducts() {
|
165
|
+
return buildProductsByWake(this.cartWake.products);
|
166
|
+
}
|
167
|
+
handleCloseModal() {
|
168
|
+
this.showModal = false;
|
169
|
+
}
|
170
|
+
save(amount) {
|
171
|
+
localStorage.setItem(this.cartWake.id, amount.toString());
|
172
|
+
this.canCancel = true;
|
173
|
+
this.amountCancel = amount.toString();
|
174
|
+
}
|
175
|
+
async cancel() {
|
176
|
+
this.message = "";
|
177
|
+
this.loading = true;
|
178
|
+
try {
|
179
|
+
await this.crmBonusService.cancel(this.cartWake.id);
|
180
|
+
this.canCancel = false;
|
181
|
+
localStorage.removeItem(this.cartWake.id);
|
182
|
+
}
|
183
|
+
catch (error) {
|
184
|
+
this.message = "Não consegui cancelar o bônus, tente novamente!";
|
185
|
+
}
|
186
|
+
finally {
|
187
|
+
this.loading = false;
|
188
|
+
}
|
189
|
+
}
|
190
|
+
async handleSendPin(phone) {
|
191
|
+
this.message = "";
|
192
|
+
if (!phone) {
|
193
|
+
this.message = "Informe seu telefone";
|
194
|
+
return;
|
195
|
+
}
|
196
|
+
this.customer.phone = phone;
|
197
|
+
const _phone = phone.replace(/\D/g, '');
|
198
|
+
this.phone = Number(_phone);
|
199
|
+
if (this.customer.name) {
|
200
|
+
return this.sendPin(phone);
|
201
|
+
}
|
202
|
+
await this.crmBonusRef.setStep(StepFormEnum.STEP_NAME);
|
203
|
+
this.showModal = true;
|
204
|
+
}
|
205
|
+
render() {
|
206
|
+
return (h("loading-container", { key: '21fafa4b9339db4a55ba454d05eecc0e4a8a2763', loading: this.loading_reprocess }, h("crm-giftback-form", { key: 'ef564d7e6794664b107d3996c8d081eafebfecb6', 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() })));
|
207
|
+
}
|
208
|
+
static get is() { return "crm-bonus"; }
|
209
|
+
static get encapsulation() { return "scoped"; }
|
210
|
+
static get originalStyleUrls() {
|
211
|
+
return {
|
212
|
+
"$": ["crm-bonus.css"]
|
213
|
+
};
|
214
|
+
}
|
215
|
+
static get styleUrls() {
|
216
|
+
return {
|
217
|
+
"$": ["crm-bonus.css"]
|
218
|
+
};
|
219
|
+
}
|
220
|
+
static get assetsDirs() { return ["assets"]; }
|
221
|
+
static get properties() {
|
222
|
+
return {
|
223
|
+
"cart": {
|
224
|
+
"type": "any",
|
225
|
+
"mutable": false,
|
226
|
+
"complexType": {
|
227
|
+
"original": "any",
|
228
|
+
"resolved": "any",
|
229
|
+
"references": {}
|
230
|
+
},
|
231
|
+
"required": false,
|
232
|
+
"optional": false,
|
233
|
+
"docs": {
|
234
|
+
"tags": [],
|
235
|
+
"text": ""
|
236
|
+
},
|
237
|
+
"attribute": "cart",
|
238
|
+
"reflect": false
|
239
|
+
}
|
240
|
+
};
|
241
|
+
}
|
242
|
+
static get states() {
|
243
|
+
return {
|
244
|
+
"showModal": {},
|
245
|
+
"cartWake": {},
|
246
|
+
"customer": {},
|
247
|
+
"loading": {},
|
248
|
+
"message": {},
|
249
|
+
"phone": {},
|
250
|
+
"canCancel": {},
|
251
|
+
"amountCancel": {},
|
252
|
+
"sent": {},
|
253
|
+
"session": {},
|
254
|
+
"loading_reprocess": {}
|
255
|
+
};
|
256
|
+
}
|
257
|
+
static get methods() {
|
258
|
+
return {
|
259
|
+
"resetBonus": {
|
260
|
+
"complexType": {
|
261
|
+
"signature": "() => Promise<void>",
|
262
|
+
"parameters": [],
|
263
|
+
"references": {
|
264
|
+
"Promise": {
|
265
|
+
"location": "global",
|
266
|
+
"id": "global::Promise"
|
267
|
+
}
|
268
|
+
},
|
269
|
+
"return": "Promise<void>"
|
270
|
+
},
|
271
|
+
"docs": {
|
272
|
+
"text": "",
|
273
|
+
"tags": []
|
274
|
+
}
|
275
|
+
},
|
276
|
+
"setloading": {
|
277
|
+
"complexType": {
|
278
|
+
"signature": "() => Promise<void>",
|
279
|
+
"parameters": [],
|
280
|
+
"references": {
|
281
|
+
"Promise": {
|
282
|
+
"location": "global",
|
283
|
+
"id": "global::Promise"
|
284
|
+
}
|
285
|
+
},
|
286
|
+
"return": "Promise<void>"
|
287
|
+
},
|
288
|
+
"docs": {
|
289
|
+
"text": "",
|
290
|
+
"tags": []
|
291
|
+
}
|
292
|
+
},
|
293
|
+
"reprocess": {
|
294
|
+
"complexType": {
|
295
|
+
"signature": "() => Promise<void>",
|
296
|
+
"parameters": [],
|
297
|
+
"references": {
|
298
|
+
"Promise": {
|
299
|
+
"location": "global",
|
300
|
+
"id": "global::Promise"
|
301
|
+
}
|
302
|
+
},
|
303
|
+
"return": "Promise<void>"
|
304
|
+
},
|
305
|
+
"docs": {
|
306
|
+
"text": "",
|
307
|
+
"tags": []
|
308
|
+
}
|
309
|
+
}
|
310
|
+
};
|
311
|
+
}
|
312
|
+
}
|
313
|
+
//# sourceMappingURL=crm-bonus.js.map
|
@@ -0,0 +1 @@
|
|
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,GA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,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAC5B,CAAC;QAED,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QACvD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,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 console.log('[handleLoad]', this.cartWake)\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 console.log('productsWake', productsWake)\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"]}
|
@@ -0,0 +1,19 @@
|
|
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
|
+
}
|