ameliabooking
/
v3
/
src
/
views
/
admin
/
customize
/
steps
/
Cabinet
/
common
/
parts
/
PaymentButton.vue
ameliabooking
/
v3
/
src
/
views
/
admin
/
customize
/
steps
/
Cabinet
/
common
/
parts
Last commit date
CollapseCard
1 month ago
AppointmentBooking.vue
1 month ago
CancelPopup.vue
1 month ago
DeleteProfile.vue
1 month ago
Filters.vue
1 month ago
PaymentButton.vue
1 month ago
Skeleton.vue
1 month ago
TimeZoneSelect.vue
1 month ago
PaymentButton.vue
76 lines
| 1 | <template> |
| 2 | <AmButton :size="props.btnSize" :suffix="arrowDown" class="am-button-single" :class="props.class"> |
| 3 | {{ labelsDisplay('pay_now_btn') }} |
| 4 | </AmButton> |
| 5 | </template> |
| 6 | |
| 7 | <script setup> |
| 8 | // * Import from Vue |
| 9 | import { computed, inject, defineComponent } from 'vue' |
| 10 | |
| 11 | // * Components |
| 12 | import AmButton from '../../../../../../_components/button/AmButton.vue' |
| 13 | import IconComponent from '../../../../../../_components/icons/IconComponent.vue' |
| 14 | |
| 15 | // * Composables |
| 16 | import { useReactiveCustomize } from '../../../../../../../assets/js/admin/useReactiveCustomize.js' |
| 17 | |
| 18 | let props = defineProps({ |
| 19 | reservation: { |
| 20 | type: Object, |
| 21 | default: () => {}, |
| 22 | }, |
| 23 | bookable: { |
| 24 | type: Object, |
| 25 | default: () => {}, |
| 26 | }, |
| 27 | btnSize: { |
| 28 | type: String, |
| 29 | default: 'mini', |
| 30 | }, |
| 31 | class: { |
| 32 | type: String, |
| 33 | default: '', |
| 34 | }, |
| 35 | }) |
| 36 | |
| 37 | let arrowDown = defineComponent({ |
| 38 | components: { IconComponent }, |
| 39 | template: `<IconComponent icon="arrow-down"></IconComponent>`, |
| 40 | }) |
| 41 | |
| 42 | /************* |
| 43 | * Customize * |
| 44 | *************/ |
| 45 | // * Customize |
| 46 | const { amCustomize } = useReactiveCustomize() |
| 47 | |
| 48 | // * Labels |
| 49 | let langKey = inject('langKey') |
| 50 | let amLabels = inject('labels') |
| 51 | |
| 52 | let pageRenderKey = inject('pageRenderKey') |
| 53 | let stepName = inject('stepName') |
| 54 | |
| 55 | // * Label computed function |
| 56 | function labelsDisplay(label) { |
| 57 | let computedLabel = computed(() => { |
| 58 | return amCustomize.value[pageRenderKey.value][stepName.value].translations && |
| 59 | amCustomize.value[pageRenderKey.value][stepName.value].translations[label] && |
| 60 | amCustomize.value[pageRenderKey.value][stepName.value].translations[label][langKey.value] |
| 61 | ? amCustomize.value[pageRenderKey.value][stepName.value].translations[label][langKey.value] |
| 62 | : amLabels[label] |
| 63 | }) |
| 64 | |
| 65 | return computedLabel.value |
| 66 | } |
| 67 | </script> |
| 68 | |
| 69 | <script> |
| 70 | export default { |
| 71 | name: 'PaymentButton', |
| 72 | } |
| 73 | </script> |
| 74 | |
| 75 | <style lang="scss"></style> |
| 76 |