@ozdao/martyrs 0.2.428 → 0.2.430
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/community.server.js +1 -1
- package/dist/community.server.mjs +1 -1
- package/dist/events.server.js +1 -1
- package/dist/events.server.mjs +1 -1
- package/dist/gallery.server.js +1 -1
- package/dist/gallery.server.mjs +1 -1
- package/dist/{globals.logger-Deb_8o7C.mjs → globals.cache-BT6q3vOf.mjs} +0 -33
- package/dist/{globals.logger-BuG0pN80.js → globals.cache-CwWvNGFQ.js} +0 -33
- package/dist/globals.logger-BdjooLaD.js +34 -0
- package/dist/globals.logger-DusiFsxN.mjs +35 -0
- package/dist/martyrs/src/modules/chats/components/pages/ChatPage.vue.cjs +13 -3
- package/dist/martyrs/src/modules/chats/components/pages/ChatPage.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/chats/components/pages/ChatPage.vue.js +14 -4
- package/dist/martyrs/src/modules/chats/components/pages/ChatPage.vue.js.map +1 -1
- package/dist/martyrs/src/modules/chats/components/sections/ChatWindow.vue.cjs +24 -6
- package/dist/martyrs/src/modules/chats/components/sections/ChatWindow.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/chats/components/sections/ChatWindow.vue.js +25 -7
- package/dist/martyrs/src/modules/chats/components/sections/ChatWindow.vue.js.map +1 -1
- package/dist/martyrs/src/modules/chats/store/chat.store.cjs +7 -8
- package/dist/martyrs/src/modules/chats/store/chat.store.cjs.map +1 -1
- package/dist/martyrs/src/modules/chats/store/chat.store.js +7 -8
- package/dist/martyrs/src/modules/chats/store/chat.store.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/globals.websocket.cjs +6 -8
- package/dist/martyrs/src/modules/globals/views/classes/globals.websocket.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/globals.websocket.js +6 -8
- package/dist/martyrs/src/modules/globals/views/classes/globals.websocket.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs +11 -8
- 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 +11 -8
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.cjs +5 -5
- package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.js +5 -5
- package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.cjs +17 -9
- package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.js +17 -9
- package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Sidebar.vue.cjs +16 -4
- package/dist/martyrs/src/modules/globals/views/components/partials/Sidebar.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Sidebar.vue.js +16 -4
- package/dist/martyrs/src/modules/globals/views/components/partials/Sidebar.vue.js.map +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.cjs +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js.map +1 -1
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.cjs +7 -1
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js +7 -1
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderBackoffice.vue.cjs +112 -0
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderBackoffice.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderBackoffice.vue.js +112 -0
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderBackoffice.vue.js.map +1 -0
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderItem.vue.cjs +2 -2
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderItem.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderItem.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderItem.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.cjs +18 -12
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.js +18 -12
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +200 -92
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +213 -105
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs +9 -12
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +10 -13
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +14 -6
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +23 -15
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.cjs +16 -99
- package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js +16 -99
- package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.cjs +2 -2
- 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 +2 -2
- package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.cjs +99 -99
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +102 -102
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormPayment.vue.cjs +14 -8
- package/dist/martyrs/src/modules/orders/components/sections/FormPayment.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormPayment.vue.js +15 -9
- package/dist/martyrs/src/modules/orders/components/sections/FormPayment.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/store/orders.cjs +51 -0
- package/dist/martyrs/src/modules/orders/store/orders.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/store/orders.js +51 -0
- package/dist/martyrs/src/modules/orders/store/orders.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.cjs +59 -56
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +63 -60
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/store/organizations.cjs +0 -2
- package/dist/martyrs/src/modules/organizations/store/organizations.cjs.map +1 -1
- package/dist/martyrs/src/modules/organizations/store/organizations.js +1 -3
- package/dist/martyrs/src/modules/organizations/store/organizations.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.cjs +4 -3
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +5 -4
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js.map +1 -1
- package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.cjs +15 -12
- package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.js +15 -12
- package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.js.map +1 -1
- package/dist/martyrs/src/modules/spots/store/spots.cjs +2 -2
- package/dist/martyrs/src/modules/spots/store/spots.cjs.map +1 -1
- package/dist/martyrs/src/modules/spots/store/spots.js +2 -2
- package/dist/martyrs/src/modules/spots/store/spots.js.map +1 -1
- package/dist/martyrs.css +1 -1
- package/dist/orders.server.js +11 -4
- package/dist/orders.server.mjs +10 -3
- package/dist/organizations.server.js +33 -30
- package/dist/organizations.server.mjs +33 -30
- package/dist/products.server.js +1 -1
- package/dist/products.server.mjs +1 -1
- package/dist/{queryProcessor-CCmHM0yi.mjs → queryProcessor-CWnMIe2U.mjs} +4 -1
- package/dist/{queryProcessor-CwQakZkT.js → queryProcessor-D6GuKfTV.js} +4 -1
- package/dist/rents.server.js +4 -3
- package/dist/rents.server.mjs +3 -2
- package/dist/spots.server.js +41 -12
- package/dist/spots.server.mjs +41 -12
- package/dist/style.css +57 -65
- package/dist/wallet.server.js +1 -1
- package/dist/wallet.server.mjs +1 -1
- package/package.json +1 -1
- package/src/modules/chats/components/pages/ChatPage.vue +18 -23
- package/src/modules/chats/components/sections/ChatWindow.vue +55 -38
- package/src/modules/chats/store/chat.store.js +20 -21
- package/src/modules/globals/controllers/utils/queryProcessor.js +2 -1
- package/src/modules/globals/views/classes/globals.websocket.js +10 -11
- package/src/modules/globals/views/components/layouts/Client.vue +21 -15
- package/src/modules/globals/views/components/partials/Header.vue +3 -4
- package/src/modules/globals/views/components/partials/Navigation.vue +17 -19
- package/src/modules/globals/views/components/partials/Sidebar.vue +20 -9
- package/src/modules/marketplace/views/components/sections/SectionMenu.vue +1 -1
- package/src/modules/notifications/components/elements/NotificationBadge.vue +7 -0
- package/src/modules/orders/components/blocks/CardOrderBackoffice.vue +106 -0
- package/src/modules/orders/components/blocks/CardOrderItem.vue +2 -2
- package/src/modules/orders/components/blocks/CardOrderUser.vue +16 -9
- package/src/modules/orders/components/pages/OrderBackoffice.vue +146 -77
- package/src/modules/orders/components/pages/OrderCreate.vue +7 -12
- package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +15 -3
- package/src/modules/orders/components/pages/Orders.vue +10 -93
- package/src/modules/orders/components/partials/ShopCart.vue +2 -2
- package/src/modules/orders/components/sections/FormDelivery.vue +35 -43
- package/src/modules/orders/components/sections/FormPayment.vue +17 -7
- package/src/modules/orders/controllers/orders.controller.js +12 -1
- package/src/modules/orders/store/orders.js +65 -0
- package/src/modules/organizations/components/pages/Organization.vue +48 -47
- package/src/modules/organizations/controllers/organizations.controller.js +57 -47
- package/src/modules/organizations/store/organizations.js +6 -6
- package/src/modules/products/components/pages/Products.vue +4 -3
- package/src/modules/spots/components/blocks/CardSpot.vue +8 -7
- package/src/modules/spots/controllers/spots.controller.js +47 -14
- package/src/modules/spots/routes/spots.routes.js +2 -3
- package/src/modules/spots/store/spots.js +4 -4
- package/src/styles/base/shadow_transitions_hover_refactor.scss +1 -0
- package/src/modules/landing/components/sections/HowToBuyWDR.vue +0 -130
- package/src/modules/landing/components/sections/WhatIsWDRSection.vue +0 -116
|
@@ -2,24 +2,32 @@
|
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
const vueRouter = require("vue-router");
|
|
5
|
-
|
|
5
|
+
;/* empty css */
|
|
6
|
+
;/* empty css */
|
|
7
|
+
const Field = require("../../../../components/Field/Field.vue.cjs");
|
|
8
|
+
const Radio = require("../../../../components/Radio/Radio.vue.cjs");
|
|
9
|
+
;/* empty css */
|
|
10
|
+
;/* empty css */
|
|
6
11
|
const CardSpot = require("../../../spots/components/blocks/CardSpot.vue.cjs");
|
|
7
|
-
|
|
12
|
+
require("../../../spots/store/spots.cjs");
|
|
8
13
|
const globals = require("../../../globals/views/store/globals.cjs");
|
|
9
14
|
const Block = require("../../../../components/Block/Block.vue.cjs");
|
|
10
15
|
const Address = require("../../../../components/Address/Address.vue2.cjs");
|
|
11
16
|
const LocationMarker = require("../../../../components/LocationMarker/LocationMarker.vue2.cjs");
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
const _hoisted_1 = {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "mn-b-small flex-nowrap flex"
|
|
20
|
+
};
|
|
21
|
+
const _hoisted_2 = { key: 1 };
|
|
15
22
|
const _sfc_main = {
|
|
16
23
|
__name: "FormDelivery",
|
|
17
24
|
props: {
|
|
18
|
-
order: Object
|
|
25
|
+
order: Object,
|
|
26
|
+
organization: Object
|
|
19
27
|
},
|
|
20
28
|
setup(__props) {
|
|
21
29
|
const props = __props;
|
|
22
|
-
|
|
30
|
+
vueRouter.useRoute();
|
|
23
31
|
vue.watch(() => props.order.delivery.type, (newType) => {
|
|
24
32
|
if (newType !== "pickup") {
|
|
25
33
|
props.order.delivery.spot = null;
|
|
@@ -31,100 +39,92 @@ const _sfc_main = {
|
|
|
31
39
|
props.order.delivery.location = globals.state.position.location;
|
|
32
40
|
}
|
|
33
41
|
});
|
|
42
|
+
const availableDeliveryTypes = vue.computed(() => {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
const types = /* @__PURE__ */ new Set();
|
|
45
|
+
(_b = (_a = props.organization) == null ? void 0 : _a.spots) == null ? void 0 : _b.forEach((spot) => {
|
|
46
|
+
var _a2;
|
|
47
|
+
(_a2 = spot.delivery) == null ? void 0 : _a2.forEach((type) => types.add(type));
|
|
48
|
+
});
|
|
49
|
+
return Array.from(types);
|
|
50
|
+
});
|
|
51
|
+
function capitalize(str) {
|
|
52
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
53
|
+
}
|
|
34
54
|
return (_ctx, _cache) => {
|
|
35
55
|
return vue.openBlock(), vue.createBlock(Block.default, { title: "Delivery" }, {
|
|
36
|
-
default: vue.withCtx(() =>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
vue.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
apiKey: _ctx.GOOGLE_MAPS_API_KEY,
|
|
109
|
-
address: __props.order.delivery.address,
|
|
110
|
-
location: __props.order.delivery.location,
|
|
111
|
-
class: "mn-b-thin radius-bl-medium radius-br-medium h-15r o-hidden",
|
|
112
|
-
"onUpdate:location": _cache[4] || (_cache[4] = (newLocation) => {
|
|
113
|
-
if (__props.order.delivery.type === "courier") __props.order.delivery.location = newLocation;
|
|
114
|
-
}),
|
|
115
|
-
"onUpdate:address": _cache[5] || (_cache[5] = (newAddress) => {
|
|
116
|
-
if (__props.order.delivery.type === "courier") __props.order.delivery.address = newAddress;
|
|
117
|
-
})
|
|
118
|
-
}, null, 8, ["apiKey", "address", "location"])
|
|
119
|
-
], 64)) : vue.createCommentVNode("", true),
|
|
120
|
-
vue.createVNode(Field.default, {
|
|
121
|
-
field: __props.order.comment,
|
|
122
|
-
"onUpdate:field": _cache[6] || (_cache[6] = ($event) => __props.order.comment = $event),
|
|
123
|
-
placeholder: "Comments regarding the address (apartment unit, floor level, building section)",
|
|
124
|
-
type: "textarea",
|
|
125
|
-
class: "bg-white pd-medium radius-small"
|
|
126
|
-
}, null, 8, ["field"])
|
|
127
|
-
]),
|
|
56
|
+
default: vue.withCtx(() => {
|
|
57
|
+
var _a;
|
|
58
|
+
return [
|
|
59
|
+
_cache[7] || (_cache[7] = vue.createElementVNode("h5", { class: "font-second mn-b-thin" }, "Select delivery type", -1)),
|
|
60
|
+
availableDeliveryTypes.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
61
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(availableDeliveryTypes.value, (type) => {
|
|
62
|
+
return vue.openBlock(), vue.createBlock(Radio.default, {
|
|
63
|
+
key: type,
|
|
64
|
+
radio: __props.order.delivery.type,
|
|
65
|
+
"onUpdate:radio": ($event) => __props.order.delivery.type = $event,
|
|
66
|
+
label: capitalize(type),
|
|
67
|
+
value: type,
|
|
68
|
+
class: "bg-white pd-medium radius-small w-100 mn-r-small"
|
|
69
|
+
}, null, 8, ["radio", "onUpdate:radio", "label", "value"]);
|
|
70
|
+
}), 128))
|
|
71
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, "No delivery options available.")),
|
|
72
|
+
__props.order.delivery.type === "pickup" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
73
|
+
_cache[5] || (_cache[5] = vue.createElementVNode("h5", { class: "font-second mn-b-thin" }, "Select pickup spot", -1)),
|
|
74
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList((_a = __props.organization) == null ? void 0 : _a.spots.filter((item) => {
|
|
75
|
+
var _a2;
|
|
76
|
+
return (_a2 = item.delivery) == null ? void 0 : _a2.includes("pickup");
|
|
77
|
+
}), (spot, index) => {
|
|
78
|
+
return vue.openBlock(), vue.createBlock(CardSpot.default, {
|
|
79
|
+
key: index,
|
|
80
|
+
spot,
|
|
81
|
+
organization: __props.order.organization,
|
|
82
|
+
editAcess: false,
|
|
83
|
+
showDeliveryOptions: false,
|
|
84
|
+
showPaymentOptions: false,
|
|
85
|
+
selected: __props.order.delivery.spot === spot._id,
|
|
86
|
+
onClick: () => __props.order.delivery.spot = __props.order.delivery.spot === spot._id ? null : spot._id,
|
|
87
|
+
class: "mn-b-thin radius-medium o-hidden bg-white"
|
|
88
|
+
}, null, 8, ["spot", "organization", "selected", "onClick"]);
|
|
89
|
+
}), 128))
|
|
90
|
+
], 64)) : __props.order.delivery.type === "courier" || __props.order.delivery.type === "post" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
|
|
91
|
+
_cache[6] || (_cache[6] = vue.createElementVNode("h5", { class: "font-second mn-b-thin" }, "Address", -1)),
|
|
92
|
+
vue.createVNode(Address.default, {
|
|
93
|
+
label: "Location",
|
|
94
|
+
apiKey: _ctx.GOOGLE_MAPS_API_KEY,
|
|
95
|
+
address: __props.order.delivery.address,
|
|
96
|
+
location: __props.order.delivery.location,
|
|
97
|
+
placeholder: "Enter your address",
|
|
98
|
+
class: "bg-white radius-tl-medium radius-tr-medium t-black pd-medium",
|
|
99
|
+
"onUpdate:location": _cache[0] || (_cache[0] = (newLocation) => {
|
|
100
|
+
__props.order.delivery.location = newLocation;
|
|
101
|
+
}),
|
|
102
|
+
"onUpdate:address": _cache[1] || (_cache[1] = (newAddress) => {
|
|
103
|
+
__props.order.delivery.address = newAddress;
|
|
104
|
+
})
|
|
105
|
+
}, null, 8, ["apiKey", "address", "location"]),
|
|
106
|
+
vue.createVNode(LocationMarker.default, {
|
|
107
|
+
apiKey: _ctx.GOOGLE_MAPS_API_KEY,
|
|
108
|
+
address: __props.order.delivery.address,
|
|
109
|
+
location: __props.order.delivery.location,
|
|
110
|
+
class: "mn-b-thin radius-bl-medium radius-br-medium h-15r o-hidden",
|
|
111
|
+
"onUpdate:location": _cache[2] || (_cache[2] = (newLocation) => {
|
|
112
|
+
if (__props.order.delivery.type === "courier") __props.order.delivery.location = newLocation;
|
|
113
|
+
}),
|
|
114
|
+
"onUpdate:address": _cache[3] || (_cache[3] = (newAddress) => {
|
|
115
|
+
if (__props.order.delivery.type === "courier") __props.order.delivery.address = newAddress;
|
|
116
|
+
})
|
|
117
|
+
}, null, 8, ["apiKey", "address", "location"])
|
|
118
|
+
], 64)) : vue.createCommentVNode("", true),
|
|
119
|
+
vue.createVNode(Field.default, {
|
|
120
|
+
field: __props.order.comment,
|
|
121
|
+
"onUpdate:field": _cache[4] || (_cache[4] = ($event) => __props.order.comment = $event),
|
|
122
|
+
placeholder: "Comments regarding the address (apartment unit, floor level, building section)",
|
|
123
|
+
type: "textarea",
|
|
124
|
+
class: "bg-white pd-medium radius-small"
|
|
125
|
+
}, null, 8, ["field"])
|
|
126
|
+
];
|
|
127
|
+
}),
|
|
128
128
|
_: 1
|
|
129
129
|
});
|
|
130
130
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormDelivery.vue.cjs","sources":["../../../../../../../src/modules/orders/components/sections/FormDelivery.vue"],"sourcesContent":["<template>\n <Block title=\"Delivery\">\n <h5 class=\"font-second mn-b-thin\">Select delivery type</h5>\n <div class=\"mn-b-small flex-nowrap flex\">\n <Radio \n v-
|
|
1
|
+
{"version":3,"file":"FormDelivery.vue.cjs","sources":["../../../../../../../src/modules/orders/components/sections/FormDelivery.vue"],"sourcesContent":["<template>\n <Block title=\"Delivery\">\n <h5 class=\"font-second mn-b-thin\">Select delivery type</h5>\n \n <div class=\"mn-b-small flex-nowrap flex\" v-if=\"availableDeliveryTypes.length\">\n <Radio \n v-for=\"type in availableDeliveryTypes\"\n :key=\"type\"\n v-model:radio=\"order.delivery.type\"\n :label=\"capitalize(type)\"\n :value=\"type\"\n class=\"bg-white pd-medium radius-small w-100 mn-r-small\"\n />\n </div>\n <div v-else>No delivery options available.</div>\n\n <!-- Раздел для Pickup -->\n <template v-if=\"order.delivery.type === 'pickup'\">\n <h5 class=\"font-second mn-b-thin\">Select pickup spot</h5>\n <CardSpot\n v-for=\"(spot, index) in organization?.spots.filter(item => item.delivery?.includes('pickup'))\"\n :key=\"index\"\n :spot=\"spot\"\n :organization=\"order.organization\"\n :editAcess=\"false\"\n :showDeliveryOptions=\"false\"\n :showPaymentOptions=\"false\"\n :selected=\"order.delivery.spot === spot._id\"\n @click=\"() => order.delivery.spot = order.delivery.spot === spot._id ? null : spot._id\"\n class=\"mn-b-thin radius-medium o-hidden bg-white\"\n />\n </template>\n\n <!-- Раздел для Courier -->\n <template v-else-if=\"order.delivery.type === 'courier' || order.delivery.type === 'post'\">\n <h5 class=\"font-second mn-b-thin\">Address</h5>\n <Address\n label=\"Location\" \n :apiKey=\"GOOGLE_MAPS_API_KEY\" \n :address=\"order.delivery.address\" \n :location=\"order.delivery.location\" \n placeholder=\"Enter your address\" \n class=\"bg-white radius-tl-medium radius-tr-medium t-black pd-medium\"\n @update:location=\"newLocation => { order.delivery.location = newLocation; }\"\n @update:address=\"newAddress => { order.delivery.address = newAddress; }\"\n />\n <!-- Карта доставки -->\n <LocationMarker \n :apiKey=\"GOOGLE_MAPS_API_KEY\" \n :address=\"order.delivery.address\" \n :location=\"order.delivery.location\"\n class=\"mn-b-thin radius-bl-medium radius-br-medium h-15r o-hidden\"\n @update:location=\"newLocation => { \n if (order.delivery.type === 'courier') order.delivery.location = newLocation;\n }\"\n @update:address=\"newAddress => { \n if (order.delivery.type === 'courier') order.delivery.address = newAddress;\n }\"\n />\n </template>\n <!-- Комментарии -->\n <Field \n v-model:field=\"order.comment\" \n placeholder=\"Comments regarding the address (apartment unit, floor level, building section)\"\n type=\"textarea\" \n class=\"bg-white pd-medium radius-small\"\n />\n </Block>\n</template>\n\n<script setup>\nimport { watch, computed, onMounted } from 'vue';\nimport { useRoute } from 'vue-router';\n\nimport Feed from '@martyrs/src/components/Feed/Feed.vue';\nimport CardSpot from '@martyrs/src/modules/spots/components/blocks/CardSpot.vue'; \nimport * as spotsModule from '@martyrs/src/modules/spots/store/spots';\nimport * as globals from '@martyrs/src/modules/globals/views/store/globals';\nimport Block from '@martyrs/src/components/Block/Block.vue';\nimport Address from '@martyrs/src/components/Address/Address.vue';\nimport LocationMarker from '@martyrs/src/components/LocationMarker/LocationMarker.vue';\nimport Radio from '@martyrs/src/components/Radio/Radio.vue';\nimport Field from '@martyrs/src/components/Field/Field.vue';\n\nconst props = defineProps({\n order: Object,\n organization: Object,\n});\n\nconst route = useRoute();\n\n// Сбрасываем spot при переключении типа доставки\nwatch(() => props.order.delivery.type, (newType) => {\n if (newType !== 'pickup') {\n props.order.delivery.spot = null;\n }\n});\n\n// Устанавливаем начальные данные из globals при монтировании\nonMounted(() => {\n if (globals.state.position) {\n props.order.delivery.address = globals.state.position.address;\n props.order.delivery.location = globals.state.position.location;\n }\n});\n\nconst availableDeliveryTypes = computed(() => {\n const types = new Set()\n props.organization?.spots?.forEach(spot => {\n spot.delivery?.forEach(type => types.add(type))\n })\n return Array.from(types)\n})\n\nfunction capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1)\n}\n\n</script>"],"names":["useRoute","watch","onMounted","globals.state","computed","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFA,UAAM,QAAQ;AAKAA,cAAQ,SAAA;AAGtBC,QAAAA,MAAM,MAAM,MAAM,MAAM,SAAS,MAAM,CAAC,YAAY;AAClD,UAAI,YAAY,UAAU;AACxB,cAAM,MAAM,SAAS,OAAO;AAAA,MAChC;AAAA,IACA,CAAC;AAGDC,QAAAA,UAAU,MAAM;AACd,UAAIC,QAAAA,MAAc,UAAU;AAC1B,cAAM,MAAM,SAAS,UAAUA,QAAa,MAAC,SAAS;AACtD,cAAM,MAAM,SAAS,WAAWA,QAAa,MAAC,SAAS;AAAA,MAC3D;AAAA,IACA,CAAC;AAED,UAAM,yBAAyBC,IAAQ,SAAC,MAAM;;AAC5C,YAAM,QAAQ,oBAAI,IAAG;AACrB,wBAAM,iBAAN,mBAAoB,UAApB,mBAA2B,QAAQ,UAAQ;;AACzC,SAAAC,MAAA,KAAK,aAAL,gBAAAA,IAAe,QAAQ,UAAQ,MAAM,IAAI,IAAI;AAAA,MAC9C;AACD,aAAO,MAAM,KAAK,KAAK;AAAA,IACzB,CAAC;AAED,aAAS,WAAW,KAAK;AACvB,aAAO,IAAI,OAAO,CAAC,EAAE,gBAAgB,IAAI,MAAM,CAAC;AAAA,IAClD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,23 +1,31 @@
|
|
|
1
|
-
import { watch, onMounted, createBlock, openBlock, withCtx, createElementVNode, createElementBlock, createCommentVNode, createVNode, Fragment,
|
|
1
|
+
import { watch, onMounted, computed, createBlock, openBlock, withCtx, createElementVNode, createElementBlock, createCommentVNode, createVNode, Fragment, renderList } from "vue";
|
|
2
2
|
import { useRoute } from "vue-router";
|
|
3
|
-
|
|
3
|
+
/* empty css */
|
|
4
|
+
/* empty css */
|
|
5
|
+
import Field from "../../../../components/Field/Field.vue.js";
|
|
6
|
+
import _sfc_main$2 from "../../../../components/Radio/Radio.vue.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
/* empty css */
|
|
4
9
|
import CardSpot from "../../../spots/components/blocks/CardSpot.vue.js";
|
|
5
|
-
import
|
|
10
|
+
import "../../../spots/store/spots.js";
|
|
6
11
|
import { state } from "../../../globals/views/store/globals.js";
|
|
7
12
|
import _sfc_main$1 from "../../../../components/Block/Block.vue.js";
|
|
8
|
-
import _sfc_main$
|
|
9
|
-
import _sfc_main$
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
import _sfc_main$3 from "../../../../components/Address/Address.vue2.js";
|
|
14
|
+
import _sfc_main$4 from "../../../../components/LocationMarker/LocationMarker.vue2.js";
|
|
15
|
+
const _hoisted_1 = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "mn-b-small flex-nowrap flex"
|
|
18
|
+
};
|
|
19
|
+
const _hoisted_2 = { key: 1 };
|
|
13
20
|
const _sfc_main = {
|
|
14
21
|
__name: "FormDelivery",
|
|
15
22
|
props: {
|
|
16
|
-
order: Object
|
|
23
|
+
order: Object,
|
|
24
|
+
organization: Object
|
|
17
25
|
},
|
|
18
26
|
setup(__props) {
|
|
19
27
|
const props = __props;
|
|
20
|
-
|
|
28
|
+
useRoute();
|
|
21
29
|
watch(() => props.order.delivery.type, (newType) => {
|
|
22
30
|
if (newType !== "pickup") {
|
|
23
31
|
props.order.delivery.spot = null;
|
|
@@ -29,100 +37,92 @@ const _sfc_main = {
|
|
|
29
37
|
props.order.delivery.location = state.position.location;
|
|
30
38
|
}
|
|
31
39
|
});
|
|
40
|
+
const availableDeliveryTypes = computed(() => {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
const types = /* @__PURE__ */ new Set();
|
|
43
|
+
(_b = (_a = props.organization) == null ? void 0 : _a.spots) == null ? void 0 : _b.forEach((spot) => {
|
|
44
|
+
var _a2;
|
|
45
|
+
(_a2 = spot.delivery) == null ? void 0 : _a2.forEach((type) => types.add(type));
|
|
46
|
+
});
|
|
47
|
+
return Array.from(types);
|
|
48
|
+
});
|
|
49
|
+
function capitalize(str) {
|
|
50
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
51
|
+
}
|
|
32
52
|
return (_ctx, _cache) => {
|
|
33
53
|
return openBlock(), createBlock(_sfc_main$1, { title: "Delivery" }, {
|
|
34
|
-
default: withCtx(() =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
apiKey: _ctx.GOOGLE_MAPS_API_KEY,
|
|
107
|
-
address: __props.order.delivery.address,
|
|
108
|
-
location: __props.order.delivery.location,
|
|
109
|
-
class: "mn-b-thin radius-bl-medium radius-br-medium h-15r o-hidden",
|
|
110
|
-
"onUpdate:location": _cache[4] || (_cache[4] = (newLocation) => {
|
|
111
|
-
if (__props.order.delivery.type === "courier") __props.order.delivery.location = newLocation;
|
|
112
|
-
}),
|
|
113
|
-
"onUpdate:address": _cache[5] || (_cache[5] = (newAddress) => {
|
|
114
|
-
if (__props.order.delivery.type === "courier") __props.order.delivery.address = newAddress;
|
|
115
|
-
})
|
|
116
|
-
}, null, 8, ["apiKey", "address", "location"])
|
|
117
|
-
], 64)) : createCommentVNode("", true),
|
|
118
|
-
createVNode(Field, {
|
|
119
|
-
field: __props.order.comment,
|
|
120
|
-
"onUpdate:field": _cache[6] || (_cache[6] = ($event) => __props.order.comment = $event),
|
|
121
|
-
placeholder: "Comments regarding the address (apartment unit, floor level, building section)",
|
|
122
|
-
type: "textarea",
|
|
123
|
-
class: "bg-white pd-medium radius-small"
|
|
124
|
-
}, null, 8, ["field"])
|
|
125
|
-
]),
|
|
54
|
+
default: withCtx(() => {
|
|
55
|
+
var _a;
|
|
56
|
+
return [
|
|
57
|
+
_cache[7] || (_cache[7] = createElementVNode("h5", { class: "font-second mn-b-thin" }, "Select delivery type", -1)),
|
|
58
|
+
availableDeliveryTypes.value.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
59
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(availableDeliveryTypes.value, (type) => {
|
|
60
|
+
return openBlock(), createBlock(_sfc_main$2, {
|
|
61
|
+
key: type,
|
|
62
|
+
radio: __props.order.delivery.type,
|
|
63
|
+
"onUpdate:radio": ($event) => __props.order.delivery.type = $event,
|
|
64
|
+
label: capitalize(type),
|
|
65
|
+
value: type,
|
|
66
|
+
class: "bg-white pd-medium radius-small w-100 mn-r-small"
|
|
67
|
+
}, null, 8, ["radio", "onUpdate:radio", "label", "value"]);
|
|
68
|
+
}), 128))
|
|
69
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_2, "No delivery options available.")),
|
|
70
|
+
__props.order.delivery.type === "pickup" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
71
|
+
_cache[5] || (_cache[5] = createElementVNode("h5", { class: "font-second mn-b-thin" }, "Select pickup spot", -1)),
|
|
72
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList((_a = __props.organization) == null ? void 0 : _a.spots.filter((item) => {
|
|
73
|
+
var _a2;
|
|
74
|
+
return (_a2 = item.delivery) == null ? void 0 : _a2.includes("pickup");
|
|
75
|
+
}), (spot, index) => {
|
|
76
|
+
return openBlock(), createBlock(CardSpot, {
|
|
77
|
+
key: index,
|
|
78
|
+
spot,
|
|
79
|
+
organization: __props.order.organization,
|
|
80
|
+
editAcess: false,
|
|
81
|
+
showDeliveryOptions: false,
|
|
82
|
+
showPaymentOptions: false,
|
|
83
|
+
selected: __props.order.delivery.spot === spot._id,
|
|
84
|
+
onClick: () => __props.order.delivery.spot = __props.order.delivery.spot === spot._id ? null : spot._id,
|
|
85
|
+
class: "mn-b-thin radius-medium o-hidden bg-white"
|
|
86
|
+
}, null, 8, ["spot", "organization", "selected", "onClick"]);
|
|
87
|
+
}), 128))
|
|
88
|
+
], 64)) : __props.order.delivery.type === "courier" || __props.order.delivery.type === "post" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
89
|
+
_cache[6] || (_cache[6] = createElementVNode("h5", { class: "font-second mn-b-thin" }, "Address", -1)),
|
|
90
|
+
createVNode(_sfc_main$3, {
|
|
91
|
+
label: "Location",
|
|
92
|
+
apiKey: _ctx.GOOGLE_MAPS_API_KEY,
|
|
93
|
+
address: __props.order.delivery.address,
|
|
94
|
+
location: __props.order.delivery.location,
|
|
95
|
+
placeholder: "Enter your address",
|
|
96
|
+
class: "bg-white radius-tl-medium radius-tr-medium t-black pd-medium",
|
|
97
|
+
"onUpdate:location": _cache[0] || (_cache[0] = (newLocation) => {
|
|
98
|
+
__props.order.delivery.location = newLocation;
|
|
99
|
+
}),
|
|
100
|
+
"onUpdate:address": _cache[1] || (_cache[1] = (newAddress) => {
|
|
101
|
+
__props.order.delivery.address = newAddress;
|
|
102
|
+
})
|
|
103
|
+
}, null, 8, ["apiKey", "address", "location"]),
|
|
104
|
+
createVNode(_sfc_main$4, {
|
|
105
|
+
apiKey: _ctx.GOOGLE_MAPS_API_KEY,
|
|
106
|
+
address: __props.order.delivery.address,
|
|
107
|
+
location: __props.order.delivery.location,
|
|
108
|
+
class: "mn-b-thin radius-bl-medium radius-br-medium h-15r o-hidden",
|
|
109
|
+
"onUpdate:location": _cache[2] || (_cache[2] = (newLocation) => {
|
|
110
|
+
if (__props.order.delivery.type === "courier") __props.order.delivery.location = newLocation;
|
|
111
|
+
}),
|
|
112
|
+
"onUpdate:address": _cache[3] || (_cache[3] = (newAddress) => {
|
|
113
|
+
if (__props.order.delivery.type === "courier") __props.order.delivery.address = newAddress;
|
|
114
|
+
})
|
|
115
|
+
}, null, 8, ["apiKey", "address", "location"])
|
|
116
|
+
], 64)) : createCommentVNode("", true),
|
|
117
|
+
createVNode(Field, {
|
|
118
|
+
field: __props.order.comment,
|
|
119
|
+
"onUpdate:field": _cache[4] || (_cache[4] = ($event) => __props.order.comment = $event),
|
|
120
|
+
placeholder: "Comments regarding the address (apartment unit, floor level, building section)",
|
|
121
|
+
type: "textarea",
|
|
122
|
+
class: "bg-white pd-medium radius-small"
|
|
123
|
+
}, null, 8, ["field"])
|
|
124
|
+
];
|
|
125
|
+
}),
|
|
126
126
|
_: 1
|
|
127
127
|
});
|
|
128
128
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormDelivery.vue.js","sources":["../../../../../../../src/modules/orders/components/sections/FormDelivery.vue"],"sourcesContent":["<template>\n <Block title=\"Delivery\">\n <h5 class=\"font-second mn-b-thin\">Select delivery type</h5>\n <div class=\"mn-b-small flex-nowrap flex\">\n <Radio \n v-
|
|
1
|
+
{"version":3,"file":"FormDelivery.vue.js","sources":["../../../../../../../src/modules/orders/components/sections/FormDelivery.vue"],"sourcesContent":["<template>\n <Block title=\"Delivery\">\n <h5 class=\"font-second mn-b-thin\">Select delivery type</h5>\n \n <div class=\"mn-b-small flex-nowrap flex\" v-if=\"availableDeliveryTypes.length\">\n <Radio \n v-for=\"type in availableDeliveryTypes\"\n :key=\"type\"\n v-model:radio=\"order.delivery.type\"\n :label=\"capitalize(type)\"\n :value=\"type\"\n class=\"bg-white pd-medium radius-small w-100 mn-r-small\"\n />\n </div>\n <div v-else>No delivery options available.</div>\n\n <!-- Раздел для Pickup -->\n <template v-if=\"order.delivery.type === 'pickup'\">\n <h5 class=\"font-second mn-b-thin\">Select pickup spot</h5>\n <CardSpot\n v-for=\"(spot, index) in organization?.spots.filter(item => item.delivery?.includes('pickup'))\"\n :key=\"index\"\n :spot=\"spot\"\n :organization=\"order.organization\"\n :editAcess=\"false\"\n :showDeliveryOptions=\"false\"\n :showPaymentOptions=\"false\"\n :selected=\"order.delivery.spot === spot._id\"\n @click=\"() => order.delivery.spot = order.delivery.spot === spot._id ? null : spot._id\"\n class=\"mn-b-thin radius-medium o-hidden bg-white\"\n />\n </template>\n\n <!-- Раздел для Courier -->\n <template v-else-if=\"order.delivery.type === 'courier' || order.delivery.type === 'post'\">\n <h5 class=\"font-second mn-b-thin\">Address</h5>\n <Address\n label=\"Location\" \n :apiKey=\"GOOGLE_MAPS_API_KEY\" \n :address=\"order.delivery.address\" \n :location=\"order.delivery.location\" \n placeholder=\"Enter your address\" \n class=\"bg-white radius-tl-medium radius-tr-medium t-black pd-medium\"\n @update:location=\"newLocation => { order.delivery.location = newLocation; }\"\n @update:address=\"newAddress => { order.delivery.address = newAddress; }\"\n />\n <!-- Карта доставки -->\n <LocationMarker \n :apiKey=\"GOOGLE_MAPS_API_KEY\" \n :address=\"order.delivery.address\" \n :location=\"order.delivery.location\"\n class=\"mn-b-thin radius-bl-medium radius-br-medium h-15r o-hidden\"\n @update:location=\"newLocation => { \n if (order.delivery.type === 'courier') order.delivery.location = newLocation;\n }\"\n @update:address=\"newAddress => { \n if (order.delivery.type === 'courier') order.delivery.address = newAddress;\n }\"\n />\n </template>\n <!-- Комментарии -->\n <Field \n v-model:field=\"order.comment\" \n placeholder=\"Comments regarding the address (apartment unit, floor level, building section)\"\n type=\"textarea\" \n class=\"bg-white pd-medium radius-small\"\n />\n </Block>\n</template>\n\n<script setup>\nimport { watch, computed, onMounted } from 'vue';\nimport { useRoute } from 'vue-router';\n\nimport Feed from '@martyrs/src/components/Feed/Feed.vue';\nimport CardSpot from '@martyrs/src/modules/spots/components/blocks/CardSpot.vue'; \nimport * as spotsModule from '@martyrs/src/modules/spots/store/spots';\nimport * as globals from '@martyrs/src/modules/globals/views/store/globals';\nimport Block from '@martyrs/src/components/Block/Block.vue';\nimport Address from '@martyrs/src/components/Address/Address.vue';\nimport LocationMarker from '@martyrs/src/components/LocationMarker/LocationMarker.vue';\nimport Radio from '@martyrs/src/components/Radio/Radio.vue';\nimport Field from '@martyrs/src/components/Field/Field.vue';\n\nconst props = defineProps({\n order: Object,\n organization: Object,\n});\n\nconst route = useRoute();\n\n// Сбрасываем spot при переключении типа доставки\nwatch(() => props.order.delivery.type, (newType) => {\n if (newType !== 'pickup') {\n props.order.delivery.spot = null;\n }\n});\n\n// Устанавливаем начальные данные из globals при монтировании\nonMounted(() => {\n if (globals.state.position) {\n props.order.delivery.address = globals.state.position.address;\n props.order.delivery.location = globals.state.position.location;\n }\n});\n\nconst availableDeliveryTypes = computed(() => {\n const types = new Set()\n props.organization?.spots?.forEach(spot => {\n spot.delivery?.forEach(type => types.add(type))\n })\n return Array.from(types)\n})\n\nfunction capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1)\n}\n\n</script>"],"names":["globals.state","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAoFA,UAAM,QAAQ;AAKA,aAAQ;AAGtB,UAAM,MAAM,MAAM,MAAM,SAAS,MAAM,CAAC,YAAY;AAClD,UAAI,YAAY,UAAU;AACxB,cAAM,MAAM,SAAS,OAAO;AAAA,MAChC;AAAA,IACA,CAAC;AAGD,cAAU,MAAM;AACd,UAAIA,MAAc,UAAU;AAC1B,cAAM,MAAM,SAAS,UAAUA,MAAc,SAAS;AACtD,cAAM,MAAM,SAAS,WAAWA,MAAc,SAAS;AAAA,MAC3D;AAAA,IACA,CAAC;AAED,UAAM,yBAAyB,SAAS,MAAM;;AAC5C,YAAM,QAAQ,oBAAI,IAAG;AACrB,wBAAM,iBAAN,mBAAoB,UAApB,mBAA2B,QAAQ,UAAQ;;AACzC,SAAAC,MAAA,KAAK,aAAL,gBAAAA,IAAe,QAAQ,UAAQ,MAAM,IAAI,IAAI;AAAA,MAC9C;AACD,aAAO,MAAM,KAAK,KAAK;AAAA,IACzB,CAAC;AAED,aAAS,WAAW,KAAK;AACvB,aAAO,IAAI,OAAO,CAAC,EAAE,gBAAgB,IAAI,MAAM,CAAC;AAAA,IAClD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -7,9 +7,20 @@ const _hoisted_1 = { class: "mn-b-small flex-nowrap flex" };
|
|
|
7
7
|
const _sfc_main = {
|
|
8
8
|
__name: "FormPayment",
|
|
9
9
|
props: {
|
|
10
|
-
order: Object
|
|
10
|
+
order: Object,
|
|
11
|
+
organization: Object
|
|
11
12
|
},
|
|
12
13
|
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const availablePaymentTypes = vue.computed(() => {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
const types = /* @__PURE__ */ new Set();
|
|
18
|
+
(_b = (_a = props.organization) == null ? void 0 : _a.spots) == null ? void 0 : _b.forEach((spot) => {
|
|
19
|
+
var _a2;
|
|
20
|
+
(_a2 = spot.payment) == null ? void 0 : _a2.forEach((type) => types.add(type));
|
|
21
|
+
});
|
|
22
|
+
return Array.from(types);
|
|
23
|
+
});
|
|
13
24
|
return (_ctx, _cache) => {
|
|
14
25
|
return vue.openBlock(), vue.createBlock(Block.default, { title: "Payment" }, {
|
|
15
26
|
default: vue.withCtx(() => [
|
|
@@ -17,16 +28,11 @@ const _sfc_main = {
|
|
|
17
28
|
vue.createVNode(Select.default, {
|
|
18
29
|
select: __props.order.payment.type,
|
|
19
30
|
"onUpdate:select": _cache[0] || (_cache[0] = ($event) => __props.order.payment.type = $event),
|
|
20
|
-
|
|
21
|
-
options: [
|
|
22
|
-
{ name: "Cash", value: "cash" },
|
|
23
|
-
{ name: "Card", value: "card" },
|
|
24
|
-
{ name: "Bank Transfer", value: "bank" }
|
|
25
|
-
],
|
|
31
|
+
options: availablePaymentTypes.value,
|
|
26
32
|
placeholder: "Select type of payment",
|
|
27
33
|
size: "small",
|
|
28
34
|
class: "bg-white pd-medium radius-small w-100"
|
|
29
|
-
}, null, 8, ["select"])
|
|
35
|
+
}, null, 8, ["select", "options"])
|
|
30
36
|
])
|
|
31
37
|
]),
|
|
32
38
|
_: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormPayment.vue.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FormPayment.vue.cjs","sources":["../../../../../../../src/modules/orders/components/sections/FormPayment.vue"],"sourcesContent":["<template>\n <Block title=\"Payment\">\n <div class=\"mn-b-small flex-nowrap flex\">\n <Select \n v-model:select=\"order.payment.type\"\n :options=\"availablePaymentTypes\"\n placeholder=\"Select type of payment\" \n size=\"small\"\n class=\"bg-white pd-medium radius-small w-100\"\n />\n </div>\n </Block>\n</template>\n\n<script setup>\n\nimport { computed } from 'vue';\n\nimport Block from '@martyrs/src/components/Block/Block.vue'\nimport Select from '@martyrs/src/components/Select/Select.vue'\n\nconst props = defineProps({\n order: Object,\n organization: Object,\n});\n\nconst availablePaymentTypes = computed(() => {\n const types = new Set()\n props.organization?.spots?.forEach(spot => {\n spot.payment?.forEach(type => types.add(type))\n })\n return Array.from(types)\n})\n\n\n\n</script>"],"names":["computed","_a"],"mappings":";;;;;;;;;;;;;AAqBA,UAAM,QAAQ;AAKd,UAAM,wBAAwBA,IAAQ,SAAC,MAAM;;AAC3C,YAAM,QAAQ,oBAAI,IAAG;AACrB,wBAAM,iBAAN,mBAAoB,UAApB,mBAA2B,QAAQ,UAAQ;;AACzC,SAAAC,MAAA,KAAK,YAAL,gBAAAA,IAAc,QAAQ,UAAQ,MAAM,IAAI,IAAI;AAAA,MAC7C;AACD,aAAO,MAAM,KAAK,KAAK;AAAA,IACzB,CAAC;;;;;;;;;;;;;;;;;;;;;"}
|