@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
|
@@ -54,25 +54,24 @@ class GlobalWebSocket {
|
|
|
54
54
|
return Promise.resolve(false);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
//
|
|
58
|
-
if (this.isConnected && this.userId === userId && this.socket) {
|
|
59
|
-
return Promise.resolve(this.socket);
|
|
60
|
-
}
|
|
61
|
-
|
|
57
|
+
// Always update userId before any connection logic
|
|
62
58
|
this.userId = userId;
|
|
63
59
|
|
|
64
|
-
// If
|
|
65
|
-
if (this.
|
|
66
|
-
return this.
|
|
60
|
+
// If already connected with the same user and socket is valid, return the existing connection
|
|
61
|
+
if (this.isConnected && this.socket && this.socket.readyState === WebSocket.OPEN) {
|
|
62
|
+
return Promise.resolve(this.socket);
|
|
67
63
|
}
|
|
68
64
|
|
|
65
|
+
// Clear any existing connection promise to avoid conflicts
|
|
66
|
+
this.connectPromise = null;
|
|
67
|
+
|
|
69
68
|
// Create new connection promise
|
|
70
69
|
this.connectPromise = new Promise((resolve, reject) => {
|
|
71
70
|
// Close existing connection if any
|
|
72
71
|
this.disconnect();
|
|
73
72
|
|
|
74
73
|
// Create new WebSocket connection with user ID
|
|
75
|
-
const wsUrl = userId ? `${this.baseUrl}?userId=${userId}` : this.baseUrl;
|
|
74
|
+
const wsUrl = userId ? `${this.baseUrl}?userId=${encodeURIComponent(userId)}` : this.baseUrl;
|
|
76
75
|
this.socket = new WebSocket(wsUrl);
|
|
77
76
|
|
|
78
77
|
// Setup event handlers
|
|
@@ -142,7 +141,7 @@ class GlobalWebSocket {
|
|
|
142
141
|
* @param {Object|String} data - Data to send
|
|
143
142
|
* @returns {Boolean} Success status
|
|
144
143
|
*/
|
|
145
|
-
send(data) {
|
|
144
|
+
async send(data) {
|
|
146
145
|
if (!this.socket || this.socket.readyState !== WebSocket.OPEN) {
|
|
147
146
|
console.error('Cannot send message: WebSocket is not connected');
|
|
148
147
|
return false;
|
|
@@ -150,7 +149,7 @@ class GlobalWebSocket {
|
|
|
150
149
|
|
|
151
150
|
try {
|
|
152
151
|
const message = typeof data === 'string' ? data : JSON.stringify(data);
|
|
153
|
-
this.socket.send(message);
|
|
152
|
+
await this.socket.send(message);
|
|
154
153
|
return true;
|
|
155
154
|
} catch (error) {
|
|
156
155
|
console.error('Error sending WebSocket message:', error);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:class="{
|
|
6
6
|
'pd-t-extra': MOBILE_APP === 'ios',
|
|
7
7
|
'bg-white': headerTheme === 'light',
|
|
8
|
-
'bg-
|
|
8
|
+
'bg-black': headerTheme === 'dark'
|
|
9
9
|
}"
|
|
10
10
|
>
|
|
11
11
|
<transition name="moveFromTop" appear>
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
:horizontal="true"
|
|
27
27
|
:navigationItems="route.meta.sidebar_navigation_items"
|
|
28
28
|
:stateSidebar="globals.state.isOpenSidebar"
|
|
29
|
+
:theme="headerTheme"
|
|
29
30
|
/>
|
|
30
31
|
</component>
|
|
31
32
|
|
|
@@ -57,7 +58,6 @@
|
|
|
57
58
|
}"
|
|
58
59
|
>
|
|
59
60
|
<ShopCart
|
|
60
|
-
class="pd-t-extra"
|
|
61
61
|
:class="{
|
|
62
62
|
'mobile:pd-t-extra': MOBILE_APP === 'ios',
|
|
63
63
|
}"
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
:stateSidebar="globals.state.isOpenSidebar"
|
|
78
78
|
:widthHidden='route.meta?.sidebar_width_hidden'
|
|
79
79
|
:width="route.meta?.sidebar_width"
|
|
80
|
+
:theme="headerTheme"
|
|
80
81
|
@closeSidebar="() => globals.state.isOpenSidebar = !globals.state.isOpenSidebar"
|
|
81
82
|
>
|
|
82
83
|
<transition name="moveFromTop" mode="out-in" appear>
|
|
@@ -86,6 +87,7 @@
|
|
|
86
87
|
:key="route.meta.sidebar_navigation"
|
|
87
88
|
:navigationItems="route.meta.sidebar_navigation_items"
|
|
88
89
|
:stateSidebar="globals.state.isOpenSidebar"
|
|
90
|
+
:theme="headerTheme"
|
|
89
91
|
/>
|
|
90
92
|
</transition>
|
|
91
93
|
</component>
|
|
@@ -286,19 +288,23 @@
|
|
|
286
288
|
position: absolute;
|
|
287
289
|
}
|
|
288
290
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
291
|
+
.moveFromTop-enter-active,
|
|
292
|
+
.moveFromTop-leave-active {
|
|
293
|
+
transition: all 0.3s ease, max-height 0.2s ease;
|
|
294
|
+
overflow: hidden;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.moveFromTop-enter-from,
|
|
298
|
+
.moveFromTop-leave-to {
|
|
299
|
+
transform: translateY(-1rem);
|
|
300
|
+
opacity: 0;
|
|
301
|
+
max-height: 0;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.moveFromTop-enter-to,
|
|
305
|
+
.moveFromTop-leave-from {
|
|
306
|
+
max-height: 100vh;
|
|
307
|
+
}
|
|
302
308
|
|
|
303
309
|
.moveFromTopAbsolute-enter-active,
|
|
304
310
|
.moveFromTopAbsolute-leave-active {
|
|
@@ -71,11 +71,10 @@
|
|
|
71
71
|
pos-relative pos-t-0
|
|
72
72
|
br-b
|
|
73
73
|
br-solid
|
|
74
|
-
br-light
|
|
75
74
|
"
|
|
76
75
|
:class="{
|
|
77
|
-
't-black': theme === 'light',
|
|
78
|
-
't-white': theme === 'dark'
|
|
76
|
+
't-black br-light': theme === 'light',
|
|
77
|
+
't-white br-dark': theme === 'dark'
|
|
79
78
|
}"
|
|
80
79
|
>
|
|
81
80
|
<div class="flex-nowrap flex-v-center flex-justify-start flex gap-micro ">
|
|
@@ -173,7 +172,7 @@
|
|
|
173
172
|
|
|
174
173
|
<NotificationBadge
|
|
175
174
|
v-if="auth.state.user._id"
|
|
176
|
-
:fill="'rgb(var(--black))'"
|
|
175
|
+
:fill="theme === 'light' ? 'rgb(var(--black))' : 'rgb(var(--white))'"
|
|
177
176
|
/>
|
|
178
177
|
|
|
179
178
|
<Button
|
|
@@ -22,6 +22,10 @@ import Spoiler from '@martyrs/src/components/Spoiler/Spoiler.vue'
|
|
|
22
22
|
|
|
23
23
|
const props = defineProps({
|
|
24
24
|
navigationItems: Array, // Fixed property name typo
|
|
25
|
+
theme: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "light"
|
|
28
|
+
},
|
|
25
29
|
stateSidebar: {
|
|
26
30
|
type: Boolean,
|
|
27
31
|
default: false
|
|
@@ -82,10 +86,10 @@ const processRoute = (route) => {
|
|
|
82
86
|
|
|
83
87
|
<template>
|
|
84
88
|
<nav
|
|
85
|
-
class="o-
|
|
89
|
+
class="o-x-hidden h-100"
|
|
86
90
|
:class="[
|
|
87
91
|
stateSidebar ? 'pd-small' : 'pd-micro',
|
|
88
|
-
horizontal ? 'w-100 desktop-only flex flex-center flex-nowrap' : 'rows-1',
|
|
92
|
+
horizontal ? 'w-100 desktop-only flex flex-center flex-nowrap o-y-hidden' : 'o-y-scroll rows-1',
|
|
89
93
|
]"
|
|
90
94
|
>
|
|
91
95
|
<div
|
|
@@ -94,7 +98,7 @@ const processRoute = (route) => {
|
|
|
94
98
|
:key="section.category"
|
|
95
99
|
:class="[
|
|
96
100
|
horizontal ? 'w-max flex-child-default flex flex-nowrap' : '',
|
|
97
|
-
|
|
101
|
+
stateSidebar && !horizontal ? 'mn-t-medium' : '',
|
|
98
102
|
]"
|
|
99
103
|
class=""
|
|
100
104
|
>
|
|
@@ -102,7 +106,9 @@ const processRoute = (route) => {
|
|
|
102
106
|
class="sidebar-category"
|
|
103
107
|
:class="{
|
|
104
108
|
'hidden': !stateSidebar || horizontal,
|
|
105
|
-
'visible': stateSidebar && !horizontal
|
|
109
|
+
'visible': stateSidebar && !horizontal,
|
|
110
|
+
't-black': theme === 'light',
|
|
111
|
+
't-white': theme === 'dark'
|
|
106
112
|
}"
|
|
107
113
|
>
|
|
108
114
|
{{ section.category }}
|
|
@@ -119,8 +125,9 @@ const processRoute = (route) => {
|
|
|
119
125
|
v-show="!item.visible || (typeof item.visible === 'function' ? item.visible(auth.state) : true)"
|
|
120
126
|
class="flex-center"
|
|
121
127
|
:class="[
|
|
122
|
-
stateSidebar ? '' : '
|
|
128
|
+
stateSidebar ? '' : '',
|
|
123
129
|
horizontal ? 'w-100 flex flex-nowrap' : '',
|
|
130
|
+
stateSidebar && !horizontal ? '' : 'aspect-1x1'
|
|
124
131
|
]"
|
|
125
132
|
>
|
|
126
133
|
<button
|
|
@@ -129,14 +136,15 @@ const processRoute = (route) => {
|
|
|
129
136
|
:class="[
|
|
130
137
|
stateSidebar || horizontal ? 'expanded-item pd-thin' : 'w-100 h-100 justify-center',
|
|
131
138
|
horizontal ? 'w-max flex flex-nowrap' : '',
|
|
132
|
-
item.route && $route.path === processRoute(item.route) ? 'bg-light' : ''
|
|
139
|
+
item.route && $route.path === processRoute(item.route) ? theme === 'light' ? 'bg-light' : 'bg-dark' : '',
|
|
140
|
+
theme === 'light' ? 'hover-bg-light' : 'hover-bg-dark'
|
|
133
141
|
]"
|
|
134
142
|
>
|
|
135
143
|
<component
|
|
136
144
|
v-if="item.iconComponent && !horizontal"
|
|
137
145
|
:is="item.iconComponent"
|
|
138
146
|
class="i-medium flex-child-default"
|
|
139
|
-
:fill="globals.state.theme.darkmode ? 'rgba(255,255,255,0.7)' : 'rgba(0,0,0,0.25)'"
|
|
147
|
+
:fill="globals.state.theme.darkmode || theme === 'dark' ? 'rgba(255,255,255,0.7)' : 'rgba(0,0,0,0.25)'"
|
|
140
148
|
/>
|
|
141
149
|
<span v-if="!item.iconComponent && !horizontal" class="i-medium sidebar-item-icon t-lh-1 flex-child-default">{{ item.icon }}</span>
|
|
142
150
|
|
|
@@ -177,7 +185,7 @@ const processRoute = (route) => {
|
|
|
177
185
|
v-if="subItem.iconComponent"
|
|
178
186
|
:is="subItem.iconComponent"
|
|
179
187
|
class="sidebar-subitem-icon i-medium"
|
|
180
|
-
:fill="globals.state.theme.darkmode ? 'rgba(255,255,255,0.7)' : 'rgba(0,0,0,0.25)'"
|
|
188
|
+
:fill="globals.state.theme.darkmode || theme === 'dark' ? 'rgba(255,255,255,0.7)' : 'rgba(0,0,0,0.25)'"
|
|
181
189
|
/>
|
|
182
190
|
<span v-else class="sidebar-subitem-icon">{{ subItem.icon }}</span>
|
|
183
191
|
<span class="sidebar-subitem-title">{{ subItem.title }}</span>
|
|
@@ -211,7 +219,7 @@ const processRoute = (route) => {
|
|
|
211
219
|
v-if="subItem.iconComponent"
|
|
212
220
|
:is="subItem.iconComponent"
|
|
213
221
|
class="sidebar-subitem-icon i-medium"
|
|
214
|
-
|
|
222
|
+
:fill="globals.state.theme.darkmode || theme === 'dark' ? 'rgba(255,255,255,0.7)' : 'rgba(0,0,0,0.25)'"
|
|
215
223
|
/>
|
|
216
224
|
<span v-else class="sidebar-subitem-icon">{{ subItem.icon }}</span>
|
|
217
225
|
<span class="sidebar-subitem-title">{{ subItem.title }}</span>
|
|
@@ -242,16 +250,6 @@ const processRoute = (route) => {
|
|
|
242
250
|
|
|
243
251
|
|
|
244
252
|
|
|
245
|
-
.sidebar-subitem-link:hover {
|
|
246
|
-
background: var(--light-regular);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.sidebar-item-btn:hover {
|
|
250
|
-
background: var(--light-regular);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
253
|
.expanded-item {
|
|
256
254
|
display: flex;
|
|
257
255
|
align-items: center;
|
|
@@ -3,6 +3,10 @@ import { ref, watch } from 'vue'
|
|
|
3
3
|
import * as globals from '@martyrs/src/modules/globals/views/store/globals'
|
|
4
4
|
|
|
5
5
|
const props = defineProps({
|
|
6
|
+
theme: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: "light"
|
|
9
|
+
},
|
|
6
10
|
stateSidebar: {
|
|
7
11
|
type: Boolean,
|
|
8
12
|
default: false
|
|
@@ -28,18 +32,30 @@ const toggleSidebar = () => {
|
|
|
28
32
|
|
|
29
33
|
<template>
|
|
30
34
|
<aside
|
|
31
|
-
class="transition-linear w-min-0 o-hidden flex-child-default z-index-2
|
|
35
|
+
class="transition-linear w-min-0 o-hidden flex-child-default z-index-2 br-r br-solid flex flex-column h-100"
|
|
32
36
|
:class="[
|
|
33
37
|
'sidebar-container',
|
|
34
|
-
|
|
38
|
+
//
|
|
39
|
+
stateSidebar
|
|
40
|
+
? `${width} w-min-10 tablet:w-min-100 tablet:w-100 mobile:w-min-100 mobile:w-100`
|
|
41
|
+
: `${widthHidden} mobile:w-0 br-zero`,
|
|
42
|
+
//
|
|
43
|
+
theme === 'light'
|
|
44
|
+
? 't-black bg-white br-light'
|
|
45
|
+
: 't-white bg-black br-dark'
|
|
35
46
|
]"
|
|
36
47
|
>
|
|
37
48
|
<!-- Slot for navigation content -->
|
|
38
49
|
<slot></slot>
|
|
39
50
|
|
|
40
51
|
<div
|
|
41
|
-
class="
|
|
42
|
-
:class="{
|
|
52
|
+
class="br-solid br-t"
|
|
53
|
+
:class="{
|
|
54
|
+
'pd-micro': !stateSidebar,
|
|
55
|
+
'pd-small': stateSidebar,
|
|
56
|
+
'br-light': theme === 'light',
|
|
57
|
+
'br-dark': theme === 'dark'
|
|
58
|
+
}"
|
|
43
59
|
>
|
|
44
60
|
<button
|
|
45
61
|
@click="() => globals.actions.toggleTheme()"
|
|
@@ -101,11 +117,6 @@ const toggleSidebar = () => {
|
|
|
101
117
|
transform: scale(1.1);
|
|
102
118
|
}
|
|
103
119
|
|
|
104
|
-
.sidebar-footer {
|
|
105
|
-
border-top-width: 1px;
|
|
106
|
-
border-top-style: solid;
|
|
107
|
-
border-top-color: var(--light-regular);
|
|
108
|
-
}
|
|
109
120
|
|
|
110
121
|
.hidden {
|
|
111
122
|
opacity: 0;
|
|
@@ -117,6 +117,13 @@ const handleClickOutside = (event) => {
|
|
|
117
117
|
// Lifecycle hooks
|
|
118
118
|
onMounted(() => {
|
|
119
119
|
document.addEventListener('click', handleClickOutside);
|
|
120
|
+
|
|
121
|
+
if (isOpen.value) {
|
|
122
|
+
const userId = auth.state.user._id;
|
|
123
|
+
if (userId) {
|
|
124
|
+
getNotifications(userId);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
120
127
|
});
|
|
121
128
|
|
|
122
129
|
onUnmounted(() => {
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bg-light pos-relative pd-medium radius-medium">
|
|
3
|
+
<CardHeader
|
|
4
|
+
:entity="order"
|
|
5
|
+
:entityType="'order'"
|
|
6
|
+
:user="user"
|
|
7
|
+
:owner="order.creator"
|
|
8
|
+
:creator="order.creator"
|
|
9
|
+
:date="order.createdAt"
|
|
10
|
+
class="mn-b-small"
|
|
11
|
+
/>
|
|
12
|
+
|
|
13
|
+
<div class="mn-b-small pd-small bg-white radius-small flex-nowrap flex">
|
|
14
|
+
<div class="w-100">
|
|
15
|
+
<p class="t-truncate">{{order.delivery.address || 'Not specified'}}</p>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div class="w-100 t-right">
|
|
19
|
+
<h3 class="mn-b-thin">{{currency}}{{getTotal(order.positions)}}</h3>
|
|
20
|
+
<p>#{{order._id.slice(0, 4) + '...' + order._id.slice(-4)}}</p>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="cols-1 pos-relative mn-b-small gap-thin pd-small bg-white radius-small">
|
|
25
|
+
<!-- Всегда отображаем первые две позиции -->
|
|
26
|
+
<template v-for="(position, index) in order.positions">
|
|
27
|
+
<transition name="moveFromTop">
|
|
28
|
+
<div
|
|
29
|
+
v-if="index < 2 || (spoiler && index >= 2)"
|
|
30
|
+
:key="index"
|
|
31
|
+
class="w-100 flex"
|
|
32
|
+
>
|
|
33
|
+
<p class="mn-r-auto">{{ position.name }}</p>
|
|
34
|
+
<p class="t-right">
|
|
35
|
+
{{ position.quantity }} {{ position.type }}
|
|
36
|
+
x
|
|
37
|
+
<span class="t-transp">{{ currency }} {{ position.price }}</span>
|
|
38
|
+
</p>
|
|
39
|
+
</div>
|
|
40
|
+
</transition>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<!-- Кнопка переключения для дополнительных позиций, видна только если есть больше двух позиций -->
|
|
44
|
+
<button
|
|
45
|
+
v-if="order.positions.length > 2"
|
|
46
|
+
@click.prevent="spoiler = !spoiler"
|
|
47
|
+
class="cursor-pointer radius-big bg-light-transp-50 pd-nano w-100 flex-center flex"
|
|
48
|
+
>
|
|
49
|
+
{{ !spoiler ? `+${order.positions.length - 2} more` : `Hide` }}
|
|
50
|
+
</button>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div class="pd-small bg-white radius-small gap-micro flex-v-center flex-nowrap flex">
|
|
54
|
+
<IconTime class="i-semi t-transp" fill="rgb(var(--black)" />
|
|
55
|
+
<p class="t-medium mn-r-auto">{{formatDate(order.deadline)}}</p>
|
|
56
|
+
|
|
57
|
+
<span
|
|
58
|
+
class="flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin bg-main"
|
|
59
|
+
>
|
|
60
|
+
{{order.status}}
|
|
61
|
+
</span>
|
|
62
|
+
|
|
63
|
+
<span
|
|
64
|
+
class="flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin t-white bg-red"
|
|
65
|
+
>
|
|
66
|
+
{{order.payment.status || 'Not defined'}}
|
|
67
|
+
</span>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<div v-if="order.comment" class="pos-relative radius-small bg-fifth-transp-10 mn-t-thin pd-small">
|
|
71
|
+
<p class="mn-b-thin t-transp uppercase p-small t-medium">Comment</p>
|
|
72
|
+
<p>{{order.comment}}</p>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</template>
|
|
76
|
+
|
|
77
|
+
<script setup>
|
|
78
|
+
import { ref } from 'vue';
|
|
79
|
+
import CardHeader from '@martyrs/src/modules/globals/views/components/blocks/CardHeader.vue';
|
|
80
|
+
import IconTime from '@martyrs/src/modules/icons/entities/IconTime.vue';
|
|
81
|
+
|
|
82
|
+
const props = defineProps({
|
|
83
|
+
order: {
|
|
84
|
+
type: Object,
|
|
85
|
+
required: true
|
|
86
|
+
},
|
|
87
|
+
user: {
|
|
88
|
+
type: Object,
|
|
89
|
+
required: true
|
|
90
|
+
},
|
|
91
|
+
formatDate: {
|
|
92
|
+
type: Function,
|
|
93
|
+
required: true
|
|
94
|
+
},
|
|
95
|
+
getTotal: {
|
|
96
|
+
type: Function,
|
|
97
|
+
required: true
|
|
98
|
+
},
|
|
99
|
+
currency: {
|
|
100
|
+
type: String,
|
|
101
|
+
default: ''
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
const spoiler = ref(false);
|
|
106
|
+
</script>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<div>
|
|
24
24
|
<p>
|
|
25
25
|
<span class="t-second mn-r-micro d-inline-block t-demi">
|
|
26
|
-
{{ product.price_currency || returnCurrency() }}{{ (product.listing === 'rent' ? (rentalDays || product.quantity ||
|
|
26
|
+
{{ product.price_currency || returnCurrency() }}{{ (product.listing === 'rent' ? (rentalDays || product.quantity || 0) : (product.quantity || 0)) * product.price }}
|
|
27
27
|
</span>
|
|
28
28
|
|
|
29
29
|
<span class="p-small t-transp">
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<template v-else>
|
|
37
|
-
{{ product.quantity ||
|
|
37
|
+
{{ product.quantity || 0 }} {{ product.unit || 'pcs' }}
|
|
38
38
|
</template>
|
|
39
39
|
</span>
|
|
40
40
|
</p>
|
|
@@ -148,17 +148,24 @@ const statusText = computed(() => {
|
|
|
148
148
|
case 'canceled':
|
|
149
149
|
return `Canceled, ${updatedDate}`;
|
|
150
150
|
default:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
// Расчет задержки
|
|
152
|
+
if (props.positions?.length) {
|
|
153
|
+
const lastPosition = props.positions[props.positions.length - 1];
|
|
154
|
+
const lastEndDateRaw = lastPosition?.date?.end;
|
|
155
|
+
|
|
156
|
+
if (lastEndDateRaw) {
|
|
157
|
+
const lastEndDate = new Date(lastEndDateRaw);
|
|
154
158
|
const now = new Date();
|
|
155
|
-
const diffTime = Math.abs(now - lastEndDate);
|
|
159
|
+
const diffTime = Math.abs(now.getTime() - lastEndDate.getTime());
|
|
156
160
|
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
|
161
|
+
|
|
157
162
|
if (diffDays > 0 && props.status !== 'finished' && props.status !== 'canceled') {
|
|
158
163
|
return `Delay ${diffDays} day${diffDays > 1 ? 's' : ''}`;
|
|
159
164
|
}
|
|
160
165
|
}
|
|
161
|
-
|
|
166
|
+
}
|
|
167
|
+
return `Created, ${createdDate}`;
|
|
168
|
+
|
|
162
169
|
}
|
|
163
170
|
});
|
|
164
171
|
|
|
@@ -192,16 +199,16 @@ threeDaysFromNow.setDate(today.getDate() + 3);
|
|
|
192
199
|
// Показывать ли уведомление о возврате
|
|
193
200
|
const showReturnNotice = computed(() => {
|
|
194
201
|
return props.positions.some(position => {
|
|
195
|
-
const endDate = getDateWithoutTime(position.date.end);
|
|
196
|
-
return endDate <= threeDaysFromNow;
|
|
202
|
+
const endDate = position?.date?.end ? getDateWithoutTime(position.date.end) : null;
|
|
203
|
+
return endDate !== null && endDate <= threeDaysFromNow;
|
|
197
204
|
});
|
|
198
205
|
});
|
|
199
206
|
|
|
200
207
|
// Есть ли просроченные позиции
|
|
201
208
|
const hasOverdue = computed(() => {
|
|
202
209
|
return props.positions.some(position => {
|
|
203
|
-
const endDate = getDateWithoutTime(position.date.end);
|
|
204
|
-
return endDate < today;
|
|
210
|
+
const endDate = position?.date?.end ? getDateWithoutTime(position.date.end) : null;
|
|
211
|
+
return endDate !== null && endDate < today;
|
|
205
212
|
});
|
|
206
213
|
});
|
|
207
214
|
|