@ozdao/prometheus-framework 0.2.92 → 0.2.94
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/events.server.js +14 -6
- package/dist/events.server.mjs +14 -6
- package/dist/main-CX2ISR43.mjs +13629 -0
- package/dist/main-cffh4bbv.js +92 -0
- package/dist/main.css +1 -1
- package/dist/orders.server.js +37 -23
- package/dist/orders.server.mjs +37 -23
- package/dist/organizations.server.js +2 -1
- package/dist/organizations.server.mjs +2 -1
- package/dist/prometheus-framework/src/components/Address/Address.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Address/Address.vue2.js +46 -48
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +25 -20
- package/dist/prometheus-framework/src/components/Map/Map.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Map/Map.vue.js +36 -26
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +103 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +1 -103
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.js +36 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.js +1 -36
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/VideoPlayer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/VideoPlayer.vue.js +11 -11
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +45 -45
- package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +39 -65
- package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.js +31 -31
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +242 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js +62 -62
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +28 -28
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +99 -70
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +10 -10
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.router.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.router.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.js +33 -34
- package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +42 -42
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +28 -26
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +11 -11
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +47 -44
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +162 -168
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +27 -26
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +7 -7
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +13 -13
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +14 -15
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +22 -20
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.js +59 -38
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +23 -22
- package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +17 -14
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +1 -1
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/web-CQQEUA9l.js +1 -0
- package/dist/web-D2Em-p-C.mjs +54 -0
- package/package.json +1 -1
- package/src/components/Address/Address.vue +23 -34
- package/src/components/LocationMarker/LocationMarker.vue +6 -1
- package/src/components/LocationSelection/LocationSelection.vue +4 -0
- package/src/components/Map/Map.vue +29 -15
- package/src/modules/constructor/components/elements/VideoPlayer.vue +2 -2
- package/src/modules/events/controllers/events.controller.js +4 -4
- package/src/modules/globals/components/blocks/CardHeader.vue +2 -2
- package/src/modules/integrations/stripe/controllers/services/stripe.service.js +17 -6
- package/src/modules/landing/components/pages/Farming.vue +226 -0
- package/src/modules/landing/components/pages/Governance.vue +3 -5
- package/src/modules/landing/components/pages/Home.vue +0 -3
- package/src/modules/landing/components/pages/Hotel.vue +1 -3
- package/src/modules/landing/components/pages/Page.vue +0 -3
- package/src/modules/landing/components/sections/Examples.vue +4 -56
- package/src/modules/landing/components/sections/SectionFeature.vue +41 -0
- package/src/modules/landing/components/sections/SectionFeaturesImages.vue +122 -0
- package/src/modules/landing/components/sections/SectionFocus.vue +59 -0
- package/src/modules/landing/components/sections/SectionHeroVideo.vue +164 -0
- package/src/modules/landing/router/landing.js +11 -0
- package/src/modules/marketplace/components/sections/Filters.vue +26 -23
- package/src/modules/orders/components/blocks/CardOrderItem.vue +8 -0
- package/src/modules/orders/components/blocks/StatusHistory.vue +25 -53
- package/src/modules/orders/components/pages/Order.vue +2 -6
- package/src/modules/orders/components/pages/OrderBackoffice.vue +393 -0
- package/src/modules/orders/components/pages/OrderCreate.vue +5 -4
- package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +2 -3
- package/src/modules/orders/components/pages/Orders.vue +60 -11
- package/src/modules/orders/components/sections/FormDelivery.vue +2 -2
- package/src/modules/orders/controllers/orders.controller.js +30 -19
- package/src/modules/orders/models/order.model.js +8 -2
- package/src/modules/orders/router/orders.backoffice.router.js +1 -1
- package/src/modules/orders/router/orders.router.js +2 -2
- package/src/modules/orders/store/orders.js +3 -7
- package/src/modules/orders/store/shopcart.js +1 -1
- package/src/modules/organizations/components/blocks/CardDepartment.vue +2 -0
- package/src/modules/organizations/components/pages/Department.vue +5 -1
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +65 -27
- package/src/modules/organizations/components/pages/Members.vue +2 -1
- package/src/modules/organizations/components/pages/Organization.vue +1 -1
- package/src/modules/organizations/controllers/memberships.controller.js +3 -1
- package/src/modules/organizations/store/memberships.js +1 -1
- package/src/modules/products/components/blocks/CardProduct.vue +2 -3
- package/src/modules/products/components/pages/ProductEdit.vue +10 -13
- package/src/modules/products/components/pages/Products.vue +2 -0
- package/src/modules/products/store/products.js +25 -2
- package/src/modules/spots/components/blocks/CardSpot.vue +2 -2
- package/src/modules/users/components/blocks/CardUser.vue +1 -0
- package/src/modules/landing/components/sections/AboutSection.vue +0 -69
@@ -1,17 +1,22 @@
|
|
1
1
|
<template>
|
2
2
|
<div class="bg-grey radius-medium w-100">
|
3
3
|
<h3 class="pd-medium">Tracking History</h3>
|
4
|
-
<div v-for="status in
|
4
|
+
<div v-for="status in statusDetailedHistory" :key="status" class="w-100 br-t br-solid br-black-transp-10 pd-medium flex-v-center flex-nowrap flex">
|
5
5
|
<div class="flex-center flex i-big radius-extra br-solid br-2px br-black-transp-10 mn-r-small">
|
6
|
-
|
7
6
|
<IconCheckmark
|
8
|
-
v-if="isStatusInHistory(status.
|
7
|
+
v-if="isStatusInHistory(status.status)"
|
9
8
|
class="i-medium"
|
10
9
|
/>
|
11
10
|
</div>
|
12
|
-
|
11
|
+
|
12
|
+
<div>
|
13
|
+
<p class="h4 w-8r">{{status.status}}</p>
|
14
|
+
<p v-if="status.timestamp" class="h5 w-8r">{{formatDate(status.timestamp)}}</p>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<p class="h5 w-8r">{{status._id}}</p>
|
13
18
|
<!-- <button v-if="status.value === 'delivered'" @click="printReceipt()" class="mn-l-auto bg-main button radius-big">Print</button> -->
|
14
|
-
<button v-if="edit" :disabled="!isNextPossibleStatus(status
|
19
|
+
<button v-if="edit" :disabled="!isNextPossibleStatus(status)" @click="setStatus(status)" class="mn-l-auto bg-main button radius-big">Set status</button>
|
15
20
|
</div>
|
16
21
|
</div>
|
17
22
|
</template>
|
@@ -32,46 +37,22 @@ const props = defineProps({
|
|
32
37
|
},
|
33
38
|
edit: {
|
34
39
|
type: Boolean
|
40
|
+
},
|
41
|
+
statuses: {
|
42
|
+
type: Array
|
35
43
|
}
|
36
44
|
})
|
37
45
|
|
38
|
-
|
39
|
-
const
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
nextstatus: 'Confirming order...',
|
49
|
-
description: 'Your order has been confirmed. We are now processing your items and preparing them for shipment.'
|
50
|
-
},{
|
51
|
-
value: 'confirmed',
|
52
|
-
name: 'Confirmed',
|
53
|
-
nextstatus: 'Order is confirmed. Packing order...',
|
54
|
-
description: 'Your order has been confirmed. We are now processing your items and preparing them for shipment.'
|
55
|
-
},{
|
56
|
-
value: 'packing',
|
57
|
-
name: 'Packing',
|
58
|
-
nextstatus: 'Packing order...',
|
59
|
-
description: 'Your order is now awaiting shipment. Once shipped, you will receive a notification with tracking information.'
|
60
|
-
},{
|
61
|
-
value: 'packed',
|
62
|
-
name: 'Packed',
|
63
|
-
nextstatus: 'Delivering order...',
|
64
|
-
description: 'Your order is now awaiting shipment. Once shipped, you will receive a notification with tracking information.'
|
65
|
-
},{
|
66
|
-
value: 'in delivery',
|
67
|
-
name: 'Delivering',
|
68
|
-
description: 'Your order is currently in transit. Our delivery team is working hard to get your items to you as soon as possible.'
|
69
|
-
},{
|
70
|
-
value: 'delivered',
|
71
|
-
name: 'Delivered',
|
72
|
-
description: 'Congratulations! Your order has been successfully delivered. If you have any concerns or feedback, feel free to contact us.'
|
73
|
-
}
|
74
|
-
]);
|
46
|
+
const statusDetailedHistory = props.statuses.map(status => {
|
47
|
+
const historyEntry = props.statusHistory.find(entry => entry.status === status);
|
48
|
+
|
49
|
+
return {
|
50
|
+
status,
|
51
|
+
timestamp: historyEntry ? historyEntry.timestamp : 'N/A',
|
52
|
+
inHistory: !!historyEntry,
|
53
|
+
_id: historyEntry ? historyEntry._id : null
|
54
|
+
};
|
55
|
+
});
|
75
56
|
|
76
57
|
const statusCurrent = ref(props.statusCurrent);
|
77
58
|
const statusHistory = ref(props.statusHistory);
|
@@ -83,20 +64,11 @@ const isStatusInHistory = (statusValue) => {
|
|
83
64
|
|
84
65
|
// Проверка, является ли статус следующим возможным действием
|
85
66
|
const isNextPossibleStatus = (statusValue) => {
|
86
|
-
const currentIndex = statuses.
|
87
|
-
console.log(status.status === statusCurrent.value)
|
88
|
-
console.log(statusCurrent.value)
|
89
|
-
console.log(status)
|
67
|
+
const currentIndex = props.statuses.findIndex(status => status === statusCurrent.value);
|
90
68
|
const nextIndex = currentIndex + 1;
|
91
|
-
return statuses
|
69
|
+
return props.statuses[nextIndex] && props.statuses[nextIndex] === statusValue;
|
92
70
|
};
|
93
71
|
|
94
|
-
// Функция установки нового статуса
|
95
|
-
const setStatus = async (newStatus) => {
|
96
|
-
// console.log(status)
|
97
|
-
// orders.state.current.status = status.value
|
98
|
-
// await orders.actions.update(orders.state.current)
|
99
|
-
}
|
100
72
|
|
101
73
|
const printerIP = ref('192.168.1.197');
|
102
74
|
const printerPort = ref(9100);
|
@@ -210,7 +210,7 @@
|
|
210
210
|
<script setup="props">
|
211
211
|
import { computed, ref, onMounted } from 'vue'
|
212
212
|
import { useRouter, useRoute } from 'vue-router'
|
213
|
-
|
213
|
+
|
214
214
|
import CardOrderItem from '@pf/src/modules/orders/components/blocks/CardOrderItem.vue'
|
215
215
|
import CardOrganization from '@pf/src/modules/organizations/components/blocks/CardOrganization.vue'
|
216
216
|
|
@@ -242,7 +242,6 @@
|
|
242
242
|
_id: order.value?.owner.target._id,
|
243
243
|
location: globals.state.position?.location,
|
244
244
|
});
|
245
|
-
|
246
245
|
})
|
247
246
|
|
248
247
|
let cartTotalPrice = computed(() => {
|
@@ -262,10 +261,7 @@
|
|
262
261
|
|
263
262
|
const product = productsOrganization.value.find(product => product._id === _id)
|
264
263
|
|
265
|
-
|
266
|
-
console.log(productsOrganization)
|
267
|
-
|
268
|
-
return {
|
264
|
+
return {
|
269
265
|
name: product.name,
|
270
266
|
images: product.images,
|
271
267
|
price: product.price,
|
@@ -0,0 +1,393 @@
|
|
1
|
+
<template>
|
2
|
+
<div v-if="order && orderOrganization" class="pd-thin">
|
3
|
+
|
4
|
+
<SectionPageTitle
|
5
|
+
:title="`Order is ${order.status}`"
|
6
|
+
class="mn-b-small bg-grey bg-grey radius-big"
|
7
|
+
/>
|
8
|
+
|
9
|
+
<div v-if="order" class="mn-b-thin pos-relative w-100 bg-main radius-big pd-big">
|
10
|
+
<div class="mn-b-small flex-nowrap flex">
|
11
|
+
<p class="t-medium p-medium mn-r-auto">
|
12
|
+
Progress
|
13
|
+
</p>
|
14
|
+
|
15
|
+
<p class="t-medium p-medium">
|
16
|
+
Order No: <span class="p-small t-transp">#{{order._id}}</span>
|
17
|
+
</p>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
|
21
|
+
<h2 class="mn-b-small"></h2>
|
22
|
+
|
23
|
+
<div class="radius-extra mn-b-medium flex-nowrap flex pos-relative ">
|
24
|
+
<div v-for="(status, index) in statuses" :key="index" class="mn-r-thin w-20">
|
25
|
+
<div
|
26
|
+
class="bg-grey br-anim br-glow radius-extra h-1r w-100"
|
27
|
+
:class="
|
28
|
+
{ 'br-glow-anim': isActiveStatus(index) },
|
29
|
+
{ 't-transp': !isActiveStatus(index) },
|
30
|
+
{ 'blink': order.status === statuses[index] && getNextStatus(order.status) }
|
31
|
+
"
|
32
|
+
/>
|
33
|
+
<div
|
34
|
+
:class="{ 't-transp': !isActiveStatus(index) }"
|
35
|
+
class="mn-t-thin t-medium uppercase">{{ statusLabels[index] }}</div>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div class="flex-nowrap flex">
|
40
|
+
<div class="w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-white-transp-20">
|
41
|
+
<IconTime class="i-semi t-transp" fill="rgb(var(--black)" />
|
42
|
+
<p class="t-medium mn-r-auto">Estimated Arrival {{formatDate(order.deadline)}}</p>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<button v-if="getNextStatus(order.status) && route.name === 'Order Edit'" @click="openStatusPopup" class="mn-l-auto bg-black t-white button">
|
46
|
+
Mark as {{ getStatusLabel(getNextStatus(order.status)) }}
|
47
|
+
</button>
|
48
|
+
</div>
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<Popup
|
52
|
+
title="Change status"
|
53
|
+
@close-popup="closeStatusPopup"
|
54
|
+
:isPopupOpen="isOpeStatusPopup"
|
55
|
+
class="bg-white w-min-30r w-max-30r radius-big pd-big"
|
56
|
+
>
|
57
|
+
<p class="bg-grey radius-small pd-small mn-b-thin">Estimated Arrival {{formatDate(order.deadline)}}</p>
|
58
|
+
<ul class="bg-grey pd-small radius-small flex gap-thin flex-column mn-b-semi">
|
59
|
+
<CardOrderItem
|
60
|
+
v-for="(product, index) in orderProducts" :key="product._id"
|
61
|
+
:editable="false"
|
62
|
+
:product="product"
|
63
|
+
/>
|
64
|
+
</ul>
|
65
|
+
<button @click="setNextStatus" class="w-100 bg-black-small t-white button">
|
66
|
+
{{'Confirm Changing to ' + getStatusLabel(getNextStatus(order.status))}}
|
67
|
+
</button>
|
68
|
+
</Popup>
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
<div v-if="order" class="gap-thin cols-2">
|
73
|
+
|
74
|
+
<div class="w-100">
|
75
|
+
|
76
|
+
|
77
|
+
<CardOrganization
|
78
|
+
v-if="orderOrganization[0]"
|
79
|
+
:organization="orderOrganization[0]"
|
80
|
+
:showRating="true"
|
81
|
+
:showFollowers="false"
|
82
|
+
:showProducts="false"
|
83
|
+
class="bg-grey mn-b-thin w-100 o-hidden radius-big pd-small "
|
84
|
+
/>
|
85
|
+
|
86
|
+
|
87
|
+
<div
|
88
|
+
class="mn-b-thin bg-grey w-100 o-hidden radius-medium "
|
89
|
+
>
|
90
|
+
<div class="pd-small flex-nowrap flex">
|
91
|
+
<div class="mn-r-auto">
|
92
|
+
<span class="d-block t-medium p-medium">Your order is</span>
|
93
|
+
<span class=" t-lh-075 h2 d-block mn-b-small">{{order.status}}</span>
|
94
|
+
<p class="pd-t-nano pd-b-nano pd-r-thin pd-l-thin radius-extra bg-black t-white w-max">as on 29 aug 2021, Friday</p>
|
95
|
+
</div>
|
96
|
+
<div class="t-right">
|
97
|
+
Cancel order<br>
|
98
|
+
Exchange item
|
99
|
+
<hr class="mn-b-thin mn-t-thin">
|
100
|
+
For Delivery Queries Contact Us
|
101
|
+
|
102
|
+
</div>
|
103
|
+
</div>
|
104
|
+
|
105
|
+
<div class="pd-small cols-2 br-t br-black-transp-10 br-solid">
|
106
|
+
<p class="w-100 t-medium p-medium">
|
107
|
+
Phone
|
108
|
+
</p>
|
109
|
+
|
110
|
+
<p class="w-100 t-right ">
|
111
|
+
{{order.user?.number}}
|
112
|
+
</p>
|
113
|
+
</div>
|
114
|
+
|
115
|
+
<div v-if="order.user?.messenger.type" class="pd-small cols-2 br-t br-black-transp-10 br-solid">
|
116
|
+
<p class="w-100 t-medium p-medium">
|
117
|
+
{{order.user?.messenger.type}}
|
118
|
+
</p>
|
119
|
+
|
120
|
+
<p class="w-100 t-right ">
|
121
|
+
{{order.user?.messenger.value}}
|
122
|
+
</p>
|
123
|
+
</div>
|
124
|
+
|
125
|
+
<div class="pd-small cols-2 br-t br-black-transp-10 br-solid">
|
126
|
+
<p class="t-medium p-medium">
|
127
|
+
Address
|
128
|
+
</p>
|
129
|
+
|
130
|
+
<p class="w-100 t-right">
|
131
|
+
<!-- {{order.delivery?.address.slice(0,64)}} -->
|
132
|
+
</p>
|
133
|
+
</div>
|
134
|
+
|
135
|
+
<div class="pd-small cols-2 br-t br-black-transp-10 br-solid">
|
136
|
+
<p class="mn-b-small t-medium p-medium">
|
137
|
+
Delivery
|
138
|
+
</p>
|
139
|
+
|
140
|
+
<p class="w-100 t-right mn-b-small">
|
141
|
+
{{order.delivery?.type}}
|
142
|
+
</p>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
</div>
|
146
|
+
|
147
|
+
<StatusHistory
|
148
|
+
v-if="orders.state.current.status_history"
|
149
|
+
:statuses="statuses"
|
150
|
+
:statusHistory="orders.state.current.status_history"
|
151
|
+
:statusCurrent="orders.state.current.status"
|
152
|
+
:edit="route.name === 'Order Edit'"
|
153
|
+
/>
|
154
|
+
|
155
|
+
<!-- <button
|
156
|
+
@click="requestPayment(order)"
|
157
|
+
v-if="
|
158
|
+
order.status === 'Подтвержден'
|
159
|
+
&& order.payment.type === 'Online'
|
160
|
+
&& payment.Status !== 'CONFIRMED'
|
161
|
+
&& payment.Status !== 'REFUNDED'
|
162
|
+
"
|
163
|
+
class='w-100 button'>Оплатить заказ</button> -->
|
164
|
+
<span class="t-transp" v-if="payment && payment.Status === 'CONFIRMED'">Paid</span>
|
165
|
+
</div>
|
166
|
+
|
167
|
+
<div class="bg-grey radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100">
|
168
|
+
<h3 class="mn-b-small">Order Summary</h3>
|
169
|
+
|
170
|
+
<ul class="flex gap-thin flex-column mn-b-semi">
|
171
|
+
<CardOrderItem
|
172
|
+
v-for="(product, index) in orderProducts" :key="product._id"
|
173
|
+
:editable="false"
|
174
|
+
:product="product"
|
175
|
+
/>
|
176
|
+
</ul>
|
177
|
+
|
178
|
+
<div class="mn-b-medium radius-small br-solid br-1px br-black-transp-10 w-100">
|
179
|
+
<div class="pd-small br-solid br-b br-black-transp-10 flex">
|
180
|
+
<p class="mn-r-auto t-transp">In total</p>
|
181
|
+
<p>{{ cartTotalPrice }} {{returnCurrency()}} </p>
|
182
|
+
</div>
|
183
|
+
<div class="pd-small br-solid br-b br-black-transp-10 flex">
|
184
|
+
<p class="mn-r-auto t-transp">Delivery</p>
|
185
|
+
<p>{{returnCurrency()}} {{ Math.trunc(100 + 20 * orderOrganization[0]?.distance - 7,5 * (orderOrganization[0]?.distance / 10))}} </p>
|
186
|
+
</div>
|
187
|
+
<div class="pd-small flex-bottom flex">
|
188
|
+
<p class="mn-r-auto t-transp">In total to pay</p>
|
189
|
+
<p class="p-big t-semi">{{returnCurrency()}} {{ Math.trunc(100 + 20 * orderOrganization[0]?.distance - 7,5 * (orderOrganization[0]?.distance / 10)) + cartTotalPrice }}</p>
|
190
|
+
</div>
|
191
|
+
</div>
|
192
|
+
|
193
|
+
<h3 class="mn-b-small">Chat With Us</h3>
|
194
|
+
|
195
|
+
<ChatWindow
|
196
|
+
:username="
|
197
|
+
route.name === 'Order Status' ? order.user?.name || 'User' : 'Weeder Support'
|
198
|
+
"
|
199
|
+
:chatID="route.params.order"
|
200
|
+
class="radius-semi bg-white o-hidden"
|
201
|
+
/>
|
202
|
+
|
203
|
+
</div>
|
204
|
+
</div>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
</template>
|
208
|
+
|
209
|
+
|
210
|
+
<script setup="props">
|
211
|
+
import { computed, ref, onMounted } from 'vue'
|
212
|
+
import { useRouter, useRoute } from 'vue-router'
|
213
|
+
|
214
|
+
import SectionPageTitle from '@pf/src/modules/globals/components/sections/SectionPageTitle.vue'
|
215
|
+
|
216
|
+
import Popup from "@pf/src/components/Popup/Popup.vue";
|
217
|
+
|
218
|
+
import IconTime from '@pf/src/modules/icons/entities/IconTime.vue'
|
219
|
+
|
220
|
+
// Block
|
221
|
+
import CardOrderItem from '@pf/src/modules/orders/components/blocks/CardOrderItem.vue'
|
222
|
+
import CardOrganization from '@pf/src/modules/organizations/components/blocks/CardOrganization.vue'
|
223
|
+
|
224
|
+
import ChatWindow from '@pf/src/modules/chats/components/pages/ChatPage.vue';
|
225
|
+
|
226
|
+
import StatusHistory from '@pf/src/modules/orders/components/blocks/StatusHistory.vue'
|
227
|
+
|
228
|
+
import * as globals from '@pf/src/modules/globals/store/globals'
|
229
|
+
import * as orders from '@pf/src/modules/orders/store/orders'
|
230
|
+
import * as products from '@pf/src/modules/products/store/products'
|
231
|
+
import * as organizations from '@pf/src/modules/organizations/store/organizations'
|
232
|
+
|
233
|
+
|
234
|
+
const router = useRouter()
|
235
|
+
const route = useRoute()
|
236
|
+
|
237
|
+
const order = ref(null)
|
238
|
+
const productsOrganization = ref(null)
|
239
|
+
const orderOrganization = ref(null)
|
240
|
+
|
241
|
+
const statuses = ['created', 'confirmed', 'packing', 'in delivery', 'delivered'];
|
242
|
+
const statusLabels = ['Order Confirming', 'Order Confirmed', 'Packing', 'In Delivery', 'Delivered'];
|
243
|
+
|
244
|
+
const isActiveStatus = (index) => {
|
245
|
+
return statuses.slice(index).includes(order.value.status);
|
246
|
+
};
|
247
|
+
|
248
|
+
// description: 'Your order has been successfully created. Our manager will contact you within five minutes to confirm your order.'
|
249
|
+
// description: 'Your order has been confirmed. We are now processing your items and preparing them for shipment.'
|
250
|
+
// description: 'Your order is now awaiting shipment. Once shipped, you will receive a notification with tracking information.'
|
251
|
+
// description: 'Your order is now awaiting shipment. Once shipped, you will receive a notification with tracking information.'
|
252
|
+
// description: 'Your order is currently in transit. Our delivery team is working hard to get your items to you as soon as possible.'
|
253
|
+
// description: 'Congratulations! Your order has been successfully delivered. If you have any concerns or feedback, feel free to contact us.'
|
254
|
+
|
255
|
+
|
256
|
+
const isOpeStatusPopup = ref(false);
|
257
|
+
const selectedMember = ref(null);
|
258
|
+
const orderProducts = ref([]);
|
259
|
+
|
260
|
+
function openStatusPopup(member) {
|
261
|
+
isOpeStatusPopup.value = true;
|
262
|
+
if (typeof member === "number") selectedMember.value = member;
|
263
|
+
}
|
264
|
+
|
265
|
+
function closeStatusPopup() {
|
266
|
+
isOpeStatusPopup.value = false;
|
267
|
+
selectedMember.value = null;
|
268
|
+
}
|
269
|
+
|
270
|
+
onMounted(async()=>{
|
271
|
+
order.value = await orders.actions.read({_id: route.params.order})
|
272
|
+
order.value = order.value[0]
|
273
|
+
|
274
|
+
productsOrganization.value = await products.actions.read({
|
275
|
+
organization: order.value.owner.target._id,
|
276
|
+
limit: 1000,
|
277
|
+
});
|
278
|
+
|
279
|
+
console.log(productsOrganization.value)
|
280
|
+
|
281
|
+
const productsMap = productsOrganization.value.reduce((map, product) => {
|
282
|
+
map[product._id] = product;
|
283
|
+
return map;
|
284
|
+
}, {});
|
285
|
+
|
286
|
+
console.log(productsMap)
|
287
|
+
|
288
|
+
// Сопоставление продуктов с позициями заказа
|
289
|
+
orderProducts.value = order.value.positions.map(({ _id, quantity }) => {
|
290
|
+
const product = productsMap[_id];
|
291
|
+
return {
|
292
|
+
name: product.name,
|
293
|
+
images: product.images,
|
294
|
+
price: product.price,
|
295
|
+
_id: product._id,
|
296
|
+
quantity
|
297
|
+
};
|
298
|
+
});
|
299
|
+
|
300
|
+
orderOrganization.value = await organizations.actions.read({
|
301
|
+
_id: order.value?.owner.target._id,
|
302
|
+
location: globals.state.position?.location,
|
303
|
+
});
|
304
|
+
|
305
|
+
})
|
306
|
+
|
307
|
+
let cartTotalPrice = computed(() => {
|
308
|
+
return Number(order.value?.positions.reduce((total, product) => {
|
309
|
+
return total + product.price * product.quantity;
|
310
|
+
}, 0));
|
311
|
+
})
|
312
|
+
|
313
|
+
let cartTotalAmount = computed(() => {
|
314
|
+
return Number(order.value?.positions.reduce((total, product) => {
|
315
|
+
return total + product.quantity;
|
316
|
+
}, 0));
|
317
|
+
})
|
318
|
+
|
319
|
+
// Функция установки нового статуса
|
320
|
+
async function setStatus (newStatus) {
|
321
|
+
orders.state.current.status = newStatus
|
322
|
+
|
323
|
+
await orders.actions.update(orders.state.current)
|
324
|
+
}
|
325
|
+
|
326
|
+
function getNextStatus(currentStatus) {
|
327
|
+
const currentIndex = statuses.indexOf(currentStatus);
|
328
|
+
|
329
|
+
if (currentIndex !== -1 && currentIndex + 1 < statuses.length) {
|
330
|
+
return statuses[currentIndex + 1];
|
331
|
+
}
|
332
|
+
return null; // Если следующий статус не существует
|
333
|
+
}
|
334
|
+
|
335
|
+
function getStatusLabel(status) {
|
336
|
+
const index = statuses.indexOf(status);
|
337
|
+
|
338
|
+
return status ? statusLabels[index] : "";
|
339
|
+
}
|
340
|
+
async function setNextStatus() {
|
341
|
+
const nextStatus = getNextStatus(orders.state.current.status);
|
342
|
+
|
343
|
+
if (nextStatus) {
|
344
|
+
orders.state.current.status = nextStatus;
|
345
|
+
|
346
|
+
await orders.actions.update(orders.state.current)
|
347
|
+
} else {
|
348
|
+
console.error('Next status is void. Must handle somehow.');
|
349
|
+
}
|
350
|
+
|
351
|
+
closeStatusPopup()
|
352
|
+
}
|
353
|
+
|
354
|
+
|
355
|
+
function requestPayment(order) {
|
356
|
+
// store.dispatch("payments/newPayment", order);
|
357
|
+
}
|
358
|
+
|
359
|
+
function calculateDeliveryTime(distance, date) {
|
360
|
+
if (!distance) {
|
361
|
+
return null;
|
362
|
+
}
|
363
|
+
|
364
|
+
const basePreparationTime = 10 * 60 * 1000; // Convert to milliseconds
|
365
|
+
const travelTime = Math.ceil((15 + 5 + 3 * distance) / 5) * 5 * 60 * 1000;
|
366
|
+
|
367
|
+
// Преобразование даты начала в миллисекунды и добавление времени подготовки и доставки
|
368
|
+
const startTime = new Date(date).getTime();
|
369
|
+
const estimatedDeliveryTime = new Date(startTime + basePreparationTime + travelTime);
|
370
|
+
|
371
|
+
console.log(date)
|
372
|
+
console.log(estimatedDeliveryTime)
|
373
|
+
|
374
|
+
return estimatedDeliveryTime;
|
375
|
+
}
|
376
|
+
|
377
|
+
|
378
|
+
</script>
|
379
|
+
|
380
|
+
<style lang="scss" scoped>
|
381
|
+
.blink {
|
382
|
+
animation: blink-animation 1s ease infinite;
|
383
|
+
}
|
384
|
+
|
385
|
+
@keyframes blink-animation {
|
386
|
+
0%, 100% {
|
387
|
+
opacity: 1;
|
388
|
+
}
|
389
|
+
50% {
|
390
|
+
opacity: 0.8;
|
391
|
+
}
|
392
|
+
}
|
393
|
+
</style>
|
@@ -22,7 +22,7 @@
|
|
22
22
|
class="order-form col"
|
23
23
|
>
|
24
24
|
<FormCustomerDetails
|
25
|
-
:
|
25
|
+
:customer="orders.state.current.customer"
|
26
26
|
/>
|
27
27
|
<FormDelivery
|
28
28
|
v-if="orders.state.current.status !== true && shopcart.state.positions.length > 0"
|
@@ -148,7 +148,6 @@ const cartTotalPrice = computed(() => shopcart.getters.cartTotalPrice)
|
|
148
148
|
// Organization
|
149
149
|
const orderOrganization = ref({})
|
150
150
|
|
151
|
-
import Radio from '@pf/src/components/Radio/Radio.vue'
|
152
151
|
|
153
152
|
onMounted(async()=> {
|
154
153
|
orderOrganization.value = await organizations.actions.read({
|
@@ -201,14 +200,14 @@ async function handleCreate() {
|
|
201
200
|
orders.state.current.status = 'created';
|
202
201
|
|
203
202
|
orders.state.current.owner = {
|
204
|
-
target:
|
203
|
+
target: shopcart.state.organization,
|
205
204
|
type: 'organization'
|
206
205
|
}
|
207
206
|
|
208
207
|
if (auth.state.user._id) {
|
209
208
|
orders.state.current.creator = {
|
210
209
|
target: auth.state.user._id,
|
211
|
-
type: '
|
210
|
+
type: 'User'
|
212
211
|
}
|
213
212
|
}
|
214
213
|
|
@@ -223,6 +222,8 @@ async function handleCreate() {
|
|
223
222
|
let order = await orders.actions.create(orders.state.current);
|
224
223
|
|
225
224
|
if (order) {
|
225
|
+
shopcart.actions.resetShopcart()
|
226
|
+
|
226
227
|
router.push({
|
227
228
|
name: 'Order Status',
|
228
229
|
params: {
|
@@ -27,12 +27,12 @@
|
|
27
27
|
<Popup
|
28
28
|
@close-popup="closeProductsPopup"
|
29
29
|
:isPopupOpen="isOpenProductsPopup"
|
30
|
-
class="bg-white w-min-30r w-max-30r radius-big pd-medium"
|
30
|
+
class="bg-white w-min-30r w-max-30r h-max-100 flex flex-column radius-big pd-medium pos-relative"
|
31
31
|
>
|
32
32
|
|
33
33
|
<h3 class="mn-b-small">Add to order</h3>
|
34
34
|
|
35
|
-
<div class="h-100
|
35
|
+
<div class="bg-grey h-max-100 mn-b-thin o-scroll pd-medium radius-big">
|
36
36
|
<Feed
|
37
37
|
:search="{
|
38
38
|
placeholder: 'Search products...',
|
@@ -221,7 +221,6 @@
|
|
221
221
|
|
222
222
|
import customers from '@pf/src/modules/orders/store/customers.store';
|
223
223
|
|
224
|
-
|
225
224
|
// Accessing router
|
226
225
|
const route = useRoute()
|
227
226
|
const router = useRouter()
|