@viur/shop-components 0.0.1-dev.25 → 0.0.1-dev.27
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 +1 -1
- package/src/components/cart/CartView.vue +57 -35
package/package.json
CHANGED
|
@@ -30,6 +30,51 @@
|
|
|
30
30
|
</CartLeaf>
|
|
31
31
|
</template>
|
|
32
32
|
</div>
|
|
33
|
+
|
|
34
|
+
<!-- <teleport to="#order_sidebar" v-if="sidebar"> -->
|
|
35
|
+
<div v-if="sidebar">
|
|
36
|
+
<h2 class="viur-shop-cart-sidebar-headline headline">Zusammenfassung</h2>
|
|
37
|
+
<br />
|
|
38
|
+
|
|
39
|
+
<sl-input label="Rabattcode eingeben"></sl-input>
|
|
40
|
+
<br />
|
|
41
|
+
|
|
42
|
+
<div class="viur-shop-cart-sidebar-info-line">
|
|
43
|
+
<span>Zwischensumme</span> -->
|
|
44
|
+
<!-- TODO: Preis in shop modul muss trotzdem ohne rabatt sein - extra feld für rabattierten preis und rabatt müssen ebenfalls hier sichtbar werden -->
|
|
45
|
+
{{
|
|
46
|
+
mode === "basket"
|
|
47
|
+
? cartStore.state.basketRootNode.total
|
|
48
|
+
: cartStore.state.whishlistRootNodes[cartKey].total
|
|
49
|
+
}}
|
|
50
|
+
€
|
|
51
|
+
</div>
|
|
52
|
+
<div class="viur-shop-cart-sidebar-info-line">
|
|
53
|
+
<span>Rabatt</span>
|
|
54
|
+
0 €
|
|
55
|
+
</div>
|
|
56
|
+
<div class="viur-shop-cart-sidebar-info-line">
|
|
57
|
+
<span>Versandkosten</span>
|
|
58
|
+
0 €
|
|
59
|
+
</div>
|
|
60
|
+
<div class="viur-shop-cart-sidebar-info-line total">
|
|
61
|
+
<span>Gesamt:</span>
|
|
62
|
+
{{
|
|
63
|
+
mode === "basket"
|
|
64
|
+
? cartStore.state.basketRootNode.total
|
|
65
|
+
: cartStore.state.whishlistRootNodes[cartKey].total
|
|
66
|
+
}}
|
|
67
|
+
€
|
|
68
|
+
</div>
|
|
69
|
+
<div class="viur-shop-cart-sidebar-btn-wrap">
|
|
70
|
+
<sl-button variant="info" size="small"> Jetzt Bestellen </sl-button>
|
|
71
|
+
<sl-button size="small" variant="primary">
|
|
72
|
+
<sl-icon name="paypal" slot="prefix"></sl-icon>
|
|
73
|
+
Paypal
|
|
74
|
+
</sl-button>
|
|
75
|
+
</div>
|
|
76
|
+
<!-- </teleport> -->
|
|
77
|
+
</div>
|
|
33
78
|
<!-- <pre> {{ state.leaves }}</pre> -->
|
|
34
79
|
</template>
|
|
35
80
|
|
|
@@ -141,40 +186,7 @@
|
|
|
141
186
|
|
|
142
187
|
</div>
|
|
143
188
|
|
|
144
|
-
<teleport to="#order_sidebar" v-if="sidebar">
|
|
145
|
-
<h2 class="viur-shop-cart-sidebar-headline headline">
|
|
146
|
-
Zusammenfassung
|
|
147
|
-
</h2>
|
|
148
|
-
<br />
|
|
149
|
-
|
|
150
|
-
<sl-input label="Rabattcode eingeben"></sl-input>
|
|
151
|
-
<br />
|
|
152
189
|
|
|
153
|
-
<div class="viur-shop-cart-sidebar-info-line">
|
|
154
|
-
<span>Zwischensumme</span> -->
|
|
155
|
-
<!-- TODO: Preis in shop modul muss trotzdem ohne rabatt sein - extra feld für rabattierten preis und rabatt müssen ebenfalls hier sichtbar werden -->
|
|
156
|
-
<!-- {{ cartStore.state.carts[cartStore.state.basket].info.total }} €
|
|
157
|
-
</div>
|
|
158
|
-
<div class="viur-shop-cart-sidebar-info-line">
|
|
159
|
-
<span>Rabatt</span>
|
|
160
|
-
0 €
|
|
161
|
-
</div>
|
|
162
|
-
<div class="viur-shop-cart-sidebar-info-line">
|
|
163
|
-
<span>Versandkosten</span>
|
|
164
|
-
0 €
|
|
165
|
-
</div>
|
|
166
|
-
<div class="viur-shop-cart-sidebar-info-line total">
|
|
167
|
-
<span>Gesamt:</span>
|
|
168
|
-
{{ cartStore.state.carts[cartStore.state.basket].info.total }} €
|
|
169
|
-
</div>
|
|
170
|
-
<div class="viur-shop-cart-sidebar-btn-wrap">
|
|
171
|
-
<sl-button variant="info" size="small"> Jetzt Bestellen </sl-button>
|
|
172
|
-
<sl-button size="small" variant="primary">
|
|
173
|
-
<sl-icon name="paypal" slot="prefix"></sl-icon>
|
|
174
|
-
Paypal
|
|
175
|
-
</sl-button>
|
|
176
|
-
</div>
|
|
177
|
-
</teleport>
|
|
178
190
|
</div>
|
|
179
191
|
</template> -->
|
|
180
192
|
</template>
|
|
@@ -239,7 +251,7 @@ async function onConfirm() {
|
|
|
239
251
|
confirm.value.hide();
|
|
240
252
|
}
|
|
241
253
|
|
|
242
|
-
function updateItem(e) {
|
|
254
|
+
async function updateItem(e) {
|
|
243
255
|
console.log("updateItem :", e);
|
|
244
256
|
|
|
245
257
|
if (e.quantity === 0) {
|
|
@@ -248,6 +260,8 @@ function updateItem(e) {
|
|
|
248
260
|
state.currentNode = e.node;
|
|
249
261
|
} else {
|
|
250
262
|
cartStore.updateItem(e.articleKey, e.node.key, e.quantity);
|
|
263
|
+
|
|
264
|
+
await updateCart();
|
|
251
265
|
}
|
|
252
266
|
}
|
|
253
267
|
|
|
@@ -265,10 +279,18 @@ async function onDialogHide() {
|
|
|
265
279
|
item.quantity = 1;
|
|
266
280
|
}
|
|
267
281
|
});
|
|
268
|
-
// TODO: await updateCart(state.currentNode.key);
|
|
269
282
|
|
|
270
283
|
state.currentItem = {};
|
|
271
284
|
state.currentNode = {};
|
|
285
|
+
|
|
286
|
+
await updateCart();
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
async function updateCart() {
|
|
290
|
+
state.nodes = [];
|
|
291
|
+
state.leaves = {};
|
|
292
|
+
|
|
293
|
+
await getChildren();
|
|
272
294
|
}
|
|
273
295
|
|
|
274
296
|
async function getChildren(parentKey = props.cartKey) {
|