ameliabooking
/
v3
/
src
/
views
/
admin
/
customize
/
steps
/
Events
/
common
/
EventPayment
/
EventPayment.vue
ameliabooking
/
v3
/
src
/
views
/
admin
/
customize
/
steps
/
Events
/
common
/
EventPayment
Last commit date
parts
3 days ago
EventPayment.vue
1 month ago
EventPayment.vue
187 lines
| 1 | <template> |
| 2 | <div :class="props.globalClass"> |
| 3 | <Payment |
| 4 | v-if="selectedEvent" |
| 5 | :selected-item="selectedEvent" |
| 6 | :customized-labels="customLabels" |
| 7 | ></Payment> |
| 8 | </div> |
| 9 | </template> |
| 10 | |
| 11 | <script setup> |
| 12 | // * Common Components |
| 13 | import Payment from '../../../common/Payment.vue' |
| 14 | |
| 15 | // * Import from Vue |
| 16 | import { ref, reactive, computed, inject } from 'vue' |
| 17 | |
| 18 | // * Import Libraries |
| 19 | import moment from 'moment' |
| 20 | |
| 21 | // * Composables |
| 22 | import { useReactiveCustomize } from '../../../../../../../assets/js/admin/useReactiveCustomize.js' |
| 23 | |
| 24 | // * Components Properties |
| 25 | let props = defineProps({ |
| 26 | globalClass: { |
| 27 | type: String, |
| 28 | default: '', |
| 29 | }, |
| 30 | componentClass: { |
| 31 | type: String, |
| 32 | default: '', |
| 33 | }, |
| 34 | inDialog: { |
| 35 | type: Boolean, |
| 36 | default: false, |
| 37 | }, |
| 38 | }) |
| 39 | |
| 40 | // * Base Urls |
| 41 | const baseUrls = inject('baseUrls') |
| 42 | |
| 43 | // * Selected Event |
| 44 | let selectedEvent = ref({ |
| 45 | id: 3, |
| 46 | bookable: true, |
| 47 | color: '#1788FB', |
| 48 | opened: true, |
| 49 | full: false, |
| 50 | closed: false, |
| 51 | description: |
| 52 | "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.", |
| 53 | fullPayment: false, |
| 54 | gallery: [ |
| 55 | { |
| 56 | pictureFullPath: `${baseUrls.value.wpAmeliaPluginURL}v3/src/assets/img/admin/customize/img_holder1.svg`, |
| 57 | }, |
| 58 | { |
| 59 | pictureFullPath: `${baseUrls.value.wpAmeliaPluginURL}v3/src/assets/img/admin/customize/img_holder1.svg`, |
| 60 | }, |
| 61 | { |
| 62 | pictureFullPath: `${baseUrls.value.wpAmeliaPluginURL}v3/src/assets/img/admin/customize/img_holder1.svg`, |
| 63 | }, |
| 64 | { |
| 65 | pictureFullPath: `${baseUrls.value.wpAmeliaPluginURL}v3/src/assets/img/admin/customize/img_holder1.svg`, |
| 66 | }, |
| 67 | { |
| 68 | pictureFullPath: `${baseUrls.value.wpAmeliaPluginURL}v3/src/assets/img/admin/customize/img_holder1.svg`, |
| 69 | }, |
| 70 | ], |
| 71 | locationId: 1, |
| 72 | customPricing: true, |
| 73 | customTickets: [ |
| 74 | { |
| 75 | enabled: true, |
| 76 | id: 1, |
| 77 | eventId: 1, |
| 78 | name: 'Ticket one', |
| 79 | price: 10, |
| 80 | sold: 0, |
| 81 | spots: 20, |
| 82 | }, |
| 83 | { |
| 84 | enabled: true, |
| 85 | id: 2, |
| 86 | eventId: 1, |
| 87 | name: 'Ticket two', |
| 88 | price: 50, |
| 89 | sold: 0, |
| 90 | spots: 20, |
| 91 | }, |
| 92 | { |
| 93 | enabled: true, |
| 94 | id: 2, |
| 95 | eventId: 1, |
| 96 | name: 'Ticket three', |
| 97 | price: 100, |
| 98 | sold: 0, |
| 99 | spots: 20, |
| 100 | }, |
| 101 | ], |
| 102 | depositPerPerson: true, |
| 103 | depositPayment: 'percentage', |
| 104 | deposit: 10, |
| 105 | maxCapacity: 9, |
| 106 | maxCustomCapacity: null, |
| 107 | maxExtraPeople: 3, |
| 108 | name: 'Even 3', |
| 109 | organizerId: 1, |
| 110 | periods: [ |
| 111 | { |
| 112 | id: 1, |
| 113 | eventId: 1, |
| 114 | periodStart: moment().add(2, 'days').add(5, 'hours').format('YYYY-MM-DD hh:mm:ss'), |
| 115 | periodEnd: moment().add(4, 'days').add(10, 'hours').format('YYYY-MM-DD hh:mm:ss'), |
| 116 | }, |
| 117 | ], |
| 118 | pictureFullPath: null, |
| 119 | pictureThumbPath: null, |
| 120 | places: 30, |
| 121 | price: 10, |
| 122 | providers: [ |
| 123 | { |
| 124 | id: 1, |
| 125 | firstName: 'Jane', |
| 126 | lastName: 'Doe', |
| 127 | description: |
| 128 | "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.", |
| 129 | }, |
| 130 | { |
| 131 | id: 2, |
| 132 | firstName: 'Sahar', |
| 133 | lastName: 'Potter', |
| 134 | description: |
| 135 | "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.", |
| 136 | }, |
| 137 | { |
| 138 | id: 3, |
| 139 | firstName: 'Miles', |
| 140 | lastName: 'Shannon', |
| 141 | description: |
| 142 | "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.", |
| 143 | }, |
| 144 | ], |
| 145 | show: true, |
| 146 | status: 'approved', |
| 147 | tags: [{}], |
| 148 | }) |
| 149 | |
| 150 | // * Customize |
| 151 | const { amCustomize } = useReactiveCustomize() |
| 152 | |
| 153 | // * Form string recognition |
| 154 | let pageRenderKey = inject('pageRenderKey') |
| 155 | |
| 156 | // * Labels |
| 157 | let langKey = inject('langKey') |
| 158 | let amLabels = inject('labels') |
| 159 | |
| 160 | // * Computed labels |
| 161 | let customLabels = computed(() => { |
| 162 | let computedLabels = reactive({ ...amLabels }) |
| 163 | |
| 164 | if (amCustomize.value[pageRenderKey.value].payment.translations) { |
| 165 | let customizedLabels = amCustomize.value[pageRenderKey.value].payment.translations |
| 166 | Object.keys(customizedLabels).forEach((labelKey) => { |
| 167 | if (customizedLabels[labelKey][langKey.value]) { |
| 168 | computedLabels[labelKey] = customizedLabels[labelKey][langKey.value] |
| 169 | } else if (customizedLabels[labelKey].default) { |
| 170 | computedLabels[labelKey] = customizedLabels[labelKey].default |
| 171 | } |
| 172 | }) |
| 173 | } |
| 174 | return computedLabels |
| 175 | }) |
| 176 | </script> |
| 177 | |
| 178 | <script> |
| 179 | export default { |
| 180 | name: 'EventPayment', |
| 181 | key: 'payment', |
| 182 | label: 'event_payment', |
| 183 | } |
| 184 | </script> |
| 185 | |
| 186 | <style lang="scss"></style> |
| 187 |