@viur/shop-components 0.0.1-dev.23 → 0.0.1-dev.25
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
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<img
|
|
4
4
|
class="viur-shop-cart-card-img"
|
|
5
5
|
slot="image"
|
|
6
|
-
:src="getImage(state.leaf.shop_image)"
|
|
6
|
+
:src="getImage(state.leaf.shop_image ? state.leaf.shop_image : undefined)"
|
|
7
7
|
/>
|
|
8
8
|
<div class="viur-shop-cart-card-header" slot="header">
|
|
9
9
|
<h4 class="viur-shop-cart-card-headline headline">
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
|
|
75
75
|
<script setup>
|
|
76
76
|
import { computed, onBeforeMount, reactive } from "vue";
|
|
77
|
+
import { Request } from "@viur/vue-utils";
|
|
77
78
|
|
|
78
79
|
const props = defineProps({
|
|
79
80
|
leaf: { type: Object, required: true },
|
|
@@ -86,6 +87,12 @@ const state = reactive({
|
|
|
86
87
|
leaf: {},
|
|
87
88
|
});
|
|
88
89
|
|
|
90
|
+
function getImage(image) {
|
|
91
|
+
if (image !== undefined) return Request.downloadUrlFor(image);
|
|
92
|
+
|
|
93
|
+
return "https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80";
|
|
94
|
+
}
|
|
95
|
+
|
|
89
96
|
function updateItem(item, articleKey, node, quantity) {
|
|
90
97
|
emit("updateItem", {
|
|
91
98
|
item: item,
|
|
@@ -259,12 +259,14 @@ function removeItem(e) {
|
|
|
259
259
|
state.currentNode = e.node;
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
function onDialogHide() {
|
|
262
|
+
async function onDialogHide() {
|
|
263
263
|
state.leaves[state.currentNode.key].forEach((item) => {
|
|
264
264
|
if (item.key === state.currentItem.key) {
|
|
265
265
|
item.quantity = 1;
|
|
266
266
|
}
|
|
267
267
|
});
|
|
268
|
+
// TODO: await updateCart(state.currentNode.key);
|
|
269
|
+
|
|
268
270
|
state.currentItem = {};
|
|
269
271
|
state.currentNode = {};
|
|
270
272
|
}
|
package/src/stores/cart.js
CHANGED
|
@@ -48,7 +48,7 @@ export const useCartStore = defineStore("cartstore", () => {
|
|
|
48
48
|
parent_cart_key: cartKey,
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
await updateCart(cartKey);
|
|
51
|
+
// await updateCart(cartKey);
|
|
52
52
|
console.log("addToCart", resp); //TODO: Errorhandling as soon as shop module works again
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -78,15 +78,12 @@ export const useCartStore = defineStore("cartstore", () => {
|
|
|
78
78
|
quantity_mode: "replace",
|
|
79
79
|
});
|
|
80
80
|
|
|
81
|
-
if (quantity === 0) {
|
|
82
|
-
await updateCart(cartKey);
|
|
83
|
-
}
|
|
84
81
|
console.log("update Resp", resp); //TODO: Errorhandling as soon as shop module works again
|
|
85
82
|
}
|
|
86
83
|
|
|
87
|
-
async function updateCart(cartKey) {
|
|
88
|
-
|
|
89
|
-
}
|
|
84
|
+
// async function updateCart(cartKey) {
|
|
85
|
+
// await getChildren(cartKey);
|
|
86
|
+
// }
|
|
90
87
|
|
|
91
88
|
async function getAdressStructure() {
|
|
92
89
|
let addSkel = await shopClient.address_structure();
|