@viur/shop-components 0.0.1-dev.6 → 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.
- package/.editorconfig +16 -0
- package/.github/workflows/npm-publish.yml +42 -0
- package/.gitmodules +3 -0
- package/LICENSE +21 -0
- package/README.md +13 -2
- package/old/client/HttpClient.js +111 -0
- package/old/client/ViURShopClient.js +472 -0
- package/old/client/index.js +23 -0
- package/old/client/types.js +10 -0
- package/old/components/ExampleUsage.vue +95 -0
- package/old/components/ShopCart.vue +91 -0
- package/old/components/ShopOrderComplete.vue +73 -0
- package/old/components/ShopOrderConfirm.vue +311 -0
- package/old/components/ShopOrderStepper.vue +352 -0
- package/old/components/ShopPaymentProvider.vue +113 -0
- package/old/components/ShopShippingMethod.vue +52 -0
- package/old/components/ShopSummary.vue +138 -0
- package/old/components/ShopUserData.vue +218 -0
- package/old/components/cart/CartLeaf.vue +277 -0
- package/old/components/cart/CartLeafModel.vue +312 -0
- package/old/components/cart/CartNode.vue +26 -0
- package/old/components/cart/CartTree.vue +67 -0
- package/old/components/cart/CartTreeWrapper.vue +73 -0
- package/old/components/cart/CartView.vue +82 -0
- package/old/components/cart/Discount.vue +91 -0
- package/old/components/generic/loadinghandler.vue +76 -0
- package/old/components/paymentProvider/paypalplus.vue +0 -0
- package/old/components/paymentProvider/prepayment.vue +0 -0
- package/old/components/paymentProvider/unzerPayment.vue +140 -0
- package/old/components/simple/ShopUserData.vue +161 -0
- package/old/components/simple/SimpleDefaultLayout.vue +116 -0
- package/old/components/ui/generic/CardSelector.vue +52 -0
- package/old/components/ui/generic/CartList.vue +69 -0
- package/old/components/ui/generic/ShippingInfo.vue +56 -0
- package/old/components/ui/generic/ShopPriceFormatter.vue +41 -0
- package/old/components/ui/generic/alerts/ShopAlert.vue +30 -0
- package/old/components/ui/payment/PaymentOption.vue +79 -0
- package/old/components/ui/payment/PaymentSelector.vue +158 -0
- package/old/components/ui/stepper/StepperItem.vue +90 -0
- package/old/components/ui/stepper/StepperTab.vue +161 -0
- package/old/components/ui/stepper/StepperTrigger.vue +69 -0
- package/old/components/ui/userdata/AddForm.vue +160 -0
- package/old/components/ui/userdata/AddressBox.vue +137 -0
- package/old/components/ui/userdata/BaseLayout.vue +77 -0
- package/old/components/ui/userdata/CustomBooleanBone.vue +58 -0
- package/old/components/ui/userdata/CustomSelectBone.vue +91 -0
- package/old/components/ui/userdata/CustomStringBone.vue +71 -0
- package/old/components/ui/userdata/DefaultLayout.vue +126 -0
- package/old/components/ui/userdata/SelectAddress.vue +21 -0
- package/old/components/ui/userdata/multi/ActionBar.vue +38 -0
- package/old/components/ui/userdata/multi/CartSelection.vue +42 -0
- package/old/ignite/.editorconfig +20 -0
- package/old/ignite/.github/workflows/ignite.yml +64 -0
- package/old/ignite/.github/workflows/node.yml +30 -0
- package/old/ignite/.postcssrc.cjs +25 -0
- package/old/ignite/CHANGELOG.md +244 -0
- package/old/ignite/LICENSE +21 -0
- package/old/ignite/README.md +92 -0
- package/old/ignite/dist/ignite.css +2019 -0
- package/old/ignite/dist/ignite.min.css +4 -0
- package/old/ignite/foundation/basic.css +371 -0
- package/old/ignite/foundation/color.css +323 -0
- package/old/ignite/foundation/config.css +188 -0
- package/old/ignite/foundation/grid.css +78 -0
- package/old/ignite/foundation/mediaqueries.css +71 -0
- package/old/ignite/foundation/reset.css +261 -0
- package/old/ignite/ignite.css +29 -0
- package/old/ignite/ignite.css.map +1 -0
- package/old/ignite/package-lock.json +5530 -0
- package/old/ignite/package.json +58 -0
- package/old/ignite/shoelace.css +19 -0
- package/old/ignite/themes/dark.css +12 -0
- package/old/ignite/themes/light.css +11 -0
- package/old/ignite/utilities/shoelace.css +537 -0
- package/old/ignite/utilities/utilities.css +24 -0
- package/old/stores/address.js +122 -0
- package/old/stores/cart.js +266 -0
- package/old/stores/message.js +21 -0
- package/old/stores/order.js +202 -0
- package/old/stores/payment.js +79 -0
- package/old/stores/shipping.js +78 -0
- package/package.json +23 -23
- package/src/Shop.vue +212 -0
- package/src/ShopOrderStepper.vue +89 -0
- package/src/ShopSummary.vue +170 -0
- package/src/Steps/ShopCart.vue +60 -0
- package/src/Steps/ShopOrderComplete.vue +24 -0
- package/src/Steps/ShopOrderConfirm.vue +295 -0
- package/src/Steps/ShopPaymentProvider.vue +53 -0
- package/src/Steps/ShopShippingMethod.vue +53 -0
- package/src/Steps/ShopUserDataGuest.vue +78 -0
- package/src/Steps/index.js +15 -0
- package/src/components/AddressForm.vue +84 -0
- package/src/components/AddressFormLayout.vue +107 -0
- package/src/components/CardSelector.vue +68 -0
- package/src/components/CartItem.vue +325 -0
- package/src/components/CartItemSmall.vue +257 -0
- package/src/components/LoadingHandler.vue +76 -0
- package/src/components/PaymentOption.vue +78 -0
- package/src/components/PaymentProviderUnzer.vue +201 -0
- package/src/components/PaymentSelector.vue +55 -0
- package/src/components/ShopAlert.vue +30 -0
- package/src/components/StepperTab.vue +132 -0
- package/src/components/dialogButton.vue +49 -0
- package/src/composables/address.js +95 -0
- package/src/composables/cart.js +132 -0
- package/src/composables/order.js +80 -0
- package/src/composables/payment.js +75 -0
- package/src/composables/shipping.js +32 -0
- package/src/main.js +44 -0
- package/src/shop.js +251 -0
- package/src/translations/de.js +15 -0
- package/src/translations/en.js +5 -0
- package/src/utils.js +49 -0
- package/vite.config.js +51 -0
- package/src/components/cart/CartView.vue +0 -692
- package/src/components/cart/ConfirmView.vue +0 -314
- package/src/components/order/category/CategoryList.vue +0 -83
- package/src/components/order/category/CategoryView.vue +0 -143
- package/src/components/order/information/UserInfoMulti.vue +0 -427
- package/src/components/order/information/UserInformation.vue +0 -332
- package/src/components/order/information/adress/ShippingAdress.vue +0 -143
- package/src/components/order/item/ItemCard.vue +0 -168
- package/src/components/order/item/ItemView.vue +0 -233
- package/src/components/order/process/ExampleUsage.vue +0 -100
- package/src/components/order/process/OrderComplete.vue +0 -41
- package/src/components/order/process/OrderTabHeader.vue +0 -7
- package/src/components/order/process/OrderView.vue +0 -210
- package/src/router/index.js +0 -103
- package/src/stores/cart.js +0 -111
- package/src/views/ViewMissing.vue +0 -20
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
HTTPError,
|
|
3
|
+
request,
|
|
4
|
+
getSkey,
|
|
5
|
+
errorHandler,
|
|
6
|
+
} from './HttpClient.js'
|
|
7
|
+
import {
|
|
8
|
+
ViURShopClient,
|
|
9
|
+
} from './ViURShopClient.js'
|
|
10
|
+
import {
|
|
11
|
+
CartType,
|
|
12
|
+
CustomerType,
|
|
13
|
+
} from './types.js';
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
HTTPError,
|
|
17
|
+
request,
|
|
18
|
+
getSkey,
|
|
19
|
+
errorHandler,
|
|
20
|
+
ViURShopClient,
|
|
21
|
+
CartType,
|
|
22
|
+
CustomerType,
|
|
23
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sl-spinner v-if="!rootNode"></sl-spinner>
|
|
3
|
+
<shop-order-stepper
|
|
4
|
+
:tabs="state.tabs"
|
|
5
|
+
@tabChange="handleTabs"
|
|
6
|
+
:sidebar="true"
|
|
7
|
+
:sidebar-bottom="false"
|
|
8
|
+
:show-discount="true"
|
|
9
|
+
:custom-shipping-component="state.customShipping"
|
|
10
|
+
v-else
|
|
11
|
+
>
|
|
12
|
+
<!-- customize slots -->
|
|
13
|
+
<!-- <template #main> The Order Stepper </template> -->
|
|
14
|
+
<!-- <template #trigger> Buttons for Stepper control </template> -->
|
|
15
|
+
<!-- <template #sidebar> the side/bottom bar </template> -->
|
|
16
|
+
</shop-order-stepper>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup>
|
|
20
|
+
import { onBeforeMount, reactive, shallowRef, computed } from "vue";
|
|
21
|
+
|
|
22
|
+
import ShopCart from "./ShopCart.vue";
|
|
23
|
+
import ShopOrderConfirm from "./ShopOrderConfirm.vue";
|
|
24
|
+
import ShopOrderStepper from "./ShopOrderStepper.vue";
|
|
25
|
+
import ShopOrderComplete from "./ShopOrderComplete.vue";
|
|
26
|
+
import ShopUserData from "./ShopUserData.vue";
|
|
27
|
+
import ShopPaymentProvider from "./ShopPaymentProvider.vue";
|
|
28
|
+
import ShopShippingMethod from "./ShopShippingMethod.vue";
|
|
29
|
+
|
|
30
|
+
import { useCartStore } from "../stores/cart";
|
|
31
|
+
|
|
32
|
+
const cartStore = useCartStore();
|
|
33
|
+
|
|
34
|
+
const rootNode = computed(() =>
|
|
35
|
+
cartStore.state.basket.key ? cartStore.state.basket.key : "",
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const state = reactive({
|
|
39
|
+
tabs: {
|
|
40
|
+
cart: {
|
|
41
|
+
component: shallowRef(ShopCart),
|
|
42
|
+
displayName: "Warenkorb",
|
|
43
|
+
props: {
|
|
44
|
+
standalone: false,
|
|
45
|
+
cartKey: rootNode,
|
|
46
|
+
},
|
|
47
|
+
icon: { name: "bag" },
|
|
48
|
+
position: 1,
|
|
49
|
+
},
|
|
50
|
+
userData: {
|
|
51
|
+
component: shallowRef(ShopUserData),
|
|
52
|
+
props: {
|
|
53
|
+
multiMode: false,
|
|
54
|
+
},
|
|
55
|
+
displayName: "Daten Eingeben",
|
|
56
|
+
icon: { name: "card-list" },
|
|
57
|
+
position: 2, //reihfolge ändern
|
|
58
|
+
},
|
|
59
|
+
selectShippingMethod: {
|
|
60
|
+
component: shallowRef(ShopShippingMethod),
|
|
61
|
+
displayName: "Versandart wählen",
|
|
62
|
+
icon: { name: "truck" },
|
|
63
|
+
position: 3,
|
|
64
|
+
},
|
|
65
|
+
selectPaymentProvider: {
|
|
66
|
+
component: shallowRef(ShopPaymentProvider),
|
|
67
|
+
props: {},
|
|
68
|
+
displayName: "Zahlungsart auswählen",
|
|
69
|
+
icon: { name: "card-list" },
|
|
70
|
+
position: 4, //reihfolge ändern
|
|
71
|
+
},
|
|
72
|
+
orderConfirm: {
|
|
73
|
+
component: shallowRef(ShopOrderConfirm),
|
|
74
|
+
props: {},
|
|
75
|
+
displayName: "Bestellung prüfen",
|
|
76
|
+
icon: { name: "clipboard-check" },
|
|
77
|
+
position: 5,
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
orderComplete: {
|
|
81
|
+
component: shallowRef(ShopOrderComplete),
|
|
82
|
+
props: {},
|
|
83
|
+
displayName: "Bestellung Abgeschlossen",
|
|
84
|
+
icon: { name: "bag-check" },
|
|
85
|
+
position: 6,
|
|
86
|
+
showNext: false,
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
onBeforeMount(async () => {
|
|
92
|
+
await cartStore.setConfig("shop", "path/to/placeholder");
|
|
93
|
+
await cartStore.init(false, false);
|
|
94
|
+
});
|
|
95
|
+
</script>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sl-spinner v-if="state.loading"></sl-spinner>
|
|
3
|
+
<CartTree v-model="state.data" v-else-if="!state.loading && tree"></CartTree>
|
|
4
|
+
<CartView
|
|
5
|
+
v-model="state.data"
|
|
6
|
+
:standalone="standalone"
|
|
7
|
+
:customComponent="customComponent"
|
|
8
|
+
v-else
|
|
9
|
+
>
|
|
10
|
+
</CartView>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup>
|
|
14
|
+
import { reactive, onBeforeMount, watch } from "vue";
|
|
15
|
+
import { useCartStore } from "../stores/cart.js";
|
|
16
|
+
import { useOrderStore } from "../stores/order.js";
|
|
17
|
+
import CartTree from "./cart/CartTree.vue";
|
|
18
|
+
import CartView from "./cart/CartView.vue";
|
|
19
|
+
|
|
20
|
+
const props = defineProps({
|
|
21
|
+
tree: { type: Boolean, default: false },
|
|
22
|
+
cartKey: { type: String },
|
|
23
|
+
standalone: { type: Boolean, default: true },
|
|
24
|
+
customComponent: { default: undefined },
|
|
25
|
+
});
|
|
26
|
+
const emits = defineEmits(["valid", "invalid"]);
|
|
27
|
+
|
|
28
|
+
const cartStore = useCartStore();
|
|
29
|
+
const orderStore = useOrderStore();
|
|
30
|
+
|
|
31
|
+
const state = reactive({
|
|
32
|
+
currentItem: {},
|
|
33
|
+
currentNode: {},
|
|
34
|
+
data: [],
|
|
35
|
+
loading: true,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
async function getChildren(parentKey = props.cartKey) {
|
|
39
|
+
state.loading = true;
|
|
40
|
+
if (orderStore.state.currentbasketKey && orderStore.state.currentbasketKey!==props.cartKey){
|
|
41
|
+
parentKey = orderStore.state.currentbasketKey
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const children = await cartStore.getChildren(parentKey);
|
|
45
|
+
|
|
46
|
+
children.forEach(async (child) => {
|
|
47
|
+
if (child.skel_type === "node") {
|
|
48
|
+
if (!Object.keys(cartStore.state.childrenByNode.includes(parentKey))) {
|
|
49
|
+
cartStore.state.childrenByNode[parentKey] = [];
|
|
50
|
+
}
|
|
51
|
+
cartStore.state.childrenByNode[parentKey].push(child);
|
|
52
|
+
state.data.push(child);
|
|
53
|
+
await getChildren(child.key);
|
|
54
|
+
} else {
|
|
55
|
+
state.data.push(child);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
state.loading = false;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function getCart() {
|
|
62
|
+
state.data = [];
|
|
63
|
+
await getChildren();
|
|
64
|
+
if (state.data.length) {
|
|
65
|
+
state.data.push(cartStore.state.basket);
|
|
66
|
+
emits("valid", true);
|
|
67
|
+
} else {
|
|
68
|
+
emits("valid", false);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
watch(
|
|
73
|
+
() => props.cartKey,
|
|
74
|
+
async (newVal, oldVal) => {
|
|
75
|
+
if (newVal) {
|
|
76
|
+
await getCart();
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
onBeforeMount(async () => {
|
|
82
|
+
if (!props.standalone) {
|
|
83
|
+
await getCart();
|
|
84
|
+
}
|
|
85
|
+
if (props.cartKey && props.standalone) {
|
|
86
|
+
await getCart();
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
</script>
|
|
90
|
+
|
|
91
|
+
<style scoped></style>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bind">
|
|
3
|
+
<h1 class="viur-shop-success-headline headline">
|
|
4
|
+
Vielen Dank für Ihre Bestellung
|
|
5
|
+
</h1>
|
|
6
|
+
<p class="paragraph"><strong>Ihre Bestellnummer:</strong> 123345670</p>
|
|
7
|
+
<p class="paragraph">
|
|
8
|
+
Wir haben Ihre Bestellung erhalten und werden diese schenllstmöglich
|
|
9
|
+
bearbeiten.<br />
|
|
10
|
+
Sie erhalten in wenigen Minuten eine Bestätigung per E-Mail.
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
class="viur-shop-order-complete-slot"
|
|
15
|
+
v-if="additionalComponents.length"
|
|
16
|
+
>
|
|
17
|
+
<template v-for="component in additionalComponents">
|
|
18
|
+
<component
|
|
19
|
+
:is="component.component"
|
|
20
|
+
v-bind="component.props ? component.props : ''"
|
|
21
|
+
>
|
|
22
|
+
</component>
|
|
23
|
+
</template>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div class="btn-wrap">
|
|
27
|
+
<sl-button size="medium" @click="goToStart()"> Zur Startseite </sl-button>
|
|
28
|
+
|
|
29
|
+
<sl-button variant="primary" @click="goToShop()" size="medium">
|
|
30
|
+
Weiter Einkaufen
|
|
31
|
+
</sl-button>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script setup>
|
|
37
|
+
const props = defineProps({
|
|
38
|
+
redirectUrl: {
|
|
39
|
+
type: String,
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
additionalComponents: {
|
|
43
|
+
type: Array,
|
|
44
|
+
default: [],
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
const emit = defineEmits(["goToStart"]);
|
|
48
|
+
|
|
49
|
+
function goToStart() {
|
|
50
|
+
emit("goToStart");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function goToShop() {
|
|
54
|
+
window.location.href = props.redirectUrl;
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<style scoped>
|
|
59
|
+
.btn-wrap {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: row;
|
|
62
|
+
flex-wrap: nowrap;
|
|
63
|
+
justify-content: space-between;
|
|
64
|
+
width: 100%;
|
|
65
|
+
|
|
66
|
+
margin-top: var(--sl-spacing-x-large);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.viur-shop-success-headline {
|
|
70
|
+
margin: 0 0 var(--sl-spacing-x-large) 0;
|
|
71
|
+
font-size: var(--shop-success-headline-size);
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="list">
|
|
3
|
+
<h2 class="viur-shop-cart-headline headline">Bestellung prüfen</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
|
+
Versandadresse
|
|
8
|
+
<!-- <sl-button
|
|
9
|
+
outline
|
|
10
|
+
size="small"
|
|
11
|
+
@click="editShippingAddress(tabName)"
|
|
12
|
+
>
|
|
13
|
+
<sl-icon name="pencil" slot="prefix"></sl-icon>
|
|
14
|
+
</sl-button> -->
|
|
15
|
+
</div>
|
|
16
|
+
{{ addressStore.state.active.shipping.firstname }}
|
|
17
|
+
{{ addressStore.state.active.shipping.lastname }}<br />
|
|
18
|
+
{{ addressStore.state.active.shipping.street_name }}
|
|
19
|
+
{{ addressStore.state.active.shipping.street_number }}<br />
|
|
20
|
+
{{ addressStore.state.active.shipping.zip_code }}
|
|
21
|
+
{{ addressStore.state.active.shipping.city }}<br />
|
|
22
|
+
{{ getCountryName(addressStore.state.active.shipping.country) }}<br />
|
|
23
|
+
</div>
|
|
24
|
+
<div class="viur-shop-cart-address">
|
|
25
|
+
<div class="viur-shop-cart-address-headline">
|
|
26
|
+
Rechnungsadresse
|
|
27
|
+
<sl-button outline size="small">
|
|
28
|
+
<sl-icon name="pencil" slot="prefix"></sl-icon>
|
|
29
|
+
</sl-button>
|
|
30
|
+
</div>
|
|
31
|
+
{{ addressStore.state.active.billing.firstname }}
|
|
32
|
+
{{ addressStore.state.active.billing.lastname }}<br />
|
|
33
|
+
{{ addressStore.state.active.billing.street_name }}
|
|
34
|
+
{{ addressStore.state.active.billing.street_number }}<br />
|
|
35
|
+
{{ addressStore.state.active.billing.zip_code }}
|
|
36
|
+
{{ addressStore.state.active.billing.city }}<br />
|
|
37
|
+
{{ getCountryName(addressStore.state.active.billing.country) }}<br />
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div class="viur-shop-cart-payment">
|
|
42
|
+
<div class="viur-shop-cart-payment-method">
|
|
43
|
+
<span>Zahlungsmethode:</span>
|
|
44
|
+
<img
|
|
45
|
+
:src="state.selectedPaymentProvider[1].image_path"
|
|
46
|
+
style="width: 100px"
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
<sl-button outline size="small">
|
|
50
|
+
<sl-icon name="pencil" slot="prefix"></sl-icon>
|
|
51
|
+
</sl-button>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div class="viur-shop-cart-payment">
|
|
55
|
+
<div class="viur-shop-cart-payment-method">
|
|
56
|
+
<span>Versandart:</span>
|
|
57
|
+
<p>
|
|
58
|
+
{{ shippingStore.state.selectedShippingMethod.dest.name }}
|
|
59
|
+
-
|
|
60
|
+
<sl-format-number
|
|
61
|
+
type="currency"
|
|
62
|
+
currency="EUR"
|
|
63
|
+
:value="
|
|
64
|
+
shippingStore.state.selectedShippingMethod.dest.shipping_cost
|
|
65
|
+
"
|
|
66
|
+
lang="de"
|
|
67
|
+
>
|
|
68
|
+
</sl-format-number>
|
|
69
|
+
</p>
|
|
70
|
+
</div>
|
|
71
|
+
<sl-button outline size="small">
|
|
72
|
+
<sl-icon name="pencil" slot="prefix"></sl-icon>
|
|
73
|
+
</sl-button>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<h2 class="viur-shop-cart-headline headline">Warenkorb</h2>
|
|
77
|
+
|
|
78
|
+
<sl-spinner v-if="state.loading"></sl-spinner>
|
|
79
|
+
<CartList :list="state.data" :limit="1" v-else></CartList>
|
|
80
|
+
<sl-button size="small" @click=""> Zahlungspflichtig bestellen </sl-button>
|
|
81
|
+
</div>
|
|
82
|
+
</template>
|
|
83
|
+
|
|
84
|
+
<script setup>
|
|
85
|
+
import { computed, onBeforeMount, reactive } from "vue";
|
|
86
|
+
import CartList from "./ui/generic/CartList.vue";
|
|
87
|
+
import { usePaymentStore } from "../stores/payment.js";
|
|
88
|
+
import { useAddressStore } from "../stores/address.js";
|
|
89
|
+
import { useOrderStore } from "../stores/order.js";
|
|
90
|
+
import { useCartStore } from "../stores/cart.js";
|
|
91
|
+
import { useShippingStore } from "../stores/shipping.js";
|
|
92
|
+
|
|
93
|
+
const emit = defineEmits(["editAddress"]);
|
|
94
|
+
|
|
95
|
+
const props = defineProps({});
|
|
96
|
+
|
|
97
|
+
const cartStore = useCartStore();
|
|
98
|
+
const paymentStore = usePaymentStore();
|
|
99
|
+
const addressStore = useAddressStore();
|
|
100
|
+
const orderStore = useOrderStore();
|
|
101
|
+
const shippingStore = useShippingStore();
|
|
102
|
+
|
|
103
|
+
// const searchWarning = ref()
|
|
104
|
+
const state = reactive({
|
|
105
|
+
loading: true,
|
|
106
|
+
selectedPaymentProvider: computed(() => {
|
|
107
|
+
/* fixme this compute generates an error
|
|
108
|
+
Uncaught (in promise) TypeError: Cannot set properties of null (setting '__vnode')
|
|
109
|
+
but the value is correct.
|
|
110
|
+
*/
|
|
111
|
+
return paymentStore.state.paymentSelection;
|
|
112
|
+
}),
|
|
113
|
+
images: {},
|
|
114
|
+
showOrderButton: false,
|
|
115
|
+
data: [],
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
function editShippingAddress(e) {
|
|
119
|
+
emit("editAddress", e);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function getCountryName(val) {
|
|
123
|
+
if (!addressStore.state.structure || !val) {
|
|
124
|
+
return val;
|
|
125
|
+
}
|
|
126
|
+
for (const country of addressStore.state.structure.country.values) {
|
|
127
|
+
if (val === country[0]) {
|
|
128
|
+
return country[1];
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return val;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
async function getOrderCart(
|
|
135
|
+
parentKey = orderStore.state.currentOrder.cart.dest.key,
|
|
136
|
+
) {
|
|
137
|
+
state.loading = true;
|
|
138
|
+
const children = await cartStore.getChildren(parentKey);
|
|
139
|
+
|
|
140
|
+
children.forEach(async (child) => {
|
|
141
|
+
if (child.skel_type === "node") {
|
|
142
|
+
if (!Object.keys(cartStore.state.childrenByNode.includes(parentKey))) {
|
|
143
|
+
cartStore.state.childrenByNode[parentKey] = [];
|
|
144
|
+
}
|
|
145
|
+
cartStore.state.childrenByNode[parentKey].push(child);
|
|
146
|
+
state.data.push(child);
|
|
147
|
+
await getChildren(child.key);
|
|
148
|
+
} else {
|
|
149
|
+
state.data.push(child);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
state.loading = false;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
onBeforeMount(async () => {
|
|
156
|
+
await getOrderCart();
|
|
157
|
+
});
|
|
158
|
+
</script>
|
|
159
|
+
|
|
160
|
+
<style scoped>
|
|
161
|
+
.viur-shop-cart-sidebar-btn-wrap {
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-direction: column;
|
|
164
|
+
margin-top: var(--sl-spacing-large);
|
|
165
|
+
|
|
166
|
+
sl-button {
|
|
167
|
+
margin-bottom: var(--sl-spacing-x-small);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
sl-alert {
|
|
172
|
+
margin-top: var(--sl-spacing-medium);
|
|
173
|
+
margin-bottom: var(--sl-spacing-medium);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
sl-tooltip {
|
|
177
|
+
&::part(body) {
|
|
178
|
+
line-height: 1.2;
|
|
179
|
+
font-weight: 400;
|
|
180
|
+
padding: 10px;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
sl-menu-item {
|
|
185
|
+
&::part(base) {
|
|
186
|
+
padding: 0.2em 0.9em 0.2em 0.8em;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&::part(checked-icon) {
|
|
190
|
+
display: none;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&::part(prefix) {
|
|
194
|
+
margin-right: 10px;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&::part(suffix) {
|
|
198
|
+
margin-right: -1.5em;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.viur-shop-cart-sidebar-info-line {
|
|
203
|
+
display: flex;
|
|
204
|
+
flex-direction: row;
|
|
205
|
+
flex-wrap: nowrap;
|
|
206
|
+
margin: var(--sl-spacing-2x-small) 0;
|
|
207
|
+
|
|
208
|
+
span {
|
|
209
|
+
margin-right: auto;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
&.total {
|
|
213
|
+
font-weight: 600;
|
|
214
|
+
border-top: 1px solid var(--sl-color-neutral-300);
|
|
215
|
+
border-bottom: 1px solid var(--sl-color-neutral-300);
|
|
216
|
+
padding: var(--sl-spacing-x-small) 0;
|
|
217
|
+
margin: var(--sl-spacing-small) 0;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.viur-shop-cart-mini-card {
|
|
222
|
+
margin-bottom: var(--sl-spacing-x-large);
|
|
223
|
+
|
|
224
|
+
&::part(header) {
|
|
225
|
+
border-bottom: none;
|
|
226
|
+
padding-top: 0;
|
|
227
|
+
padding-right: 0;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
&::part(image) {
|
|
231
|
+
flex-basis: 25%;
|
|
232
|
+
max-width: 90px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
&::part(body) {
|
|
236
|
+
display: flex;
|
|
237
|
+
flex: 1;
|
|
238
|
+
padding-top: 0;
|
|
239
|
+
padding-bottom: 0;
|
|
240
|
+
padding-right: 0;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
&::part(group) {
|
|
244
|
+
padding: var(--sl-spacing-small) 0;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.viur-shop-cart-mini-card-body-row {
|
|
249
|
+
display: grid;
|
|
250
|
+
grid-template-columns: 1fr auto auto;
|
|
251
|
+
gap: var(--sl-spacing-large);
|
|
252
|
+
flex: 1;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.viur-shop-cart-mini-card-body-info {
|
|
256
|
+
display: flex;
|
|
257
|
+
flex-direction: column;
|
|
258
|
+
height: 100%;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.viur-shop-cart-mini-card-info-wrap {
|
|
262
|
+
display: flex;
|
|
263
|
+
flex-wrap: nowrap;
|
|
264
|
+
gap: var(--sl-spacing-medium);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.viur-shop-cart-mini-card-info {
|
|
268
|
+
display: flex;
|
|
269
|
+
flex-direction: row;
|
|
270
|
+
flex-wrap: nowrap;
|
|
271
|
+
|
|
272
|
+
span {
|
|
273
|
+
margin-right: var(--sl-spacing-x-small);
|
|
274
|
+
font-weight: 600;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.viur-shop-cart-address-wrap {
|
|
279
|
+
display: grid;
|
|
280
|
+
grid-template-columns: 1fr 1fr;
|
|
281
|
+
gap: var(--sl-spacing-x-large);
|
|
282
|
+
margin-bottom: var(--sl-spacing-x-large);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.viur-shop-cart-address-headline {
|
|
286
|
+
display: flex;
|
|
287
|
+
flex-direction: row;
|
|
288
|
+
flex-wrap: nowrap;
|
|
289
|
+
align-items: center;
|
|
290
|
+
justify-content: space-between;
|
|
291
|
+
font-weight: 600;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.viur-shop-cart-payment {
|
|
295
|
+
display: flex;
|
|
296
|
+
flex-direction: row;
|
|
297
|
+
flex-wrap: nowrap;
|
|
298
|
+
align-items: center;
|
|
299
|
+
justify-content: space-between;
|
|
300
|
+
margin-bottom: var(--sl-spacing-x-large);
|
|
301
|
+
|
|
302
|
+
span {
|
|
303
|
+
font-weight: 600;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.viur-shop-cart-headline {
|
|
308
|
+
margin: 0 0 var(--sl-spacing-x-large) 0;
|
|
309
|
+
font-size: var(--shop-form-headline-size);
|
|
310
|
+
}
|
|
311
|
+
</style>
|