PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.8
Booking for Appointments and Events Calendar – Amelia v2.4.8
2.4.8 2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / v3 / src / views / public / EventForm / Common / EventPayment / EventPayment.vue
ameliabooking / v3 / src / views / public / EventForm / Common / EventPayment Last commit date
EventPayment.vue 1 month ago
EventPayment.vue
122 lines
1 <template>
2 <div :class="props.globalClass" :style="cssVars">
3 <Payment
4 v-if="selectedEvent"
5 :selected-item="selectedEvent"
6 :tax-visibility="taxVisible"
7 :in-dialog="true"
8 ></Payment>
9 </div>
10 </template>
11
12 <script setup>
13 // * Components
14 import Payment from '../../../Parts/Payment/Page/Payment.vue'
15
16 // * Import from Vue
17 import { inject, provide, reactive, computed } from 'vue'
18
19 // * Import from Vuex
20 import { useStore } from 'vuex'
21
22 // * Composables
23 import { useColorTransparency } from '../../../../../assets/js/common/colorManipulation'
24 import { useTaxVisibility } from '../../../../../assets/js/common/pricing'
25
26 let props = defineProps({
27 globalClass: {
28 type: String,
29 default: '',
30 },
31 inDialog: {
32 type: Boolean,
33 default: false,
34 },
35 })
36
37 // * Store
38 const store = useStore()
39
40 const { footerButtonReset } = inject('changingStepsFunctions', {
41 footerButtonReset: () => {},
42 })
43
44 footerButtonReset()
45
46 let stepsArray = inject('stepsArray')
47 let stepIndex = inject('stepIndex')
48
49 // * Form Key
50 let formKey = computed(() => store.getters['getFormKey'])
51
52 // * Amelia Settings
53 let amSettings = computed(() => store.getters['getSettings'])
54
55 // * labels
56 const labels = inject('labels')
57
58 // * local language short code
59 const localLanguage = inject('localLanguage')
60
61 // * Computed labels
62 let amLabels = computed(() => {
63 let computedLabels = reactive({ ...labels })
64 let componentKey = stepsArray.value[stepIndex.value].key
65
66 if (
67 amSettings.value.customizedData &&
68 formKey.value in amSettings.value.customizedData &&
69 amSettings.value.customizedData[formKey.value][componentKey].translations
70 ) {
71 let customizedLabels = amSettings.value.customizedData[formKey.value][componentKey].translations
72 Object.keys(customizedLabels).forEach((labelKey) => {
73 if (customizedLabels[labelKey][localLanguage.value]) {
74 computedLabels[labelKey] = customizedLabels[labelKey][localLanguage.value]
75 } else if (customizedLabels[labelKey].default) {
76 computedLabels[labelKey] = customizedLabels[labelKey].default
77 }
78 })
79 }
80 return computedLabels
81 })
82
83 provide('amLabels', amLabels.value)
84
85 // * Event obj
86 let selectedEvent = computed(() =>
87 store.getters['eventEntities/getEvent'](store.getters['eventBooking/getSelectedEventId']),
88 )
89
90 // * Tax
91 let taxVisible = computed(() => {
92 return useTaxVisibility(store, selectedEvent.value.id, 'event')
93 })
94
95 // * Colors
96 let amColors = inject('amColors')
97
98 const cssVars = computed(() => {
99 return {
100 '--am-c-ps-price-bgr': useColorTransparency(amColors.value.colorBtnPrim, 0.05),
101 '--am-c-ps-total-price': amColors.value.colorBtnPrim,
102 '--am-c-ps-text-op50': useColorTransparency(amColors.value.colorMainText, 0.5),
103 '--am-c-ps-text-op25': useColorTransparency(amColors.value.colorMainText, 0.25),
104 '--am-c-ps-text-op20': useColorTransparency(amColors.value.colorMainText, 0.2),
105 '--am-c-ps-text-op06': useColorTransparency(amColors.value.colorMainText, 0.06),
106 '--am-c-ps-primary': amColors.value.colorPrimary,
107 '--am-c-ps-primary-op10': useColorTransparency(amColors.value.colorPrimary, 0.1),
108 '--am-c-ps-primary-op06': useColorTransparency(amColors.value.colorPrimary, 0.06),
109 }
110 })
111 </script>
112
113 <script>
114 export default {
115 name: 'EventPayment',
116 key: 'payment',
117 label: 'event_payment',
118 }
119 </script>
120
121 <style lang="scss"></style>
122