@viur/shop-components 0.0.1-dev.60 → 0.0.1-dev.61

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.
Files changed (135) hide show
  1. package/old/client/HttpClient.js +111 -0
  2. package/old/client/ViURShopClient.js +472 -0
  3. package/old/client/index.js +23 -0
  4. package/old/client/types.js +10 -0
  5. package/old/components/ExampleUsage.vue +95 -0
  6. package/old/components/ShopCart.vue +91 -0
  7. package/old/components/ShopOrderConfirm.vue +311 -0
  8. package/{src → old}/components/ShopOrderStepper.vue +111 -23
  9. package/old/components/ShopPaymentProvider.vue +113 -0
  10. package/old/components/ShopShippingMethod.vue +52 -0
  11. package/{src/components/ui → old/components}/ShopSummary.vue +28 -35
  12. package/{src → old}/components/ShopUserData.vue +51 -65
  13. package/{src → old}/components/cart/CartLeafModel.vue +24 -16
  14. package/{src → old}/components/cart/CartNode.vue +1 -0
  15. package/{src → old}/components/cart/CartTree.vue +13 -0
  16. package/old/components/cart/CartView.vue +82 -0
  17. package/{src → old}/components/cart/Discount.vue +8 -8
  18. package/old/components/generic/loadinghandler.vue +76 -0
  19. package/old/components/paymentProvider/prepayment.vue +0 -0
  20. package/old/components/paymentProvider/unzerPayment.vue +140 -0
  21. package/old/components/simple/ShopUserData.vue +161 -0
  22. package/old/components/simple/SimpleDefaultLayout.vue +116 -0
  23. package/old/components/ui/generic/CardSelector.vue +52 -0
  24. package/old/components/ui/generic/CartList.vue +69 -0
  25. package/old/components/ui/generic/ShippingInfo.vue +56 -0
  26. package/old/components/ui/generic/alerts/ShopAlert.vue +30 -0
  27. package/old/components/ui/payment/PaymentOption.vue +79 -0
  28. package/old/components/ui/payment/PaymentSelector.vue +158 -0
  29. package/old/components/ui/stepper/StepperItem.vue +90 -0
  30. package/{src → old}/components/ui/stepper/StepperTab.vue +30 -2
  31. package/old/components/ui/stepper/StepperTrigger.vue +69 -0
  32. package/old/components/ui/userdata/AddForm.vue +160 -0
  33. package/old/components/ui/userdata/AddressBox.vue +137 -0
  34. package/{src → old}/components/ui/userdata/BaseLayout.vue +15 -32
  35. package/old/stores/address.js +122 -0
  36. package/old/stores/cart.js +266 -0
  37. package/old/stores/message.js +21 -0
  38. package/old/stores/order.js +202 -0
  39. package/old/stores/payment.js +79 -0
  40. package/old/stores/shipping.js +78 -0
  41. package/package.json +3 -5
  42. package/src/Shop.vue +212 -0
  43. package/src/ShopOrderStepper.vue +89 -0
  44. package/src/ShopSummary.vue +170 -0
  45. package/src/Steps/ShopCart.vue +60 -0
  46. package/src/Steps/ShopOrderComplete.vue +24 -0
  47. package/src/Steps/ShopOrderConfirm.vue +295 -0
  48. package/src/Steps/ShopPaymentProvider.vue +53 -0
  49. package/src/Steps/ShopShippingMethod.vue +53 -0
  50. package/src/Steps/ShopUserDataGuest.vue +78 -0
  51. package/src/Steps/index.js +15 -0
  52. package/src/components/AddressForm.vue +84 -0
  53. package/src/components/AddressFormLayout.vue +107 -0
  54. package/src/components/CardSelector.vue +68 -0
  55. package/src/components/CartItem.vue +325 -0
  56. package/src/components/CartItemSmall.vue +257 -0
  57. package/src/components/LoadingHandler.vue +76 -0
  58. package/src/components/PaymentOption.vue +78 -0
  59. package/src/components/PaymentProviderUnzer.vue +201 -0
  60. package/src/components/PaymentSelector.vue +55 -0
  61. package/src/components/ShopAlert.vue +30 -0
  62. package/src/components/StepperTab.vue +132 -0
  63. package/src/components/dialogButton.vue +49 -0
  64. package/src/composables/address.js +95 -0
  65. package/src/composables/cart.js +132 -0
  66. package/src/composables/order.js +80 -0
  67. package/src/composables/payment.js +75 -0
  68. package/src/composables/shipping.js +32 -0
  69. package/src/main.js +32 -38
  70. package/src/shop.js +251 -0
  71. package/src/translations/de.js +15 -0
  72. package/src/translations/en.js +5 -0
  73. package/src/utils.js +49 -0
  74. package/vite.config.js +0 -2
  75. package/src/components/ShopCart.vue +0 -512
  76. package/src/components/ShopOrderConfirm.vue +0 -291
  77. package/src/components/cart/CartView.vue +0 -723
  78. package/src/components/order/OrderSidebar.vue +0 -102
  79. package/src/components/order/category/CategoryList.vue +0 -83
  80. package/src/components/order/category/CategoryView.vue +0 -143
  81. package/src/components/order/information/adress/ShippingAdress.vue +0 -143
  82. package/src/components/order/item/ItemCard.vue +0 -168
  83. package/src/components/order/item/ItemView.vue +0 -232
  84. package/src/components/order/process/ConfirmView.vue +0 -312
  85. package/src/components/order/process/ExampleUsage.vue +0 -113
  86. package/src/components/order/process/OrderTabHeader.vue +0 -16
  87. package/src/components/order/process/SelectPaymentProvider.vue +0 -62
  88. package/src/components/order/process/Shipping.vue +0 -46
  89. package/src/components/ui/generic/ArticleList.vue +0 -222
  90. package/src/components/ui/generic/ExamplePagination.vue +0 -236
  91. package/src/components/ui/generic/alerts/ShopAlert.vue +0 -19
  92. package/src/components/ui/generic/makeData.js +0 -39
  93. package/src/components/ui/stepper/StepperItem.vue +0 -39
  94. package/src/components/ui/stepper/StepperTrigger.vue +0 -35
  95. package/src/components/ui/userdata/AddForm.vue +0 -125
  96. package/src/components/ui/userdata/AddressBox.vue +0 -117
  97. package/src/router/index.js +0 -103
  98. package/src/stores/cart.js +0 -336
  99. package/src/views/ViewMissing.vue +0 -20
  100. /package/{src → old}/components/ShopOrderComplete.vue +0 -0
  101. /package/{src → old}/components/cart/CartLeaf.vue +0 -0
  102. /package/{src → old}/components/cart/CartTreeWrapper.vue +0 -0
  103. /package/{src/components/lib/utils.js → old/components/paymentProvider/paypalplus.vue} +0 -0
  104. /package/{src → old}/components/ui/generic/ShopPriceFormatter.vue +0 -0
  105. /package/{src → old}/components/ui/userdata/CustomBooleanBone.vue +0 -0
  106. /package/{src → old}/components/ui/userdata/CustomSelectBone.vue +0 -0
  107. /package/{src → old}/components/ui/userdata/CustomStringBone.vue +0 -0
  108. /package/{src → old}/components/ui/userdata/DefaultLayout.vue +0 -0
  109. /package/{src → old}/components/ui/userdata/SelectAddress.vue +0 -0
  110. /package/{src → old}/components/ui/userdata/multi/ActionBar.vue +0 -0
  111. /package/{src → old}/components/ui/userdata/multi/CartSelection.vue +0 -0
  112. /package/{src/style → old}/ignite/.editorconfig +0 -0
  113. /package/{src/style → old}/ignite/.github/workflows/ignite.yml +0 -0
  114. /package/{src/style → old}/ignite/.github/workflows/node.yml +0 -0
  115. /package/{src/style → old}/ignite/.postcssrc.cjs +0 -0
  116. /package/{src/style → old}/ignite/CHANGELOG.md +0 -0
  117. /package/{src/style → old}/ignite/LICENSE +0 -0
  118. /package/{src/style → old}/ignite/README.md +0 -0
  119. /package/{src/style → old}/ignite/dist/ignite.css +0 -0
  120. /package/{src/style → old}/ignite/dist/ignite.min.css +0 -0
  121. /package/{src/style → old}/ignite/foundation/basic.css +0 -0
  122. /package/{src/style → old}/ignite/foundation/color.css +0 -0
  123. /package/{src/style → old}/ignite/foundation/config.css +0 -0
  124. /package/{src/style → old}/ignite/foundation/grid.css +0 -0
  125. /package/{src/style → old}/ignite/foundation/mediaqueries.css +0 -0
  126. /package/{src/style → old}/ignite/foundation/reset.css +0 -0
  127. /package/{src/style → old}/ignite/ignite.css +0 -0
  128. /package/{src/style → old}/ignite/ignite.css.map +0 -0
  129. /package/{src/style → old}/ignite/package-lock.json +0 -0
  130. /package/{src/style → old}/ignite/package.json +0 -0
  131. /package/{src/style → old}/ignite/shoelace.css +0 -0
  132. /package/{src/style → old}/ignite/themes/dark.css +0 -0
  133. /package/{src/style → old}/ignite/themes/light.css +0 -0
  134. /package/{src/style → old}/ignite/utilities/shoelace.css +0 -0
  135. /package/{src/style → old}/ignite/utilities/utilities.css +0 -0
@@ -0,0 +1,170 @@
1
+ <template>
2
+ <h2 class="viur-shop-cart-sidebar-headline headline">Zusammenfassung</h2>
3
+
4
+ <div class="viur-shop-cart-sidebar-summary">
5
+ <template v-for="i in 10">
6
+ <div class="viur-shop-cart-sidebar-summary-item">
7
+ <div class="viur-shop-cart-sidebar-summary-item-amount">1x</div>
8
+ <div class="viur-shop-cart-sidebar-summary-item-name">Item Name auch noch etwas länger zum testen</div>
9
+ <div class="viur-shop-cart-sidebar-summary-item-price">1.333,00€</div>
10
+ </div>
11
+
12
+ <div class="viur-shop-cart-sidebar-summary-item">
13
+ <div class="viur-shop-cart-sidebar-summary-item-amount">1x</div>
14
+ <div class="viur-shop-cart-sidebar-summary-item-name">Item Name</div>
15
+ <div class="viur-shop-cart-sidebar-summary-item-price">1.333,00€</div>
16
+ </div>
17
+ </template>
18
+ </div>
19
+
20
+ <div class="viur-shop-cart-sidebar-info-line">
21
+ <span>Zwischensumme</span>
22
+
23
+ <sl-format-number
24
+ lang="de"
25
+ type="currency"
26
+ currency="EUR"
27
+ :value="shopStore.state.order?.total"
28
+ >
29
+ </sl-format-number>
30
+ </div>
31
+
32
+ <div class="viur-shop-cart-sidebar-info-line">
33
+ <span>Versandkosten</span>
34
+
35
+ <sl-format-number
36
+ lang="de"
37
+ type="currency"
38
+ currency="EUR"
39
+ :value="shopStore.state.order?.cart?.dest?.shipping?.dest?.shipping_cost"
40
+ >
41
+ </sl-format-number>
42
+ </div>
43
+ <div class="viur-shop-cart-shipping-item">
44
+ <span>Lieferzeit </span>
45
+ <template v-if="shopStore.state.order?.cart?.dest?.shipping?.dest?.delivery_time_range === 1">
46
+ {{shopStore.state.order?.cart?.dest?.shipping?.dest?.delivery_time_range}} Tag
47
+ </template>
48
+ <template v-else>
49
+ {{shopStore.state.order?.cart?.dest?.shipping?.dest?.delivery_time_range}} Tage
50
+ </template>
51
+ </div>
52
+
53
+ <div class="viur-shop-cart-sidebar-info-line">
54
+ <span>Rabatt</span>
55
+
56
+ <sl-format-number
57
+ lang="de"
58
+ type="currency"
59
+ currency="EUR"
60
+ :value="0"
61
+ >
62
+ </sl-format-number>
63
+ </div>
64
+ <div class="viur-shop-cart-sidebar-info-line">
65
+
66
+ </div>
67
+ <div class="viur-shop-cart-sidebar-info-line total">
68
+ <span>Gesamt:</span>
69
+ <sl-format-number
70
+ lang="de"
71
+ type="currency"
72
+ currency="EUR"
73
+ :value="state.total"
74
+ >
75
+ </sl-format-number>
76
+ </div>
77
+
78
+ <slot name="action-buttons">
79
+ <div class="viur-shop-cart-sidebar-btn-wrap" v-if="!shopStore.state.order?.['is_paid']">
80
+ <sl-button variant="primary" size="medium">Bestellen</sl-button>
81
+ </div>
82
+ </slot>
83
+ </template>
84
+ <script setup>
85
+ import {reactive, computed} from 'vue'
86
+ import {useViurShopStore} from "./shop";
87
+ const shopStore = useViurShopStore();
88
+ console.log(shopStore.state.order)
89
+
90
+ const state = reactive({
91
+ total:computed(()=>{
92
+ return shopStore.state.order?.total + (shopStore.state.order?.cart?.dest?.shipping?.dest?.shipping_cost?shopStore.state.order?.cart?.dest?.shipping?.dest?.shipping_cost:0)
93
+ })
94
+ })
95
+
96
+
97
+ </script>
98
+
99
+ <style scoped>
100
+ .viur-shop-cart-sidebar-info-line {
101
+ display: flex;
102
+ flex-direction: row;
103
+ flex-wrap: nowrap;
104
+ margin: var(--sl-spacing-2x-small) 0;
105
+
106
+ &.total {
107
+ font-weight: 600;
108
+ border-top: 1px solid var(--sl-color-neutral-300);
109
+ border-bottom: 1px solid var(--sl-color-neutral-300);
110
+ padding: var(--sl-spacing-x-small) 0;
111
+ margin: var(--sl-spacing-small) 0;
112
+ }
113
+
114
+ span {
115
+ margin-right: auto;
116
+ }
117
+ }
118
+
119
+ .viur-shop-cart-sidebar-btn-wrap {
120
+ display: flex;
121
+ flex-direction: column;
122
+ margin-top: var(--sl-spacing-large);
123
+
124
+ sl-button {
125
+ margin-bottom: var(--sl-spacing-x-small);
126
+ }
127
+ }
128
+
129
+ .viur-shop-cart-sidebar-headline {
130
+ margin: 0 0 var(--sl-spacing-large) 0;
131
+ }
132
+
133
+ .viur-shop-cart-sidebar-summary{
134
+ display: flex;
135
+ flex-direction: column;
136
+ overflow: auto;
137
+ margin-bottom: var(--sl-spacing-small);
138
+ padding-right: 4px;
139
+ margin-right: -4px;
140
+
141
+ &::-webkit-scrollbar {
142
+ width: 3px;
143
+ }
144
+
145
+ &::-webkit-scrollbar-track {
146
+ background: transparent;
147
+ }
148
+
149
+ &::-webkit-scrollbar-thumb {
150
+ background: var(--sl-color-neutral-300);
151
+ transition: background ease .3s;
152
+ }
153
+
154
+ &::-webkit-scrollbar-thumb:hover {
155
+ background: var(--sl-color-neutral-400);
156
+ }
157
+ }
158
+
159
+ .viur-shop-cart-sidebar-summary-item{
160
+ display: flex;
161
+ flex-direction: row;
162
+ flex-wrap: nowrap;
163
+ gap: var(--sl-spacing-medium);
164
+ margin-bottom: var(--sl-spacing-small);
165
+ }
166
+
167
+ .viur-shop-cart-sidebar-summary-item-name{
168
+ margin-right: auto;
169
+ }
170
+ </style>
@@ -0,0 +1,60 @@
1
+ <template>
2
+ <sl-button @click="fetchCart">
3
+ reload
4
+ </sl-button>
5
+ <sl-button @click="addItem('agtha3ZpdXIzdGVzdHIZCxIMZ3JlZW5hcnRpY2xlGICAgMSf-50JDA')">
6
+ add
7
+ </sl-button>
8
+ <loading-handler :isLoading="cartState.isLoading" :isUpdating="cartState.isUpdating">
9
+ <div class="item-wrapper" v-if="state.items.length>0">
10
+ <cart-item v-for="item in state.items" :item="item"
11
+ :edit="!shopStore.state.order?.['is_checkout_in_progress']"
12
+ >
13
+
14
+ </cart-item>
15
+ </div>
16
+ <shop-alert v-else variant="info" duration="Infinity">
17
+ <template #alertMsg>
18
+ {{ $t('shop.cart_empty') }}
19
+ </template>
20
+ </shop-alert>
21
+ </loading-handler>
22
+
23
+ <slot
24
+ nextName="weiter"
25
+ :activefunction="()=>state.items.length>0"
26
+ :nextfunction="()=>true"
27
+ >
28
+ </slot>
29
+
30
+ </template>
31
+
32
+ <script setup>
33
+ import { useViurShopStore } from '../shop'
34
+ import {computed, onBeforeMount, onMounted, reactive, watch} from 'vue'
35
+ import { useCart } from '../composables/cart';
36
+ import LoadingHandler from '../components/LoadingHandler.vue';
37
+ import CartItem from '../components/CartItem.vue';
38
+ import CartItemSmall from '../components/CartItemSmall.vue';
39
+ import ShopAlert from '../components/ShopAlert.vue';
40
+
41
+ const shopStore = useViurShopStore()
42
+ const {fetchCart,addItem, state:cartState} = useCart()
43
+
44
+ const state = reactive({
45
+ items: computed(()=>shopStore.state.cartList.filter(i=>i['skel_type']==='leaf'))
46
+ })
47
+
48
+ onBeforeMount(()=>{
49
+ fetchCart()
50
+ })
51
+
52
+ </script>
53
+ <style scoped>
54
+ .item-wrapper{
55
+ display:flex;
56
+ flex-direction: column;
57
+ gap: 20px;
58
+ }
59
+
60
+ </style>
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <div class="bind">
3
+ <h1 class="viur-shop-success-headline headline">
4
+ {{ $t('shop.order_thanks') }}
5
+ </h1>
6
+ <p class="paragraph"><strong>{{ $t('shop.order_number') }}:</strong> {{ shopStore.state.order?.["order_uid"] }}</p>
7
+ <p class="paragraph" v-html=" $t('shop.order_message')">
8
+ </p>
9
+
10
+ <p class="paragraph" v-if="shopStore.state.order?.['is_paid']">
11
+ {{ $t('shop.order_paid') }}
12
+ </p>
13
+
14
+ <p class="paragraph" v-if="shopStore.state.order?.['is_rts']">
15
+ {{ $t('shop.order_ready_to_ship') }}
16
+ </p>
17
+ </div>
18
+ </template>
19
+
20
+ <script setup>
21
+ import {computed, reactive} from 'vue'
22
+ import { useViurShopStore } from '../shop';
23
+ const shopStore = useViurShopStore()
24
+ </script>
@@ -0,0 +1,295 @@
1
+ <template>
2
+ <div class="list">
3
+ <h2 class="viur-shop-cart-headline headline">{{ $t('shop.check_order')}}</h2>
4
+ <div class="viur-shop-cart-address-wrap">
5
+ <div class="viur-shop-cart-address">
6
+ <div class="viur-shop-cart-address-headline">
7
+ {{ $t('viur.shop.skeleton.cartnode.shipping_address') }}
8
+ </div>
9
+ <template v-if="state.shippingAddress">
10
+ {{ state.shippingAddress?.firstname }}
11
+ {{ state.shippingAddress?.lastname }}<br />
12
+ {{ state.shippingAddress?.street_name }}
13
+ {{ state.shippingAddress?.street_number }}<br />
14
+ {{ state.shippingAddress?.zip_code }}
15
+ {{ state.shippingAddress?.city }}<br />
16
+ {{ getDescrName('country',state.shippingAddress?.country) }}<br />
17
+ </template>
18
+ </div>
19
+ <div class="viur-shop-cart-address">
20
+ <div class="viur-shop-cart-address-headline">
21
+ {{ $t('viur.shop.skeleton.order.billing_address') }}
22
+ </div>
23
+ <template v-if="state.billingAddress">
24
+ {{ state.billingAddress.firstname }}
25
+ {{ state.billingAddress.lastname }}<br />
26
+ {{ state.billingAddress.street_name }}
27
+ {{ state.billingAddress.street_number }}<br />
28
+ {{ state.billingAddress.zip_code }}
29
+ {{ state.billingAddress.city }}<br />
30
+ {{ getDescrName('country',state.billingAddress.country) }}<br />
31
+ </template>
32
+ </div>
33
+ </div>
34
+
35
+ <div class="viur-shop-cart-payment">
36
+ <div class="viur-shop-cart-payment-method">
37
+ <span>{{ $t('viur.shop.skeleton.order.payment') }} </span>
38
+ <p>
39
+ {{ shopStore.state['paymentMeta']?.[state.payment]?.['title']}}
40
+ </p>
41
+ </div>
42
+ </div>
43
+
44
+ <div class="viur-shop-cart-payment">
45
+ <div class="viur-shop-cart-payment-method">
46
+ <span>{{ $t('viur.shop.module.shipping') }}</span>
47
+ <p>
48
+ {{ state.shipping?.name }}
49
+ -
50
+ <sl-format-number
51
+ type="currency"
52
+ currency="EUR"
53
+ :value="
54
+ state.shipping?.shipping_cost
55
+ "
56
+ lang="de"
57
+ >
58
+ </sl-format-number>
59
+ </p>
60
+ </div>
61
+ </div>
62
+
63
+ <sl-details :summary="$t('viur.shop.skeleton.order.cart')">
64
+ <cart-item-small v-for="item in state.cartList" :item="item">
65
+ </cart-item-small>
66
+ </sl-details>
67
+ </div>
68
+
69
+ <div class="wrapper">
70
+ <sl-button size="small" @click="startCheckout" :disabled="!shopStore.state.canCheckout" variant="success">{{ $t('shop.order_pay') }}</sl-button>
71
+ </div>
72
+
73
+ <template v-if="shopStore.state.order?.['payment_provider'] !== null && shopStore.state.order?.['payment_provider'].startsWith('unzer-')">
74
+ <sl-dialog v-if="state.paymentPopup" label="Zahlung" :open="state.paymentPopup" @sl-after-hide="state.paymentPopup=false">
75
+ <payment-provider-unzer @cancel="paymentCanceled"></payment-provider-unzer>
76
+ </sl-dialog>
77
+ </template>
78
+ </template>
79
+ <script setup>
80
+ import {computed, onBeforeMount, reactive, watch} from 'vue'
81
+ import { useViurShopStore } from '../shop';
82
+ import boneUtils from '@viur/vue-utils/bones/utils'
83
+ import {Request} from '@viur/vue-utils'
84
+ import CartItemSmall from '../components/CartItemSmall.vue';
85
+ import PaymentProviderUnzer from '../components/PaymentProviderUnzer.vue';
86
+ const shopStore = useViurShopStore()
87
+
88
+
89
+ // collected data from order Object > Session cart is not available anymore
90
+ const state = reactive({
91
+ shippingAddress: computed(()=>shopStore.state.order?.['cart']?.['dest']?.['shipping_address']?.['dest']),
92
+ shipping: computed(()=>shopStore.state.order?.['cart']?.['dest']?.['shipping']?.['dest']),
93
+ billingAddress: computed(()=>shopStore.state.order?.['billing_address']?.['dest']),
94
+ payment: computed(()=>shopStore.state.order?.['payment_provider']),
95
+ cartList:[],
96
+ paymentPopup:false
97
+ })
98
+
99
+
100
+ // simple wrapper for value rendering
101
+ function getDescrName(boneName, val) {
102
+ if (!shopStore.state.addressStructure || !val) return val
103
+ return boneUtils.getDescr(shopStore.state.addressStructure[boneName],val)
104
+ }
105
+
106
+ // fetch cart from order
107
+ function getOrderCart(){
108
+ let cartKey = shopStore.state.order?.['cart']?.['dest']?.['key']
109
+ Request.get(`${shopStore.state.shopApiUrl}/cart_list`,{dataObj:{
110
+ cart_key:cartKey
111
+ }}).then(async( resp) =>{
112
+ let data = await resp.json()
113
+ state.cartList=data
114
+ })
115
+ }
116
+
117
+ function paymentCanceled(){
118
+ state.paymentPopup=false
119
+ }
120
+
121
+ //open popup and freeze cart
122
+ function startCheckout(){
123
+ state.paymentPopup=true
124
+ shopStore.checkout()
125
+ }
126
+
127
+ //close popup if payment successfull
128
+ watch(()=>shopStore.state.order?.['is_paid'],(newVal,oldVal)=>{
129
+ if(newVal){
130
+ state.paymentPopup=false
131
+ }
132
+ })
133
+
134
+ onBeforeMount(()=>{
135
+ getOrderCart()
136
+ })
137
+
138
+ </script>
139
+
140
+ <style scoped>
141
+ .wrapper{
142
+ padding:20px;
143
+ }
144
+
145
+ .viur-shop-cart-sidebar-btn-wrap {
146
+ display: flex;
147
+ flex-direction: column;
148
+ margin-top: var(--sl-spacing-large);
149
+
150
+ sl-button {
151
+ margin-bottom: var(--sl-spacing-x-small);
152
+ }
153
+ }
154
+
155
+ sl-alert {
156
+ margin-top: var(--sl-spacing-medium);
157
+ margin-bottom: var(--sl-spacing-medium);
158
+ }
159
+
160
+ sl-tooltip {
161
+ &::part(body) {
162
+ line-height: 1.2;
163
+ font-weight: 400;
164
+ padding: 10px;
165
+ }
166
+ }
167
+
168
+ sl-menu-item {
169
+ &::part(base) {
170
+ padding: 0.2em 0.9em 0.2em 0.8em;
171
+ }
172
+
173
+ &::part(checked-icon) {
174
+ display: none;
175
+ }
176
+
177
+ &::part(prefix) {
178
+ margin-right: 10px;
179
+ }
180
+
181
+ &::part(suffix) {
182
+ margin-right: -1.5em;
183
+ }
184
+ }
185
+
186
+ .viur-shop-cart-sidebar-info-line {
187
+ display: flex;
188
+ flex-direction: row;
189
+ flex-wrap: nowrap;
190
+ margin: var(--sl-spacing-2x-small) 0;
191
+
192
+ span {
193
+ margin-right: auto;
194
+ }
195
+
196
+ &.total {
197
+ font-weight: 600;
198
+ border-top: 1px solid var(--sl-color-neutral-300);
199
+ border-bottom: 1px solid var(--sl-color-neutral-300);
200
+ padding: var(--sl-spacing-x-small) 0;
201
+ margin: var(--sl-spacing-small) 0;
202
+ }
203
+ }
204
+
205
+ .viur-shop-cart-mini-card {
206
+ margin-bottom: var(--sl-spacing-x-large);
207
+
208
+ &::part(header) {
209
+ border-bottom: none;
210
+ padding-top: 0;
211
+ padding-right: 0;
212
+ }
213
+
214
+ &::part(image) {
215
+ flex-basis: 25%;
216
+ max-width: 90px;
217
+ }
218
+
219
+ &::part(body) {
220
+ display: flex;
221
+ flex: 1;
222
+ padding-top: 0;
223
+ padding-bottom: 0;
224
+ padding-right: 0;
225
+ }
226
+
227
+ &::part(group) {
228
+ padding: var(--sl-spacing-small) 0;
229
+ }
230
+ }
231
+
232
+ .viur-shop-cart-mini-card-body-row {
233
+ display: grid;
234
+ grid-template-columns: 1fr auto auto;
235
+ gap: var(--sl-spacing-large);
236
+ flex: 1;
237
+ }
238
+
239
+ .viur-shop-cart-mini-card-body-info {
240
+ display: flex;
241
+ flex-direction: column;
242
+ height: 100%;
243
+ }
244
+
245
+ .viur-shop-cart-mini-card-info-wrap {
246
+ display: flex;
247
+ flex-wrap: nowrap;
248
+ gap: var(--sl-spacing-medium);
249
+ }
250
+
251
+ .viur-shop-cart-mini-card-info {
252
+ display: flex;
253
+ flex-direction: row;
254
+ flex-wrap: nowrap;
255
+
256
+ span {
257
+ margin-right: var(--sl-spacing-x-small);
258
+ font-weight: 600;
259
+ }
260
+ }
261
+
262
+ .viur-shop-cart-address-wrap {
263
+ display: grid;
264
+ grid-template-columns: 1fr 1fr;
265
+ gap: var(--sl-spacing-x-large);
266
+ margin-bottom: var(--sl-spacing-x-large);
267
+ }
268
+
269
+ .viur-shop-cart-address-headline {
270
+ display: flex;
271
+ flex-direction: row;
272
+ flex-wrap: nowrap;
273
+ align-items: center;
274
+ justify-content: space-between;
275
+ font-weight: 600;
276
+ }
277
+
278
+ .viur-shop-cart-payment {
279
+ display: flex;
280
+ flex-direction: row;
281
+ flex-wrap: nowrap;
282
+ align-items: center;
283
+ justify-content: space-between;
284
+ margin-bottom: var(--sl-spacing-x-large);
285
+
286
+ span {
287
+ font-weight: 600;
288
+ }
289
+ }
290
+
291
+ .viur-shop-cart-headline {
292
+ margin: 0 0 var(--sl-spacing-x-large) 0;
293
+ font-size: var(--shop-form-headline-size);
294
+ }
295
+ </style>
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <sl-radio-group :value="state.selection">
3
+ <sl-details-group>
4
+
5
+ <payment-option v-for="option in paymentState.paymentData" :key="option.id"
6
+ :paymenttype="option.paymenttype"
7
+ :name="option.name"
8
+ :icon="option.icon"
9
+ :widget="option.widget"
10
+ :description="option.description"
11
+ @change="optionChanged"
12
+
13
+ >
14
+ </payment-option>
15
+
16
+ </sl-details-group>
17
+ </sl-radio-group>
18
+
19
+ <slot
20
+ nextName="weiter"
21
+ :activefunction="()=>shopStore.state.order?.['payment_provider']"
22
+ :nextfunction="()=>true"
23
+ >
24
+ </slot>
25
+
26
+ </template>
27
+ <script setup>
28
+ import {computed, reactive, onBeforeMount} from 'vue'
29
+ import PaymentOption from "../components/PaymentOption.vue";
30
+ import {usePayment} from "../composables/payment";
31
+ import {useOrder} from "../composables/order";
32
+ import {useViurShopStore} from "../shop";
33
+
34
+ const {state:paymentState, fetchPaymentData} = usePayment()
35
+ const {addOrUpdateOrder} = useOrder()
36
+ const shopStore = useViurShopStore()
37
+
38
+ const state = reactive({
39
+ selection:null,
40
+ })
41
+
42
+ function optionChanged(type){
43
+ shopStore.state.order['payment_provider'] = null
44
+ state.selection=type
45
+ addOrUpdateOrder({payment_provider:type})
46
+ }
47
+
48
+ onBeforeMount(()=>{
49
+ fetchPaymentData().then(()=>{
50
+ state.selection = shopStore.state.order?.['payment_provider']
51
+ })
52
+ })
53
+ </script>
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <loading-handler :isLoading="shippingState.isLoading">
3
+
4
+ <card-selector :options="shippingState.shippingData"
5
+ v-model:selection="state.selectedShippingMethod"
6
+ @change="updateShippingMethod"
7
+ >
8
+ <template v-slot="{option, index}">
9
+ <img slot="image">
10
+ {{ option['dest']['name'] }} - Lieferzeit: {{ option['dest']['delivery_time_range'] }} Tage
11
+ </template>
12
+ </card-selector>
13
+ </loading-handler>
14
+ <slot
15
+ nextName="weiter"
16
+ :activefunction="()=>shopStore.state.cartRoot?.['shipping']"
17
+ :nextfunction="()=>true"
18
+ >
19
+ </slot>
20
+ </template>
21
+ <script setup>
22
+ import {reactive,onBeforeMount} from "vue";
23
+ import CardSelector from "../components/CardSelector.vue";
24
+ import LoadingHandler from "../../old/components/generic/loadinghandler.vue";
25
+ import {useShipping} from "../composables/shipping";
26
+ import {useCart} from "../composables/cart";
27
+ import {useViurShopStore} from "../shop";
28
+
29
+ const shopStore = useViurShopStore();
30
+ const {updateCart} = useCart();
31
+ const {state: shippingState,fetchShippingData} = useShipping();
32
+
33
+ const state = reactive({
34
+ selectedShippingMethod: null
35
+ })
36
+
37
+ function updateShippingMethod(selection){
38
+ shopStore.state.cartRoot['shipping'] = null
39
+ if (selection){
40
+ updateCart({shipping_key:selection['dest']['key']})
41
+ }
42
+ }
43
+
44
+ onBeforeMount(()=>{
45
+ fetchShippingData()
46
+ state.selectedShippingMethod = shopStore.state.cartRoot?.['shipping']
47
+ })
48
+ </script>
49
+
50
+
51
+ <style scoped>
52
+
53
+ </style>