@viur/shop-components 0.0.1-dev.3 → 0.0.1-dev.30
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/package.json +8 -37
- package/src/components/cart/CartLeaf.vue +195 -0
- package/src/components/cart/CartNode.vue +13 -0
- package/src/components/cart/CartView.vue +701 -0
- package/src/components/cart/ConfirmView.vue +314 -0
- package/src/components/order/category/CategoryList.vue +83 -0
- package/src/components/order/category/CategoryView.vue +143 -0
- package/src/components/order/information/UserInfoMulti.vue +427 -0
- package/src/components/order/information/UserInformation.vue +332 -0
- package/src/components/order/information/adress/ShippingAdress.vue +143 -0
- package/src/components/order/item/ItemCard.vue +168 -0
- package/src/components/order/item/ItemView.vue +233 -0
- package/src/components/order/process/ExampleUsage.vue +111 -0
- package/src/components/order/process/OrderComplete.vue +41 -0
- package/src/components/order/process/OrderTabHeader.vue +7 -0
- package/src/components/order/process/OrderView.vue +210 -0
- package/src/router/index.js +103 -0
- package/src/stores/cart.js +112 -0
- package/src/views/ViewMissing.vue +20 -0
- package/dist/shop-components.js +0 -36284
- package/dist/shop-components.umd.cjs +0 -6974
- package/dist/style.css +0 -1
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="wrap">
|
|
3
|
+
<div class="viur-shop-item-view-image-wrap">
|
|
4
|
+
<sl-carousel class="viur-shop-item-view-carousel-thumbnails" navigation loop>
|
|
5
|
+
<sl-carousel-item>
|
|
6
|
+
<img
|
|
7
|
+
:alt="state.item.shop_name"
|
|
8
|
+
:src="getImage(state.item)"
|
|
9
|
+
/>
|
|
10
|
+
</sl-carousel-item>
|
|
11
|
+
</sl-carousel>
|
|
12
|
+
|
|
13
|
+
<div class="viur-shop-item-view-thumbnails">
|
|
14
|
+
<div class="viur-shop-item-view-thumbnails-scroller">
|
|
15
|
+
<img :alt="state.item.shop_name"
|
|
16
|
+
class="viur-shop-item-view-thumbnails-image active"
|
|
17
|
+
:src="getImage(state.item)" />
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div class="viur-shop-item-view-info-wrap">
|
|
23
|
+
<h1 class="viur-shop-item-view-headline">{{ state.item.shop_name }}</h1>
|
|
24
|
+
<h2 class="viur-shop-item-view-subline">B 21 x H 6,5 x T 19 cm</h2>
|
|
25
|
+
|
|
26
|
+
<div class="viur-shop-item-view-price">
|
|
27
|
+
{{ state.item.shop_price_retail }} €
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div class="viur-shop-item-view-paragraph">
|
|
31
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
|
|
32
|
+
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
|
|
33
|
+
sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
|
|
34
|
+
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit
|
|
35
|
+
amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
|
|
36
|
+
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
|
37
|
+
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
|
|
38
|
+
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div class="viur-shop-item-view-btn-wrap">
|
|
42
|
+
<sl-button
|
|
43
|
+
size="small"
|
|
44
|
+
class="viur-shop-item-view-add-to-cart-btn"
|
|
45
|
+
variant="primary"
|
|
46
|
+
title="Add to cart"
|
|
47
|
+
@click.stop="cartStore.addToCart(item.key, cartStore.state.currentCart)"
|
|
48
|
+
>
|
|
49
|
+
<sl-icon name="bag-plus"
|
|
50
|
+
slot="prefix"
|
|
51
|
+
></sl-icon>
|
|
52
|
+
|
|
53
|
+
In den Warenkorb
|
|
54
|
+
</sl-button>
|
|
55
|
+
|
|
56
|
+
<sl-button
|
|
57
|
+
size="small"
|
|
58
|
+
outline
|
|
59
|
+
class="viur-shop-item-view-add-to-favourites-btn"
|
|
60
|
+
variant="primary"
|
|
61
|
+
title="Add to favourites"
|
|
62
|
+
>
|
|
63
|
+
<sl-icon name="heart"
|
|
64
|
+
slot="prefix"
|
|
65
|
+
></sl-icon>
|
|
66
|
+
Auf die Wunschliste
|
|
67
|
+
</sl-button>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
</div>
|
|
72
|
+
<br>
|
|
73
|
+
<h1 class="viur-shop-item-view-headline">Ähnliche Artikel</h1>
|
|
74
|
+
<div class="viur-shop-item-view-item-grid">
|
|
75
|
+
<ItemCard :item="state.item">
|
|
76
|
+
</ItemCard>
|
|
77
|
+
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
</template>
|
|
81
|
+
|
|
82
|
+
<script setup>
|
|
83
|
+
import { computed, onBeforeMount, reactive } from "vue";
|
|
84
|
+
import { Request } from "@viur/vue-utils";
|
|
85
|
+
import { useRoute } from "vue-router";
|
|
86
|
+
// component imports
|
|
87
|
+
import ItemCard from "../item/ItemCard.vue";
|
|
88
|
+
import '@viur/shoelace/dist/components/carousel/carousel.js';
|
|
89
|
+
|
|
90
|
+
const route = useRoute();
|
|
91
|
+
|
|
92
|
+
const state = reactive({
|
|
93
|
+
item: {},
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
function getImage(item) {
|
|
97
|
+
console.log("hier", item.dk_artikel);
|
|
98
|
+
let imageUrl =
|
|
99
|
+
"https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80";
|
|
100
|
+
if (item?.dk_artikel.dest.image) {
|
|
101
|
+
return Request.downloadUrlFor(item.dk_artikel.dest.image);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return imageUrl;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
onBeforeMount(async () => {
|
|
108
|
+
Request.get(`/json/variante/view/${route.params.item}`).then(async (resp) => {
|
|
109
|
+
let data = await resp.json();
|
|
110
|
+
|
|
111
|
+
state.item = data.values;
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
</script>
|
|
115
|
+
|
|
116
|
+
<style scoped>
|
|
117
|
+
.wrap{
|
|
118
|
+
display: grid;
|
|
119
|
+
grid-template-columns: 45% minmax(0 ,1fr);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.viur-shop-item-view-info-wrap{
|
|
123
|
+
padding: var(--sl-spacing-x-large);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.viur-shop-item-view-image-wrap{
|
|
127
|
+
display: flex;
|
|
128
|
+
flex-direction: column;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
sl-carousel{
|
|
132
|
+
aspect-ratio: 1;
|
|
133
|
+
background-color: var(--sl-color-neutral-200);
|
|
134
|
+
|
|
135
|
+
&::part(base){
|
|
136
|
+
display: flex;
|
|
137
|
+
gap: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&::part(scroll-container){
|
|
141
|
+
border-radius: 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&::part(navigation-button){
|
|
145
|
+
position: absolute;
|
|
146
|
+
background-color: color-mix(in hsl, var(--sl-color-neutral-0) 85%, transparent);
|
|
147
|
+
color: var(--app-primary-color);
|
|
148
|
+
border-radius: 0;
|
|
149
|
+
transition: all ease.3s;
|
|
150
|
+
opacity: 0;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&::part(navigation-button--previous){
|
|
154
|
+
left: 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&::part(navigation-button--next){
|
|
158
|
+
right: 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&:hover{
|
|
162
|
+
&::part(navigation-button){
|
|
163
|
+
opacity: 1;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.viur-shop-item-view-thumbnails {
|
|
169
|
+
display: flex;
|
|
170
|
+
justify-content: start;
|
|
171
|
+
margin-top: vaR(--sl-spacing-medium)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.viur-shop-item-view-thumbnails-scroller {
|
|
175
|
+
display: flex;
|
|
176
|
+
gap: var(--sl-spacing-small);
|
|
177
|
+
overflow-x: auto;
|
|
178
|
+
scrollbar-width: none;
|
|
179
|
+
scroll-behavior: smooth;
|
|
180
|
+
scroll-padding: var(--sl-spacing-small);
|
|
181
|
+
|
|
182
|
+
&::-webkit-scrollbar {
|
|
183
|
+
display: none;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.viur-shop-item-view-thumbnails-image {
|
|
188
|
+
width: 64px;
|
|
189
|
+
height: 64px;
|
|
190
|
+
object-fit: cover;
|
|
191
|
+
opacity: 0.3;
|
|
192
|
+
will-change: opacity;
|
|
193
|
+
transition: 250ms opacity;
|
|
194
|
+
cursor: pointer;
|
|
195
|
+
|
|
196
|
+
&.active {
|
|
197
|
+
opacity: 1;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
.viur-shop-item-view-headline{
|
|
203
|
+
margin-bottom: var(--sl-spacing-small);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.viur-shop-item-view-subline{
|
|
207
|
+
margin-bottom: var(--sl-spacing-small);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.viur-shop-item-view-price{
|
|
211
|
+
font-size: 1.4em;
|
|
212
|
+
margin-bottom: var(--sl-spacing-small);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.viur-shop-item-view-paragraph{
|
|
216
|
+
margin-bottom: var(--sl-spacing-x-large);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.viur-shop-item-view-btn-wrap{
|
|
220
|
+
display: flex;
|
|
221
|
+
flex-direction: column;
|
|
222
|
+
|
|
223
|
+
sl-button{
|
|
224
|
+
margin-bottom: var(--sl-spacing-x-small);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.viur-shop-item-view-item-grid{
|
|
229
|
+
display: grid;
|
|
230
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
231
|
+
grid-gap: var(--sl-spacing-medium);
|
|
232
|
+
}
|
|
233
|
+
</style>
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<order-view :tabs="state.tabs" @tabChange="handleTabs" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { onBeforeMount, reactive, shallowRef, computed } from "vue";
|
|
7
|
+
import { ListRequest } from "@viur/vue-utils";
|
|
8
|
+
|
|
9
|
+
import CartView from "../../cart/CartView.vue";
|
|
10
|
+
import ConfirmView from "../../cart/ConfirmView.vue";
|
|
11
|
+
import OrderView from "./OrderView.vue";
|
|
12
|
+
import CategoryView from "../category/CategoryView.vue";
|
|
13
|
+
import OrderComplete from "./OrderComplete.vue";
|
|
14
|
+
import UserInformation from "../information/UserInformation.vue";
|
|
15
|
+
import UserInfoMulti from "../information/UserInfoMulti.vue";
|
|
16
|
+
import { useCartStore } from "../../../stores/cart";
|
|
17
|
+
|
|
18
|
+
const cartStore = useCartStore();
|
|
19
|
+
|
|
20
|
+
const rootNode = computed(() =>
|
|
21
|
+
cartStore.state.basketRootNode.key ? cartStore.state.basketRootNode.key : "",
|
|
22
|
+
);
|
|
23
|
+
const state = reactive({
|
|
24
|
+
rootNode: {},
|
|
25
|
+
tabs: {
|
|
26
|
+
cart: {
|
|
27
|
+
component: shallowRef(CartView),
|
|
28
|
+
props: {
|
|
29
|
+
sidebar: true,
|
|
30
|
+
mode: "basket",
|
|
31
|
+
cartKey: rootNode,
|
|
32
|
+
}, // cartKey (on initial call has to be a root node) is a required prop, make sure that cartStore.init() is called before cart is mounted
|
|
33
|
+
displayName: "Warenkorb",
|
|
34
|
+
icon: { name: "cart", library: "hsk" },
|
|
35
|
+
position: 2,
|
|
36
|
+
disabled: false,
|
|
37
|
+
atShow: null,
|
|
38
|
+
atHide: null,
|
|
39
|
+
},
|
|
40
|
+
// confirm: {
|
|
41
|
+
// component: shallowRef(ConfirmView),
|
|
42
|
+
// props: {},
|
|
43
|
+
// displayName: "Bestellung prüfen",
|
|
44
|
+
// icon: { name: "order-check", library: "hsk" },
|
|
45
|
+
// position: 5,
|
|
46
|
+
// disabled: false,
|
|
47
|
+
// atShow: null,
|
|
48
|
+
// atHide: null,
|
|
49
|
+
// },
|
|
50
|
+
// order: {
|
|
51
|
+
// component: shallowRef(CategoryView),
|
|
52
|
+
// props: {
|
|
53
|
+
// listHandler: ListRequest("categorystore", {
|
|
54
|
+
// module: "variante",
|
|
55
|
+
// params: { type: "dk", limit: 99 },
|
|
56
|
+
// }),
|
|
57
|
+
// },
|
|
58
|
+
// displayName: "Artikel Bestellen",
|
|
59
|
+
// icon: { name: "cart-add", library: "hsk" },
|
|
60
|
+
// position: 1,
|
|
61
|
+
// disabled: false,
|
|
62
|
+
// atShow: null,
|
|
63
|
+
// atHide: null,
|
|
64
|
+
// },
|
|
65
|
+
// orderComplete: {
|
|
66
|
+
// component: shallowRef(OrderComplete),
|
|
67
|
+
// props: {},
|
|
68
|
+
// displayName: "Bestellung Abgeschlossen",
|
|
69
|
+
// icon: { name: "order-confirmed", library: "hsk" },
|
|
70
|
+
// position: 6,
|
|
71
|
+
// disabled: true,
|
|
72
|
+
// atShow: null,
|
|
73
|
+
// atHide: null,
|
|
74
|
+
// },
|
|
75
|
+
userInfo: {
|
|
76
|
+
component: shallowRef(UserInformation),
|
|
77
|
+
props: {},
|
|
78
|
+
displayName: "Daten Eingeben",
|
|
79
|
+
icon: { name: "user", library: "hsk" },
|
|
80
|
+
position: 3,
|
|
81
|
+
disabled: false,
|
|
82
|
+
atShow: null,
|
|
83
|
+
atHide: null,
|
|
84
|
+
},
|
|
85
|
+
// userInfoMulti: {
|
|
86
|
+
// component: shallowRef(UserInfoMulti),
|
|
87
|
+
// props: {},
|
|
88
|
+
// displayName: "Daten Eingeben (Multi)",
|
|
89
|
+
// icon: { name: "user", library: "hsk" },
|
|
90
|
+
// position: 4,
|
|
91
|
+
// disabled: false,
|
|
92
|
+
// atShow: null,
|
|
93
|
+
// atHide: null,
|
|
94
|
+
// },
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
function handleTabs(e) {
|
|
99
|
+
// console.dir("hier", e.target)
|
|
100
|
+
if (e?.detail.name === "confirm") {
|
|
101
|
+
state.tabs.orderComplete.disabled = false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
onBeforeMount(async () => {
|
|
106
|
+
await cartStore.init();
|
|
107
|
+
await cartStore.getAdressStructure();
|
|
108
|
+
|
|
109
|
+
console.log("debug init exampleusage :", cartStore.state.basketRootNode);
|
|
110
|
+
});
|
|
111
|
+
</script>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bind">
|
|
3
|
+
<h1 class="headline">Vielen Dank für Ihre Bestellung</h1>
|
|
4
|
+
<br>
|
|
5
|
+
<p class="paragraph">
|
|
6
|
+
<strong>Ihre Bestellnummer:</strong> 123345670
|
|
7
|
+
</p>
|
|
8
|
+
<p class="paragraph">
|
|
9
|
+
Wir haben Ihre Bestellung erhalten und werden diese schenllstmöglich bearbeiten.<br>
|
|
10
|
+
Sie erhalten in wenigen Minuten eine Bestätigung per E-Mail.
|
|
11
|
+
|
|
12
|
+
<div class="btn-wrap">
|
|
13
|
+
<sl-button size="medium">
|
|
14
|
+
Zur Startseite
|
|
15
|
+
</sl-button>
|
|
16
|
+
|
|
17
|
+
<sl-button variant="primary"
|
|
18
|
+
size="medium">
|
|
19
|
+
Weiter Einkaufen
|
|
20
|
+
</sl-button>
|
|
21
|
+
</div>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup></script>
|
|
28
|
+
|
|
29
|
+
<style scoped>
|
|
30
|
+
|
|
31
|
+
.btn-wrap{
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
flex-wrap: nowrap;
|
|
35
|
+
justify-content: space-between;
|
|
36
|
+
width: 100%;
|
|
37
|
+
|
|
38
|
+
margin-top: var(--sl-spacing-x-large);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
</style>
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bind viur-shop-wrap">
|
|
3
|
+
<sl-tab-group
|
|
4
|
+
class="viur-shop-order-tab"
|
|
5
|
+
noScrollControls
|
|
6
|
+
@sl-tab-show="onTabChange"
|
|
7
|
+
ref="tabGroup"
|
|
8
|
+
>
|
|
9
|
+
<sl-tab
|
|
10
|
+
slot="nav"
|
|
11
|
+
:panel="tab"
|
|
12
|
+
v-for="(tab, index) in state.tabNames"
|
|
13
|
+
:key="tab"
|
|
14
|
+
:disabled="tabs[tab].disabled"
|
|
15
|
+
>
|
|
16
|
+
<div class="viur-shop-order-step">
|
|
17
|
+
<sl-icon
|
|
18
|
+
:name="tabs[tab].icon.name"
|
|
19
|
+
:library="tabs[tab].icon.library"
|
|
20
|
+
>
|
|
21
|
+
</sl-icon>
|
|
22
|
+
<div class="viur-shop-order-status-text">
|
|
23
|
+
{{ index + 1 }}. {{ tabs[tab].displayName }}
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
<sl-icon
|
|
27
|
+
name="chevron-right"
|
|
28
|
+
class="viur-shop-order-tab-check"
|
|
29
|
+
v-if="index < state.tabNames.length - 1"
|
|
30
|
+
></sl-icon>
|
|
31
|
+
</sl-tab>
|
|
32
|
+
|
|
33
|
+
<sl-tab-panel
|
|
34
|
+
:name="tab"
|
|
35
|
+
v-for="(tab, index) in state.tabNames"
|
|
36
|
+
:key="tab"
|
|
37
|
+
>
|
|
38
|
+
<component
|
|
39
|
+
:is="tabs[tab].component"
|
|
40
|
+
v-bind="tabs[tab].props ? tabs[tab].props : ''"
|
|
41
|
+
>
|
|
42
|
+
</component>
|
|
43
|
+
<div
|
|
44
|
+
class="viur-shop-form-footer"
|
|
45
|
+
:class="{ 'flex-end': state.isFirstTab(index) }"
|
|
46
|
+
v-if="index !== state.tabNames.length - 1"
|
|
47
|
+
>
|
|
48
|
+
<sl-button type="submit" v-show="index !== 0" @click="prevTab(state.tabNames[index-1])">
|
|
49
|
+
Zurück
|
|
50
|
+
</sl-button>
|
|
51
|
+
<!-- :disabled="!state.requiredFieldsFilled" -->
|
|
52
|
+
<sl-button type="submit" variant="primary" @click="nextTab(state.tabNames[index+1])">
|
|
53
|
+
Weiter
|
|
54
|
+
</sl-button>
|
|
55
|
+
</div>
|
|
56
|
+
</sl-tab-panel>
|
|
57
|
+
</sl-tab-group>
|
|
58
|
+
|
|
59
|
+
<div class="viur-shop-sidebar" id="order_sidebar"></div>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<script setup>
|
|
64
|
+
import { reactive, computed, ref } from "vue";
|
|
65
|
+
|
|
66
|
+
const props = defineProps({
|
|
67
|
+
tabs: {
|
|
68
|
+
type: Object,
|
|
69
|
+
required: true,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const emit = defineEmits(["tabChange"]);
|
|
74
|
+
|
|
75
|
+
const state = reactive({
|
|
76
|
+
tabNames: computed(() => sortTabs(props.tabs)),
|
|
77
|
+
isFirstTab: (index) => {
|
|
78
|
+
if (index === 0) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
return false;
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const tabGroup = ref(null);
|
|
86
|
+
|
|
87
|
+
function sortTabs(tabs) {
|
|
88
|
+
let sortedArray = [];
|
|
89
|
+
let outputArray = [];
|
|
90
|
+
|
|
91
|
+
for (const tab in tabs) {
|
|
92
|
+
if (tabs[tab].position) {
|
|
93
|
+
sortedArray.push([tab, tabs[tab].position]);
|
|
94
|
+
} else {
|
|
95
|
+
sortedArray.push([tab, 0]);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
sortedArray.sort((a, b) => {
|
|
100
|
+
return a[1] - b[1];
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
sortedArray.forEach((tab) => {
|
|
104
|
+
outputArray.push(tab[0]);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
return outputArray;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function onTabChange(e) {
|
|
111
|
+
emit("tabChange", e);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
function prevTab(tabName) {
|
|
116
|
+
tabGroup.value.show(tabName);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function nextTab(tabName) {
|
|
120
|
+
tabGroup.value.show(tabName);
|
|
121
|
+
}
|
|
122
|
+
</script>
|
|
123
|
+
|
|
124
|
+
<style scoped>
|
|
125
|
+
.viur-shop-wrap {
|
|
126
|
+
flex-direction: row;
|
|
127
|
+
gap: var(--sl-spacing-x-large);
|
|
128
|
+
align-items: flex-start;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.viur-shop-sidebar {
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
background-color: var(--sl-color-neutral-100);
|
|
135
|
+
min-width: 300px;
|
|
136
|
+
padding: var(--sl-spacing-medium);
|
|
137
|
+
position: sticky;
|
|
138
|
+
top: 0;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.viur-shop-order-tab {
|
|
142
|
+
sl-tab {
|
|
143
|
+
width: 25%;
|
|
144
|
+
|
|
145
|
+
&::part(base) {
|
|
146
|
+
width: 100%;
|
|
147
|
+
height: 100%;
|
|
148
|
+
display: flex;
|
|
149
|
+
justify-content: center;
|
|
150
|
+
align-items: center;
|
|
151
|
+
position: relative;
|
|
152
|
+
color: var(--sl-color-neutral-400);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&[aria-selected="true"]::part(base) {
|
|
156
|
+
color: var(--ignt-color-primary) !important;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.viur-shop-order-step {
|
|
162
|
+
width: 100%;
|
|
163
|
+
height: 100%;
|
|
164
|
+
display: flex;
|
|
165
|
+
flex-direction: column;
|
|
166
|
+
justify-content: flex-start;
|
|
167
|
+
align-items: center;
|
|
168
|
+
|
|
169
|
+
@media (--ignt-mq-max-break-small) {
|
|
170
|
+
justify-content: center;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
sl-icon {
|
|
174
|
+
font-size: 2.5em;
|
|
175
|
+
margin-bottom: 10px;
|
|
176
|
+
|
|
177
|
+
@media (--ignt-mq-max-break-small) {
|
|
178
|
+
display: none;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.viur-shop-order-tab-check {
|
|
184
|
+
position: absolute;
|
|
185
|
+
right: -0.5em;
|
|
186
|
+
|
|
187
|
+
@media (--ignt-mq-max-break-small) {
|
|
188
|
+
font-size: 0.7em;
|
|
189
|
+
right: -0.35em;
|
|
190
|
+
top: calc(50% - 0.35em);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.viur-shop-order-status-text {
|
|
195
|
+
font-size: 0.8em;
|
|
196
|
+
color: inherit;
|
|
197
|
+
text-align: center;
|
|
198
|
+
margin-top: 0.6em;
|
|
199
|
+
white-space: initial;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.viur-shop-form-footer {
|
|
203
|
+
display: flex;
|
|
204
|
+
justify-content: space-between;
|
|
205
|
+
margin-top: var(--sl-spacing-large);
|
|
206
|
+
}
|
|
207
|
+
.flex-end {
|
|
208
|
+
justify-content: flex-end;
|
|
209
|
+
}
|
|
210
|
+
</style>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { createRouter, createWebHashHistory } from "vue-router";
|
|
3
|
+
import ViewMissing from "../views/ViewMissing.vue";
|
|
4
|
+
|
|
5
|
+
const default_routes = [
|
|
6
|
+
{
|
|
7
|
+
path: "/:pathMatch(.*)*",
|
|
8
|
+
name: "view_missing",
|
|
9
|
+
component: ViewMissing,
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
path: "/shop/category/:identifier",
|
|
13
|
+
name: "CategoryView",
|
|
14
|
+
component: () => import("../components/order/category/CategoryView.vue"),
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
path: "/shop/item/:item",
|
|
18
|
+
name: "itemView",
|
|
19
|
+
component: () => import("../components/order/item/ItemView.vue"),
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
path: "/shop/cart/view",
|
|
23
|
+
name: "CartView",
|
|
24
|
+
component: () => import("../components/cart/CartView.vue"),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
path: "/shop/order/",
|
|
28
|
+
name: "OrderView",
|
|
29
|
+
component: () => import("../components/order/process/ExampleUsage.vue"),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
path: "/shop/order/confirm",
|
|
33
|
+
name: "ConfirmView",
|
|
34
|
+
component: () => import("../components/cart/ConfirmView.vue"),
|
|
35
|
+
},
|
|
36
|
+
];4
|
|
37
|
+
|
|
38
|
+
function createRouterInstance(routes, replace = false) {
|
|
39
|
+
let newRoutes = [];
|
|
40
|
+
if (replace) {
|
|
41
|
+
newRoutes = routes;
|
|
42
|
+
} else {
|
|
43
|
+
newRoutes = routes.concat(default_routes);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const router = createRouter({
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
history: createWebHashHistory(import.meta.env.BASE_URL),
|
|
49
|
+
routes: newRoutes,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// router.afterEach((to, from) => {
|
|
53
|
+
// //useUserStore().addAction();
|
|
54
|
+
// });
|
|
55
|
+
|
|
56
|
+
// router.beforeEach((to, from, next) => {
|
|
57
|
+
// const contextStore = useContextStore();
|
|
58
|
+
// let localContext = {};
|
|
59
|
+
// let handlerId = to.query["_"]?.toString();
|
|
60
|
+
// if (!handlerId) next();
|
|
61
|
+
// if (Object.keys(contextStore.state.localContext).includes(handlerId)) {
|
|
62
|
+
// localContext = contextStore.state.localContext[handlerId];
|
|
63
|
+
// }
|
|
64
|
+
// let newQuery = {
|
|
65
|
+
// ...contextStore.state.globalContext,
|
|
66
|
+
// ...localContext,
|
|
67
|
+
// ...to.query,
|
|
68
|
+
// };
|
|
69
|
+
// if (
|
|
70
|
+
// Object.keys(to.query).every(
|
|
71
|
+
// (key) =>
|
|
72
|
+
// to.query[key] === newQuery[key] &&
|
|
73
|
+
// to.query.hasOwnProperty(key) &&
|
|
74
|
+
// newQuery.hasOwnProperty(key),
|
|
75
|
+
// ) &&
|
|
76
|
+
// Object.keys(newQuery).every(
|
|
77
|
+
// (key) =>
|
|
78
|
+
// to.query[key] === newQuery[key] &&
|
|
79
|
+
// to.query.hasOwnProperty(key) &&
|
|
80
|
+
// newQuery.hasOwnProperty(key),
|
|
81
|
+
// )
|
|
82
|
+
// ) {
|
|
83
|
+
// //disabled because of to much context copy and updates
|
|
84
|
+
// // Writes query to context
|
|
85
|
+
// /*
|
|
86
|
+
// for (const [k, v] of Object.entries(to.query)) {
|
|
87
|
+
// if (k.startsWith("_")) continue
|
|
88
|
+
// if (Object.keys(contextStore.state.localContext).includes(handlerId)) {
|
|
89
|
+
// contextStore.state.localContext[handlerId][k] = v
|
|
90
|
+
// } else {
|
|
91
|
+
// contextStore.state.localContext[handlerId] = { [k]: v }
|
|
92
|
+
// }
|
|
93
|
+
// }*/
|
|
94
|
+
// next(); // no change
|
|
95
|
+
// } else {
|
|
96
|
+
// to.query = newQuery;
|
|
97
|
+
// next(to);
|
|
98
|
+
// }
|
|
99
|
+
// });
|
|
100
|
+
return router;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export default createRouterInstance;
|