@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
package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationBadge.vue.js","sources":["../../../../../../../src/modules/notifications/components/elements/NotificationBadge.vue"],"sourcesContent":["<template>\n <div class=\"notification-badge-container\">\n <button \n class=\"i-semi notification-button\"\n @click=\"toggleNotifications\"\n :aria-label=\"unreadCount > 0 ? `${unreadCount} unread notifications` : 'No unread notifications'\"\n >\n <IconBell class=\"notification-icon i-medium\" :fill=\"fill\"/>\n <span \n v-if=\"unreadCount > 0\" \n class=\"button-counter\"\n >\n {{ unreadCount > 99 ? '99+' : unreadCount }}\n </span>\n </button>\n <div v-if=\"isOpen\" class=\"notifications-dropdown\">\n <div class=\"notifications-header\">\n <h3>Notifications</h3>\n <button \n v-if=\"unreadCount > 0\" \n class=\"mark-all-read-btn\" \n @click=\"markAllAsRead\"\n >\n Mark all read\n </button>\n </div>\n <div v-if=\"loading\" class=\"notifications-loading\">\n Loading...\n </div>\n <div v-else-if=\"notifications.length === 0\" class=\"notifications-empty\">\n No notifications\n </div>\n <div v-else class=\"notifications-list\">\n <notification-item \n v-for=\"notification in recentNotifications\" \n :key=\"notification._id\" \n :notification=\"notification\"\n @click=\"handleNotificationClick(notification)\"\n />\n </div>\n <div class=\"notifications-footer\">\n <router-link to=\"/notifications\" @click=\"isOpen = false\">\n View all notifications\n </router-link>\n </div>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, computed, onMounted, onUnmounted, inject } from 'vue';\nimport { useRouter } from 'vue-router';\nimport NotificationItem from '../blocks/NotificationItem.vue';\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth';\n\nimport IconBell from '@martyrs/src/modules/icons/entities/IconBell.vue';\n\nconst props = defineProps({\n maxNotifications: {\n type: Number,\n default: 5\n },\n fill: {\n type: String,\n default: 'rgb(var(--white))'\n }\n});\n\n// Get router and notification functionality\nconst router = useRouter();\nconst { notifications, unreadCount, loading, markAllAsRead, getNotifications } = inject('useNotifications')();\n\n// Local state\nconst isOpen = ref(false);\n\n// Computed properties\nconst recentNotifications = computed(() => {\n return notifications.value\n .slice()\n .sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt))\n .slice(0, props.maxNotifications);\n});\n\n// Methods\nconst toggleNotifications = () => {\n isOpen.value = !isOpen.value;\n \n // Load notifications if opening\n if (isOpen.value) {\n const userId = auth.state.user._id;\n if (userId) {\n getNotifications(userId);\n }\n }\n};\n\nconst handleNotificationClick = (notification) => {\n isOpen.value = false;\n \n if (notification._id) {\n // Handle in store\n actions.handleNotificationAction({\n notificationId: notification._id,\n ...notification.metadata\n });\n }\n};\n\n// Close dropdown when clicking outside\nconst handleClickOutside = (event) => {\n const container = document.querySelector('.notification-badge-container');\n if (container && !container.contains(event.target)) {\n isOpen.value = false;\n }\n};\n\n// Lifecycle hooks\nonMounted(() => {\n document.addEventListener('click', handleClickOutside);\n});\n\nonUnmounted(() => {\n document.removeEventListener('click', handleClickOutside);\n});\n</script>\n\n<style scoped>\n.notification-badge-container {\n position: relative;\n display: inline-block;\n}\n\n.notification-button {\n background: none;\n border: none;\n cursor: pointer;\n position: relative;\n font-size: 1.2rem;\n}\n\n.notification-icon {\n font-size: 1.4rem;\n}\n.button-counter {\n position: absolute;\n right: -8px;\n bottom: -8px;\n background: rgb(var(--fourth));\n color: rgb(var(--white));\n height: 16px;\n border-radius: 16px;\n width: 16px;\n font-weight: 500;\n text-align: center;\n line-height: 16px;\n font-size: 10px;\n}\n.notifications-dropdown {\n position: absolute;\n top: 100%;\n right: 0;\n width: 320px;\n max-height: 400px;\n overflow-y: auto;\n background-color: white;\n border-radius: 4px;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n z-index: 1000;\n}\n\n.notifications-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 12px 16px;\n border-bottom: 1px solid #eee;\n}\n\n.notifications-header h3 {\n margin: 0;\n font-size: 1rem;\n}\n\n.mark-all-read-btn {\n background: none;\n border: none;\n color: #2196f3;\n font-size: 0.8rem;\n cursor: pointer;\n}\n\n.notifications-loading,\n.notifications-empty {\n padding: 24px;\n text-align: center;\n color: #666;\n}\n\n.notifications-list {\n max-height: 300px;\n overflow-y: auto;\n}\n\n.notifications-footer {\n padding: 12px 16px;\n text-align: center;\n border-top: 1px solid #eee;\n}\n\n.notifications-footer a {\n color: #2196f3;\n text-decoration: none;\n font-size: 0.9rem;\n}\n</style>"],"names":["auth.state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,UAAM,QAAQ;AAYC,cAAS;AACxB,UAAM,EAAE,eAAe,aAAa,SAAS,eAAe,qBAAqB,OAAO,kBAAkB,EAAG;AAG7G,UAAM,SAAS,IAAI,KAAK;AAGxB,UAAM,sBAAsB,SAAS,MAAM;AACzC,aAAO,cAAc,MAClB,MAAK,EACL,KAAK,CAAC,GAAG,MAAM,IAAI,KAAK,EAAE,SAAS,IAAI,IAAI,KAAK,EAAE,SAAS,CAAC,EAC5D,MAAM,GAAG,MAAM,gBAAgB;AAAA,IACpC,CAAC;AAGD,UAAM,sBAAsB,MAAM;AAChC,aAAO,QAAQ,CAAC,OAAO;AAGvB,UAAI,OAAO,OAAO;AAChB,cAAM,SAASA,MAAW,KAAK;AAC/B,YAAI,QAAQ;AACV,2BAAiB,MAAM;AAAA,QAC7B;AAAA,MACA;AAAA,IACA;AAEA,UAAM,0BAA0B,CAAC,iBAAiB;AAChD,aAAO,QAAQ;AAEf,UAAI,aAAa,KAAK;AAEpB,gBAAQ,yBAAyB;AAAA,UAC/B,gBAAgB,aAAa;AAAA,UAC7B,GAAG,aAAa;AAAA,QACtB,CAAK;AAAA,MACL;AAAA,IACA;AAGA,UAAM,qBAAqB,CAAC,UAAU;AACpC,YAAM,YAAY,SAAS,cAAc,+BAA+B;AACxE,UAAI,aAAa,CAAC,UAAU,SAAS,MAAM,MAAM,GAAG;AAClD,eAAO,QAAQ;AAAA,MACnB;AAAA,IACA;AAGA,cAAU,MAAM;AACd,eAAS,iBAAiB,SAAS,kBAAkB;AAAA,
|
|
1
|
+
{"version":3,"file":"NotificationBadge.vue.js","sources":["../../../../../../../src/modules/notifications/components/elements/NotificationBadge.vue"],"sourcesContent":["<template>\n <div class=\"notification-badge-container\">\n <button \n class=\"i-semi notification-button\"\n @click=\"toggleNotifications\"\n :aria-label=\"unreadCount > 0 ? `${unreadCount} unread notifications` : 'No unread notifications'\"\n >\n <IconBell class=\"notification-icon i-medium\" :fill=\"fill\"/>\n <span \n v-if=\"unreadCount > 0\" \n class=\"button-counter\"\n >\n {{ unreadCount > 99 ? '99+' : unreadCount }}\n </span>\n </button>\n <div v-if=\"isOpen\" class=\"notifications-dropdown\">\n <div class=\"notifications-header\">\n <h3>Notifications</h3>\n <button \n v-if=\"unreadCount > 0\" \n class=\"mark-all-read-btn\" \n @click=\"markAllAsRead\"\n >\n Mark all read\n </button>\n </div>\n <div v-if=\"loading\" class=\"notifications-loading\">\n Loading...\n </div>\n <div v-else-if=\"notifications.length === 0\" class=\"notifications-empty\">\n No notifications\n </div>\n <div v-else class=\"notifications-list\">\n <notification-item \n v-for=\"notification in recentNotifications\" \n :key=\"notification._id\" \n :notification=\"notification\"\n @click=\"handleNotificationClick(notification)\"\n />\n </div>\n <div class=\"notifications-footer\">\n <router-link to=\"/notifications\" @click=\"isOpen = false\">\n View all notifications\n </router-link>\n </div>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, computed, onMounted, onUnmounted, inject } from 'vue';\nimport { useRouter } from 'vue-router';\nimport NotificationItem from '../blocks/NotificationItem.vue';\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth';\n\nimport IconBell from '@martyrs/src/modules/icons/entities/IconBell.vue';\n\nconst props = defineProps({\n maxNotifications: {\n type: Number,\n default: 5\n },\n fill: {\n type: String,\n default: 'rgb(var(--white))'\n }\n});\n\n// Get router and notification functionality\nconst router = useRouter();\nconst { notifications, unreadCount, loading, markAllAsRead, getNotifications } = inject('useNotifications')();\n\n// Local state\nconst isOpen = ref(false);\n\n// Computed properties\nconst recentNotifications = computed(() => {\n return notifications.value\n .slice()\n .sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt))\n .slice(0, props.maxNotifications);\n});\n\n// Methods\nconst toggleNotifications = () => {\n isOpen.value = !isOpen.value;\n \n // Load notifications if opening\n if (isOpen.value) {\n const userId = auth.state.user._id;\n if (userId) {\n getNotifications(userId);\n }\n }\n};\n\nconst handleNotificationClick = (notification) => {\n isOpen.value = false;\n \n if (notification._id) {\n // Handle in store\n actions.handleNotificationAction({\n notificationId: notification._id,\n ...notification.metadata\n });\n }\n};\n\n// Close dropdown when clicking outside\nconst handleClickOutside = (event) => {\n const container = document.querySelector('.notification-badge-container');\n if (container && !container.contains(event.target)) {\n isOpen.value = false;\n }\n};\n\n// Lifecycle hooks\nonMounted(() => {\n document.addEventListener('click', handleClickOutside);\n\n if (isOpen.value) {\n const userId = auth.state.user._id;\n if (userId) {\n getNotifications(userId);\n }\n }\n});\n\nonUnmounted(() => {\n document.removeEventListener('click', handleClickOutside);\n});\n</script>\n\n<style scoped>\n.notification-badge-container {\n position: relative;\n display: inline-block;\n}\n\n.notification-button {\n background: none;\n border: none;\n cursor: pointer;\n position: relative;\n font-size: 1.2rem;\n}\n\n.notification-icon {\n font-size: 1.4rem;\n}\n.button-counter {\n position: absolute;\n right: -8px;\n bottom: -8px;\n background: rgb(var(--fourth));\n color: rgb(var(--white));\n height: 16px;\n border-radius: 16px;\n width: 16px;\n font-weight: 500;\n text-align: center;\n line-height: 16px;\n font-size: 10px;\n}\n.notifications-dropdown {\n position: absolute;\n top: 100%;\n right: 0;\n width: 320px;\n max-height: 400px;\n overflow-y: auto;\n background-color: white;\n border-radius: 4px;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n z-index: 1000;\n}\n\n.notifications-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 12px 16px;\n border-bottom: 1px solid #eee;\n}\n\n.notifications-header h3 {\n margin: 0;\n font-size: 1rem;\n}\n\n.mark-all-read-btn {\n background: none;\n border: none;\n color: #2196f3;\n font-size: 0.8rem;\n cursor: pointer;\n}\n\n.notifications-loading,\n.notifications-empty {\n padding: 24px;\n text-align: center;\n color: #666;\n}\n\n.notifications-list {\n max-height: 300px;\n overflow-y: auto;\n}\n\n.notifications-footer {\n padding: 12px 16px;\n text-align: center;\n border-top: 1px solid #eee;\n}\n\n.notifications-footer a {\n color: #2196f3;\n text-decoration: none;\n font-size: 0.9rem;\n}\n</style>"],"names":["auth.state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,UAAM,QAAQ;AAYC,cAAS;AACxB,UAAM,EAAE,eAAe,aAAa,SAAS,eAAe,qBAAqB,OAAO,kBAAkB,EAAG;AAG7G,UAAM,SAAS,IAAI,KAAK;AAGxB,UAAM,sBAAsB,SAAS,MAAM;AACzC,aAAO,cAAc,MAClB,MAAK,EACL,KAAK,CAAC,GAAG,MAAM,IAAI,KAAK,EAAE,SAAS,IAAI,IAAI,KAAK,EAAE,SAAS,CAAC,EAC5D,MAAM,GAAG,MAAM,gBAAgB;AAAA,IACpC,CAAC;AAGD,UAAM,sBAAsB,MAAM;AAChC,aAAO,QAAQ,CAAC,OAAO;AAGvB,UAAI,OAAO,OAAO;AAChB,cAAM,SAASA,MAAW,KAAK;AAC/B,YAAI,QAAQ;AACV,2BAAiB,MAAM;AAAA,QAC7B;AAAA,MACA;AAAA,IACA;AAEA,UAAM,0BAA0B,CAAC,iBAAiB;AAChD,aAAO,QAAQ;AAEf,UAAI,aAAa,KAAK;AAEpB,gBAAQ,yBAAyB;AAAA,UAC/B,gBAAgB,aAAa;AAAA,UAC7B,GAAG,aAAa;AAAA,QACtB,CAAK;AAAA,MACL;AAAA,IACA;AAGA,UAAM,qBAAqB,CAAC,UAAU;AACpC,YAAM,YAAY,SAAS,cAAc,+BAA+B;AACxE,UAAI,aAAa,CAAC,UAAU,SAAS,MAAM,MAAM,GAAG;AAClD,eAAO,QAAQ;AAAA,MACnB;AAAA,IACA;AAGA,cAAU,MAAM;AACd,eAAS,iBAAiB,SAAS,kBAAkB;AAErD,UAAI,OAAO,OAAO;AAChB,cAAM,SAASA,MAAW,KAAK;AAC/B,YAAI,QAAQ;AACV,2BAAiB,MAAM;AAAA,QAC7B;AAAA,MACA;AAAA,IACA,CAAC;AAED,gBAAY,MAAM;AAChB,eAAS,oBAAoB,SAAS,kBAAkB;AAAA,IAC1D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const vue = require("vue");
|
|
4
|
+
const CardHeader = require("../../../globals/views/components/blocks/CardHeader.vue.cjs");
|
|
5
|
+
const IconTime = require("../../../icons/entities/IconTime.vue.cjs");
|
|
6
|
+
const _hoisted_1 = { class: "bg-light pos-relative pd-medium radius-medium" };
|
|
7
|
+
const _hoisted_2 = { class: "mn-b-small pd-small bg-white radius-small flex-nowrap flex" };
|
|
8
|
+
const _hoisted_3 = { class: "w-100" };
|
|
9
|
+
const _hoisted_4 = { class: "t-truncate" };
|
|
10
|
+
const _hoisted_5 = { class: "w-100 t-right" };
|
|
11
|
+
const _hoisted_6 = { class: "mn-b-thin" };
|
|
12
|
+
const _hoisted_7 = { class: "cols-1 pos-relative mn-b-small gap-thin pd-small bg-white radius-small" };
|
|
13
|
+
const _hoisted_8 = { class: "mn-r-auto" };
|
|
14
|
+
const _hoisted_9 = { class: "t-right" };
|
|
15
|
+
const _hoisted_10 = { class: "t-transp" };
|
|
16
|
+
const _hoisted_11 = { class: "pd-small bg-white radius-small gap-micro flex-v-center flex-nowrap flex" };
|
|
17
|
+
const _hoisted_12 = { class: "t-medium mn-r-auto" };
|
|
18
|
+
const _hoisted_13 = { 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" };
|
|
19
|
+
const _hoisted_14 = { 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" };
|
|
20
|
+
const _hoisted_15 = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "pos-relative radius-small bg-fifth-transp-10 mn-t-thin pd-small"
|
|
23
|
+
};
|
|
24
|
+
const _sfc_main = {
|
|
25
|
+
__name: "CardOrderBackoffice",
|
|
26
|
+
props: {
|
|
27
|
+
order: {
|
|
28
|
+
type: Object,
|
|
29
|
+
required: true
|
|
30
|
+
},
|
|
31
|
+
user: {
|
|
32
|
+
type: Object,
|
|
33
|
+
required: true
|
|
34
|
+
},
|
|
35
|
+
formatDate: {
|
|
36
|
+
type: Function,
|
|
37
|
+
required: true
|
|
38
|
+
},
|
|
39
|
+
getTotal: {
|
|
40
|
+
type: Function,
|
|
41
|
+
required: true
|
|
42
|
+
},
|
|
43
|
+
currency: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: ""
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
setup(__props) {
|
|
49
|
+
const spoiler = vue.ref(false);
|
|
50
|
+
return (_ctx, _cache) => {
|
|
51
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
52
|
+
vue.createVNode(CardHeader.default, {
|
|
53
|
+
entity: __props.order,
|
|
54
|
+
entityType: "order",
|
|
55
|
+
user: __props.user,
|
|
56
|
+
owner: __props.order.creator,
|
|
57
|
+
creator: __props.order.creator,
|
|
58
|
+
date: __props.order.createdAt,
|
|
59
|
+
class: "mn-b-small"
|
|
60
|
+
}, null, 8, ["entity", "user", "owner", "creator", "date"]),
|
|
61
|
+
vue.createElementVNode("div", _hoisted_2, [
|
|
62
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
63
|
+
vue.createElementVNode("p", _hoisted_4, vue.toDisplayString(__props.order.delivery.address || "Not specified"), 1)
|
|
64
|
+
]),
|
|
65
|
+
vue.createElementVNode("div", _hoisted_5, [
|
|
66
|
+
vue.createElementVNode("h3", _hoisted_6, vue.toDisplayString(__props.currency) + vue.toDisplayString(__props.getTotal(__props.order.positions)), 1),
|
|
67
|
+
vue.createElementVNode("p", null, "#" + vue.toDisplayString(__props.order._id.slice(0, 4) + "..." + __props.order._id.slice(-4)), 1)
|
|
68
|
+
])
|
|
69
|
+
]),
|
|
70
|
+
vue.createElementVNode("div", _hoisted_7, [
|
|
71
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.order.positions, (position, index) => {
|
|
72
|
+
return vue.openBlock(), vue.createBlock(vue.Transition, { name: "moveFromTop" }, {
|
|
73
|
+
default: vue.withCtx(() => [
|
|
74
|
+
index < 2 || spoiler.value && index >= 2 ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
75
|
+
key: index,
|
|
76
|
+
class: "w-100 flex"
|
|
77
|
+
}, [
|
|
78
|
+
vue.createElementVNode("p", _hoisted_8, vue.toDisplayString(position.name), 1),
|
|
79
|
+
vue.createElementVNode("p", _hoisted_9, [
|
|
80
|
+
vue.createTextVNode(vue.toDisplayString(position.quantity) + " " + vue.toDisplayString(position.type) + " x ", 1),
|
|
81
|
+
vue.createElementVNode("span", _hoisted_10, vue.toDisplayString(__props.currency) + " " + vue.toDisplayString(position.price), 1)
|
|
82
|
+
])
|
|
83
|
+
])) : vue.createCommentVNode("", true)
|
|
84
|
+
]),
|
|
85
|
+
_: 2
|
|
86
|
+
}, 1024);
|
|
87
|
+
}), 256)),
|
|
88
|
+
__props.order.positions.length > 2 ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
89
|
+
key: 0,
|
|
90
|
+
onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => spoiler.value = !spoiler.value, ["prevent"])),
|
|
91
|
+
class: "cursor-pointer radius-big bg-light-transp-50 pd-nano w-100 flex-center flex"
|
|
92
|
+
}, vue.toDisplayString(!spoiler.value ? `+${__props.order.positions.length - 2} more` : `Hide`), 1)) : vue.createCommentVNode("", true)
|
|
93
|
+
]),
|
|
94
|
+
vue.createElementVNode("div", _hoisted_11, [
|
|
95
|
+
vue.createVNode(IconTime.default, {
|
|
96
|
+
class: "i-semi t-transp",
|
|
97
|
+
fill: "rgb(var(--black)"
|
|
98
|
+
}),
|
|
99
|
+
vue.createElementVNode("p", _hoisted_12, vue.toDisplayString(__props.formatDate(__props.order.deadline)), 1),
|
|
100
|
+
vue.createElementVNode("span", _hoisted_13, vue.toDisplayString(__props.order.status), 1),
|
|
101
|
+
vue.createElementVNode("span", _hoisted_14, vue.toDisplayString(__props.order.payment.status || "Not defined"), 1)
|
|
102
|
+
]),
|
|
103
|
+
__props.order.comment ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_15, [
|
|
104
|
+
_cache[1] || (_cache[1] = vue.createElementVNode("p", { class: "mn-b-thin t-transp uppercase p-small t-medium" }, "Comment", -1)),
|
|
105
|
+
vue.createElementVNode("p", null, vue.toDisplayString(__props.order.comment), 1)
|
|
106
|
+
])) : vue.createCommentVNode("", true)
|
|
107
|
+
]);
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
exports.default = _sfc_main;
|
|
112
|
+
//# sourceMappingURL=CardOrderBackoffice.vue.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardOrderBackoffice.vue.cjs","sources":["../../../../../../../src/modules/orders/components/blocks/CardOrderBackoffice.vue"],"sourcesContent":["<template>\n <div class=\"bg-light pos-relative pd-medium radius-medium\">\n <CardHeader \n :entity=\"order\"\n :entityType=\"'order'\"\n :user=\"user\"\n :owner=\"order.creator\" \n :creator=\"order.creator\"\n :date=\"order.createdAt\"\n class=\"mn-b-small\"\n />\n\n <div class=\"mn-b-small pd-small bg-white radius-small flex-nowrap flex\"> \n <div class=\"w-100\">\n <p class=\"t-truncate\">{{order.delivery.address || 'Not specified'}}</p> \n </div>\n\n <div class=\"w-100 t-right\">\n <h3 class=\"mn-b-thin\">{{currency}}{{getTotal(order.positions)}}</h3>\n <p>#{{order._id.slice(0, 4) + '...' + order._id.slice(-4)}}</p> \n </div>\n </div>\n \n <div class=\"cols-1 pos-relative mn-b-small gap-thin pd-small bg-white radius-small\">\n\t\t <!-- Всегда отображаем первые две позиции -->\n\t\t <template v-for=\"(position, index) in order.positions\">\n\t\t \t<transition name=\"moveFromTop\">\n\t\t\t <div \n\t\t\t v-if=\"index < 2 || (spoiler && index >= 2)\" \n\t\t\t :key=\"index\" \n\t\t\t class=\"w-100 flex\"\n\t\t\t >\n\t\t\t <p class=\"mn-r-auto\">{{ position.name }}</p>\n\t\t\t <p class=\"t-right\">\n\t\t\t {{ position.quantity }} {{ position.type }}\n\t\t\t x\n\t\t\t <span class=\"t-transp\">{{ currency }} {{ position.price }}</span>\n\t\t\t </p>\n\t\t\t </div>\n\t </transition>\n\t\t </template>\n\t\t\n\t\t <!-- Кнопка переключения для дополнительных позиций, видна только если есть больше двух позиций -->\n\t\t <button\n\t\t v-if=\"order.positions.length > 2\"\n\t\t @click.prevent=\"spoiler = !spoiler\"\n\t\t class=\"cursor-pointer radius-big bg-light-transp-50 pd-nano w-100 flex-center flex\"\n\t\t >\n\t\t {{ !spoiler ? `+${order.positions.length - 2} more` : `Hide` }}\n\t\t </button>\n\t\t</div>\n\n <div class=\"pd-small bg-white radius-small gap-micro flex-v-center flex-nowrap flex\"> \n <IconTime class=\"i-semi t-transp\" fill=\"rgb(var(--black)\" />\n <p class=\"t-medium mn-r-auto\">{{formatDate(order.deadline)}}</p>\n\n <span \n 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\"\n >\n {{order.status}}\n </span>\n\n <span \n 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\"\n >\n {{order.payment.status || 'Not defined'}}\n </span>\n </div>\n\n <div v-if=\"order.comment\" class=\"pos-relative radius-small bg-fifth-transp-10 mn-t-thin pd-small\">\n <p class=\"mn-b-thin t-transp uppercase p-small t-medium\">Comment</p>\n <p>{{order.comment}}</p>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref } from 'vue';\nimport CardHeader from '@martyrs/src/modules/globals/views/components/blocks/CardHeader.vue';\nimport IconTime from '@martyrs/src/modules/icons/entities/IconTime.vue';\n\nconst props = defineProps({\n order: {\n type: Object,\n required: true\n },\n user: {\n type: Object,\n required: true\n },\n formatDate: {\n type: Function,\n required: true\n },\n getTotal: {\n type: Function,\n required: true\n },\n currency: {\n type: String,\n default: ''\n }\n});\n\nconst spoiler = ref(false);\n</script>"],"names":["ref"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwGA,UAAM,UAAUA,IAAG,IAAC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ref, createElementBlock, openBlock, createVNode, createElementVNode, createCommentVNode, toDisplayString, Fragment, renderList, createBlock, Transition, withCtx, createTextVNode, withModifiers } from "vue";
|
|
2
|
+
import _sfc_main$1 from "../../../globals/views/components/blocks/CardHeader.vue.js";
|
|
3
|
+
import IconTime from "../../../icons/entities/IconTime.vue.js";
|
|
4
|
+
const _hoisted_1 = { class: "bg-light pos-relative pd-medium radius-medium" };
|
|
5
|
+
const _hoisted_2 = { class: "mn-b-small pd-small bg-white radius-small flex-nowrap flex" };
|
|
6
|
+
const _hoisted_3 = { class: "w-100" };
|
|
7
|
+
const _hoisted_4 = { class: "t-truncate" };
|
|
8
|
+
const _hoisted_5 = { class: "w-100 t-right" };
|
|
9
|
+
const _hoisted_6 = { class: "mn-b-thin" };
|
|
10
|
+
const _hoisted_7 = { class: "cols-1 pos-relative mn-b-small gap-thin pd-small bg-white radius-small" };
|
|
11
|
+
const _hoisted_8 = { class: "mn-r-auto" };
|
|
12
|
+
const _hoisted_9 = { class: "t-right" };
|
|
13
|
+
const _hoisted_10 = { class: "t-transp" };
|
|
14
|
+
const _hoisted_11 = { class: "pd-small bg-white radius-small gap-micro flex-v-center flex-nowrap flex" };
|
|
15
|
+
const _hoisted_12 = { class: "t-medium mn-r-auto" };
|
|
16
|
+
const _hoisted_13 = { 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" };
|
|
17
|
+
const _hoisted_14 = { 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" };
|
|
18
|
+
const _hoisted_15 = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "pos-relative radius-small bg-fifth-transp-10 mn-t-thin pd-small"
|
|
21
|
+
};
|
|
22
|
+
const _sfc_main = {
|
|
23
|
+
__name: "CardOrderBackoffice",
|
|
24
|
+
props: {
|
|
25
|
+
order: {
|
|
26
|
+
type: Object,
|
|
27
|
+
required: true
|
|
28
|
+
},
|
|
29
|
+
user: {
|
|
30
|
+
type: Object,
|
|
31
|
+
required: true
|
|
32
|
+
},
|
|
33
|
+
formatDate: {
|
|
34
|
+
type: Function,
|
|
35
|
+
required: true
|
|
36
|
+
},
|
|
37
|
+
getTotal: {
|
|
38
|
+
type: Function,
|
|
39
|
+
required: true
|
|
40
|
+
},
|
|
41
|
+
currency: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: ""
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
setup(__props) {
|
|
47
|
+
const spoiler = ref(false);
|
|
48
|
+
return (_ctx, _cache) => {
|
|
49
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
50
|
+
createVNode(_sfc_main$1, {
|
|
51
|
+
entity: __props.order,
|
|
52
|
+
entityType: "order",
|
|
53
|
+
user: __props.user,
|
|
54
|
+
owner: __props.order.creator,
|
|
55
|
+
creator: __props.order.creator,
|
|
56
|
+
date: __props.order.createdAt,
|
|
57
|
+
class: "mn-b-small"
|
|
58
|
+
}, null, 8, ["entity", "user", "owner", "creator", "date"]),
|
|
59
|
+
createElementVNode("div", _hoisted_2, [
|
|
60
|
+
createElementVNode("div", _hoisted_3, [
|
|
61
|
+
createElementVNode("p", _hoisted_4, toDisplayString(__props.order.delivery.address || "Not specified"), 1)
|
|
62
|
+
]),
|
|
63
|
+
createElementVNode("div", _hoisted_5, [
|
|
64
|
+
createElementVNode("h3", _hoisted_6, toDisplayString(__props.currency) + toDisplayString(__props.getTotal(__props.order.positions)), 1),
|
|
65
|
+
createElementVNode("p", null, "#" + toDisplayString(__props.order._id.slice(0, 4) + "..." + __props.order._id.slice(-4)), 1)
|
|
66
|
+
])
|
|
67
|
+
]),
|
|
68
|
+
createElementVNode("div", _hoisted_7, [
|
|
69
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.order.positions, (position, index) => {
|
|
70
|
+
return openBlock(), createBlock(Transition, { name: "moveFromTop" }, {
|
|
71
|
+
default: withCtx(() => [
|
|
72
|
+
index < 2 || spoiler.value && index >= 2 ? (openBlock(), createElementBlock("div", {
|
|
73
|
+
key: index,
|
|
74
|
+
class: "w-100 flex"
|
|
75
|
+
}, [
|
|
76
|
+
createElementVNode("p", _hoisted_8, toDisplayString(position.name), 1),
|
|
77
|
+
createElementVNode("p", _hoisted_9, [
|
|
78
|
+
createTextVNode(toDisplayString(position.quantity) + " " + toDisplayString(position.type) + " x ", 1),
|
|
79
|
+
createElementVNode("span", _hoisted_10, toDisplayString(__props.currency) + " " + toDisplayString(position.price), 1)
|
|
80
|
+
])
|
|
81
|
+
])) : createCommentVNode("", true)
|
|
82
|
+
]),
|
|
83
|
+
_: 2
|
|
84
|
+
}, 1024);
|
|
85
|
+
}), 256)),
|
|
86
|
+
__props.order.positions.length > 2 ? (openBlock(), createElementBlock("button", {
|
|
87
|
+
key: 0,
|
|
88
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => spoiler.value = !spoiler.value, ["prevent"])),
|
|
89
|
+
class: "cursor-pointer radius-big bg-light-transp-50 pd-nano w-100 flex-center flex"
|
|
90
|
+
}, toDisplayString(!spoiler.value ? `+${__props.order.positions.length - 2} more` : `Hide`), 1)) : createCommentVNode("", true)
|
|
91
|
+
]),
|
|
92
|
+
createElementVNode("div", _hoisted_11, [
|
|
93
|
+
createVNode(IconTime, {
|
|
94
|
+
class: "i-semi t-transp",
|
|
95
|
+
fill: "rgb(var(--black)"
|
|
96
|
+
}),
|
|
97
|
+
createElementVNode("p", _hoisted_12, toDisplayString(__props.formatDate(__props.order.deadline)), 1),
|
|
98
|
+
createElementVNode("span", _hoisted_13, toDisplayString(__props.order.status), 1),
|
|
99
|
+
createElementVNode("span", _hoisted_14, toDisplayString(__props.order.payment.status || "Not defined"), 1)
|
|
100
|
+
]),
|
|
101
|
+
__props.order.comment ? (openBlock(), createElementBlock("div", _hoisted_15, [
|
|
102
|
+
_cache[1] || (_cache[1] = createElementVNode("p", { class: "mn-b-thin t-transp uppercase p-small t-medium" }, "Comment", -1)),
|
|
103
|
+
createElementVNode("p", null, toDisplayString(__props.order.comment), 1)
|
|
104
|
+
])) : createCommentVNode("", true)
|
|
105
|
+
]);
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
export {
|
|
110
|
+
_sfc_main as default
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=CardOrderBackoffice.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardOrderBackoffice.vue.js","sources":["../../../../../../../src/modules/orders/components/blocks/CardOrderBackoffice.vue"],"sourcesContent":["<template>\n <div class=\"bg-light pos-relative pd-medium radius-medium\">\n <CardHeader \n :entity=\"order\"\n :entityType=\"'order'\"\n :user=\"user\"\n :owner=\"order.creator\" \n :creator=\"order.creator\"\n :date=\"order.createdAt\"\n class=\"mn-b-small\"\n />\n\n <div class=\"mn-b-small pd-small bg-white radius-small flex-nowrap flex\"> \n <div class=\"w-100\">\n <p class=\"t-truncate\">{{order.delivery.address || 'Not specified'}}</p> \n </div>\n\n <div class=\"w-100 t-right\">\n <h3 class=\"mn-b-thin\">{{currency}}{{getTotal(order.positions)}}</h3>\n <p>#{{order._id.slice(0, 4) + '...' + order._id.slice(-4)}}</p> \n </div>\n </div>\n \n <div class=\"cols-1 pos-relative mn-b-small gap-thin pd-small bg-white radius-small\">\n\t\t <!-- Всегда отображаем первые две позиции -->\n\t\t <template v-for=\"(position, index) in order.positions\">\n\t\t \t<transition name=\"moveFromTop\">\n\t\t\t <div \n\t\t\t v-if=\"index < 2 || (spoiler && index >= 2)\" \n\t\t\t :key=\"index\" \n\t\t\t class=\"w-100 flex\"\n\t\t\t >\n\t\t\t <p class=\"mn-r-auto\">{{ position.name }}</p>\n\t\t\t <p class=\"t-right\">\n\t\t\t {{ position.quantity }} {{ position.type }}\n\t\t\t x\n\t\t\t <span class=\"t-transp\">{{ currency }} {{ position.price }}</span>\n\t\t\t </p>\n\t\t\t </div>\n\t </transition>\n\t\t </template>\n\t\t\n\t\t <!-- Кнопка переключения для дополнительных позиций, видна только если есть больше двух позиций -->\n\t\t <button\n\t\t v-if=\"order.positions.length > 2\"\n\t\t @click.prevent=\"spoiler = !spoiler\"\n\t\t class=\"cursor-pointer radius-big bg-light-transp-50 pd-nano w-100 flex-center flex\"\n\t\t >\n\t\t {{ !spoiler ? `+${order.positions.length - 2} more` : `Hide` }}\n\t\t </button>\n\t\t</div>\n\n <div class=\"pd-small bg-white radius-small gap-micro flex-v-center flex-nowrap flex\"> \n <IconTime class=\"i-semi t-transp\" fill=\"rgb(var(--black)\" />\n <p class=\"t-medium mn-r-auto\">{{formatDate(order.deadline)}}</p>\n\n <span \n 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\"\n >\n {{order.status}}\n </span>\n\n <span \n 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\"\n >\n {{order.payment.status || 'Not defined'}}\n </span>\n </div>\n\n <div v-if=\"order.comment\" class=\"pos-relative radius-small bg-fifth-transp-10 mn-t-thin pd-small\">\n <p class=\"mn-b-thin t-transp uppercase p-small t-medium\">Comment</p>\n <p>{{order.comment}}</p>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref } from 'vue';\nimport CardHeader from '@martyrs/src/modules/globals/views/components/blocks/CardHeader.vue';\nimport IconTime from '@martyrs/src/modules/icons/entities/IconTime.vue';\n\nconst props = defineProps({\n order: {\n type: Object,\n required: true\n },\n user: {\n type: Object,\n required: true\n },\n formatDate: {\n type: Function,\n required: true\n },\n getTotal: {\n type: Function,\n required: true\n },\n currency: {\n type: String,\n default: ''\n }\n});\n\nconst spoiler = ref(false);\n</script>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwGA,UAAM,UAAU,IAAI,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -105,7 +105,7 @@ const _sfc_main = {
|
|
|
105
105
|
vue.createElementVNode("p", _hoisted_6, vue.toDisplayString(__props.product.name), 1),
|
|
106
106
|
vue.createElementVNode("div", null, [
|
|
107
107
|
vue.createElementVNode("p", null, [
|
|
108
|
-
vue.createElementVNode("span", _hoisted_7, vue.toDisplayString(__props.product.price_currency || _ctx.returnCurrency()) + vue.toDisplayString((__props.product.listing === "rent" ? rentalDays.value || __props.product.quantity ||
|
|
108
|
+
vue.createElementVNode("span", _hoisted_7, vue.toDisplayString(__props.product.price_currency || _ctx.returnCurrency()) + vue.toDisplayString((__props.product.listing === "rent" ? rentalDays.value || __props.product.quantity || 0 : __props.product.quantity || 0) * __props.product.price), 1),
|
|
109
109
|
vue.createElementVNode("span", _hoisted_8, [
|
|
110
110
|
__props.product.quantity ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
111
111
|
vue.createTextVNode(vue.toDisplayString(__props.product.price_currency || _ctx.returnCurrency()) + vue.toDisplayString(__props.product.price), 1)
|
|
@@ -114,7 +114,7 @@ const _sfc_main = {
|
|
|
114
114
|
__props.product.listing === "rent" && rentDates.value.start && rentDates.value.end ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
115
115
|
vue.createTextVNode(vue.toDisplayString(rentalDays.value) + " days ", 1)
|
|
116
116
|
], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
117
|
-
vue.createTextVNode(vue.toDisplayString(__props.product.quantity ||
|
|
117
|
+
vue.createTextVNode(vue.toDisplayString(__props.product.quantity || 0) + " " + vue.toDisplayString(__props.product.unit || "pcs"), 1)
|
|
118
118
|
], 64))
|
|
119
119
|
])
|
|
120
120
|
])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardOrderItem.vue.cjs","sources":["../../../../../../../src/modules/orders/components/blocks/CardOrderItem.vue"],"sourcesContent":["<template>\n <div class=\"gap-small pos-relative cols-1\">\n <div class=\"pos-relative w-100 gap-thin flex-stretch flex-nowrap flex\">\n <div class=\"bg-light h-100 o-hidden pos-relative radius-small aspect-1x1\"\n style=\"flex: 1 0 auto\"\n >\n <!-- Item Image -->\n <img loading=\"lazy\" \n class=\"w-100 object-fit-cover pos-absolute h-100\" \n v-if=\"product.images[0]\" \n :src=\"(FILE_SERVER_URL || '') + product.images[0]\"\n >\n <PlaceholderImage\n v-if=\"!product.images[0]\" \n class=\"bg-light pos-absolute radius-small w-100 h-100\"\n />\n </div>\n \n <!-- Item Description -->\n <div class=\"w-100 pos-relative\">\n <!-- Name -->\n <p class=\"t-truncate t-medium\">{{ product.name }}</p>\n <div>\n <p>\n <span class=\"t-second mn-r-micro d-inline-block t-demi\">\n {{ product.price_currency || returnCurrency() }}{{ (product.listing === 'rent' ? (rentalDays || product.quantity ||
|
|
1
|
+
{"version":3,"file":"CardOrderItem.vue.cjs","sources":["../../../../../../../src/modules/orders/components/blocks/CardOrderItem.vue"],"sourcesContent":["<template>\n <div class=\"gap-small pos-relative cols-1\">\n <div class=\"pos-relative w-100 gap-thin flex-stretch flex-nowrap flex\">\n <div class=\"bg-light h-100 o-hidden pos-relative radius-small aspect-1x1\"\n style=\"flex: 1 0 auto\"\n >\n <!-- Item Image -->\n <img loading=\"lazy\" \n class=\"w-100 object-fit-cover pos-absolute h-100\" \n v-if=\"product.images[0]\" \n :src=\"(FILE_SERVER_URL || '') + product.images[0]\"\n >\n <PlaceholderImage\n v-if=\"!product.images[0]\" \n class=\"bg-light pos-absolute radius-small w-100 h-100\"\n />\n </div>\n \n <!-- Item Description -->\n <div class=\"w-100 pos-relative\">\n <!-- Name -->\n <p class=\"t-truncate t-medium\">{{ product.name }}</p>\n <div>\n <p>\n <span class=\"t-second mn-r-micro d-inline-block t-demi\">\n {{ product.price_currency || returnCurrency() }}{{ (product.listing === 'rent' ? (rentalDays || product.quantity || 0) : (product.quantity || 0)) * product.price }}\n </span>\n\n <span class=\"p-small t-transp\">\n <template v-if=\"product.quantity\">{{product.price_currency || returnCurrency() }}{{product.price}} </template>\n × \n <template v-if=\"product.listing === 'rent' && rentDates.start && rentDates.end\">\n {{ rentalDays }} days\n </template>\n \n <template v-else>\n {{ product.quantity || 0 }} {{ product.unit || 'pcs' }}\n </template>\n </span>\n </p> \n </div>\n \n <!-- Control Buttons -->\n <div v-if=\"editable || product.listing === 'rent'\" class=\"mn-t-thin gap-thin flex-nojustify flex\">\n <!-- For Rent Items: Edit Dates Button -->\n <div v-if=\"(product.listing === 'rent') && (rentDates.start && rentDates.end)\" class=\"flex gap-thin flex-v-center cursor-pointer pd-thin w-100 bg-light radius-small\">\n <IconCalendar\n @click=\"openRentDatePopup\"\n class=\"cursor-pointer i-medium\"\n />\n <!-- Rent Dates Display -->\n <p @click=\"editable ? openRentDatePopup : null\" class=\"t-medium t-transp\">\n {{ formatDate(rentDates.start, { dayMonth: true, language: locale }) }} - {{ formatDate(rentDates.end, { dayMonth: true, language: locale }) }}\n </p>\n </div>\n\n <!-- For Regular Items: Quantity Control Buttons -->\n <template v-if=\"editable &&product.listing !== 'rent'\">\n <IconAdd\n @click=\"increase_(product)\"\n class=\"hover-scale-1 cursor-pointer bg-light i-big pd-thin radius-small\"\n />\n <IconMinus\n @click=\"decrease(product)\"\n class=\"hover-scale-1 cursor-pointer bg-light i-big pd-thin radius-small\"\n />\n <IconDelete\n @click=\"remove(product)\"\n class=\"hover-scale-1 cursor-pointer bg-light i-big pd-thin radius-small\"\n />\n </template>\n\n <IconEdit\n v-if=\"product.listing === 'rent' && editable\"\n @click=\"openRentDatePopup\"\n class=\"hover-scale-1 cursor-pointer bg-light i-big pd-small radius-small\"\n />\n </div>\n </div>\n </div>\n \n <!-- Rent Date Popup -->\n <PopupDateSelector\n :isOpen=\"isRentDatePopupOpen\"\n :product=\"product\"\n :initialDates=\"rentDates\"\n :showFees=\"true\"\n :showVat=\"true\"\n :feesRate=\"0.15\"\n :vatRate=\"0.2\"\n :showCancelButton=\"true\"\n :onCancel=\"() => remove(product)\"\n @confirm=\"updateRentDates\"\n @close=\"closeRentDatePopup\"\n />\n </div>\n</template>\n\n<script setup>\nimport { ref, computed } from 'vue'\nimport { useRouter } from 'vue-router'\nimport { useI18n } from 'vue-i18n'\nimport { format } from 'date-fns'\nimport IconAdd from '@martyrs/src/modules/icons/navigation/IconAdd.vue'\nimport IconEdit from '@martyrs/src/modules/icons/navigation/IconEdit.vue'\nimport IconMinus from '@martyrs/src/modules/icons/navigation/IconMinus.vue'\nimport IconDelete from '@martyrs/src/modules/icons/navigation/IconDelete.vue'\nimport IconCalendar from '@martyrs/src/modules/icons/entities/IconCalendar.vue'\nimport PlaceholderImage from '@martyrs/src/modules/icons/placeholders/PlaceholderImage.vue'\nimport PopupDateSelector from '@martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue'\n\nconst router = useRouter()\nconst emits = defineEmits(['increase', 'decrease', 'remove', 'updateRentDates'])\n\nconst props = defineProps({\n product: Object,\n editable: Boolean,\n increase: Function,\n decrease: Function,\n remove: Function,\n})\n\nconst { locale } = useI18n()\n\n// Rental dates state - initialize from product if available\nconst rentDates = ref({\n start: props.product.date?.start || null,\n end: props.product.date?.end || null\n})\n\n// Rental days calculation\nconst rentalDays = computed(() => {\n if (!rentDates.value.start || !rentDates.value.end) return 0\n \n const start = new Date(rentDates.value.start)\n const end = new Date(rentDates.value.end)\n const diffTime = Math.abs(end - start)\n return Math.ceil(diffTime / (1000 * 60 * 60 * 24)) + 1\n})\n\n// Popup state\nconst isRentDatePopupOpen = ref(false)\n\n// Methods for buttons\nfunction increase_(product) {\n if (props.increase) {\n props.increase(product)\n }\n emits('increase', product)\n}\n\nfunction decrease(product) {\n if (props.decrease) {\n props.decrease(product)\n }\n emits('decrease', product)\n}\n\nfunction remove(product) {\n if (props.remove) {\n props.remove(product)\n }\n emits('remove', product)\n}\n\n// Rent date popup functions\nfunction openRentDatePopup() {\n isRentDatePopupOpen.value = true\n}\n\nfunction closeRentDatePopup() {\nisRentDatePopupOpen.value = false\n}\n\nfunction updateRentDates(dates) {\n rentDates.value = dates\n emits('updateRentDates', props.product, dates)\n closeRentDatePopup()\n}\n</script>\n\n<style lang=\"scss\">\n</style>"],"names":["useRouter","useI18n","ref","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+GeA,cAAS,UAAA;AACxB,UAAM,QAAQ;AAEd,UAAM,QAAQ;AAQd,UAAM,EAAE,OAAQ,IAAGC,QAAO,QAAA;AAG1B,UAAM,YAAYC,IAAAA,IAAI;AAAA,MACpB,SAAO,WAAM,QAAQ,SAAd,mBAAoB,UAAS;AAAA,MACpC,OAAK,WAAM,QAAQ,SAAd,mBAAoB,QAAO;AAAA,IAClC,CAAC;AAGD,UAAM,aAAaC,IAAQ,SAAC,MAAM;AAChC,UAAI,CAAC,UAAU,MAAM,SAAS,CAAC,UAAU,MAAM,IAAK,QAAO;AAE3D,YAAM,QAAQ,IAAI,KAAK,UAAU,MAAM,KAAK;AAC5C,YAAM,MAAM,IAAI,KAAK,UAAU,MAAM,GAAG;AACxC,YAAM,WAAW,KAAK,IAAI,MAAM,KAAK;AACrC,aAAO,KAAK,KAAK,YAAY,MAAO,KAAK,KAAK,GAAG,IAAI;AAAA,IACvD,CAAC;AAGD,UAAM,sBAAsBD,IAAG,IAAC,KAAK;AAGrC,aAAS,UAAU,SAAS;AAC1B,UAAI,MAAM,UAAU;AAClB,cAAM,SAAS,OAAO;AAAA,MAC1B;AACE,YAAM,YAAY,OAAO;AAAA,IAC3B;AAEA,aAAS,SAAS,SAAS;AACzB,UAAI,MAAM,UAAU;AAClB,cAAM,SAAS,OAAO;AAAA,MAC1B;AACE,YAAM,YAAY,OAAO;AAAA,IAC3B;AAEA,aAAS,OAAO,SAAS;AACvB,UAAI,MAAM,QAAQ;AAChB,cAAM,OAAO,OAAO;AAAA,MACxB;AACE,YAAM,UAAU,OAAO;AAAA,IACzB;AAGA,aAAS,oBAAoB;AAC3B,0BAAoB,QAAQ;AAAA,IAC9B;AAEA,aAAS,qBAAqB;AAC9B,0BAAoB,QAAQ;AAAA,IAC5B;AAEA,aAAS,gBAAgB,OAAO;AAC9B,gBAAU,QAAQ;AAClB,YAAM,mBAAmB,MAAM,SAAS,KAAK;AAC7C,yBAAkB;AAAA,IACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -103,7 +103,7 @@ const _sfc_main = {
|
|
|
103
103
|
createElementVNode("p", _hoisted_6, toDisplayString(__props.product.name), 1),
|
|
104
104
|
createElementVNode("div", null, [
|
|
105
105
|
createElementVNode("p", null, [
|
|
106
|
-
createElementVNode("span", _hoisted_7, toDisplayString(__props.product.price_currency || _ctx.returnCurrency()) + toDisplayString((__props.product.listing === "rent" ? rentalDays.value || __props.product.quantity ||
|
|
106
|
+
createElementVNode("span", _hoisted_7, toDisplayString(__props.product.price_currency || _ctx.returnCurrency()) + toDisplayString((__props.product.listing === "rent" ? rentalDays.value || __props.product.quantity || 0 : __props.product.quantity || 0) * __props.product.price), 1),
|
|
107
107
|
createElementVNode("span", _hoisted_8, [
|
|
108
108
|
__props.product.quantity ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
109
109
|
createTextVNode(toDisplayString(__props.product.price_currency || _ctx.returnCurrency()) + toDisplayString(__props.product.price), 1)
|
|
@@ -112,7 +112,7 @@ const _sfc_main = {
|
|
|
112
112
|
__props.product.listing === "rent" && rentDates.value.start && rentDates.value.end ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
113
113
|
createTextVNode(toDisplayString(rentalDays.value) + " days ", 1)
|
|
114
114
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
115
|
-
createTextVNode(toDisplayString(__props.product.quantity ||
|
|
115
|
+
createTextVNode(toDisplayString(__props.product.quantity || 0) + " " + toDisplayString(__props.product.unit || "pcs"), 1)
|
|
116
116
|
], 64))
|
|
117
117
|
])
|
|
118
118
|
])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardOrderItem.vue.js","sources":["../../../../../../../src/modules/orders/components/blocks/CardOrderItem.vue"],"sourcesContent":["<template>\n <div class=\"gap-small pos-relative cols-1\">\n <div class=\"pos-relative w-100 gap-thin flex-stretch flex-nowrap flex\">\n <div class=\"bg-light h-100 o-hidden pos-relative radius-small aspect-1x1\"\n style=\"flex: 1 0 auto\"\n >\n <!-- Item Image -->\n <img loading=\"lazy\" \n class=\"w-100 object-fit-cover pos-absolute h-100\" \n v-if=\"product.images[0]\" \n :src=\"(FILE_SERVER_URL || '') + product.images[0]\"\n >\n <PlaceholderImage\n v-if=\"!product.images[0]\" \n class=\"bg-light pos-absolute radius-small w-100 h-100\"\n />\n </div>\n \n <!-- Item Description -->\n <div class=\"w-100 pos-relative\">\n <!-- Name -->\n <p class=\"t-truncate t-medium\">{{ product.name }}</p>\n <div>\n <p>\n <span class=\"t-second mn-r-micro d-inline-block t-demi\">\n {{ product.price_currency || returnCurrency() }}{{ (product.listing === 'rent' ? (rentalDays || product.quantity ||
|
|
1
|
+
{"version":3,"file":"CardOrderItem.vue.js","sources":["../../../../../../../src/modules/orders/components/blocks/CardOrderItem.vue"],"sourcesContent":["<template>\n <div class=\"gap-small pos-relative cols-1\">\n <div class=\"pos-relative w-100 gap-thin flex-stretch flex-nowrap flex\">\n <div class=\"bg-light h-100 o-hidden pos-relative radius-small aspect-1x1\"\n style=\"flex: 1 0 auto\"\n >\n <!-- Item Image -->\n <img loading=\"lazy\" \n class=\"w-100 object-fit-cover pos-absolute h-100\" \n v-if=\"product.images[0]\" \n :src=\"(FILE_SERVER_URL || '') + product.images[0]\"\n >\n <PlaceholderImage\n v-if=\"!product.images[0]\" \n class=\"bg-light pos-absolute radius-small w-100 h-100\"\n />\n </div>\n \n <!-- Item Description -->\n <div class=\"w-100 pos-relative\">\n <!-- Name -->\n <p class=\"t-truncate t-medium\">{{ product.name }}</p>\n <div>\n <p>\n <span class=\"t-second mn-r-micro d-inline-block t-demi\">\n {{ product.price_currency || returnCurrency() }}{{ (product.listing === 'rent' ? (rentalDays || product.quantity || 0) : (product.quantity || 0)) * product.price }}\n </span>\n\n <span class=\"p-small t-transp\">\n <template v-if=\"product.quantity\">{{product.price_currency || returnCurrency() }}{{product.price}} </template>\n × \n <template v-if=\"product.listing === 'rent' && rentDates.start && rentDates.end\">\n {{ rentalDays }} days\n </template>\n \n <template v-else>\n {{ product.quantity || 0 }} {{ product.unit || 'pcs' }}\n </template>\n </span>\n </p> \n </div>\n \n <!-- Control Buttons -->\n <div v-if=\"editable || product.listing === 'rent'\" class=\"mn-t-thin gap-thin flex-nojustify flex\">\n <!-- For Rent Items: Edit Dates Button -->\n <div v-if=\"(product.listing === 'rent') && (rentDates.start && rentDates.end)\" class=\"flex gap-thin flex-v-center cursor-pointer pd-thin w-100 bg-light radius-small\">\n <IconCalendar\n @click=\"openRentDatePopup\"\n class=\"cursor-pointer i-medium\"\n />\n <!-- Rent Dates Display -->\n <p @click=\"editable ? openRentDatePopup : null\" class=\"t-medium t-transp\">\n {{ formatDate(rentDates.start, { dayMonth: true, language: locale }) }} - {{ formatDate(rentDates.end, { dayMonth: true, language: locale }) }}\n </p>\n </div>\n\n <!-- For Regular Items: Quantity Control Buttons -->\n <template v-if=\"editable &&product.listing !== 'rent'\">\n <IconAdd\n @click=\"increase_(product)\"\n class=\"hover-scale-1 cursor-pointer bg-light i-big pd-thin radius-small\"\n />\n <IconMinus\n @click=\"decrease(product)\"\n class=\"hover-scale-1 cursor-pointer bg-light i-big pd-thin radius-small\"\n />\n <IconDelete\n @click=\"remove(product)\"\n class=\"hover-scale-1 cursor-pointer bg-light i-big pd-thin radius-small\"\n />\n </template>\n\n <IconEdit\n v-if=\"product.listing === 'rent' && editable\"\n @click=\"openRentDatePopup\"\n class=\"hover-scale-1 cursor-pointer bg-light i-big pd-small radius-small\"\n />\n </div>\n </div>\n </div>\n \n <!-- Rent Date Popup -->\n <PopupDateSelector\n :isOpen=\"isRentDatePopupOpen\"\n :product=\"product\"\n :initialDates=\"rentDates\"\n :showFees=\"true\"\n :showVat=\"true\"\n :feesRate=\"0.15\"\n :vatRate=\"0.2\"\n :showCancelButton=\"true\"\n :onCancel=\"() => remove(product)\"\n @confirm=\"updateRentDates\"\n @close=\"closeRentDatePopup\"\n />\n </div>\n</template>\n\n<script setup>\nimport { ref, computed } from 'vue'\nimport { useRouter } from 'vue-router'\nimport { useI18n } from 'vue-i18n'\nimport { format } from 'date-fns'\nimport IconAdd from '@martyrs/src/modules/icons/navigation/IconAdd.vue'\nimport IconEdit from '@martyrs/src/modules/icons/navigation/IconEdit.vue'\nimport IconMinus from '@martyrs/src/modules/icons/navigation/IconMinus.vue'\nimport IconDelete from '@martyrs/src/modules/icons/navigation/IconDelete.vue'\nimport IconCalendar from '@martyrs/src/modules/icons/entities/IconCalendar.vue'\nimport PlaceholderImage from '@martyrs/src/modules/icons/placeholders/PlaceholderImage.vue'\nimport PopupDateSelector from '@martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue'\n\nconst router = useRouter()\nconst emits = defineEmits(['increase', 'decrease', 'remove', 'updateRentDates'])\n\nconst props = defineProps({\n product: Object,\n editable: Boolean,\n increase: Function,\n decrease: Function,\n remove: Function,\n})\n\nconst { locale } = useI18n()\n\n// Rental dates state - initialize from product if available\nconst rentDates = ref({\n start: props.product.date?.start || null,\n end: props.product.date?.end || null\n})\n\n// Rental days calculation\nconst rentalDays = computed(() => {\n if (!rentDates.value.start || !rentDates.value.end) return 0\n \n const start = new Date(rentDates.value.start)\n const end = new Date(rentDates.value.end)\n const diffTime = Math.abs(end - start)\n return Math.ceil(diffTime / (1000 * 60 * 60 * 24)) + 1\n})\n\n// Popup state\nconst isRentDatePopupOpen = ref(false)\n\n// Methods for buttons\nfunction increase_(product) {\n if (props.increase) {\n props.increase(product)\n }\n emits('increase', product)\n}\n\nfunction decrease(product) {\n if (props.decrease) {\n props.decrease(product)\n }\n emits('decrease', product)\n}\n\nfunction remove(product) {\n if (props.remove) {\n props.remove(product)\n }\n emits('remove', product)\n}\n\n// Rent date popup functions\nfunction openRentDatePopup() {\n isRentDatePopupOpen.value = true\n}\n\nfunction closeRentDatePopup() {\nisRentDatePopupOpen.value = false\n}\n\nfunction updateRentDates(dates) {\n rentDates.value = dates\n emits('updateRentDates', props.product, dates)\n closeRentDatePopup()\n}\n</script>\n\n<style lang=\"scss\">\n</style>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+Ge,cAAS;AACxB,UAAM,QAAQ;AAEd,UAAM,QAAQ;AAQd,UAAM,EAAE,OAAQ,IAAG,QAAO;AAG1B,UAAM,YAAY,IAAI;AAAA,MACpB,SAAO,WAAM,QAAQ,SAAd,mBAAoB,UAAS;AAAA,MACpC,OAAK,WAAM,QAAQ,SAAd,mBAAoB,QAAO;AAAA,IAClC,CAAC;AAGD,UAAM,aAAa,SAAS,MAAM;AAChC,UAAI,CAAC,UAAU,MAAM,SAAS,CAAC,UAAU,MAAM,IAAK,QAAO;AAE3D,YAAM,QAAQ,IAAI,KAAK,UAAU,MAAM,KAAK;AAC5C,YAAM,MAAM,IAAI,KAAK,UAAU,MAAM,GAAG;AACxC,YAAM,WAAW,KAAK,IAAI,MAAM,KAAK;AACrC,aAAO,KAAK,KAAK,YAAY,MAAO,KAAK,KAAK,GAAG,IAAI;AAAA,IACvD,CAAC;AAGD,UAAM,sBAAsB,IAAI,KAAK;AAGrC,aAAS,UAAU,SAAS;AAC1B,UAAI,MAAM,UAAU;AAClB,cAAM,SAAS,OAAO;AAAA,MAC1B;AACE,YAAM,YAAY,OAAO;AAAA,IAC3B;AAEA,aAAS,SAAS,SAAS;AACzB,UAAI,MAAM,UAAU;AAClB,cAAM,SAAS,OAAO;AAAA,MAC1B;AACE,YAAM,YAAY,OAAO;AAAA,IAC3B;AAEA,aAAS,OAAO,SAAS;AACvB,UAAI,MAAM,QAAQ;AAChB,cAAM,OAAO,OAAO;AAAA,MACxB;AACE,YAAM,UAAU,OAAO;AAAA,IACzB;AAGA,aAAS,oBAAoB;AAC3B,0BAAoB,QAAQ;AAAA,IAC9B;AAEA,aAAS,qBAAqB;AAC9B,0BAAoB,QAAQ;AAAA,IAC5B;AAEA,aAAS,gBAAgB,OAAO;AAC9B,gBAAU,QAAQ;AAClB,YAAM,mBAAmB,MAAM,SAAS,KAAK;AAC7C,yBAAkB;AAAA,IACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -61,7 +61,7 @@ const _sfc_main = {
|
|
|
61
61
|
return d.toLocaleDateString("en-US", { day: "numeric", month: "long" });
|
|
62
62
|
};
|
|
63
63
|
const statusText = vue.computed(() => {
|
|
64
|
-
var _a, _b;
|
|
64
|
+
var _a, _b, _c;
|
|
65
65
|
const createdDate = formatDate(props.createdAt);
|
|
66
66
|
const updatedDate = formatDate(props.updatedAt);
|
|
67
67
|
switch (props.status.toLowerCase()) {
|
|
@@ -82,12 +82,16 @@ const _sfc_main = {
|
|
|
82
82
|
return `Canceled, ${updatedDate}`;
|
|
83
83
|
default:
|
|
84
84
|
if ((_b = props.positions) == null ? void 0 : _b.length) {
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
const lastPosition = props.positions[props.positions.length - 1];
|
|
86
|
+
const lastEndDateRaw = (_c = lastPosition == null ? void 0 : lastPosition.date) == null ? void 0 : _c.end;
|
|
87
|
+
if (lastEndDateRaw) {
|
|
88
|
+
const lastEndDate = new Date(lastEndDateRaw);
|
|
89
|
+
const now = /* @__PURE__ */ new Date();
|
|
90
|
+
const diffTime = Math.abs(now.getTime() - lastEndDate.getTime());
|
|
91
|
+
const diffDays = Math.ceil(diffTime / (1e3 * 60 * 60 * 24));
|
|
92
|
+
if (diffDays > 0 && props.status !== "finished" && props.status !== "canceled") {
|
|
93
|
+
return `Delay ${diffDays} day${diffDays > 1 ? "s" : ""}`;
|
|
94
|
+
}
|
|
91
95
|
}
|
|
92
96
|
}
|
|
93
97
|
return `Created, ${createdDate}`;
|
|
@@ -116,14 +120,16 @@ const _sfc_main = {
|
|
|
116
120
|
threeDaysFromNow.setDate(today.getDate() + 3);
|
|
117
121
|
const showReturnNotice = vue.computed(() => {
|
|
118
122
|
return props.positions.some((position) => {
|
|
119
|
-
|
|
120
|
-
|
|
123
|
+
var _a;
|
|
124
|
+
const endDate = ((_a = position == null ? void 0 : position.date) == null ? void 0 : _a.end) ? getDateWithoutTime(position.date.end) : null;
|
|
125
|
+
return endDate !== null && endDate <= threeDaysFromNow;
|
|
121
126
|
});
|
|
122
127
|
});
|
|
123
128
|
const hasOverdue = vue.computed(() => {
|
|
124
129
|
return props.positions.some((position) => {
|
|
125
|
-
|
|
126
|
-
|
|
130
|
+
var _a;
|
|
131
|
+
const endDate = ((_a = position == null ? void 0 : position.date) == null ? void 0 : _a.end) ? getDateWithoutTime(position.date.end) : null;
|
|
132
|
+
return endDate !== null && endDate < today;
|
|
127
133
|
});
|
|
128
134
|
});
|
|
129
135
|
return (_ctx, _cache) => {
|
|
@@ -200,6 +206,6 @@ const _sfc_main = {
|
|
|
200
206
|
};
|
|
201
207
|
}
|
|
202
208
|
};
|
|
203
|
-
const CardOrderUser = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-
|
|
209
|
+
const CardOrderUser = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-f18ee795"]]);
|
|
204
210
|
exports.default = CardOrderUser;
|
|
205
211
|
//# sourceMappingURL=CardOrderUser.vue.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardOrderUser.vue.cjs","sources":["../../../../../../../src/modules/orders/components/blocks/CardOrderUser.vue"],"sourcesContent":["<template>\n <div class=\"w-100\">\n <!-- Главный контейнер -->\n <div class=\"bg-light radius-tl-medium radius-tr-medium pd-thin gap-small flex-v-center flex-nowrap flex\"\n \t:class=\"{\n \t\t'radius-bl-medium radius-br-medium': !showReturnNotice\n \t}\"\n >\n <!-- Левая часть - сетка фотографий -->\n <div style=\"display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr\" class=\"flex-child-default gap-micro h-max-5r aspect-1x1\">\n\t\t\t <template v-if=\"positions.length > 0\">\n\t\t\t <div \n\t\t\t v-for=\"index in 4\" \n\t\t\t :key=\"index\" \n style=\"min-height: 0\"\n\t\t\t class=\"w-100 h-100 bg-white-transp-50 radius-thin\"\n\t\t\t :class=\"{\n\t\t\t 'bg-white-transp-50': index <= positions.length && index <= 3,\n\t\t\t 'bg-white-transp-50': index > positions.length || (index === 4 && positions.length <= 3),\n\t\t\t 'bg-main': index === 4 && positions.length > 3\n\t\t\t }\"\n\t\t\t >\n\t\t\t <img \n\t\t\t\t\t\t v-if=\"index > 0 && index <= positions.length && positions[index - 1]?.images?.[0]\" \n\t\t\t\t\t\t :src=\"`${FILE_SERVER_URL || ''}${positions[index - 1].images[0] || positions[index - 1].image}`\" \n\t\t\t\t\t\t class=\"radius-small object-fit-contain w-100 h-100\" \n\t\t\t\t\t\t :alt=\"positions[index - 1].name\" \n\t\t\t\t\t>\n\t\t\t <div v-else-if=\"index === 4 && positions.length > 3\" class=\"flex-center h-100\">\n\t\t\t <span class=\"t-medium t-white\">+{{ positions.length - 3 }}</span>\n\t\t\t </div>\n\t\t\t </div>\n\t\t\t </template>\n\t\t\t</div>\n\n <!-- Правая часть - контент -->\n <div class=\"flex-column flex w-100\">\n <!-- ID заказа и цена -->\n <div class=\"mn-b-thin\">\n <Tooltip :text=\"orderId\">\n\t\t\t <p class=\"p-big\">\n\t\t\t #{{ orderId.slice(0, 4) }}...{{ orderId.slice(-4) }}\n\t\t\t </p>\n\t\t\t </Tooltip>\n <p class=\"t-transp\">{{ positions.length }} items for {{ formatPrice(total) }}</p>\n </div>\n\n <!-- Оставшееся время -->\n <div class=\"flex-nowrap radius-thin bg-white w-max pd-thin flex-v-center flex\">\n\t\t\t\t\t<component :is=\"statusIcon\" class=\"t-transp\" />\n\t\t\t <span class=\"mn-l-micro p-medium\">{{ statusText }}</span>\n </div>\n </div>\n </div>\n\n <!-- Уведомление о возврате -->\n <div \n\t\t v-if=\"showReturnNotice\" \n\t\t :class=\"[\n\t\t 'flex-nowrap', \n\t\t 'flex-v-center', \n\t\t 'flex', \n\t\t 'pd-regular', \n\t\t 'radius-bl-medium', \n\t\t 'radius-br-medium',\n\t\t hasOverdue ? 'bg-fourth-nano' : 'bg-second-nano'\n\t\t ]\"\n\t\t>\n\t\t <svg \n\t\t class=\"i-medium mn-r-thin t-main\" \n\t\t xmlns=\"http://www.w3.org/2000/svg\" \n\t\t width=\"19\" \n\t\t height=\"19\" \n\t\t viewBox=\"0 0 19 19\" \n\t\t fill=\"none\"\n\t\t >\n\t\t <path \n\t\t d=\"M9.21484 18.4367C8.19857 18.4367 7.23014 18.2795 6.30957 17.965C5.389 17.6551 4.54362 17.2176 3.77344 16.6525C3.00781 16.092 2.34245 15.4266 1.77734 14.6564C1.2168 13.8863 0.779297 13.0432 0.464844 12.1271C0.154948 11.2066 0 10.2381 0 9.22186C0 8.20103 0.154948 7.23033 0.464844 6.30975C0.779297 5.38918 1.2168 4.54608 1.77734 3.78046C2.34245 3.01483 3.00781 2.34947 3.77344 1.78436C4.54362 1.21926 5.389 0.781759 6.30957 0.471863C7.23014 0.15741 8.19857 0.000183105 9.21484 0.000183105C10.2357 0.000183105 11.2064 0.15741 12.127 0.471863C13.0475 0.781759 13.8906 1.21926 14.6562 1.78436C15.4219 2.34947 16.0872 3.01483 16.6523 3.78046C17.2174 4.54608 17.6549 5.38918 17.9648 6.30975C18.2793 7.23033 18.4365 8.20103 18.4365 9.22186C18.4365 10.2381 18.2793 11.2066 17.9648 12.1271C17.6549 13.0432 17.2174 13.8863 16.6523 14.6564C16.0872 15.4266 15.4219 16.092 14.6562 16.6525C13.8906 17.2176 13.0475 17.6551 12.127 17.965C11.2064 18.2795 10.2357 18.4367 9.21484 18.4367ZM9.22168 10.6027C9.7959 10.6027 10.0967 10.3042 10.124 9.70721L10.2607 5.69452C10.2744 5.39374 10.181 5.14992 9.98047 4.96307C9.78451 4.77167 9.5293 4.67596 9.21484 4.67596C8.89583 4.67596 8.63835 4.76939 8.44238 4.95624C8.25098 5.14309 8.16211 5.38918 8.17578 5.69452L8.30566 9.71405C8.33301 10.3065 8.63835 10.6027 9.22168 10.6027ZM9.22168 13.6994C9.5498 13.6994 9.82324 13.6037 10.042 13.4123C10.2653 13.2163 10.377 12.9634 10.377 12.6535C10.377 12.3391 10.2653 12.0838 10.042 11.8879C9.82324 11.6919 9.5498 11.5939 9.22168 11.5939C8.89811 11.5939 8.6224 11.6942 8.39453 11.8947C8.17122 12.0907 8.05957 12.3436 8.05957 12.6535C8.05957 12.9634 8.17122 13.2163 8.39453 13.4123C8.6224 13.6037 8.89811 13.6994 9.22168 13.6994Z\" \n\t\t :fill=\"hasOverdue ? '#FF0000' : '#007AFF'\"\n\t\t />\n\t\t </svg>\t\n\t\t <span \n\t\t \tclass=\"p-medium t-semi\"\n\t\t \t:class=\"[\n\t\t\t hasOverdue ? 't-red' : 't-second'\n\t\t\t ]\"\n\t\t >\n\t\t\t\tNeed to return part of the equipment\n\t\t\t</span>\n\t\t</div>\n </div>\n</template>\n\n<script setup>\nimport { computed } from 'vue';\n\nimport Tooltip from '@martyrs/src/components/Tooltip/Tooltip.vue'\n\nimport IconStatusCreated from '@martyrs/src/modules/orders/components/icons/IconStatusCreated.vue';\nimport IconStatusConfirmed from '@martyrs/src/modules/orders/components/icons/IconStatusConfirmed.vue';\nimport IconStatusInUse from '@martyrs/src/modules/orders/components/icons/IconStatusInUse.vue';\nimport IconStatusFinished from '@martyrs/src/modules/orders/components/icons/IconStatusFinished.vue';\nimport IconStatusCanceled from '@martyrs/src/modules/orders/components/icons/IconStatusCanceled.vue';\nimport IconStatusDelay from '@martyrs/src/modules/orders/components/icons/IconStatusDelay.vue';\n\nconst props = defineProps({\n orderId: String,\n status: String,\n positions: Array,\n createdAt: [String, Date],\n updatedAt: [String, Date],\n total: [String, Number]\n});\n\nconst iconMap = {\n 'created': IconStatusCreated,\n 'confirmed': IconStatusConfirmed,\n 'preparing': IconStatusInUse,\n 'inuse': IconStatusInUse,\n 'finished': IconStatusFinished,\n 'canceled': IconStatusCanceled,\n 'delay': IconStatusDelay\n};\n\nconst formatDate = (date) => {\n const d = new Date(date);\n return d.toLocaleDateString('en-US', { day: 'numeric', month: 'long' });\n};\n\nconst statusText = computed(() => {\n const createdDate = formatDate(props.createdAt);\n const updatedDate = formatDate(props.updatedAt);\n \n switch(props.status.toLowerCase()) {\n case 'created':\n return `Created, ${createdDate}`;\n case 'confirmed':\n return `Confirmed, ${updatedDate}`;\n case 'preparing':\n case 'inuse':\n if (props.positions?.length) {\n const lastEndDate = new Date(props.positions[props.positions.length - 1].date.end);\n return `up to ${formatDate(lastEndDate)}`;\n }\n return `up to 18:00, ${updatedDate}`;\n case 'finished':\n return `Finished, ${updatedDate}`;\n case 'canceled':\n return `Canceled, ${updatedDate}`;\n default:\n // Расчет задержки\n if (props.positions?.length) {\n const lastEndDate = new Date(props.positions[props.positions.length - 1].date.end);\n const now = new Date();\n const diffTime = Math.abs(now - lastEndDate);\n const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));\n if (diffDays > 0 && props.status !== 'finished' && props.status !== 'canceled') {\n return `Delay ${diffDays} day${diffDays > 1 ? 's' : ''}`;\n }\n }\n return `Created, ${createdDate}`;\n }\n});\n\n// Выбор иконки\nconst statusIcon = computed(() => {\n if (props.status === 'preparing' || props.status === 'inuse') {\n // Проверка на задержку\n if (props.positions?.length) {\n const lastEndDate = new Date(props.positions[props.positions.length - 1].date.end);\n if (new Date() > lastEndDate && props.status !== 'finished' && props.status !== 'canceled') {\n return IconStatusDelay;\n }\n }\n return IconStatusInUse;\n }\n return iconMap[props.status.toLowerCase()] || IconStatusCreated;\n});\n\n// Функция для нормализации даты (убираем время)\nconst getDateWithoutTime = (dateString) => {\n const date = new Date(dateString);\n date.setHours(0, 0, 0, 0);\n return date;\n};\n\n// Текущая дата и дата через 3 дня\nconst today = getDateWithoutTime(new Date());\nconst threeDaysFromNow = new Date(today);\nthreeDaysFromNow.setDate(today.getDate() + 3);\n\n// Показывать ли уведомление о возврате\nconst showReturnNotice = computed(() => {\n return props.positions.some(position => {\n const endDate = getDateWithoutTime(position.date.end);\n return endDate <= threeDaysFromNow;\n });\n});\n\n// Есть ли просроченные позиции\nconst hasOverdue = computed(() => {\n return props.positions.some(position => {\n const endDate = getDateWithoutTime(position.date.end);\n return endDate < today;\n });\n});\n\n// Предполагается, что formatPrice определен где-то в коде\n</script>\n\n<style scoped>\n/* Добавляем стиль для текста \"просрочено\" */\n.t-red {\n color: red;\n}\n</style>"],"names":["IconStatusCreated","IconStatusConfirmed","IconStatusInUse","IconStatusFinished","IconStatusCanceled","IconStatusDelay","computed"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"CardOrderUser.vue.cjs","sources":["../../../../../../../src/modules/orders/components/blocks/CardOrderUser.vue"],"sourcesContent":["<template>\n <div class=\"w-100\">\n <!-- Главный контейнер -->\n <div class=\"bg-light radius-tl-medium radius-tr-medium pd-thin gap-small flex-v-center flex-nowrap flex\"\n \t:class=\"{\n \t\t'radius-bl-medium radius-br-medium': !showReturnNotice\n \t}\"\n >\n <!-- Левая часть - сетка фотографий -->\n <div style=\"display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr\" class=\"flex-child-default gap-micro h-max-5r aspect-1x1\">\n\t\t\t <template v-if=\"positions.length > 0\">\n\t\t\t <div \n\t\t\t v-for=\"index in 4\" \n\t\t\t :key=\"index\" \n style=\"min-height: 0\"\n\t\t\t class=\"w-100 h-100 bg-white-transp-50 radius-thin\"\n\t\t\t :class=\"{\n\t\t\t 'bg-white-transp-50': index <= positions.length && index <= 3,\n\t\t\t 'bg-white-transp-50': index > positions.length || (index === 4 && positions.length <= 3),\n\t\t\t 'bg-main': index === 4 && positions.length > 3\n\t\t\t }\"\n\t\t\t >\n\t\t\t <img \n\t\t\t\t\t\t v-if=\"index > 0 && index <= positions.length && positions[index - 1]?.images?.[0]\" \n\t\t\t\t\t\t :src=\"`${FILE_SERVER_URL || ''}${positions[index - 1].images[0] || positions[index - 1].image}`\" \n\t\t\t\t\t\t class=\"radius-small object-fit-contain w-100 h-100\" \n\t\t\t\t\t\t :alt=\"positions[index - 1].name\" \n\t\t\t\t\t>\n\t\t\t <div v-else-if=\"index === 4 && positions.length > 3\" class=\"flex-center h-100\">\n\t\t\t <span class=\"t-medium t-white\">+{{ positions.length - 3 }}</span>\n\t\t\t </div>\n\t\t\t </div>\n\t\t\t </template>\n\t\t\t</div>\n\n <!-- Правая часть - контент -->\n <div class=\"flex-column flex w-100\">\n <!-- ID заказа и цена -->\n <div class=\"mn-b-thin\">\n <Tooltip :text=\"orderId\">\n\t\t\t <p class=\"p-big\">\n\t\t\t #{{ orderId.slice(0, 4) }}...{{ orderId.slice(-4) }}\n\t\t\t </p>\n\t\t\t </Tooltip>\n <p class=\"t-transp\">{{ positions.length }} items for {{ formatPrice(total) }}</p>\n </div>\n\n <!-- Оставшееся время -->\n <div class=\"flex-nowrap radius-thin bg-white w-max pd-thin flex-v-center flex\">\n\t\t\t\t\t<component :is=\"statusIcon\" class=\"t-transp\" />\n\t\t\t <span class=\"mn-l-micro p-medium\">{{ statusText }}</span>\n </div>\n </div>\n </div>\n\n <!-- Уведомление о возврате -->\n <div \n\t\t v-if=\"showReturnNotice\" \n\t\t :class=\"[\n\t\t 'flex-nowrap', \n\t\t 'flex-v-center', \n\t\t 'flex', \n\t\t 'pd-regular', \n\t\t 'radius-bl-medium', \n\t\t 'radius-br-medium',\n\t\t hasOverdue ? 'bg-fourth-nano' : 'bg-second-nano'\n\t\t ]\"\n\t\t>\n\t\t <svg \n\t\t class=\"i-medium mn-r-thin t-main\" \n\t\t xmlns=\"http://www.w3.org/2000/svg\" \n\t\t width=\"19\" \n\t\t height=\"19\" \n\t\t viewBox=\"0 0 19 19\" \n\t\t fill=\"none\"\n\t\t >\n\t\t <path \n\t\t d=\"M9.21484 18.4367C8.19857 18.4367 7.23014 18.2795 6.30957 17.965C5.389 17.6551 4.54362 17.2176 3.77344 16.6525C3.00781 16.092 2.34245 15.4266 1.77734 14.6564C1.2168 13.8863 0.779297 13.0432 0.464844 12.1271C0.154948 11.2066 0 10.2381 0 9.22186C0 8.20103 0.154948 7.23033 0.464844 6.30975C0.779297 5.38918 1.2168 4.54608 1.77734 3.78046C2.34245 3.01483 3.00781 2.34947 3.77344 1.78436C4.54362 1.21926 5.389 0.781759 6.30957 0.471863C7.23014 0.15741 8.19857 0.000183105 9.21484 0.000183105C10.2357 0.000183105 11.2064 0.15741 12.127 0.471863C13.0475 0.781759 13.8906 1.21926 14.6562 1.78436C15.4219 2.34947 16.0872 3.01483 16.6523 3.78046C17.2174 4.54608 17.6549 5.38918 17.9648 6.30975C18.2793 7.23033 18.4365 8.20103 18.4365 9.22186C18.4365 10.2381 18.2793 11.2066 17.9648 12.1271C17.6549 13.0432 17.2174 13.8863 16.6523 14.6564C16.0872 15.4266 15.4219 16.092 14.6562 16.6525C13.8906 17.2176 13.0475 17.6551 12.127 17.965C11.2064 18.2795 10.2357 18.4367 9.21484 18.4367ZM9.22168 10.6027C9.7959 10.6027 10.0967 10.3042 10.124 9.70721L10.2607 5.69452C10.2744 5.39374 10.181 5.14992 9.98047 4.96307C9.78451 4.77167 9.5293 4.67596 9.21484 4.67596C8.89583 4.67596 8.63835 4.76939 8.44238 4.95624C8.25098 5.14309 8.16211 5.38918 8.17578 5.69452L8.30566 9.71405C8.33301 10.3065 8.63835 10.6027 9.22168 10.6027ZM9.22168 13.6994C9.5498 13.6994 9.82324 13.6037 10.042 13.4123C10.2653 13.2163 10.377 12.9634 10.377 12.6535C10.377 12.3391 10.2653 12.0838 10.042 11.8879C9.82324 11.6919 9.5498 11.5939 9.22168 11.5939C8.89811 11.5939 8.6224 11.6942 8.39453 11.8947C8.17122 12.0907 8.05957 12.3436 8.05957 12.6535C8.05957 12.9634 8.17122 13.2163 8.39453 13.4123C8.6224 13.6037 8.89811 13.6994 9.22168 13.6994Z\" \n\t\t :fill=\"hasOverdue ? '#FF0000' : '#007AFF'\"\n\t\t />\n\t\t </svg>\t\n\t\t <span \n\t\t \tclass=\"p-medium t-semi\"\n\t\t \t:class=\"[\n\t\t\t hasOverdue ? 't-red' : 't-second'\n\t\t\t ]\"\n\t\t >\n\t\t\t\tNeed to return part of the equipment\n\t\t\t</span>\n\t\t</div>\n </div>\n</template>\n\n<script setup>\nimport { computed } from 'vue';\n\nimport Tooltip from '@martyrs/src/components/Tooltip/Tooltip.vue'\n\nimport IconStatusCreated from '@martyrs/src/modules/orders/components/icons/IconStatusCreated.vue';\nimport IconStatusConfirmed from '@martyrs/src/modules/orders/components/icons/IconStatusConfirmed.vue';\nimport IconStatusInUse from '@martyrs/src/modules/orders/components/icons/IconStatusInUse.vue';\nimport IconStatusFinished from '@martyrs/src/modules/orders/components/icons/IconStatusFinished.vue';\nimport IconStatusCanceled from '@martyrs/src/modules/orders/components/icons/IconStatusCanceled.vue';\nimport IconStatusDelay from '@martyrs/src/modules/orders/components/icons/IconStatusDelay.vue';\n\nconst props = defineProps({\n orderId: String,\n status: String,\n positions: Array,\n createdAt: [String, Date],\n updatedAt: [String, Date],\n total: [String, Number]\n});\n\nconst iconMap = {\n 'created': IconStatusCreated,\n 'confirmed': IconStatusConfirmed,\n 'preparing': IconStatusInUse,\n 'inuse': IconStatusInUse,\n 'finished': IconStatusFinished,\n 'canceled': IconStatusCanceled,\n 'delay': IconStatusDelay\n};\n\nconst formatDate = (date) => {\n const d = new Date(date);\n return d.toLocaleDateString('en-US', { day: 'numeric', month: 'long' });\n};\n\nconst statusText = computed(() => {\n const createdDate = formatDate(props.createdAt);\n const updatedDate = formatDate(props.updatedAt);\n \n switch(props.status.toLowerCase()) {\n case 'created':\n return `Created, ${createdDate}`;\n case 'confirmed':\n return `Confirmed, ${updatedDate}`;\n case 'preparing':\n case 'inuse':\n if (props.positions?.length) {\n const lastEndDate = new Date(props.positions[props.positions.length - 1].date.end);\n return `up to ${formatDate(lastEndDate)}`;\n }\n return `up to 18:00, ${updatedDate}`;\n case 'finished':\n return `Finished, ${updatedDate}`;\n case 'canceled':\n return `Canceled, ${updatedDate}`;\n default:\n // Расчет задержки\n if (props.positions?.length) {\n const lastPosition = props.positions[props.positions.length - 1];\n const lastEndDateRaw = lastPosition?.date?.end;\n\n if (lastEndDateRaw) {\n const lastEndDate = new Date(lastEndDateRaw);\n const now = new Date();\n const diffTime = Math.abs(now.getTime() - lastEndDate.getTime());\n const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));\n\n if (diffDays > 0 && props.status !== 'finished' && props.status !== 'canceled') {\n return `Delay ${diffDays} day${diffDays > 1 ? 's' : ''}`;\n }\n }\n }\n return `Created, ${createdDate}`;\n\n }\n});\n\n// Выбор иконки\nconst statusIcon = computed(() => {\n if (props.status === 'preparing' || props.status === 'inuse') {\n // Проверка на задержку\n if (props.positions?.length) {\n const lastEndDate = new Date(props.positions[props.positions.length - 1].date.end);\n if (new Date() > lastEndDate && props.status !== 'finished' && props.status !== 'canceled') {\n return IconStatusDelay;\n }\n }\n return IconStatusInUse;\n }\n return iconMap[props.status.toLowerCase()] || IconStatusCreated;\n});\n\n// Функция для нормализации даты (убираем время)\nconst getDateWithoutTime = (dateString) => {\n const date = new Date(dateString);\n date.setHours(0, 0, 0, 0);\n return date;\n};\n\n// Текущая дата и дата через 3 дня\nconst today = getDateWithoutTime(new Date());\nconst threeDaysFromNow = new Date(today);\nthreeDaysFromNow.setDate(today.getDate() + 3);\n\n// Показывать ли уведомление о возврате\nconst showReturnNotice = computed(() => {\n return props.positions.some(position => {\n const endDate = position?.date?.end ? getDateWithoutTime(position.date.end) : null;\n return endDate !== null && endDate <= threeDaysFromNow;\n });\n});\n\n// Есть ли просроченные позиции\nconst hasOverdue = computed(() => {\n return props.positions.some(position => {\n const endDate = position?.date?.end ? getDateWithoutTime(position.date.end) : null;\n return endDate !== null && endDate < today;\n });\n});\n\n// Предполагается, что formatPrice определен где-то в коде\n</script>\n\n<style scoped>\n/* Добавляем стиль для текста \"просрочено\" */\n.t-red {\n color: red;\n}\n</style>"],"names":["IconStatusCreated","IconStatusConfirmed","IconStatusInUse","IconStatusFinished","IconStatusCanceled","IconStatusDelay","computed"],"mappings":"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"}
|
|
@@ -59,7 +59,7 @@ const _sfc_main = {
|
|
|
59
59
|
return d.toLocaleDateString("en-US", { day: "numeric", month: "long" });
|
|
60
60
|
};
|
|
61
61
|
const statusText = computed(() => {
|
|
62
|
-
var _a, _b;
|
|
62
|
+
var _a, _b, _c;
|
|
63
63
|
const createdDate = formatDate(props.createdAt);
|
|
64
64
|
const updatedDate = formatDate(props.updatedAt);
|
|
65
65
|
switch (props.status.toLowerCase()) {
|
|
@@ -80,12 +80,16 @@ const _sfc_main = {
|
|
|
80
80
|
return `Canceled, ${updatedDate}`;
|
|
81
81
|
default:
|
|
82
82
|
if ((_b = props.positions) == null ? void 0 : _b.length) {
|
|
83
|
-
const
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
const lastPosition = props.positions[props.positions.length - 1];
|
|
84
|
+
const lastEndDateRaw = (_c = lastPosition == null ? void 0 : lastPosition.date) == null ? void 0 : _c.end;
|
|
85
|
+
if (lastEndDateRaw) {
|
|
86
|
+
const lastEndDate = new Date(lastEndDateRaw);
|
|
87
|
+
const now = /* @__PURE__ */ new Date();
|
|
88
|
+
const diffTime = Math.abs(now.getTime() - lastEndDate.getTime());
|
|
89
|
+
const diffDays = Math.ceil(diffTime / (1e3 * 60 * 60 * 24));
|
|
90
|
+
if (diffDays > 0 && props.status !== "finished" && props.status !== "canceled") {
|
|
91
|
+
return `Delay ${diffDays} day${diffDays > 1 ? "s" : ""}`;
|
|
92
|
+
}
|
|
89
93
|
}
|
|
90
94
|
}
|
|
91
95
|
return `Created, ${createdDate}`;
|
|
@@ -114,14 +118,16 @@ const _sfc_main = {
|
|
|
114
118
|
threeDaysFromNow.setDate(today.getDate() + 3);
|
|
115
119
|
const showReturnNotice = computed(() => {
|
|
116
120
|
return props.positions.some((position) => {
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
var _a;
|
|
122
|
+
const endDate = ((_a = position == null ? void 0 : position.date) == null ? void 0 : _a.end) ? getDateWithoutTime(position.date.end) : null;
|
|
123
|
+
return endDate !== null && endDate <= threeDaysFromNow;
|
|
119
124
|
});
|
|
120
125
|
});
|
|
121
126
|
const hasOverdue = computed(() => {
|
|
122
127
|
return props.positions.some((position) => {
|
|
123
|
-
|
|
124
|
-
|
|
128
|
+
var _a;
|
|
129
|
+
const endDate = ((_a = position == null ? void 0 : position.date) == null ? void 0 : _a.end) ? getDateWithoutTime(position.date.end) : null;
|
|
130
|
+
return endDate !== null && endDate < today;
|
|
125
131
|
});
|
|
126
132
|
});
|
|
127
133
|
return (_ctx, _cache) => {
|
|
@@ -198,7 +204,7 @@ const _sfc_main = {
|
|
|
198
204
|
};
|
|
199
205
|
}
|
|
200
206
|
};
|
|
201
|
-
const CardOrderUser = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
207
|
+
const CardOrderUser = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f18ee795"]]);
|
|
202
208
|
export {
|
|
203
209
|
CardOrderUser as default
|
|
204
210
|
};
|