@ozdao/martyrs 0.2.452 → 0.2.454
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/dist/{Media-Bx_un17A.js → Media-DlEIDFaB.js} +1 -1
- package/dist/{Media-_5Qittnv.mjs → Media-DzQv7XkX.mjs} +1 -1
- package/dist/builder.js +5 -0
- package/dist/builder.mjs +5 -0
- package/dist/{main-AHluqkEA.js → main-CSphtCso.js} +6 -6
- package/dist/{main-DZCereaK.mjs → main-CjVIbgn3.mjs} +119 -126
- package/dist/martyrs/src/components/Block/Block.vue.cjs +1 -1
- package/dist/martyrs/src/components/Block/Block.vue.js +1 -1
- package/dist/martyrs/src/components/Feed/Feed.vue.cjs +1 -1
- package/dist/martyrs/src/components/Feed/Feed.vue.cjs.map +1 -1
- package/dist/martyrs/src/components/Feed/Feed.vue.js +1 -1
- package/dist/martyrs/src/components/Feed/Feed.vue.js.map +1 -1
- package/dist/martyrs/src/components/Popup/Popup.vue.cjs +0 -8
- package/dist/martyrs/src/components/Popup/Popup.vue.cjs.map +1 -1
- package/dist/martyrs/src/components/Popup/Popup.vue.js +0 -8
- package/dist/martyrs/src/components/Popup/Popup.vue.js.map +1 -1
- package/dist/martyrs/src/components/Tooltip/{Tooltip.vue.cjs → Tooltip.vue2.cjs} +2 -2
- package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.cjs.map +1 -0
- package/dist/martyrs/src/components/Tooltip/{Tooltip.vue.js → Tooltip.vue2.js} +2 -2
- package/dist/martyrs/src/components/Tooltip/{Tooltip.vue.cjs.map → Tooltip.vue2.js.map} +1 -1
- package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.cjs +2 -2
- package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js.map +1 -1
- package/dist/martyrs/src/modules/globals/globals.client.cjs +2 -0
- package/dist/martyrs/src/modules/globals/globals.client.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/globals.client.js +2 -0
- package/dist/martyrs/src/modules/globals/globals.client.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/App.vue.cjs +15 -51
- package/dist/martyrs/src/modules/globals/views/components/layouts/App.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/App.vue.js +15 -51
- package/dist/martyrs/src/modules/globals/views/components/layouts/App.vue.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs +34 -4
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js +34 -4
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/mixins/mixins.cjs +27 -17
- package/dist/martyrs/src/modules/globals/views/mixins/mixins.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/mixins/mixins.js +27 -17
- package/dist/martyrs/src/modules/globals/views/mixins/mixins.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/plugins/AlertDialog.vue.cjs +43 -0
- package/dist/martyrs/src/modules/globals/views/plugins/AlertDialog.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/globals/views/plugins/AlertDialog.vue.js +43 -0
- package/dist/martyrs/src/modules/globals/views/plugins/AlertDialog.vue.js.map +1 -0
- package/dist/martyrs/src/modules/globals/views/plugins/alert.plugin.cjs +53 -0
- package/dist/martyrs/src/modules/globals/views/plugins/alert.plugin.cjs.map +1 -0
- package/dist/martyrs/src/modules/globals/views/plugins/alert.plugin.js +53 -0
- package/dist/martyrs/src/modules/globals/views/plugins/alert.plugin.js.map +1 -0
- package/dist/martyrs/src/modules/marketplace/views/components/pages/Catalog.vue.cjs +1 -3
- package/dist/martyrs/src/modules/marketplace/views/components/pages/Catalog.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/pages/Catalog.vue.js +1 -3
- package/dist/martyrs/src/modules/marketplace/views/components/pages/Catalog.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.cjs +4 -4
- package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.js +4 -4
- package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/store/shopcart.cjs +0 -1
- package/dist/martyrs/src/modules/orders/store/shopcart.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/store/shopcart.js +0 -1
- package/dist/martyrs/src/modules/orders/store/shopcart.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.cjs +0 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +0 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js.map +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/elements/Price.vue.cjs +5 -6
- package/dist/martyrs/src/modules/products/components/elements/Price.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/elements/Price.vue.js +5 -6
- package/dist/martyrs/src/modules/products/components/elements/Price.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs +61 -69
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +62 -70
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/store/products.cjs +0 -1
- package/dist/martyrs/src/modules/products/store/products.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/store/products.js +0 -1
- package/dist/martyrs/src/modules/products/store/products.js.map +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs +0 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +0 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js.map +1 -1
- package/dist/martyrs.cjs.js +1 -1
- package/dist/martyrs.css +1 -1
- package/dist/martyrs.es.js +1 -1
- package/dist/products.server.js +5 -0
- package/dist/products.server.mjs +5 -0
- package/dist/style.css +1 -53
- package/package.json +1 -1
- package/src/builder/rspack/rspack.config.client.js +5 -0
- package/src/components/Feed/Feed.vue +1 -1
- package/src/components/Popup/Popup.vue +2 -2
- package/src/modules/auth/views/components/layouts/Auth.vue +2 -2
- package/src/modules/auth/views/components/pages/SignIn.vue +1 -1
- package/src/modules/globals/globals.client.js +5 -2
- package/src/modules/globals/views/components/layouts/App.vue +9 -93
- package/src/modules/globals/views/components/layouts/Client.vue +42 -5
- package/src/modules/globals/views/mixins/mixins.js +35 -18
- package/src/modules/globals/views/plugins/AlertDialog.vue +35 -0
- package/src/modules/globals/views/plugins/alert.plugin.js +65 -0
- package/src/modules/icons/logos/Logotype.vue +1 -1
- package/src/modules/marketplace/views/components/pages/Catalog.vue +1 -3
- package/src/modules/orders/components/partials/ShopCart.vue +4 -15
- package/src/modules/orders/store/shopcart.js +0 -2
- package/src/modules/products/components/elements/Price.vue +3 -4
- package/src/modules/products/components/pages/Product.vue +57 -38
- package/src/modules/products/controllers/products.controller.js +7 -0
- package/src/modules/products/store/products.js +0 -1
- package/src/styles/base/borders.scss +7 -1
- package/src/styles/layout.scss +3 -41
- package/dist/martyrs/src/components/Tooltip/Tooltip.vue.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Price.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Price.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -10,13 +10,14 @@ require("../../store/categories.cjs");
|
|
|
10
10
|
const shopcart = require("../../../orders/store/shopcart.cjs");
|
|
11
11
|
const Button = require("../../../../components/Button/Button.vue.cjs");
|
|
12
12
|
;/* empty css */
|
|
13
|
-
|
|
13
|
+
;/* empty css */
|
|
14
14
|
const PopupDateSelector = require("../../../globals/views/components/blocks/PopupDateSelector.vue.cjs");
|
|
15
15
|
const IconEdit = require("../../../icons/navigation/IconEdit.vue.cjs");
|
|
16
16
|
const IconShopcartAdd = require("../../../icons/actions/IconShopcartAdd.vue.cjs");
|
|
17
17
|
const ImagesThumbnails = require("../blocks/ImagesThumbnails.vue.cjs");
|
|
18
18
|
const Price = require("../elements/Price.vue.cjs");
|
|
19
19
|
const PopularProducts = require("../sections/PopularProducts.vue.cjs");
|
|
20
|
+
const CardOrganization = require("../../../organizations/components/blocks/CardOrganization.vue.cjs");
|
|
20
21
|
const _hoisted_1 = {
|
|
21
22
|
key: 0,
|
|
22
23
|
class: "h-100 w-100 mobile:pd-thin pd-big bg-white"
|
|
@@ -26,46 +27,36 @@ const _hoisted_3 = { class: "pos-relative w-100 h-100 flex-column flex-h-center
|
|
|
26
27
|
const _hoisted_4 = { class: "w-100 h1-product mn-b-small" };
|
|
27
28
|
const _hoisted_5 = {
|
|
28
29
|
key: 1,
|
|
29
|
-
class: "
|
|
30
|
+
class: "w-100 t-transp mn-b-small"
|
|
30
31
|
};
|
|
31
32
|
const _hoisted_6 = {
|
|
32
|
-
key:
|
|
33
|
-
class: "
|
|
34
|
-
};
|
|
35
|
-
const _hoisted_7 = {
|
|
36
|
-
key: 0,
|
|
37
|
-
class: "w-100 t-transp"
|
|
38
|
-
};
|
|
39
|
-
const _hoisted_8 = {
|
|
40
|
-
key: 1,
|
|
41
|
-
class: "w-100 t-transp"
|
|
42
|
-
};
|
|
43
|
-
const _hoisted_9 = {
|
|
44
|
-
key: 1,
|
|
45
|
-
class: "cols-2 pd-medium w-100 gap-small"
|
|
33
|
+
key: 2,
|
|
34
|
+
class: "w-100 t-transp mn-b-small"
|
|
46
35
|
};
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const
|
|
36
|
+
const _hoisted_7 = { class: "cols-2 mn-b-small w-100 gap-small" };
|
|
37
|
+
const _hoisted_8 = { class: "w-100 pd-small radius-small bg-light product-information" };
|
|
38
|
+
const _hoisted_9 = { class: "t-demi" };
|
|
39
|
+
const _hoisted_10 = { class: "w-max-33r" };
|
|
40
|
+
const _hoisted_11 = { class: "w-max-33r" };
|
|
41
|
+
const _hoisted_12 = { key: 0 };
|
|
42
|
+
const _hoisted_13 = { class: "gap-thin flex flex-center flex-nowrap" };
|
|
43
|
+
const _hoisted_14 = { key: 1 };
|
|
52
44
|
const _hoisted_15 = { class: "gap-thin flex flex-center flex-nowrap" };
|
|
53
|
-
const _hoisted_16 = {
|
|
54
|
-
const _hoisted_17 = { class: "gap-thin flex flex-center flex-nowrap" };
|
|
55
|
-
const _hoisted_18 = {
|
|
45
|
+
const _hoisted_16 = {
|
|
56
46
|
key: 1,
|
|
57
47
|
class: "flex-center flex uppercase radius-big t-black w-max pd-small t-medium bg-grey h-3r w-100 mn-r-smallbutton"
|
|
58
48
|
};
|
|
59
|
-
const
|
|
49
|
+
const _hoisted_17 = { class: "h-max mn-t-big pos-relative" };
|
|
60
50
|
const _sfc_main = {
|
|
61
51
|
__name: "Product",
|
|
62
52
|
emits: ["page-loading", "page-loaded"],
|
|
63
53
|
setup(__props, { emit: __emit }) {
|
|
64
54
|
const route = vueRouter.useRoute();
|
|
65
55
|
vueRouter.useRouter();
|
|
56
|
+
const { proxy } = vue.getCurrentInstance();
|
|
66
57
|
const product = vue.computed(() => products.state.current);
|
|
67
58
|
const images = vue.computed(() => products.state.current.images);
|
|
68
|
-
|
|
59
|
+
vue.ref("description");
|
|
69
60
|
const text = {
|
|
70
61
|
en: { addtoorder: "Add to Cart", fastorder: "Fast Order" },
|
|
71
62
|
ru: { addtoorder: "Добавить в корзину", fastorder: "Быстрый заказ" }
|
|
@@ -80,6 +71,7 @@ const _sfc_main = {
|
|
|
80
71
|
}
|
|
81
72
|
const emits = __emit;
|
|
82
73
|
vue.ref(null);
|
|
74
|
+
vue.ref(null);
|
|
83
75
|
products.state.current = null;
|
|
84
76
|
vue.onMounted(async () => {
|
|
85
77
|
emits("page-loading");
|
|
@@ -88,15 +80,24 @@ const _sfc_main = {
|
|
|
88
80
|
});
|
|
89
81
|
async function addToCart(product2, selectedDates = null) {
|
|
90
82
|
try {
|
|
91
|
-
if (shopcart.state.organization !== product2.owner.target) {
|
|
83
|
+
if (shopcart.state.organization && shopcart.state.organization !== product2.owner.target) {
|
|
84
|
+
const result = await proxy.$alert({
|
|
85
|
+
title: "Start a new order?",
|
|
86
|
+
message: `Your cart has items from another vendor. If you continue, we'll clear it so you can order from this one instead.`,
|
|
87
|
+
actions: [
|
|
88
|
+
{ label: "Cancel", value: false },
|
|
89
|
+
{ label: "Start New Order", value: true }
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
if (!result) throw error;
|
|
92
93
|
shopcart.state.organization = product2.owner.target;
|
|
93
94
|
shopcart.state.positions = [];
|
|
94
95
|
}
|
|
95
96
|
await shopcart.actions.addProductToCart(product2, product2.owner.target, selectedDates);
|
|
96
97
|
return true;
|
|
97
|
-
} catch (
|
|
98
|
-
console.error("
|
|
99
|
-
throw
|
|
98
|
+
} catch (error2) {
|
|
99
|
+
console.error("Error while adding product to cart:", error2);
|
|
100
|
+
throw error2;
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
103
|
return (_ctx, _cache) => {
|
|
@@ -119,42 +120,33 @@ const _sfc_main = {
|
|
|
119
120
|
size: "big",
|
|
120
121
|
class: "flex gap-micro flex-center pd-small br-solid br-1px br-black-transp-10 w-max mn-b-medium"
|
|
121
122
|
}, null, 8, ["product"]),
|
|
122
|
-
product.value.description
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
]
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}), 256)) : vue.createCommentVNode("", true)
|
|
145
|
-
]))
|
|
146
|
-
]),
|
|
147
|
-
_: 1
|
|
148
|
-
})
|
|
149
|
-
])) : vue.createCommentVNode("", true),
|
|
150
|
-
vue.createElementVNode("div", _hoisted_12, [
|
|
151
|
-
vue.createElementVNode("div", _hoisted_13, [
|
|
152
|
-
product.value.listing === "rent" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14, [
|
|
123
|
+
product.value.description && !product.value.localization < 1 && !_ctx.recommendation ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_5, vue.toDisplayString(product.value.description), 1)) : vue.createCommentVNode("", true),
|
|
124
|
+
product.value.localization && product.value.localization.length > 1 && !_ctx.recommendation ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_6, vue.toDisplayString(vue.unref(t)("description")), 1)) : vue.createCommentVNode("", true),
|
|
125
|
+
vue.createElementVNode("div", _hoisted_7, [
|
|
126
|
+
product.value.information.length > 0 ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(product.value.information, (information) => {
|
|
127
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
|
|
128
|
+
vue.createElementVNode("p", _hoisted_9, vue.toDisplayString(information.name), 1),
|
|
129
|
+
vue.createElementVNode("p", null, vue.toDisplayString(information.value), 1)
|
|
130
|
+
]);
|
|
131
|
+
}), 256)) : vue.createCommentVNode("", true)
|
|
132
|
+
]),
|
|
133
|
+
_cache[1] || (_cache[1] = vue.createElementVNode("p", { class: "t-medium mn-b-small" }, "Provided by", -1)),
|
|
134
|
+
product.value.owner ? (vue.openBlock(), vue.createBlock(CardOrganization.default, {
|
|
135
|
+
key: 3,
|
|
136
|
+
organization: product.value.owner.target,
|
|
137
|
+
showRating: true,
|
|
138
|
+
showFollowers: false,
|
|
139
|
+
showProducts: false,
|
|
140
|
+
class: "bg-light mn-b-thin w-100 o-hidden radius-medium pd-small"
|
|
141
|
+
}, null, 8, ["organization"])) : vue.createCommentVNode("", true),
|
|
142
|
+
vue.createElementVNode("div", _hoisted_10, [
|
|
143
|
+
vue.createElementVNode("div", _hoisted_11, [
|
|
144
|
+
product.value.listing === "rent" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12, [
|
|
153
145
|
vue.createElementVNode("button", {
|
|
154
146
|
onClick: openPopup,
|
|
155
147
|
class: "cursor-pointer pd-small radius-big w-max mobile:w-100 bg-main button"
|
|
156
148
|
}, [
|
|
157
|
-
vue.createElementVNode("div",
|
|
149
|
+
vue.createElementVNode("div", _hoisted_13, [
|
|
158
150
|
vue.createVNode(IconShopcartAdd.default, { class: "i-semi" }),
|
|
159
151
|
vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(t)("addtoorder")), 1)
|
|
160
152
|
])
|
|
@@ -169,27 +161,27 @@ const _sfc_main = {
|
|
|
169
161
|
onConfirm: (selectedDates) => addToCart(product.value, selectedDates),
|
|
170
162
|
onClose: closePopup
|
|
171
163
|
}, null, 8, ["product", "isOpen", "showFees", "feesRate", "showVat", "vatRate", "onConfirm"])
|
|
172
|
-
])) : (vue.openBlock(), vue.createElementBlock("div",
|
|
164
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_14, [
|
|
173
165
|
product.value.available > 0 ? (vue.openBlock(), vue.createBlock(Button.default, {
|
|
174
166
|
key: 0,
|
|
175
|
-
|
|
176
|
-
class: "h-3r w-100 bg-main button"
|
|
167
|
+
submit: () => addToCart(product.value, null),
|
|
168
|
+
class: "h-3r w-max mobile:w-100 bg-main button"
|
|
177
169
|
}, {
|
|
178
170
|
default: vue.withCtx(() => [
|
|
179
|
-
vue.createElementVNode("div",
|
|
171
|
+
vue.createElementVNode("div", _hoisted_15, [
|
|
180
172
|
vue.createVNode(IconShopcartAdd.default, { class: "i-semi" }),
|
|
181
173
|
vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(t)("addtoorder")), 1)
|
|
182
174
|
])
|
|
183
175
|
]),
|
|
184
176
|
_: 1
|
|
185
|
-
})) : (vue.openBlock(), vue.createElementBlock("div",
|
|
177
|
+
}, 8, ["submit"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_16, " Out of Stock "))
|
|
186
178
|
]))
|
|
187
179
|
])
|
|
188
180
|
])
|
|
189
181
|
])
|
|
190
182
|
]),
|
|
191
|
-
vue.createElementVNode("div",
|
|
192
|
-
_cache[
|
|
183
|
+
vue.createElementVNode("div", _hoisted_17, [
|
|
184
|
+
_cache[2] || (_cache[2] = vue.createElementVNode("h3", { class: "pd-b-small" }, "Most Popular", -1)),
|
|
193
185
|
vue.createVNode(PopularProducts.default, { class: "mn-r-big-negative mn-l-big-negative" })
|
|
194
186
|
])
|
|
195
187
|
])) : vue.createCommentVNode("", true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Product.vue.cjs","sources":["../../../../../../../src/modules/products/components/pages/Product.vue"],"sourcesContent":["<template>\n <div v-if=\"products.state.current\" class=\"h-100 w-100 mobile:pd-thin pd-big bg-white\">\n <div class=\"cols-2-1_2 w-100 gap-medium\">\n\n <ImagesThumbnails\n :images=\"images\"\n :product=\"product\"\n />\n\n <div class=\"pos-relative w-100 h-100 flex-column flex-h-center flex\">\n <IconEdit\n v-if=\"accesses && hasAccess(route.params._id, 'products', 'edit', accesses)\"\n @click=\"$router.push({ name: 'ProductEdit', params: { _id: product.owner.target, product: product._id } })\"\n class=\"pos-absolute pos-t-regular pos-r-regular i-regular t-transp\"\n />\n <h2 class=\"w-100 h1-product mn-b-small\">{{ product.name }}</h2>\n <Price :product=\"product\" size=\"big\" class=\"flex gap-micro flex-center pd-small br-solid br-1px br-black-transp-10 w-max mn-b-medium\" />\n\n <
|
|
1
|
+
{"version":3,"file":"Product.vue.cjs","sources":["../../../../../../../src/modules/products/components/pages/Product.vue"],"sourcesContent":["<template>\n <div v-if=\"products.state.current\" class=\"h-100 w-100 mobile:pd-thin pd-big bg-white\">\n <div class=\"cols-2-1_2 w-100 gap-medium\">\n\n <ImagesThumbnails\n :images=\"images\"\n :product=\"product\"\n />\n\n <div class=\"pos-relative w-100 h-100 flex-column flex-h-center flex\">\n <IconEdit\n v-if=\"accesses && hasAccess(route.params._id, 'products', 'edit', accesses)\"\n @click=\"$router.push({ name: 'ProductEdit', params: { _id: product.owner.target, product: product._id } })\"\n class=\"pos-absolute pos-t-regular pos-r-regular i-regular t-transp\"\n />\n\n\n\n <h2 class=\"w-100 h1-product mn-b-small\">{{ product.name }}</h2>\n \n <Price :product=\"product\" size=\"big\" class=\"flex gap-micro flex-center pd-small br-solid br-1px br-black-transp-10 w-max mn-b-medium\" />\n\n <p v-if=\"product.description && !product.localization < 1 && !recommendation\" class=\"w-100 t-transp mn-b-small\">\n {{ product.description }}\n </p>\n <p v-if=\"product.localization && product.localization.length > 1 && !recommendation\" class=\"w-100 t-transp mn-b-small\">\n {{ t('description') }}\n </p>\n\n <div class=\"cols-2 mn-b-small w-100 gap-small\">\n <div\n v-if=\"product.information.length > 0\"\n v-for=\"information in product.information\"\n class=\"w-100 pd-small radius-small bg-light product-information\"\n >\n <p class=\"t-demi\">{{ information.name }}</p>\n <p>{{ information.value }}</p>\n </div>\n </div>\n\n <p class=\"t-medium mn-b-small\">Provided by</p>\n <CardOrganization \n v-if=\"product.owner\"\n :organization=\"product.owner.target\"\n :showRating=\"true\"\n :showFollowers=\"false\"\n :showProducts=\"false\"\n class=\"bg-light mn-b-thin w-100 o-hidden radius-medium pd-small \"\n />\n\n\n\n <div class=\"w-max-33r\">\n <div class=\"w-max-33r\">\n\t\t <div v-if=\"product.listing === 'rent'\">\n\t\t <button @click=\"openPopup\" class=\"cursor-pointer pd-small radius-big w-max mobile:w-100 bg-main button\">\n\t\t <div class=\"gap-thin flex flex-center flex-nowrap\">\n\t\t <IconShopcartAdd class=\"i-semi\" />\n\t\t <span>{{ t('addtoorder') }}</span>\n\t\t </div>\n\t\t </button>\n\t\t <PopupDateSelector\n\t\t :product=\"product\"\n\t\t :isOpen=\"isPopupOpen\"\n\t\t :showFees=\"globals.state.options?.orders.showFees\"\n :feesRate=\"globals.state.options?.orders.feesRate || 0.15\"\n :showVat=\"globals.state.options?.orders.showVat\"\n :vatRate=\"globals.state.options?.orders.vatRate || 0\"\n\t\t :onConfirm=\"selectedDates => addToCart(product, selectedDates)\"\n\t\t @close=\"closePopup\"\n\t\t />\n\t\t </div>\n\t <div v-else>\n\t <Button\n\t v-if=\"product.available > 0\"\n\t :submit=\"() => addToCart(product, null)\"\n\t class=\"h-3r w-max mobile:w-100 bg-main button\"\n\t >\n\t <div class=\"gap-thin flex flex-center flex-nowrap\">\n\t <IconShopcartAdd class=\"i-semi\" />\n\t <span>{{ t('addtoorder') }}</span>\n\t </div>\n\t </Button>\n\t <div\n\t v-else\n\t class=\"flex-center flex uppercase radius-big t-black w-max pd-small t-medium bg-grey h-3r w-100 mn-r-smallbutton\"\n\t >\n\t Out of Stock\n\t </div>\n\t </div>\n\t </div>\n </div>\n </div>\n </div>\n\n <div class=\"h-max mn-t-big pos-relative\">\n <h3 class=\"pd-b-small\">Most Popular</h3>\n <PopularProducts class=\"mn-r-big-negative mn-l-big-negative\"/>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { computed, ref, onMounted, getCurrentInstance } from 'vue'\nimport { useRoute, useRouter } from 'vue-router'\nimport { useI18n } from 'vue-i18n'\n\n\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth'\nimport * as globals from '@martyrs/src/modules/globals/views/store/globals'\nimport * as products from '@martyrs/src/modules/products/store/products'\nimport * as categories from '@martyrs/src/modules/products/store/categories'\nimport * as shopcart from '@martyrs/src/modules/orders/store/shopcart'\n\nimport Button from '@martyrs/src/components/Button/Button.vue'\nimport Popup from '@martyrs/src/components/Popup/Popup.vue'\nimport Tab from '@martyrs/src/components/Tab/Tab.vue'\nimport Calendar from '@martyrs/src/components/DatePicker/Calendar.vue'\nimport PopupDateSelector from '@martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue'\nimport IconEdit from '@martyrs/src/modules/icons/navigation/IconEdit.vue'\nimport IconShopcartAdd from '@martyrs/src/modules/icons/actions/IconShopcartAdd.vue'\nimport ImagesThumbnails from '@martyrs/src/modules/products/components/blocks/ImagesThumbnails.vue'\nimport Price from '@martyrs/src/modules/products/components/elements/Price.vue'\nimport PopularProducts from '@martyrs/src/modules/products/components/sections/PopularProducts.vue'\n\n import CardOrganization from '@martyrs/src/modules/organizations/components/blocks/CardOrganization.vue'\n\nconst route = useRoute()\nconst router = useRouter()\nconst { proxy } = getCurrentInstance()\n\nconst product = computed(() => products.state.current)\nconst images = computed(() => products.state.current.images)\n\nconst tabProduct = ref('description')\n\nconst text = {\n en: { addtoorder: 'Add to Cart', fastorder: 'Fast Order' },\n ru: { addtoorder: 'Добавить в корзину', fastorder: 'Быстрый заказ' }\n}\n\nconst { t } = useI18n({ messages: text })\n\nconst isPopupOpen = ref(false)\n\nfunction openPopup() {\n isPopupOpen.value = true\n}\n\nfunction closePopup() {\n isPopupOpen.value = false\n}\n\nconst emits = defineEmits(['page-loading', 'page-loaded']);\n \nconst pageProduct = ref(null)\nconst orderOrganization = ref(null)\n\nproducts.state.current = null\nonMounted(async () => {\n\n emits('page-loading');\n await products.actions.read({ _id: route.params.product })\n emits('page-loaded');\n\n // route.meta.title.en = product.value.name\n // route.meta.title.ru = roduct.value.name\n\n})\n\n// onBeforeMounted\n\nfunction validateToCard(product) {\n return !(product.available > 0)\n}\n\nasync function addToCart(product, selectedDates = null) {\n try {\n // Если организация товара отличается от текущей в корзине\n if (shopcart.state.organization && shopcart.state.organization !== product.owner.target) {\n const result = await proxy.$alert({\n title: 'Start a new order?',\n message: `Your cart has items from another vendor. If you continue, we'll clear it so you can order from this one instead.`,\n actions: [\n { label: 'Cancel', value: false },\n { label: 'Start New Order', value: true }\n ]\n })\n\n if (!result) throw error\n\n shopcart.state.organization = product.owner.target\n shopcart.state.positions = []\n }\n\n await shopcart.actions.addProductToCart(product, product.owner.target, selectedDates)\n return true\n } catch (error) {\n console.error('Error while adding product to cart:', error)\n throw error\n }\n}\n</script>\n\n<style lang=\"scss\">\n</style>"],"names":["useRoute","useRouter","getCurrentInstance","computed","products.state","ref","useI18n","onMounted","products.actions","product","shopcart.state","shopcart.actions","error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+HA,UAAM,QAAQA,UAAQ,SAAA;AACPC,cAAS,UAAA;AACxB,UAAM,EAAE,MAAO,IAAGC,IAAkB,mBAAA;AAEpC,UAAM,UAAUC,IAAAA,SAAS,MAAMC,SAAAA,MAAe,OAAO;AACrD,UAAM,SAASD,IAAQ,SAAC,MAAMC,SAAc,MAAC,QAAQ,MAAM;AAExCC,QAAAA,IAAI,aAAa;AAEpC,UAAM,OAAO;AAAA,MACX,IAAI,EAAE,YAAY,eAAe,WAAW,aAAc;AAAA,MAC1D,IAAI,EAAE,YAAY,sBAAsB,WAAW,gBAAe;AAAA,IACpE;AAEA,UAAM,EAAE,EAAC,IAAKC,QAAAA,QAAQ,EAAE,UAAU,KAAM,CAAA;AAExC,UAAM,cAAcD,IAAG,IAAC,KAAK;AAE7B,aAAS,YAAY;AACnB,kBAAY,QAAQ;AAAA,IACtB;AAEA,aAAS,aAAa;AACpB,kBAAY,QAAQ;AAAA,IACtB;AAEA,UAAM,QAAQ;AAEMA,QAAAA,IAAI,IAAI;AACFA,QAAAA,IAAI,IAAI;AAElCD,aAAc,MAAC,UAAU;AACzBG,QAAAA,UAAU,YAAY;AAEpB,YAAM,cAAc;AACpB,YAAMC,SAAAA,QAAiB,KAAK,EAAE,KAAK,MAAM,OAAO,QAAS,CAAA;AACzD,YAAM,aAAa;AAAA,IAKrB,CAAC;AAQD,mBAAe,UAAUC,UAAS,gBAAgB,MAAM;AACtD,UAAI;AAEF,YAAIC,SAAAA,MAAe,gBAAgBA,SAAc,MAAC,iBAAiBD,SAAQ,MAAM,QAAQ;AACvF,gBAAM,SAAS,MAAM,MAAM,OAAO;AAAA,YAChC,OAAO;AAAA,YACP,SAAS;AAAA,YACT,SAAS;AAAA,cACP,EAAE,OAAO,UAAU,OAAO,MAAO;AAAA,cACjC,EAAE,OAAO,mBAAmB,OAAO,KAAI;AAAA,YACjD;AAAA,UACO,CAAA;AAED,cAAI,CAAC,OAAQ,OAAM;AAEnBC,yBAAe,eAAeD,SAAQ,MAAM;AAC5CC,mBAAAA,MAAe,YAAY,CAAA;AAAA,QACjC;AAEI,cAAMC,SAAAA,QAAiB,iBAAiBF,UAASA,SAAQ,MAAM,QAAQ,aAAa;AACpF,eAAO;AAAA,MACR,SAAQG,QAAO;AACd,gBAAQ,MAAM,uCAAuCA,MAAK;AAC1D,cAAMA;AAAA,MACV;AAAA,IACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, ref, onMounted, createElementBlock, createCommentVNode, openBlock, createElementVNode, createVNode, createBlock, unref, toDisplayString,
|
|
1
|
+
import { getCurrentInstance, computed, ref, onMounted, createElementBlock, createCommentVNode, openBlock, createElementVNode, createVNode, createBlock, unref, toDisplayString, Fragment, renderList, withCtx } from "vue";
|
|
2
2
|
import { useRoute, useRouter } from "vue-router";
|
|
3
3
|
import { useI18n } from "vue-i18n";
|
|
4
4
|
import "../../../auth/views/store/auth.js";
|
|
@@ -8,13 +8,14 @@ import "../../store/categories.js";
|
|
|
8
8
|
import { state as state$2, actions as actions$1 } from "../../../orders/store/shopcart.js";
|
|
9
9
|
import _sfc_main$6 from "../../../../components/Button/Button.vue.js";
|
|
10
10
|
/* empty css */
|
|
11
|
-
|
|
11
|
+
/* empty css */
|
|
12
12
|
import _sfc_main$5 from "../../../globals/views/components/blocks/PopupDateSelector.vue.js";
|
|
13
13
|
import _sfc_main$1 from "../../../icons/navigation/IconEdit.vue.js";
|
|
14
14
|
import _sfc_main$4 from "../../../icons/actions/IconShopcartAdd.vue.js";
|
|
15
15
|
import ImagesThumbnails from "../blocks/ImagesThumbnails.vue.js";
|
|
16
16
|
import _sfc_main$2 from "../elements/Price.vue.js";
|
|
17
17
|
import _sfc_main$7 from "../sections/PopularProducts.vue.js";
|
|
18
|
+
import _sfc_main$3 from "../../../organizations/components/blocks/CardOrganization.vue.js";
|
|
18
19
|
const _hoisted_1 = {
|
|
19
20
|
key: 0,
|
|
20
21
|
class: "h-100 w-100 mobile:pd-thin pd-big bg-white"
|
|
@@ -24,46 +25,36 @@ const _hoisted_3 = { class: "pos-relative w-100 h-100 flex-column flex-h-center
|
|
|
24
25
|
const _hoisted_4 = { class: "w-100 h1-product mn-b-small" };
|
|
25
26
|
const _hoisted_5 = {
|
|
26
27
|
key: 1,
|
|
27
|
-
class: "
|
|
28
|
+
class: "w-100 t-transp mn-b-small"
|
|
28
29
|
};
|
|
29
30
|
const _hoisted_6 = {
|
|
30
|
-
key:
|
|
31
|
-
class: "
|
|
32
|
-
};
|
|
33
|
-
const _hoisted_7 = {
|
|
34
|
-
key: 0,
|
|
35
|
-
class: "w-100 t-transp"
|
|
36
|
-
};
|
|
37
|
-
const _hoisted_8 = {
|
|
38
|
-
key: 1,
|
|
39
|
-
class: "w-100 t-transp"
|
|
40
|
-
};
|
|
41
|
-
const _hoisted_9 = {
|
|
42
|
-
key: 1,
|
|
43
|
-
class: "cols-2 pd-medium w-100 gap-small"
|
|
31
|
+
key: 2,
|
|
32
|
+
class: "w-100 t-transp mn-b-small"
|
|
44
33
|
};
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
34
|
+
const _hoisted_7 = { class: "cols-2 mn-b-small w-100 gap-small" };
|
|
35
|
+
const _hoisted_8 = { class: "w-100 pd-small radius-small bg-light product-information" };
|
|
36
|
+
const _hoisted_9 = { class: "t-demi" };
|
|
37
|
+
const _hoisted_10 = { class: "w-max-33r" };
|
|
38
|
+
const _hoisted_11 = { class: "w-max-33r" };
|
|
39
|
+
const _hoisted_12 = { key: 0 };
|
|
40
|
+
const _hoisted_13 = { class: "gap-thin flex flex-center flex-nowrap" };
|
|
41
|
+
const _hoisted_14 = { key: 1 };
|
|
50
42
|
const _hoisted_15 = { class: "gap-thin flex flex-center flex-nowrap" };
|
|
51
|
-
const _hoisted_16 = {
|
|
52
|
-
const _hoisted_17 = { class: "gap-thin flex flex-center flex-nowrap" };
|
|
53
|
-
const _hoisted_18 = {
|
|
43
|
+
const _hoisted_16 = {
|
|
54
44
|
key: 1,
|
|
55
45
|
class: "flex-center flex uppercase radius-big t-black w-max pd-small t-medium bg-grey h-3r w-100 mn-r-smallbutton"
|
|
56
46
|
};
|
|
57
|
-
const
|
|
47
|
+
const _hoisted_17 = { class: "h-max mn-t-big pos-relative" };
|
|
58
48
|
const _sfc_main = {
|
|
59
49
|
__name: "Product",
|
|
60
50
|
emits: ["page-loading", "page-loaded"],
|
|
61
51
|
setup(__props, { emit: __emit }) {
|
|
62
52
|
const route = useRoute();
|
|
63
53
|
useRouter();
|
|
54
|
+
const { proxy } = getCurrentInstance();
|
|
64
55
|
const product = computed(() => state.current);
|
|
65
56
|
const images = computed(() => state.current.images);
|
|
66
|
-
|
|
57
|
+
ref("description");
|
|
67
58
|
const text = {
|
|
68
59
|
en: { addtoorder: "Add to Cart", fastorder: "Fast Order" },
|
|
69
60
|
ru: { addtoorder: "Добавить в корзину", fastorder: "Быстрый заказ" }
|
|
@@ -78,6 +69,7 @@ const _sfc_main = {
|
|
|
78
69
|
}
|
|
79
70
|
const emits = __emit;
|
|
80
71
|
ref(null);
|
|
72
|
+
ref(null);
|
|
81
73
|
state.current = null;
|
|
82
74
|
onMounted(async () => {
|
|
83
75
|
emits("page-loading");
|
|
@@ -86,15 +78,24 @@ const _sfc_main = {
|
|
|
86
78
|
});
|
|
87
79
|
async function addToCart(product2, selectedDates = null) {
|
|
88
80
|
try {
|
|
89
|
-
if (state$2.organization !== product2.owner.target) {
|
|
81
|
+
if (state$2.organization && state$2.organization !== product2.owner.target) {
|
|
82
|
+
const result = await proxy.$alert({
|
|
83
|
+
title: "Start a new order?",
|
|
84
|
+
message: `Your cart has items from another vendor. If you continue, we'll clear it so you can order from this one instead.`,
|
|
85
|
+
actions: [
|
|
86
|
+
{ label: "Cancel", value: false },
|
|
87
|
+
{ label: "Start New Order", value: true }
|
|
88
|
+
]
|
|
89
|
+
});
|
|
90
|
+
if (!result) throw error;
|
|
90
91
|
state$2.organization = product2.owner.target;
|
|
91
92
|
state$2.positions = [];
|
|
92
93
|
}
|
|
93
94
|
await actions$1.addProductToCart(product2, product2.owner.target, selectedDates);
|
|
94
95
|
return true;
|
|
95
|
-
} catch (
|
|
96
|
-
console.error("
|
|
97
|
-
throw
|
|
96
|
+
} catch (error2) {
|
|
97
|
+
console.error("Error while adding product to cart:", error2);
|
|
98
|
+
throw error2;
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
return (_ctx, _cache) => {
|
|
@@ -117,42 +118,33 @@ const _sfc_main = {
|
|
|
117
118
|
size: "big",
|
|
118
119
|
class: "flex gap-micro flex-center pd-small br-solid br-1px br-black-transp-10 w-max mn-b-medium"
|
|
119
120
|
}, null, 8, ["product"]),
|
|
120
|
-
product.value.description
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
]
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}), 256)) : createCommentVNode("", true)
|
|
143
|
-
]))
|
|
144
|
-
]),
|
|
145
|
-
_: 1
|
|
146
|
-
})
|
|
147
|
-
])) : createCommentVNode("", true),
|
|
148
|
-
createElementVNode("div", _hoisted_12, [
|
|
149
|
-
createElementVNode("div", _hoisted_13, [
|
|
150
|
-
product.value.listing === "rent" ? (openBlock(), createElementBlock("div", _hoisted_14, [
|
|
121
|
+
product.value.description && !product.value.localization < 1 && !_ctx.recommendation ? (openBlock(), createElementBlock("p", _hoisted_5, toDisplayString(product.value.description), 1)) : createCommentVNode("", true),
|
|
122
|
+
product.value.localization && product.value.localization.length > 1 && !_ctx.recommendation ? (openBlock(), createElementBlock("p", _hoisted_6, toDisplayString(unref(t)("description")), 1)) : createCommentVNode("", true),
|
|
123
|
+
createElementVNode("div", _hoisted_7, [
|
|
124
|
+
product.value.information.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(product.value.information, (information) => {
|
|
125
|
+
return openBlock(), createElementBlock("div", _hoisted_8, [
|
|
126
|
+
createElementVNode("p", _hoisted_9, toDisplayString(information.name), 1),
|
|
127
|
+
createElementVNode("p", null, toDisplayString(information.value), 1)
|
|
128
|
+
]);
|
|
129
|
+
}), 256)) : createCommentVNode("", true)
|
|
130
|
+
]),
|
|
131
|
+
_cache[1] || (_cache[1] = createElementVNode("p", { class: "t-medium mn-b-small" }, "Provided by", -1)),
|
|
132
|
+
product.value.owner ? (openBlock(), createBlock(_sfc_main$3, {
|
|
133
|
+
key: 3,
|
|
134
|
+
organization: product.value.owner.target,
|
|
135
|
+
showRating: true,
|
|
136
|
+
showFollowers: false,
|
|
137
|
+
showProducts: false,
|
|
138
|
+
class: "bg-light mn-b-thin w-100 o-hidden radius-medium pd-small"
|
|
139
|
+
}, null, 8, ["organization"])) : createCommentVNode("", true),
|
|
140
|
+
createElementVNode("div", _hoisted_10, [
|
|
141
|
+
createElementVNode("div", _hoisted_11, [
|
|
142
|
+
product.value.listing === "rent" ? (openBlock(), createElementBlock("div", _hoisted_12, [
|
|
151
143
|
createElementVNode("button", {
|
|
152
144
|
onClick: openPopup,
|
|
153
145
|
class: "cursor-pointer pd-small radius-big w-max mobile:w-100 bg-main button"
|
|
154
146
|
}, [
|
|
155
|
-
createElementVNode("div",
|
|
147
|
+
createElementVNode("div", _hoisted_13, [
|
|
156
148
|
createVNode(_sfc_main$4, { class: "i-semi" }),
|
|
157
149
|
createElementVNode("span", null, toDisplayString(unref(t)("addtoorder")), 1)
|
|
158
150
|
])
|
|
@@ -167,27 +159,27 @@ const _sfc_main = {
|
|
|
167
159
|
onConfirm: (selectedDates) => addToCart(product.value, selectedDates),
|
|
168
160
|
onClose: closePopup
|
|
169
161
|
}, null, 8, ["product", "isOpen", "showFees", "feesRate", "showVat", "vatRate", "onConfirm"])
|
|
170
|
-
])) : (openBlock(), createElementBlock("div",
|
|
162
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_14, [
|
|
171
163
|
product.value.available > 0 ? (openBlock(), createBlock(_sfc_main$6, {
|
|
172
164
|
key: 0,
|
|
173
|
-
|
|
174
|
-
class: "h-3r w-100 bg-main button"
|
|
165
|
+
submit: () => addToCart(product.value, null),
|
|
166
|
+
class: "h-3r w-max mobile:w-100 bg-main button"
|
|
175
167
|
}, {
|
|
176
168
|
default: withCtx(() => [
|
|
177
|
-
createElementVNode("div",
|
|
169
|
+
createElementVNode("div", _hoisted_15, [
|
|
178
170
|
createVNode(_sfc_main$4, { class: "i-semi" }),
|
|
179
171
|
createElementVNode("span", null, toDisplayString(unref(t)("addtoorder")), 1)
|
|
180
172
|
])
|
|
181
173
|
]),
|
|
182
174
|
_: 1
|
|
183
|
-
})) : (openBlock(), createElementBlock("div",
|
|
175
|
+
}, 8, ["submit"])) : (openBlock(), createElementBlock("div", _hoisted_16, " Out of Stock "))
|
|
184
176
|
]))
|
|
185
177
|
])
|
|
186
178
|
])
|
|
187
179
|
])
|
|
188
180
|
]),
|
|
189
|
-
createElementVNode("div",
|
|
190
|
-
_cache[
|
|
181
|
+
createElementVNode("div", _hoisted_17, [
|
|
182
|
+
_cache[2] || (_cache[2] = createElementVNode("h3", { class: "pd-b-small" }, "Most Popular", -1)),
|
|
191
183
|
createVNode(_sfc_main$7, { class: "mn-r-big-negative mn-l-big-negative" })
|
|
192
184
|
])
|
|
193
185
|
])) : createCommentVNode("", true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Product.vue.js","sources":["../../../../../../../src/modules/products/components/pages/Product.vue"],"sourcesContent":["<template>\n <div v-if=\"products.state.current\" class=\"h-100 w-100 mobile:pd-thin pd-big bg-white\">\n <div class=\"cols-2-1_2 w-100 gap-medium\">\n\n <ImagesThumbnails\n :images=\"images\"\n :product=\"product\"\n />\n\n <div class=\"pos-relative w-100 h-100 flex-column flex-h-center flex\">\n <IconEdit\n v-if=\"accesses && hasAccess(route.params._id, 'products', 'edit', accesses)\"\n @click=\"$router.push({ name: 'ProductEdit', params: { _id: product.owner.target, product: product._id } })\"\n class=\"pos-absolute pos-t-regular pos-r-regular i-regular t-transp\"\n />\n <h2 class=\"w-100 h1-product mn-b-small\">{{ product.name }}</h2>\n <Price :product=\"product\" size=\"big\" class=\"flex gap-micro flex-center pd-small br-solid br-1px br-black-transp-10 w-max mn-b-medium\" />\n\n <
|
|
1
|
+
{"version":3,"file":"Product.vue.js","sources":["../../../../../../../src/modules/products/components/pages/Product.vue"],"sourcesContent":["<template>\n <div v-if=\"products.state.current\" class=\"h-100 w-100 mobile:pd-thin pd-big bg-white\">\n <div class=\"cols-2-1_2 w-100 gap-medium\">\n\n <ImagesThumbnails\n :images=\"images\"\n :product=\"product\"\n />\n\n <div class=\"pos-relative w-100 h-100 flex-column flex-h-center flex\">\n <IconEdit\n v-if=\"accesses && hasAccess(route.params._id, 'products', 'edit', accesses)\"\n @click=\"$router.push({ name: 'ProductEdit', params: { _id: product.owner.target, product: product._id } })\"\n class=\"pos-absolute pos-t-regular pos-r-regular i-regular t-transp\"\n />\n\n\n\n <h2 class=\"w-100 h1-product mn-b-small\">{{ product.name }}</h2>\n \n <Price :product=\"product\" size=\"big\" class=\"flex gap-micro flex-center pd-small br-solid br-1px br-black-transp-10 w-max mn-b-medium\" />\n\n <p v-if=\"product.description && !product.localization < 1 && !recommendation\" class=\"w-100 t-transp mn-b-small\">\n {{ product.description }}\n </p>\n <p v-if=\"product.localization && product.localization.length > 1 && !recommendation\" class=\"w-100 t-transp mn-b-small\">\n {{ t('description') }}\n </p>\n\n <div class=\"cols-2 mn-b-small w-100 gap-small\">\n <div\n v-if=\"product.information.length > 0\"\n v-for=\"information in product.information\"\n class=\"w-100 pd-small radius-small bg-light product-information\"\n >\n <p class=\"t-demi\">{{ information.name }}</p>\n <p>{{ information.value }}</p>\n </div>\n </div>\n\n <p class=\"t-medium mn-b-small\">Provided by</p>\n <CardOrganization \n v-if=\"product.owner\"\n :organization=\"product.owner.target\"\n :showRating=\"true\"\n :showFollowers=\"false\"\n :showProducts=\"false\"\n class=\"bg-light mn-b-thin w-100 o-hidden radius-medium pd-small \"\n />\n\n\n\n <div class=\"w-max-33r\">\n <div class=\"w-max-33r\">\n\t\t <div v-if=\"product.listing === 'rent'\">\n\t\t <button @click=\"openPopup\" class=\"cursor-pointer pd-small radius-big w-max mobile:w-100 bg-main button\">\n\t\t <div class=\"gap-thin flex flex-center flex-nowrap\">\n\t\t <IconShopcartAdd class=\"i-semi\" />\n\t\t <span>{{ t('addtoorder') }}</span>\n\t\t </div>\n\t\t </button>\n\t\t <PopupDateSelector\n\t\t :product=\"product\"\n\t\t :isOpen=\"isPopupOpen\"\n\t\t :showFees=\"globals.state.options?.orders.showFees\"\n :feesRate=\"globals.state.options?.orders.feesRate || 0.15\"\n :showVat=\"globals.state.options?.orders.showVat\"\n :vatRate=\"globals.state.options?.orders.vatRate || 0\"\n\t\t :onConfirm=\"selectedDates => addToCart(product, selectedDates)\"\n\t\t @close=\"closePopup\"\n\t\t />\n\t\t </div>\n\t <div v-else>\n\t <Button\n\t v-if=\"product.available > 0\"\n\t :submit=\"() => addToCart(product, null)\"\n\t class=\"h-3r w-max mobile:w-100 bg-main button\"\n\t >\n\t <div class=\"gap-thin flex flex-center flex-nowrap\">\n\t <IconShopcartAdd class=\"i-semi\" />\n\t <span>{{ t('addtoorder') }}</span>\n\t </div>\n\t </Button>\n\t <div\n\t v-else\n\t class=\"flex-center flex uppercase radius-big t-black w-max pd-small t-medium bg-grey h-3r w-100 mn-r-smallbutton\"\n\t >\n\t Out of Stock\n\t </div>\n\t </div>\n\t </div>\n </div>\n </div>\n </div>\n\n <div class=\"h-max mn-t-big pos-relative\">\n <h3 class=\"pd-b-small\">Most Popular</h3>\n <PopularProducts class=\"mn-r-big-negative mn-l-big-negative\"/>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { computed, ref, onMounted, getCurrentInstance } from 'vue'\nimport { useRoute, useRouter } from 'vue-router'\nimport { useI18n } from 'vue-i18n'\n\n\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth'\nimport * as globals from '@martyrs/src/modules/globals/views/store/globals'\nimport * as products from '@martyrs/src/modules/products/store/products'\nimport * as categories from '@martyrs/src/modules/products/store/categories'\nimport * as shopcart from '@martyrs/src/modules/orders/store/shopcart'\n\nimport Button from '@martyrs/src/components/Button/Button.vue'\nimport Popup from '@martyrs/src/components/Popup/Popup.vue'\nimport Tab from '@martyrs/src/components/Tab/Tab.vue'\nimport Calendar from '@martyrs/src/components/DatePicker/Calendar.vue'\nimport PopupDateSelector from '@martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue'\nimport IconEdit from '@martyrs/src/modules/icons/navigation/IconEdit.vue'\nimport IconShopcartAdd from '@martyrs/src/modules/icons/actions/IconShopcartAdd.vue'\nimport ImagesThumbnails from '@martyrs/src/modules/products/components/blocks/ImagesThumbnails.vue'\nimport Price from '@martyrs/src/modules/products/components/elements/Price.vue'\nimport PopularProducts from '@martyrs/src/modules/products/components/sections/PopularProducts.vue'\n\n import CardOrganization from '@martyrs/src/modules/organizations/components/blocks/CardOrganization.vue'\n\nconst route = useRoute()\nconst router = useRouter()\nconst { proxy } = getCurrentInstance()\n\nconst product = computed(() => products.state.current)\nconst images = computed(() => products.state.current.images)\n\nconst tabProduct = ref('description')\n\nconst text = {\n en: { addtoorder: 'Add to Cart', fastorder: 'Fast Order' },\n ru: { addtoorder: 'Добавить в корзину', fastorder: 'Быстрый заказ' }\n}\n\nconst { t } = useI18n({ messages: text })\n\nconst isPopupOpen = ref(false)\n\nfunction openPopup() {\n isPopupOpen.value = true\n}\n\nfunction closePopup() {\n isPopupOpen.value = false\n}\n\nconst emits = defineEmits(['page-loading', 'page-loaded']);\n \nconst pageProduct = ref(null)\nconst orderOrganization = ref(null)\n\nproducts.state.current = null\nonMounted(async () => {\n\n emits('page-loading');\n await products.actions.read({ _id: route.params.product })\n emits('page-loaded');\n\n // route.meta.title.en = product.value.name\n // route.meta.title.ru = roduct.value.name\n\n})\n\n// onBeforeMounted\n\nfunction validateToCard(product) {\n return !(product.available > 0)\n}\n\nasync function addToCart(product, selectedDates = null) {\n try {\n // Если организация товара отличается от текущей в корзине\n if (shopcart.state.organization && shopcart.state.organization !== product.owner.target) {\n const result = await proxy.$alert({\n title: 'Start a new order?',\n message: `Your cart has items from another vendor. If you continue, we'll clear it so you can order from this one instead.`,\n actions: [\n { label: 'Cancel', value: false },\n { label: 'Start New Order', value: true }\n ]\n })\n\n if (!result) throw error\n\n shopcart.state.organization = product.owner.target\n shopcart.state.positions = []\n }\n\n await shopcart.actions.addProductToCart(product, product.owner.target, selectedDates)\n return true\n } catch (error) {\n console.error('Error while adding product to cart:', error)\n throw error\n }\n}\n</script>\n\n<style lang=\"scss\">\n</style>"],"names":["products.state","products.actions","product","shopcart.state","shopcart.actions","error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+HA,UAAM,QAAQ,SAAQ;AACP,cAAS;AACxB,UAAM,EAAE,MAAO,IAAG,mBAAkB;AAEpC,UAAM,UAAU,SAAS,MAAMA,MAAe,OAAO;AACrD,UAAM,SAAS,SAAS,MAAMA,MAAe,QAAQ,MAAM;AAExC,QAAI,aAAa;AAEpC,UAAM,OAAO;AAAA,MACX,IAAI,EAAE,YAAY,eAAe,WAAW,aAAc;AAAA,MAC1D,IAAI,EAAE,YAAY,sBAAsB,WAAW,gBAAe;AAAA,IACpE;AAEA,UAAM,EAAE,EAAC,IAAK,QAAQ,EAAE,UAAU,KAAM,CAAA;AAExC,UAAM,cAAc,IAAI,KAAK;AAE7B,aAAS,YAAY;AACnB,kBAAY,QAAQ;AAAA,IACtB;AAEA,aAAS,aAAa;AACpB,kBAAY,QAAQ;AAAA,IACtB;AAEA,UAAM,QAAQ;AAEM,QAAI,IAAI;AACF,QAAI,IAAI;AAElCA,UAAe,UAAU;AACzB,cAAU,YAAY;AAEpB,YAAM,cAAc;AACpB,YAAMC,QAAiB,KAAK,EAAE,KAAK,MAAM,OAAO,QAAS,CAAA;AACzD,YAAM,aAAa;AAAA,IAKrB,CAAC;AAQD,mBAAe,UAAUC,UAAS,gBAAgB,MAAM;AACtD,UAAI;AAEF,YAAIC,QAAe,gBAAgBA,QAAe,iBAAiBD,SAAQ,MAAM,QAAQ;AACvF,gBAAM,SAAS,MAAM,MAAM,OAAO;AAAA,YAChC,OAAO;AAAA,YACP,SAAS;AAAA,YACT,SAAS;AAAA,cACP,EAAE,OAAO,UAAU,OAAO,MAAO;AAAA,cACjC,EAAE,OAAO,mBAAmB,OAAO,KAAI;AAAA,YACjD;AAAA,UACO,CAAA;AAED,cAAI,CAAC,OAAQ,OAAM;AAEnBC,kBAAe,eAAeD,SAAQ,MAAM;AAC5CC,kBAAe,YAAY,CAAA;AAAA,QACjC;AAEI,cAAMC,UAAiB,iBAAiBF,UAASA,SAAQ,MAAM,QAAQ,aAAa;AACpF,eAAO;AAAA,MACR,SAAQG,QAAO;AACd,gBAAQ,MAAM,uCAAuCA,MAAK;AAC1D,cAAMA;AAAA,MACV;AAAA,IACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|