@ozdao/martyrs 0.2.582 → 0.2.583

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.
Files changed (119) hide show
  1. package/dist/martyrs/src/components/Button/Button.vue.js +1 -1
  2. package/dist/martyrs/src/components/Feed/Carousel.vue.js +1 -1
  3. package/dist/martyrs/src/components/Feed/Feed.vue.js +2 -2
  4. package/dist/martyrs/src/components/Loader/{Loader.vue.js → Loader.vue2.js} +2 -2
  5. package/dist/martyrs/src/components/Loader/Loader.vue2.js.map +1 -0
  6. package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue.js +1 -1
  7. package/dist/martyrs/src/components/Media/Media.vue.js +1 -1
  8. package/dist/martyrs/src/components/Menu/{Menu.vue.js → Menu.vue2.js} +2 -2
  9. package/dist/martyrs/src/components/Menu/Menu.vue2.js.map +1 -0
  10. package/dist/martyrs/src/components/Spoiler/{Spoiler.vue.js → Spoiler.vue2.js} +2 -2
  11. package/dist/martyrs/src/components/Spoiler/Spoiler.vue2.js.map +1 -0
  12. package/dist/martyrs/src/components/Tab/{Tab.vue.js → Tab.vue2.js} +2 -2
  13. package/dist/martyrs/src/components/Tab/Tab.vue2.js.map +1 -0
  14. package/dist/martyrs/src/components/UploadImage/UploadImage.vue.js +1 -1
  15. package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
  16. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +1 -1
  17. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +1 -1
  18. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +8 -14
  19. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js.map +1 -1
  20. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileBlogposts.vue.js +1 -1
  21. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js +1 -1
  22. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +1 -1
  23. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +1 -1
  24. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +1 -1
  25. package/dist/martyrs/src/modules/auth/views/components/pages/UserDashboard.vue.js +182 -89
  26. package/dist/martyrs/src/modules/auth/views/components/pages/UserDashboard.vue.js.map +1 -1
  27. package/dist/martyrs/src/modules/auth/views/configs/navigation.user.config.js +9 -2
  28. package/dist/martyrs/src/modules/auth/views/configs/navigation.user.config.js.map +1 -1
  29. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +1 -1
  30. package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js +1 -1
  31. package/dist/martyrs/src/modules/core/views/components/blocks/PopupDateSelector.vue.js +1 -1
  32. package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js +1 -1
  33. package/dist/martyrs/src/modules/core/views/components/partials/Navigation.vue.js +1 -1
  34. package/dist/martyrs/src/modules/core/views/components/sections/{Filters.vue.js → Filters.vue2.js} +2 -2
  35. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue2.js.map +1 -0
  36. package/dist/martyrs/src/modules/core/views/components/sections/SectionPageTitle.vue.js +1 -1
  37. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  38. package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +2 -2
  39. package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.js +1 -1
  40. package/dist/martyrs/src/modules/events/components/sections/Feed.vue.js +1 -1
  41. package/dist/martyrs/src/modules/events/components/sections/List.vue.js +1 -1
  42. package/dist/martyrs/src/modules/landing/components/sections/SectionGuide.vue.js +1 -1
  43. package/dist/martyrs/src/modules/marketplace/views/components/pages/Marketplace.vue.js +1 -1
  44. package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js +1 -1
  45. package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +1 -1
  46. package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +1 -1
  47. package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +1 -1
  48. package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +1 -1
  49. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +1 -1
  50. package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +1 -1
  51. package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +1 -1
  52. package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js +3 -3
  53. package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js.map +1 -1
  54. package/dist/martyrs/src/modules/notifications/components/sections/NotificationPreferences.vue.js +1 -1
  55. package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.js +90 -175
  56. package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.js.map +1 -1
  57. package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +1 -1
  58. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +6 -6
  59. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js.map +1 -1
  60. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
  61. package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js +41 -28
  62. package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js.map +1 -1
  63. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +2 -2
  64. package/dist/martyrs/src/modules/orders/orders.client.js +14 -14
  65. package/dist/martyrs/src/modules/orders/orders.client.js.map +1 -1
  66. package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
  67. package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +1 -1
  68. package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js +1 -1
  69. package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  70. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
  71. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +89 -40
  72. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js.map +1 -1
  73. package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  74. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  75. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  76. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +1 -1
  77. package/dist/martyrs/src/modules/products/components/elements/Image360.vue.js +1 -1
  78. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +1 -1
  79. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
  80. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +2 -2
  81. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  82. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +3 -3
  83. package/dist/martyrs/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
  84. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  85. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +1 -1
  86. package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.js +1 -1
  87. package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
  88. package/dist/martyrs/src/modules/spots/components/pages/Spot.vue.js +1 -1
  89. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +1 -1
  90. package/dist/style.css +72 -77
  91. package/package.json +1 -1
  92. package/src/modules/TASKS.MD +26 -1
  93. package/src/modules/auth/views/components/pages/Profile.vue +9 -15
  94. package/src/modules/auth/views/components/pages/UserDashboard.vue +214 -125
  95. package/src/modules/auth/views/configs/navigation.user.config.js +8 -2
  96. package/src/modules/notifications/components/elements/NotificationBadge.vue +1 -1
  97. package/src/modules/orders/components/blocks/CardOrderUser.vue +88 -190
  98. package/src/modules/orders/components/pages/OrderBackoffice.vue +5 -5
  99. package/src/modules/orders/components/pages/Orders.vue +56 -50
  100. package/src/modules/organizations/components/pages/OrganizationEdit.vue +42 -11
  101. package/dist/martyrs/src/components/Loader/Loader.vue.js.map +0 -1
  102. package/dist/martyrs/src/components/Menu/Menu.vue.js.map +0 -1
  103. package/dist/martyrs/src/components/SelectMulti/SelectMulti.vue2.js +0 -625
  104. package/dist/martyrs/src/components/SelectMulti/SelectMulti.vue2.js.map +0 -1
  105. package/dist/martyrs/src/components/Spoiler/Spoiler.vue.js.map +0 -1
  106. package/dist/martyrs/src/components/Tab/Tab.vue.js.map +0 -1
  107. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue.js.map +0 -1
  108. package/dist/martyrs/src/modules/orders/components/icons/IconStatusCanceled.vue.js +0 -32
  109. package/dist/martyrs/src/modules/orders/components/icons/IconStatusCanceled.vue.js.map +0 -1
  110. package/dist/martyrs/src/modules/orders/components/icons/IconStatusConfirmed.vue.js +0 -32
  111. package/dist/martyrs/src/modules/orders/components/icons/IconStatusConfirmed.vue.js.map +0 -1
  112. package/dist/martyrs/src/modules/orders/components/icons/IconStatusCreated.vue.js +0 -32
  113. package/dist/martyrs/src/modules/orders/components/icons/IconStatusCreated.vue.js.map +0 -1
  114. package/dist/martyrs/src/modules/orders/components/icons/IconStatusDelay.vue.js +0 -32
  115. package/dist/martyrs/src/modules/orders/components/icons/IconStatusDelay.vue.js.map +0 -1
  116. package/dist/martyrs/src/modules/orders/components/icons/IconStatusFinished.vue.js +0 -32
  117. package/dist/martyrs/src/modules/orders/components/icons/IconStatusFinished.vue.js.map +0 -1
  118. package/dist/martyrs/src/modules/orders/components/icons/IconStatusInUse.vue.js +0 -32
  119. package/dist/martyrs/src/modules/orders/components/icons/IconStatusInUse.vue.js.map +0 -1
@@ -3,6 +3,7 @@ import IconHome from '@martyrs/src/modules/icons/entities/IconHome.vue';
3
3
  import IconEvents from '@martyrs/src/modules/icons/entities/IconEvents.vue';
4
4
  import IconGroups from '@martyrs/src/modules/icons/entities/IconGroups.vue';
5
5
  import IconOrders from '@martyrs/src/modules/icons/entities/IconOrders.vue';
6
+ import IconCommunity from '@martyrs/src/modules/icons/entities/IconCommunity.vue';
6
7
  import IconBell from '@martyrs/src/modules/icons/entities/IconBell.vue';
7
8
  import IconSettings from '@martyrs/src/modules/icons/entities/IconSettings.vue';
8
9
  import IconProfile from '@martyrs/src/modules/icons/entities/IconProfile.vue';
@@ -60,6 +61,12 @@ export const navigationItems = [
60
61
  route: (auth, route) => `/users/${route.params._id}/organizations`,
61
62
  visible: () => isModuleInstalled('organizations')
62
63
  },
64
+ {
65
+ title: 'Posts',
66
+ iconComponent: IconCommunity,
67
+ route: (auth, route) => `/users/${route.params._id}/blogposts`,
68
+ visible: () => isModuleInstalled('community')
69
+ },
63
70
  ]
64
71
  },
65
72
  {
@@ -77,8 +84,7 @@ export const navigationItems = [
77
84
  {
78
85
  title: 'Orders',
79
86
  iconComponent: IconOrders,
80
- route: (auth, route) => `/users/${route.params._id}/orders`,
81
-
87
+ route: (auth, route) => `/users/${route.params._id}/orders`
82
88
  },
83
89
  ]
84
90
  },
@@ -47,7 +47,7 @@
47
47
  Mark all read
48
48
  </button>
49
49
 
50
- <router-link class="w-100 bg-black t-white radius-small button" to="/notifications" @click="closeNotifications">
50
+ <router-link class="w-100 bg-black t-white radius-small button" :to="`/users/${auth.state.user?._id}/notifications`" @click="closeNotifications">
51
51
  View all
52
52
  </router-link>
53
53
  </div>
@@ -1,107 +1,82 @@
1
1
  <template>
2
- <div class="w-100">
3
- <!-- Главный контейнер -->
4
- <div class="bg-light radius-tl-medium radius-tr-medium pd-thin gap-small flex-v-center flex-nowrap flex"
5
- :class="{
6
- 'radius-bl-medium radius-br-medium': !showReturnNotice
7
- }"
8
- >
9
- <!-- Левая часть - сетка фотографий -->
10
- <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">
11
- <template v-if="positions.length > 0">
12
- <div
13
- v-for="index in 4"
14
- :key="index"
15
- style="min-height: 0"
16
- class="w-100 h-100 bg-white-transp-50 radius-thin"
17
- :class="{
18
- 'bg-white-transp-50': index <= positions.length && index <= 3,
19
- 'bg-white-transp-50': index > positions.length || (index === 4 && positions.length <= 3),
20
- 'bg-main': index === 4 && positions.length > 3
21
- }"
22
- >
23
- <img
24
- v-if="index > 0 && index <= positions.length && positions[index - 1]?.images?.[0]"
25
- :src="`${FILE_SERVER_URL || ''}${positions[index - 1].images[0] || positions[index - 1].image}`"
26
- class="radius-small object-fit-contain w-100 h-100"
27
- :alt="positions[index - 1].name"
28
- >
29
- <div v-else-if="index === 4 && positions.length > 3" class="flex-center h-100">
30
- <span class="fw-medium t-white">+{{ positions.length - 3 }}</span>
31
- </div>
32
- </div>
33
- </template>
34
- </div>
35
-
36
- <!-- Правая часть - контент -->
37
- <div class="flex-column flex w-100">
38
- <!-- ID заказа и цена -->
39
- <div class="mn-b-thin">
40
- <Tooltip :text="orderId">
41
- <p class="p-medium">
42
- #{{ orderId.slice(0, 4) }}...{{ orderId.slice(-4) }}
43
- </p>
44
- </Tooltip>
45
- <p class="t-transp">{{ positions.length }} items for {{ formatPrice(total) }}</p>
46
- </div>
2
+ <div class="bg-light radius-medium pd-medium">
3
+
4
+ <!-- Header: Order ID | Date | Status -->
5
+ <div class="flex-nowrap flex-v-center flex-between flex mn-b-small">
6
+ <div class="flex-v-center gap-small flex">
7
+ <span class="fw-medium t-dark">{{ formatOrderId(orderId) }}</span>
8
+ <span class="t-transp">|</span>
9
+ <span class="t-transp">{{ formatDate(createdAt, { dayMonth: true, language: locale }) }}</span>
10
+ </div>
47
11
 
48
- <!-- Оставшееся время -->
49
- <div class="flex-nowrap radius-thin bg-white w-max pd-thin flex-v-center flex">
50
- <component :is="statusIcon" class="t-transp" />
51
- <span class="mn-l-micro p-regular">{{ statusText }}</span>
52
- </div>
12
+ <!-- Status Badge -->
13
+ <div
14
+ class="pd-l-small pd-r-small pd-t-micro pd-b-micro radius-big p-small fw-semi flex-v-center gap-micro flex"
15
+ :class="statusClasses"
16
+ >
17
+ <span class="d-block radius-big" :class="dotClasses" style="width: 6px; height: 6px;"></span>
18
+ {{ statusLabel }}
53
19
  </div>
54
20
  </div>
55
21
 
56
- <!-- Уведомление о возврате -->
57
- <div
58
- v-if="showReturnNotice"
59
- :class="[
60
- 'flex-nowrap',
61
- 'flex-v-center',
62
- 'flex',
63
- 'pd-regular',
64
- 'radius-bl-medium',
65
- 'radius-br-medium',
66
- hasOverdue ? 'bg-fourth-nano' : 'bg-second-nano'
67
- ]"
68
- >
69
- <svg
70
- class="i-medium mn-r-thin t-main"
71
- xmlns="http://www.w3.org/2000/svg"
72
- width="19"
73
- height="19"
74
- viewBox="0 0 19 19"
75
- fill="none"
76
- >
77
- <path
78
- 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"
79
- :fill="hasOverdue ? '#FF0000' : '#007AFF'"
80
- />
81
- </svg>
82
- <span
83
- class="p-regular fw-semi"
84
- :class="[
85
- hasOverdue ? 't-red' : 't-grey'
86
- ]"
87
- >
88
- Need to return part of the equipment
89
- </span>
90
- </div>
22
+ <!-- Product List -->
23
+ <div class="gap-thin flex-column flex mn-b-small">
24
+ <CardOrderItem
25
+ v-for="(item, index) in positions"
26
+ :key="`${item._id}_${item.variant || 'no-variant'}_${index}`"
27
+ :editable="false"
28
+ :productId="item._id"
29
+ :variantId="item.variant"
30
+ :images="item.images"
31
+ :name="item.name"
32
+ :quantity="item.quantity"
33
+ :unit="item.unit"
34
+ :dates="item.date"
35
+ :listing="item.listing"
36
+ :price="item.price"
37
+ class="bg-white radius-small pd-small"
38
+ />
39
+ </div>
40
+
41
+ <!-- Footer: Total + Actions -->
42
+ <div class="flex-nowrap flex-v-center flex-between flex">
43
+ <div class="w-100">
44
+ <span class="fw-medium t-dark p-medium">Total</span>
45
+ <span class="fw-demi t-dark p-medium">{{ formatPrice(total) }}</span>
46
+ </div>
47
+
48
+ <div class="flex-nowrap gap-thin flex">
49
+ <button
50
+ v-if="status === 'delivered' || status === 'finished'"
51
+ class="button bg-white pd-t-thin pd-b-thin pd-l-small pd-r-small p-small fw-medium radius-small"
52
+ >
53
+ Rate
54
+ </button>
55
+ <button
56
+ v-if="status === 'created' || status === 'confirmed'"
57
+ class="button bg-main t-white pd-t-thin pd-b-thin pd-l-small pd-r-small p-small fw-medium radius-small"
58
+ >
59
+ Pay
60
+ </button>
61
+ <button class="button bg-white pd-t-thin pd-b-thin pd-l-small pd-r-small p-small fw-medium radius-small flex-v-center gap-micro flex">
62
+ Details
63
+ <IconChevronRight class="i-small" />
64
+ </button>
65
+ </div>
66
+ </div>
91
67
  </div>
92
68
  </template>
93
69
 
94
70
  <script setup>
95
71
  import { computed } from 'vue';
72
+ import { useI18n } from 'vue-i18n';
73
+ import { useGlobalMixins } from '@martyrs/src/modules/core/views/mixins/mixins.js';
96
74
 
97
- import Tooltip from '@martyrs/src/components/Tooltip/Tooltip.vue'
75
+ import IconChevronRight from '@martyrs/src/modules/icons/navigation/IconChevronRight.vue';
76
+ import CardOrderItem from '@martyrs/src/modules/orders/components/blocks/CardOrderItem.vue';
98
77
 
99
- import IconStatusCreated from '@martyrs/src/modules/orders/components/icons/IconStatusCreated.vue';
100
- import IconStatusConfirmed from '@martyrs/src/modules/orders/components/icons/IconStatusConfirmed.vue';
101
- import IconStatusInUse from '@martyrs/src/modules/orders/components/icons/IconStatusInUse.vue';
102
- import IconStatusFinished from '@martyrs/src/modules/orders/components/icons/IconStatusFinished.vue';
103
- import IconStatusCanceled from '@martyrs/src/modules/orders/components/icons/IconStatusCanceled.vue';
104
- import IconStatusDelay from '@martyrs/src/modules/orders/components/icons/IconStatusDelay.vue';
78
+ const { locale } = useI18n();
79
+ const { formatPrice, formatDate } = useGlobalMixins();
105
80
 
106
81
  const props = defineProps({
107
82
  orderId: String,
@@ -112,112 +87,35 @@ const props = defineProps({
112
87
  total: [String, Number]
113
88
  });
114
89
 
115
- const iconMap = {
116
- 'created': IconStatusCreated,
117
- 'confirmed': IconStatusConfirmed,
118
- 'preparing': IconStatusInUse,
119
- 'inuse': IconStatusInUse,
120
- 'finished': IconStatusFinished,
121
- 'canceled': IconStatusCanceled,
122
- 'delay': IconStatusDelay
90
+ const formatOrderId = (id) => {
91
+ if (!id) return '';
92
+ return `#${id.slice(0, 3).toUpperCase()}-${id.slice(-4).toUpperCase()}-${new Date().getFullYear()}`;
123
93
  };
124
94
 
125
- const formatDate = (date) => {
126
- const d = new Date(date);
127
- return d.toLocaleDateString('en-US', { day: 'numeric', month: 'long' });
95
+ const statusConfig = {
96
+ 'delivered': { label: 'Delivered', class: 't-green bg-green-nano', dot: 'bg-green' },
97
+ 'finished': { label: 'Delivered', class: 't-green bg-green-nano', dot: 'bg-green' },
98
+ 'processing': { label: 'Processing', class: 't-main bg-main-nano', dot: 'bg-main' },
99
+ 'created': { label: 'Processing', class: 't-main bg-main-nano', dot: 'bg-main' },
100
+ 'confirmed': { label: 'Confirmed', class: 't-main bg-main-nano', dot: 'bg-main' },
101
+ 'shipped': { label: 'Shipped', class: 't-second bg-second-nano', dot: 'bg-second' },
102
+ 'preparing': { label: 'Preparing', class: 't-second bg-second-nano', dot: 'bg-second' },
103
+ 'cancelled': { label: 'Cancelled', class: 't-grey bg-light', dot: 'bg-grey' },
104
+ 'canceled': { label: 'Cancelled', class: 't-grey bg-light', dot: 'bg-grey' },
105
+ 'returned': { label: 'Returned', class: 't-fourth bg-fourth-nano', dot: 'bg-fourth' }
128
106
  };
129
107
 
130
- const statusText = computed(() => {
131
- const createdDate = formatDate(props.createdAt);
132
- const updatedDate = formatDate(props.updatedAt);
133
-
134
- switch(props.status.toLowerCase()) {
135
- case 'created':
136
- return `Created, ${createdDate}`;
137
- case 'confirmed':
138
- return `Confirmed, ${updatedDate}`;
139
- case 'preparing':
140
- case 'inuse':
141
- if (props.positions?.length) {
142
- const lastEndDate = new Date(props.positions[props.positions.length - 1].date.end);
143
- return `up to ${formatDate(lastEndDate)}`;
144
- }
145
- return `up to 18:00, ${updatedDate}`;
146
- case 'finished':
147
- return `Finished, ${updatedDate}`;
148
- case 'canceled':
149
- return `Canceled, ${updatedDate}`;
150
- default:
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);
158
- const now = new Date();
159
- const diffTime = Math.abs(now.getTime() - lastEndDate.getTime());
160
- const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
108
+ const statusKey = computed(() => props.status?.toLowerCase() || 'created');
161
109
 
162
- if (diffDays > 0 && props.status !== 'finished' && props.status !== 'canceled') {
163
- return `Delay ${diffDays} day${diffDays > 1 ? 's' : ''}`;
164
- }
165
- }
166
- }
167
- return `Created, ${createdDate}`;
168
-
169
- }
170
- });
171
-
172
- // Выбор иконки
173
- const statusIcon = computed(() => {
174
- if (props.status === 'preparing' || props.status === 'inuse') {
175
- // Проверка на задержку
176
- if (props.positions?.length) {
177
- const lastEndDate = new Date(props.positions[props.positions.length - 1].date.end);
178
- if (new Date() > lastEndDate && props.status !== 'finished' && props.status !== 'canceled') {
179
- return IconStatusDelay;
180
- }
181
- }
182
- return IconStatusInUse;
183
- }
184
- return iconMap[props.status.toLowerCase()] || IconStatusCreated;
110
+ const statusLabel = computed(() => {
111
+ return statusConfig[statusKey.value]?.label || 'Processing';
185
112
  });
186
113
 
187
- // Функция для нормализации даты (убираем время)
188
- const getDateWithoutTime = (dateString) => {
189
- const date = new Date(dateString);
190
- date.setHours(0, 0, 0, 0);
191
- return date;
192
- };
193
-
194
- // Текущая дата и дата через 3 дня
195
- const today = getDateWithoutTime(new Date());
196
- const threeDaysFromNow = new Date(today);
197
- threeDaysFromNow.setDate(today.getDate() + 3);
198
-
199
- // Показывать ли уведомление о возврате
200
- const showReturnNotice = computed(() => {
201
- return props.positions.some(position => {
202
- const endDate = position?.date?.end ? getDateWithoutTime(position.date.end) : null;
203
- return endDate !== null && endDate <= threeDaysFromNow;
204
- });
114
+ const statusClasses = computed(() => {
115
+ return statusConfig[statusKey.value]?.class || 't-main bg-main-nano';
205
116
  });
206
117
 
207
- // Есть ли просроченные позиции
208
- const hasOverdue = computed(() => {
209
- return props.positions.some(position => {
210
- const endDate = position?.date?.end ? getDateWithoutTime(position.date.end) : null;
211
- return endDate !== null && endDate < today;
212
- });
118
+ const dotClasses = computed(() => {
119
+ return statusConfig[statusKey.value]?.dot || 'bg-main';
213
120
  });
214
-
215
- // Предполагается, что formatPrice определен где-то в коде
216
121
  </script>
217
-
218
- <style scoped>
219
- /* Добавляем стиль для текста "просрочено" */
220
- .t-red {
221
- color: red;
222
- }
223
- </style>
@@ -9,7 +9,7 @@
9
9
  </div>
10
10
 
11
11
  <div class="flex-nowrap flex gap-thin pos-relative ">
12
- <div v-for="(status, index) in store.core.state.options.orders.statuses" :key="index" class="w-20">
12
+ <div v-for="(status, index) in statuses" :key="index" class="w-20">
13
13
  <div
14
14
  class="bg-white br-anim br-glow radius-extra h-1r w-100"
15
15
  :class="
@@ -325,7 +325,7 @@
325
325
  const productsOrganization = ref(null)
326
326
  const orderOrganization = ref(null)
327
327
 
328
- const statuses = store.core.state.options.orders.statuses
328
+ const statuses = store.core.state.options?.orders?.statuses || []
329
329
  const statusLabels = ['Created', 'Confirmed', 'Preparing', 'In use', 'Finished'];
330
330
 
331
331
  if (route.meta.context === 'user' &&
@@ -419,16 +419,16 @@ const deliveryCost = computed(() => {
419
419
 
420
420
 
421
421
  function getNextStatus(currentStatus) {
422
- const currentIndex = store.core.state.options.orders.statuses.findIndex(status => status.value === currentStatus);
422
+ const currentIndex = statuses.findIndex(status => status.value === currentStatus);
423
423
 
424
424
  if (currentIndex !== -1 && currentIndex + 1 < statuses.length) {
425
- return store.core.state.options.orders.statuses[currentIndex + 1];
425
+ return statuses[currentIndex + 1];
426
426
  }
427
427
  return null; // If next status doesn't exist
428
428
  }
429
429
 
430
430
  const isActiveStatus = (index) => {
431
- return store.core.state.options.orders.statuses.slice(index).some(status => status.value === order.value.status);
431
+ return statuses.slice(index).some(status => status.value === order.value?.status);
432
432
  };
433
433
 
434
434
  async function changePaymentStatus() {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="mobile:pd-thin pd-medium">
2
+ <div class="mobile:pd-thin pd-medium">
3
3
  <SectionPageTitle
4
4
  v-if="!MOBILE_APP"
5
5
  title="Orders"
@@ -29,9 +29,17 @@
29
29
  <h3>{{formatPrice(totalPrice)}}</h3>
30
30
  </div>
31
31
  </div>
32
-
33
32
  </Block>
34
33
 
34
+ <!-- Tabs for user context -->
35
+ <Tab
36
+ v-if="route.meta.context === 'user'"
37
+ :tabs="tabs"
38
+ v-model:selected="tab"
39
+ classTab="bg-light"
40
+ class="mn-b-small"
41
+ />
42
+
35
43
  <Feed
36
44
  :search="true"
37
45
  :states="{
@@ -47,24 +55,24 @@
47
55
  limit: 15,
48
56
  ...(route.meta.context === 'organization' && { owner: route.params._id }),
49
57
  ...(route.meta.context === 'user' && { customer: route.params._id }),
50
- ...(tab !== 'all' && { status: tab })
58
+ ...(tab !== 'all' && { status: tabStatusFilter })
51
59
  }"
52
- v-slot="{
53
- items
60
+ v-slot="{
61
+ items
54
62
  }"
55
- class="gap-thin cols-3 mobile:cols-1"
63
+ :class="route.meta.context === 'user' ? 'gap-small cols-1' : 'gap-thin cols-3 mobile:cols-1'"
56
64
  >
57
- <router-link
65
+ <router-link
58
66
  v-if="route.meta.context !== 'user'"
59
- v-for="order in items"
60
- :to="{
61
- name: route.meta.context === 'backoffice' ? 'BackofficeOrderEdit' : 'OrganizationOrderEdit',
62
- params: route.meta.context === 'backoffice'
63
- ? { order: order._id }
67
+ v-for="order in items"
68
+ :to="{
69
+ name: route.meta.context === 'backoffice' ? 'BackofficeOrderEdit' : 'OrganizationOrderEdit',
70
+ params: route.meta.context === 'backoffice'
71
+ ? { order: order._id }
64
72
  : { order: order._id, organization: order.owner.target || order.owner._id }
65
- }"
73
+ }"
66
74
  >
67
- <CardOrderBackoffice
75
+ <CardOrderBackoffice
68
76
  :order="order"
69
77
  :user="auth.state.user"
70
78
  :formatDate="formatDate"
@@ -73,69 +81,72 @@
73
81
  />
74
82
  </router-link>
75
83
 
76
- <router-link
84
+ <router-link
77
85
  v-if="route.meta.context === 'user'"
78
- v-for="order in items"
79
- :to="{
80
- name: 'UserOrder',
81
- params: {
82
- order: order._id
83
- }
84
- }"
86
+ v-for="order in items"
87
+ :to="`/users/${route.params._id}/orders/${order._id}`"
85
88
  >
86
- <CardOrderUser
87
- :orderId="order._id"
88
- :status="order.status"
89
- :createdAt="order.createdAt"
90
- :updatedAt="order.updatedAt"
91
- :positions="order.positions"
92
- :total="orders.getters.getTotal(order.positions)"
93
- />
89
+ <CardOrderUser
90
+ :orderId="order._id"
91
+ :status="order.status"
92
+ :createdAt="order.createdAt"
93
+ :updatedAt="order.updatedAt"
94
+ :positions="order.positions"
95
+ :total="orders.getters.getTotal(order.positions)"
96
+ />
94
97
  </router-link>
95
98
  </Feed>
96
99
  </div>
97
100
  </template>
98
101
 
99
102
  <script setup>
100
- import { computed, onMounted, reactive, ref } from 'vue';
101
- import { useRoute, useRouter } from 'vue-router';
103
+ import { computed, ref } from 'vue';
104
+ import { useRoute } from 'vue-router';
102
105
 
103
- import Tab from '@martyrs/src/components/Tab/Tab.vue'
106
+ import Tab from '@martyrs/src/components/Tab/Tab.vue'
104
107
  import Block from '@martyrs/src/components/Block/Block.vue';
108
+ import Feed from '@martyrs/src/components/Feed/Feed.vue'
105
109
 
106
110
  import * as orders from '@martyrs/src/modules/orders/store/orders.js';
107
111
  import * as auth from '@martyrs/src/modules/auth/views/store/auth.js';
108
112
 
109
- import CardOrder from '@martyrs/src/modules/orders/components/blocks/CardOrder.vue'
110
-
111
113
  import CardOrderUser from '@martyrs/src/modules/orders/components/blocks/CardOrderUser.vue'
112
114
  import CardOrderBackoffice from '@martyrs/src/modules/orders/components/blocks/CardOrderBackoffice.vue'
113
-
114
115
  import SectionPageTitle from '@martyrs/src/modules/core/views/components/sections/SectionPageTitle.vue'
115
116
 
116
- import Feed from '@martyrs/src/components/Feed/Feed.vue'
117
-
118
- import IconTime from '@martyrs/src/modules/icons/entities/IconTime.vue'
119
117
  import { useGlobalMixins } from '@martyrs/src/modules/core/views/mixins/mixins.js'
120
118
 
121
119
  const route = useRoute();
122
- const router = useRouter();
123
120
  const { returnCurrency, formatPrice, formatDate } = useGlobalMixins()
124
121
 
125
- const spoiler = ref(false)
126
-
127
122
  // Tab logic
128
123
  const tab = ref('all')
129
124
 
125
+ const tabs = [
126
+ { label: 'All Orders', value: 'all' },
127
+ { label: 'In Progress', value: 'in_progress' },
128
+ { label: 'Returns & Cancellations', value: 'returns' }
129
+ ]
130
+
131
+ const tabStatusFilter = computed(() => {
132
+ switch (tab.value) {
133
+ case 'in_progress':
134
+ return ['created', 'confirmed', 'processing', 'preparing', 'shipped']
135
+ case 'returns':
136
+ return ['cancelled', 'canceled', 'returned']
137
+ default:
138
+ return null
139
+ }
140
+ })
141
+
130
142
  const totalPrice = computed(() => {
131
143
  return calculateTotalSum(orders.state.all)
132
144
  });
133
145
 
134
- const totalPriceUnpaid = computed(() => {
146
+ const totalPriceUnpaid = computed(() => {
135
147
  return calculateSum(orders.state.all,'unpaid')
136
148
  });
137
149
 
138
-
139
150
  function calculateTotalSum(orders) {
140
151
  return orders.reduce((totalSum, item) => {
141
152
  return totalSum + item.positions.reduce((sum, position) => sum + position.price, 0);
@@ -144,15 +155,10 @@
144
155
 
145
156
  function calculateSum(orders, status) {
146
157
  return orders.reduce((totalSum, item) => {
147
- if (item.payment.status === status) {
158
+ if (item.payment?.status === status) {
148
159
  return totalSum + item.positions.reduce((sum, position) => sum + position.price, 0);
149
160
  }
150
161
  return totalSum;
151
162
  }, 0);
152
163
  }
153
-
154
-
155
- onMounted(async () => {
156
-
157
- });
158
164
  </script>
@@ -1,17 +1,37 @@
1
1
  <template>
2
2
  <div class="for-transition pd-thin">
3
3
 
4
- <h3 class="mn-b-small">Type of group</h3>
5
- <p class="mn-b-thin">Public groups are open to everyone, whereas in exclusive groups only members can post. If you wish to make a group private, select 'hidden'.</p>
6
-
7
- <SelectMulti
8
- v-model="organization.state.current.types"
9
- :options="['public','exclusive','hidden']"
10
- :multiple="false"
11
- :taggable="false"
12
- placeholder="Type to search or add type of organization"
13
- class="mn-b-semi bg-light pd-medium radius-small"
14
- />
4
+ <h3 class="mn-b-small">Access & Privacy</h3>
5
+
6
+ <div class="d-grid cols-1 tablet:cols-3 gap-regular mn-b-semi">
7
+ <button
8
+ v-for="option in typeOptions"
9
+ :key="option.value"
10
+ @click="organization.state.current.types = [option.value]"
11
+ :class="[
12
+ 'd-flex items-start gap-regular pd-regular radius-semi br-1px t-left transition-timing-2',
13
+ isTypeSelected(option.value)
14
+ ? 'br-main bg-main-transp-10'
15
+ : 'br-light dark:br-dark-thin hover:br-grey bg-white dark:bg-dark'
16
+ ]"
17
+ >
18
+ <div :class="[
19
+ 'pd-thin radius-[50%]',
20
+ isTypeSelected(option.value)
21
+ ? 'bg-main t-white'
22
+ : 'bg-light dark:bg-dark-thin t-grey'
23
+ ]">
24
+ <component :is="option.icon" class="i-medium" />
25
+ </div>
26
+ <div>
27
+ <div class="fw-semi t-black dark:t-white d-flex items-center gap-thin">
28
+ {{ option.label }}
29
+ <span v-if="isTypeSelected(option.value)" class="w-[0.5rem] h-[0.5rem] radius-[50%] bg-main"></span>
30
+ </div>
31
+ <p class="p-small t-grey dark:t-grey-thin mn-t-micro">{{ option.desc }}</p>
32
+ </div>
33
+ </button>
34
+ </div>
15
35
 
16
36
 
17
37
  <h3 class="mn-b-small">Profile</h3>
@@ -115,6 +135,7 @@
115
135
 
116
136
  import { useRoute, useRouter } from 'vue-router';
117
137
 
138
+ import { IconGroups, IconLock, IconShow } from '@martyrs/src/modules/icons/icons.client.js'
118
139
  import Breadcrumbs from '@martyrs/src/components/Breadcrumbs/Breadcrumbs.vue'
119
140
  import BlockTags from '@martyrs/src/components/FieldTags/BlockTags.vue'
120
141
  import Tab from '@martyrs/src/components/Tab/Tab.vue';
@@ -134,6 +155,16 @@
134
155
 
135
156
  organization.actions.reset();
136
157
 
158
+ const typeOptions = [
159
+ { value: 'public', label: 'Public', icon: IconGroups, desc: 'Visible to everyone. Anyone can join.' },
160
+ { value: 'exclusive', label: 'Exclusive', icon: IconLock, desc: 'Visible, but membership requires approval.' },
161
+ { value: 'hidden', label: 'Hidden', icon: IconShow, desc: 'Invite only. Hidden from search.' }
162
+ ];
163
+
164
+ function isTypeSelected(type) {
165
+ return organization.state.current.types?.includes(type);
166
+ }
167
+
137
168
  onMounted(async()=>{
138
169
  if (route.params._id) {
139
170
  await organization.actions.read({ _id: route.params._id });
@@ -1 +0,0 @@
1
- {"version":3,"file":"Loader.vue.js","sources":["../../../../../src/components/Loader/Loader.vue"],"sourcesContent":["<template>\n <div class=\"circular-loader pos-relative z-index-1 w-100 h-100 w-max-2r h-max-2r\" :class=\"{ 'circular-loader-centered': centered }\">\n <svg viewBox=\"25 25 50 50\">\n <circle class=\"circular-loader-fill\" cx=\"50\" cy=\"50\" r=\"20\" fill=\"none\" stroke-width=\"4\" stroke-miterlimit=\"10\" />\n <circle class=\"circular-loader-circle\" cx=\"50\" cy=\"50\" r=\"20\" fill=\"none\" stroke-width=\"4\" stroke-miterlimit=\"10\" />\n </svg>\n <div v-if=\"progress\" class=\"progress-text\">{{ progress }}</div>\n <div v-if=\"status\" class=\"uppercase fw-semi w-m-10r status-text\">{{ status }}</div>\n </div>\n</template>\n\n<script>\nexport default {\n props: {\n progress: {\n type: Number,\n default: null,\n },\n status: {\n type: String,\n default: null,\n },\n centered: {\n type: Boolean,\n default: false\n },\n },\n};\n</script>\n\n<style>\n.circular-loader-centered {\n top: calc(50% - 1rem);\n left: calc(50% - 1rem);\n}\n\n.circular-loader svg {\n animation: rotate 2s linear infinite;\n}\n\n.circular-loader-circle {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: 0;\n stroke-linecap: round;\n stroke: rgb(var(--main));\n animation: dash 1.5s ease-in-out infinite;\n}\n\n.circular-loader-fill {\n stroke-linecap: round;\n stroke: rgba(var(--black),0.2);\n}\n\n.progress-text {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n font-size: 0.8rem;\n color: rgb(var(--main));;\n}\n\n.status-text {\n position: absolute;\n top: 120%;\n left: calc(50% - 5rem);\n font-size: 0.8rem;\n width: 10rem !important;\n text-align: center;\n}\n\n@keyframes rotate {\n 100% {\n transform: rotate(360deg);\n }\n}\n\n@keyframes dash {\n 0% {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 89, 200;\n stroke-dashoffset: -35;\n }\n 100% {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: -124;\n }\n}\n</style>"],"names":["_createElementBlock","_normalizeClass","_createElementVNode","_toDisplayString","_createCommentVNode"],"mappings":";;;AAYA,MAAK,YAAU;AAAA,EACb,OAAO;AAAA,IACL,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;IAEX,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA;IAEX,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;;AAGf;;EA3BA,KAAA;AAAA,EAMyB,OAAM;;;EAN/B,KAAA;AAAA,EAOuB,OAAM;;;sBAN3BA,mBAOM,OAAA;AAAA,IAPD,OADPC,eAAA,CACa,wEAAsE,EAAA,4BAAuC,OAAA,UAAQ,CAAA;AAAA;8BAC9HC,mBAGM,OAAA,EAHD,SAAQ,iBAAa;AAAA,MACxBA,mBAAkH,UAAA;AAAA,QAA1G,OAAM;AAAA,QAAuB,IAAG;AAAA,QAAK,IAAG;AAAA,QAAK,GAAE;AAAA,QAAK,MAAK;AAAA,QAAO,gBAAa;AAAA,QAAI,qBAAkB;AAAA;MAC3GA,mBAAoH,UAAA;AAAA,QAA5G,OAAM;AAAA,QAAyB,IAAG;AAAA,QAAK,IAAG;AAAA,QAAK,GAAE;AAAA,QAAK,MAAK;AAAA,QAAO,gBAAa;AAAA,QAAI,qBAAkB;AAAA;;IAEpG,OAAA,yBAAXF,mBAA+D,OAA/D,YAA+DG,gBAAjB,OAAA,QAAQ,GAAA,CAAA,KAN1DC,mBAAA,IAAA,IAAA;AAAA,IAOe,OAAA,uBAAXJ,mBAAmF,OAAnF,YAAmFG,gBAAf,OAAA,MAAM,GAAA,CAAA,KAP9EC,mBAAA,IAAA,IAAA;AAAA;;;"}