@ozdao/prometheus-framework 0.2.91 → 0.2.93
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/events.server.js +19 -9
- package/dist/events.server.mjs +19 -9
- 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 +32 -18
- package/dist/orders.server.mjs +32 -18
- 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/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/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +66 -0
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
- 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/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +14 -48
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +85 -25
- 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 +74 -63
- package/dist/prometheus-framework/src/modules/landing/components/sections/SectionFeatures.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/landing/components/sections/SectionFeatures.vue.js +74 -0
- package/dist/prometheus-framework/src/modules/landing/landing.client.cjs +1 -1
- package/dist/prometheus-framework/src/modules/landing/landing.client.js +4 -2
- 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 +7 -9
- 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 +27 -25
- 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 +46 -43
- 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 +37 -26
- 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/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/components/layouts/layoutEvents.vue +2 -59
- package/src/modules/events/components/pages/Events.vue +106 -23
- package/src/modules/events/controllers/events.controller.js +10 -7
- package/src/modules/globals/components/blocks/CardHeader.vue +31 -6
- 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/landing.client.js +3 -1
- 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/components/sections/SubscribeNewsletter.vue +2 -2
- package/src/modules/orders/controllers/orders.controller.js +29 -18
- package/src/modules/orders/models/order.model.js +8 -2
- package/src/modules/orders/router/orders.backoffice.router.js +3 -5
- 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 +32 -22
- package/src/modules/products/components/pages/ProductEdit.vue +10 -13
- package/src/modules/products/components/pages/Products.vue +2 -0
- package/src/modules/products/components/sections/HeroRecommendation.vue +1 -1
- 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,57 +1,57 @@
|
|
1
|
-
import { ref as
|
1
|
+
import { ref as g, onMounted as V, computed as f, openBlock as d, createElementBlock as m, createElementVNode as e, toDisplayString as a, normalizeClass as v, createTextVNode as A, createCommentVNode as u, createBlock as y, unref as p, Fragment as B, renderList as U, createVNode as q, pushScopeId as H, popScopeId as W } from "vue";
|
2
2
|
import { useRouter as Y, useRoute as L } from "vue-router";
|
3
3
|
import j from "../blocks/CardOrderItem.vue.js";
|
4
4
|
import G from "../../../organizations/components/blocks/CardOrganization.vue.js";
|
5
5
|
import J from "../../../chats/components/pages/ChatPage.vue.js";
|
6
6
|
import K from "../blocks/StatusHistory.vue.js";
|
7
7
|
import { state as Q } from "../../../globals/store/globals.js";
|
8
|
-
import { actions as X, state as
|
8
|
+
import { actions as X, state as w } from "../../store/orders.js";
|
9
9
|
import { actions as Z } from "../../../products/store/products.js";
|
10
10
|
import { actions as ee } from "../../../organizations/store/organizations.js";
|
11
11
|
import "./Order.vue2.js";
|
12
12
|
import se from "../../../../../../_virtual/_plugin-vue_export-helper.js";
|
13
|
-
const
|
13
|
+
const l = (b) => (H("data-v-150d7ff5"), b = b(), W(), b), te = {
|
14
14
|
key: 0,
|
15
15
|
class: "pd-thin"
|
16
16
|
}, ae = {
|
17
17
|
key: 0,
|
18
18
|
class: "mn-b-thin pos-relative w-100 bg-main radius-big pd-big"
|
19
|
-
}, re = { class: "mn-b-small" }, ie = /* @__PURE__ */
|
19
|
+
}, re = { class: "mn-b-small" }, ie = /* @__PURE__ */ l(() => /* @__PURE__ */ e("p", { class: "mn-b-medium w-m-40r p-medium" }, "Your order has been successfully created. Our manager will contact you within five minutes to confirm your order.", -1)), ne = { class: "radius-extra mn-b-medium flex-nowrap flex h-1r pos-relativew-40r" }, le = { class: "pos-absolute pos-t-medium pos-r-medium t-medium p-medium" }, oe = { class: "p-small t-transp" }, de = {
|
20
20
|
key: 1,
|
21
21
|
class: "gap-thin cols-2"
|
22
|
-
}, ue = { class: "w-100" }, ce = { class: "mn-b-thin bg-grey w-100 o-hidden radius-medium" }, me = { class: "pd-small flex-nowrap flex" }, pe = { class: "mn-r-auto" }, _e = /* @__PURE__ */
|
22
|
+
}, ue = { class: "w-100" }, ce = { class: "mn-b-thin bg-grey w-100 o-hidden radius-medium" }, me = { class: "pd-small flex-nowrap flex" }, pe = { class: "mn-r-auto" }, _e = /* @__PURE__ */ l(() => /* @__PURE__ */ e("span", { class: "d-block t-medium p-medium" }, "Your order is", -1)), ve = { class: "t-lh-075 h2 d-block mn-b-small" }, be = /* @__PURE__ */ l(() => /* @__PURE__ */ e("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", -1)), he = { class: "pd-small cols-2 br-t br-black-transp-10 br-solid" }, ge = /* @__PURE__ */ l(() => /* @__PURE__ */ e("p", { class: "w-100 t-medium p-medium" }, " Phone ", -1)), fe = { class: "w-100 t-right" }, ye = {
|
23
23
|
key: 0,
|
24
24
|
class: "pd-small cols-2 br-t br-black-transp-10 br-solid"
|
25
|
-
}, we = { class: "w-100 t-medium p-medium" }, ke = { class: "w-100 t-right" }, xe = { class: "pd-small cols-2 br-t br-black-transp-10 br-solid" }, Oe = /* @__PURE__ */
|
25
|
+
}, we = { class: "w-100 t-medium p-medium" }, ke = { class: "w-100 t-right" }, xe = { class: "pd-small cols-2 br-t br-black-transp-10 br-solid" }, Oe = /* @__PURE__ */ l(() => /* @__PURE__ */ e("p", { class: "t-medium p-medium" }, " Address ", -1)), De = { class: "w-100 t-right" }, Ie = { class: "pd-small cols-2 br-t br-black-transp-10 br-solid" }, Ce = /* @__PURE__ */ l(() => /* @__PURE__ */ e("p", { class: "mn-b-small t-medium p-medium" }, " Delivery ", -1)), Ne = { class: "w-100 t-right mn-b-small" }, Me = {
|
26
26
|
key: 2,
|
27
27
|
class: "t-transp"
|
28
|
-
}, Se = { class: "bg-grey radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100" }, Te = /* @__PURE__ */
|
28
|
+
}, Se = { class: "bg-grey radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100" }, Te = /* @__PURE__ */ l(() => /* @__PURE__ */ e("h3", { class: "mn-b-small" }, "Order Summary", -1)), $e = { class: "flex gap-thin flex-column mn-b-semi" }, ze = { class: "mn-b-medium radius-small br-solid br-1px br-black-transp-10 w-100" }, Pe = { class: "pd-small br-solid br-b br-black-transp-10 flex" }, Ee = /* @__PURE__ */ l(() => /* @__PURE__ */ e("p", { class: "mn-r-auto t-transp" }, "In total", -1)), Fe = { class: "pd-small br-solid br-b br-black-transp-10 flex" }, Re = /* @__PURE__ */ l(() => /* @__PURE__ */ e("p", { class: "mn-r-auto t-transp" }, "Delivery", -1)), Ve = { class: "pd-small flex-bottom flex" }, Ae = /* @__PURE__ */ l(() => /* @__PURE__ */ e("p", { class: "mn-r-auto t-transp" }, "In total to pay", -1)), Be = { class: "p-big t-semi" }, Ue = /* @__PURE__ */ l(() => /* @__PURE__ */ e("h3", { class: "mn-b-small" }, "Chat With Us", -1)), qe = {
|
29
29
|
__name: "Order",
|
30
30
|
setup(b) {
|
31
31
|
Y();
|
32
|
-
const h = L(), s =
|
32
|
+
const h = L(), s = g(null), k = g(null), i = g(null);
|
33
33
|
V(async () => {
|
34
|
-
var t,
|
35
|
-
s.value = await X.read({ _id: h.params.order }), s.value = s.value[0],
|
34
|
+
var t, n, r;
|
35
|
+
s.value = await X.read({ _id: h.params.order }), s.value = s.value[0], k.value = await Z.read({
|
36
36
|
organization: (t = s.value) == null ? void 0 : t.owner.target._id
|
37
37
|
}), i.value = await ee.read({
|
38
|
-
_id: (
|
38
|
+
_id: (n = s.value) == null ? void 0 : n.owner.target._id,
|
39
39
|
location: (r = Q.position) == null ? void 0 : r.location
|
40
40
|
});
|
41
41
|
});
|
42
|
-
let x =
|
42
|
+
let x = f(() => {
|
43
43
|
var t;
|
44
|
-
return Number((t = s.value) == null ? void 0 : t.positions.reduce((
|
44
|
+
return Number((t = s.value) == null ? void 0 : t.positions.reduce((n, r) => n + r.price * r.quantity, 0));
|
45
45
|
});
|
46
|
-
|
46
|
+
f(() => {
|
47
47
|
var t;
|
48
|
-
return Number((t = s.value) == null ? void 0 : t.positions.reduce((
|
48
|
+
return Number((t = s.value) == null ? void 0 : t.positions.reduce((n, r) => n + r.quantity, 0));
|
49
49
|
});
|
50
|
-
let F =
|
50
|
+
let F = f(() => {
|
51
51
|
var t;
|
52
|
-
return (t = s.value) == null ? void 0 : t.positions.map(({ _id:
|
53
|
-
const o =
|
54
|
-
return
|
52
|
+
return (t = s.value) == null ? void 0 : t.positions.map(({ _id: n, quantity: r }) => {
|
53
|
+
const o = k.value.find((c) => c._id === n);
|
54
|
+
return {
|
55
55
|
name: o.name,
|
56
56
|
images: o.images,
|
57
57
|
price: o.price,
|
@@ -60,19 +60,19 @@ const n = (b) => (H("data-v-622bfaf9"), b = b(), W(), b), te = {
|
|
60
60
|
};
|
61
61
|
});
|
62
62
|
});
|
63
|
-
function R(t,
|
63
|
+
function R(t, n) {
|
64
64
|
if (!t)
|
65
65
|
return null;
|
66
|
-
const r = 10 * 60 * 1e3, o = Math.ceil((20 + 3 * t) / 5) * 5 * 60 * 1e3, c = new Date(
|
67
|
-
return console.log(
|
66
|
+
const r = 10 * 60 * 1e3, o = Math.ceil((20 + 3 * t) / 5) * 5 * 60 * 1e3, c = new Date(n).getTime(), _ = new Date(c + r + o);
|
67
|
+
return console.log(n), console.log(_), _;
|
68
68
|
}
|
69
|
-
return (t,
|
69
|
+
return (t, n) => {
|
70
70
|
var r, o, c, _, O, D, I, C, N, M, S, T, $, z, P;
|
71
71
|
return s.value && i.value ? (d(), m("div", te, [
|
72
72
|
s.value ? (d(), m("div", ae, [
|
73
73
|
e("h2", re, "Order is " + a(s.value.status), 1),
|
74
74
|
ie,
|
75
|
-
e("div",
|
75
|
+
e("div", ne, [
|
76
76
|
e("div", {
|
77
77
|
class: v([
|
78
78
|
"bg-grey br-anim br-glow radius-extra mn-r-thin h-100 w-20",
|
@@ -114,14 +114,14 @@ const n = (b) => (H("data-v-622bfaf9"), b = b(), W(), b), te = {
|
|
114
114
|
]),
|
115
115
|
e("p", null, "Estimated Arrival " + a(t.formatDate(R((r = i.value[0]) == null ? void 0 : r.distance, s.value.createdAt))), 1),
|
116
116
|
e("h3", null, a((o = i.value[0]) != null && o.distance ? Math.ceil((10 + 3 * ((c = i.value[0]) == null ? void 0 : c.distance)) / 5) * 5 + "-" + Math.ceil((20 + 3 * ((_ = i.value[0]) == null ? void 0 : _.distance)) / 5) * 5 + " MIN" : "Unavailable"), 1),
|
117
|
-
e("p",
|
117
|
+
e("p", le, [
|
118
118
|
A(" Order No: "),
|
119
119
|
e("span", oe, "#" + a(s.value._id), 1)
|
120
120
|
])
|
121
121
|
])) : u("", !0),
|
122
122
|
s.value ? (d(), m("div", de, [
|
123
123
|
e("div", ue, [
|
124
|
-
i.value[0] ? (d(),
|
124
|
+
i.value[0] ? (d(), y(G, {
|
125
125
|
key: 0,
|
126
126
|
organization: i.value[0],
|
127
127
|
showRating: !0,
|
@@ -154,10 +154,10 @@ const n = (b) => (H("data-v-622bfaf9"), b = b(), W(), b), te = {
|
|
154
154
|
e("p", Ne, a((M = s.value.delivery) == null ? void 0 : M.type), 1)
|
155
155
|
])
|
156
156
|
]),
|
157
|
-
|
157
|
+
w.current.status_history ? (d(), y(K, {
|
158
158
|
key: 1,
|
159
|
-
statusHistory:
|
160
|
-
statusCurrent:
|
159
|
+
statusHistory: w.current.status_history,
|
160
|
+
statusCurrent: w.current.status,
|
161
161
|
edit: p(h).name === "Order Edit"
|
162
162
|
}, null, 8, ["statusHistory", "statusCurrent", "edit"])) : u("", !0),
|
163
163
|
t.payment && t.payment.Status === "CONFIRMED" ? (d(), m("span", Me, "Paid")) : u("", !0)
|
@@ -165,7 +165,7 @@ const n = (b) => (H("data-v-622bfaf9"), b = b(), W(), b), te = {
|
|
165
165
|
e("div", Se, [
|
166
166
|
Te,
|
167
167
|
e("ul", $e, [
|
168
|
-
(d(!0), m(B, null, U(p(F), (E, He) => (d(),
|
168
|
+
(d(!0), m(B, null, U(p(F), (E, He) => (d(), y(j, {
|
169
169
|
key: E._id,
|
170
170
|
editable: !1,
|
171
171
|
product: E
|
@@ -196,7 +196,7 @@ const n = (b) => (H("data-v-622bfaf9"), b = b(), W(), b), te = {
|
|
196
196
|
])) : u("", !0);
|
197
197
|
};
|
198
198
|
}
|
199
|
-
}, ts = /* @__PURE__ */ se(qe, [["__scopeId", "data-v-
|
199
|
+
}, ts = /* @__PURE__ */ se(qe, [["__scopeId", "data-v-150d7ff5"]]);
|
200
200
|
export {
|
201
201
|
ts as default
|
202
202
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),q=require("vue-router"),z=require("../../../globals/components/sections/SectionPageTitle.vue.cjs"),T=require("../../../../components/Popup/Popup.vue.cjs"),F=require("../../../icons/entities/IconTime.vue.cjs"),P=require("../blocks/CardOrderItem.vue.cjs"),L=require("../../../organizations/components/blocks/CardOrganization.vue.cjs"),R=require("../../../chats/components/pages/ChatPage.vue.cjs"),A=require("../blocks/StatusHistory.vue.cjs"),H=require("../../../globals/store/globals.cjs"),c=require("../../store/orders.cjs"),U=require("../../../products/store/products.cjs"),W=require("../../../organizations/store/organizations.cjs");require("./OrderBackoffice.vue2.cjs");const j=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),r=b=>(e.pushScopeId("data-v-36d45d04"),b=b(),e.popScopeId(),b),Q={key:0,class:"pd-thin"},Y={key:0,class:"mn-b-thin pos-relative w-100 bg-main radius-big pd-big"},$={class:"mn-b-small flex-nowrap flex"},G=r(()=>e.createElementVNode("p",{class:"t-medium p-medium mn-r-auto"}," Progress ",-1)),J={class:"t-medium p-medium"},K={class:"p-small t-transp"},X=r(()=>e.createElementVNode("h2",{class:"mn-b-small"},null,-1)),Z={class:"radius-extra mn-b-medium flex-nowrap flex pos-relative"},ee={class:"flex-nowrap flex"},te={class:"w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-white-transp-20"},se={class:"t-medium mn-r-auto"},ae={class:"bg-grey radius-small pd-small mn-b-thin"},re={class:"bg-grey pd-small radius-small flex gap-thin flex-column mn-b-semi"},le={key:1,class:"gap-thin cols-2"},ne={class:"w-100"},oe={class:"mn-b-thin bg-grey w-100 o-hidden radius-medium"},ie={class:"pd-small flex-nowrap flex"},ce={class:"mn-r-auto"},de=r(()=>e.createElementVNode("span",{class:"d-block t-medium p-medium"},"Your order is",-1)),ue={class:"t-lh-075 h2 d-block mn-b-small"},me=r(()=>e.createElementVNode("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",-1)),pe=r(()=>e.createElementVNode("div",{class:"t-right"},[e.createTextVNode(" Cancel order"),e.createElementVNode("br"),e.createTextVNode(" Exchange item "),e.createElementVNode("hr",{class:"mn-b-thin mn-t-thin"}),e.createTextVNode(" For Delivery Queries Contact Us ")],-1)),_e={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},he=r(()=>e.createElementVNode("p",{class:"w-100 t-medium p-medium"}," Phone ",-1)),be={class:"w-100 t-right"},ge={key:0,class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},ve={class:"w-100 t-medium p-medium"},Ne={class:"w-100 t-right"},fe=r(()=>e.createElementVNode("div",{class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},[e.createElementVNode("p",{class:"t-medium p-medium"}," Address "),e.createElementVNode("p",{class:"w-100 t-right"})],-1)),Ve={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},Ee=r(()=>e.createElementVNode("p",{class:"mn-b-small t-medium p-medium"}," Delivery ",-1)),ye={class:"w-100 t-right mn-b-small"},ke={key:2,class:"t-transp"},we={class:"bg-grey radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100"},Se=r(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Order Summary",-1)),xe={class:"flex gap-thin flex-column mn-b-semi"},Ce={class:"mn-b-medium radius-small br-solid br-1px br-black-transp-10 w-100"},Be={class:"pd-small br-solid br-b br-black-transp-10 flex"},De=r(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total",-1)),Oe={class:"pd-small br-solid br-b br-black-transp-10 flex"},qe=r(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"Delivery",-1)),Pe={class:"pd-small flex-bottom flex"},Ie=r(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total to pay",-1)),Me={class:"p-big t-semi"},ze=r(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Chat With Us",-1)),Te={__name:"OrderBackoffice",setup(b){q.useRouter();const _=q.useRoute(),s=e.ref(null),g=e.ref(null),n=e.ref(null),o=["created","confirmed","packing","in delivery","delivered"],V=["Order Confirming","Order Confirmed","Packing","In Delivery","Delivered"],v=t=>o.slice(t).includes(s.value.status),N=e.ref(!1),E=e.ref(null),f=e.ref([]);function I(t){N.value=!0,typeof t=="number"&&(E.value=t)}function y(){N.value=!1,E.value=null}e.onMounted(async()=>{var a,l;s.value=await c.actions.read({_id:_.params.order}),s.value=s.value[0],g.value=await U.actions.read({organization:s.value.owner.target._id,limit:1e3}),console.log(g.value);const t=g.value.reduce((d,u)=>(d[u._id]=u,d),{});console.log(t),f.value=s.value.positions.map(({_id:d,quantity:u})=>{const m=t[d];return{name:m.name,images:m.images,price:m.price,_id:m._id,quantity:u}}),n.value=await W.actions.read({_id:(a=s.value)==null?void 0:a.owner.target._id,location:(l=H.state.position)==null?void 0:l.location})});let k=e.computed(()=>{var t;return Number((t=s.value)==null?void 0:t.positions.reduce((a,l)=>a+l.price*l.quantity,0))});e.computed(()=>{var t;return Number((t=s.value)==null?void 0:t.positions.reduce((a,l)=>a+l.quantity,0))});function h(t){const a=o.indexOf(t);return a!==-1&&a+1<o.length?o[a+1]:null}function w(t){const a=o.indexOf(t);return t?V[a]:""}async function M(){const t=h(c.state.current.status);t?(c.state.current.status=t,await c.actions.update(c.state.current)):console.error("Next status is void. Must handle somehow."),y()}return(t,a)=>{var l,d,u,m,S,x,C,B,D,O;return s.value&&n.value?(e.openBlock(),e.createElementBlock("div",Q,[e.createVNode(z.default,{title:`Order is ${s.value.status}`,class:"mn-b-small bg-grey bg-grey radius-big"},null,8,["title"]),s.value?(e.openBlock(),e.createElementBlock("div",Y,[e.createElementVNode("div",$,[G,e.createElementVNode("p",J,[e.createTextVNode(" Order No: "),e.createElementVNode("span",K,"#"+e.toDisplayString(s.value._id),1)])]),X,e.createElementVNode("div",Z,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(p,i)=>e.createElementVNode("div",{key:i,class:"mn-r-thin w-20"},[e.createElementVNode("div",{class:e.normalizeClass(["bg-grey br-anim br-glow radius-extra h-1r w-100",{"br-glow-anim":v(i)},{"t-transp":!v(i)},{blink:s.value.status===o[i]&&h(s.value.status)}])},null,2),e.createElementVNode("div",{class:e.normalizeClass([{"t-transp":!v(i)},"mn-t-thin t-medium uppercase"])},e.toDisplayString(V[i]),3)])),64))]),e.createElementVNode("div",ee,[e.createElementVNode("div",te,[e.createVNode(F.default,{class:"i-semi t-transp",fill:"rgb(var(--black)"}),e.createElementVNode("p",se,"Estimated Arrival "+e.toDisplayString(t.formatDate(s.value.deadline)),1)]),h(s.value.status)&&e.unref(_).name==="Order Edit"?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:I,class:"mn-l-auto bg-black t-white button"}," Mark as "+e.toDisplayString(w(h(s.value.status))),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createVNode(T.default,{title:"Change status",onClosePopup:y,isPopupOpen:N.value,class:"bg-white w-min-30r w-max-30r radius-big pd-big"},{default:e.withCtx(()=>[e.createElementVNode("p",ae,"Estimated Arrival "+e.toDisplayString(t.formatDate(s.value.deadline)),1),e.createElementVNode("ul",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(p,i)=>(e.openBlock(),e.createBlock(P.default,{key:p._id,editable:!1,product:p},null,8,["product"]))),128))]),e.createElementVNode("button",{onClick:M,class:"w-100 bg-black-small t-white button"},e.toDisplayString("Confirm Changing to "+w(h(s.value.status))),1)]),_:1},8,["isPopupOpen"]),s.value?(e.openBlock(),e.createElementBlock("div",le,[e.createElementVNode("div",ne,[n.value[0]?(e.openBlock(),e.createBlock(L.default,{key:0,organization:n.value[0],showRating:!0,showFollowers:!1,showProducts:!1,class:"bg-grey mn-b-thin w-100 o-hidden radius-big pd-small"},null,8,["organization"])):e.createCommentVNode("",!0),e.createElementVNode("div",oe,[e.createElementVNode("div",ie,[e.createElementVNode("div",ce,[de,e.createElementVNode("span",ue,e.toDisplayString(s.value.status),1),me]),pe]),e.createElementVNode("div",_e,[he,e.createElementVNode("p",be,e.toDisplayString((l=s.value.user)==null?void 0:l.number),1)]),(d=s.value.user)!=null&&d.messenger.type?(e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("p",ve,e.toDisplayString((u=s.value.user)==null?void 0:u.messenger.type),1),e.createElementVNode("p",Ne,e.toDisplayString((m=s.value.user)==null?void 0:m.messenger.value),1)])):e.createCommentVNode("",!0),fe,e.createElementVNode("div",Ve,[Ee,e.createElementVNode("p",ye,e.toDisplayString((S=s.value.delivery)==null?void 0:S.type),1)])]),c.state.current.status_history?(e.openBlock(),e.createBlock(A.default,{key:1,statuses:o,statusHistory:c.state.current.status_history,statusCurrent:c.state.current.status,edit:e.unref(_).name==="Order Edit"},null,8,["statusHistory","statusCurrent","edit"])):e.createCommentVNode("",!0),t.payment&&t.payment.Status==="CONFIRMED"?(e.openBlock(),e.createElementBlock("span",ke,"Paid")):e.createCommentVNode("",!0)]),e.createElementVNode("div",we,[Se,e.createElementVNode("ul",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(p,i)=>(e.openBlock(),e.createBlock(P.default,{key:p._id,editable:!1,product:p},null,8,["product"]))),128))]),e.createElementVNode("div",Ce,[e.createElementVNode("div",Be,[De,e.createElementVNode("p",null,e.toDisplayString(e.unref(k))+" "+e.toDisplayString(t.returnCurrency()),1)]),e.createElementVNode("div",Oe,[qe,e.createElementVNode("p",null,e.toDisplayString(t.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((x=n.value[0])==null?void 0:x.distance)-7,5*(((C=n.value[0])==null?void 0:C.distance)/10))),1)]),e.createElementVNode("div",Pe,[Ie,e.createElementVNode("p",Me,e.toDisplayString(t.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((B=n.value[0])==null?void 0:B.distance)-7,5*(((D=n.value[0])==null?void 0:D.distance)/10))+e.unref(k)),1)])]),ze,e.createVNode(R.default,{username:e.unref(_).name==="Order Status"?((O=s.value.user)==null?void 0:O.name)||"User":"Weeder Support",chatID:e.unref(_).params.order,class:"radius-semi bg-white o-hidden"},null,8,["username","chatID"])])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}},Fe=j.default(Te,[["__scopeId","data-v-36d45d04"]]);exports.default=Fe;
|
@@ -0,0 +1,242 @@
|
|
1
|
+
import { ref as v, onMounted as G, computed as q, openBlock as l, createElementBlock as o, createVNode as x, createElementVNode as s, createTextVNode as O, toDisplayString as a, Fragment as N, renderList as $, normalizeClass as H, unref as g, createCommentVNode as m, withCtx as J, createBlock as C, pushScopeId as K, popScopeId as X } from "vue";
|
2
|
+
import { useRouter as Z, useRoute as ss } from "vue-router";
|
3
|
+
import ts from "../../../globals/components/sections/SectionPageTitle.vue.js";
|
4
|
+
import es from "../../../../components/Popup/Popup.vue.js";
|
5
|
+
import as from "../../../icons/entities/IconTime.vue.js";
|
6
|
+
import W from "../blocks/CardOrderItem.vue.js";
|
7
|
+
import rs from "../../../organizations/components/blocks/CardOrganization.vue.js";
|
8
|
+
import ls from "../../../chats/components/pages/ChatPage.vue.js";
|
9
|
+
import ns from "../blocks/StatusHistory.vue.js";
|
10
|
+
import { state as is } from "../../../globals/store/globals.js";
|
11
|
+
import { actions as Q, state as f } from "../../store/orders.js";
|
12
|
+
import { actions as os } from "../../../products/store/products.js";
|
13
|
+
import { actions as us } from "../../../organizations/store/organizations.js";
|
14
|
+
import "./OrderBackoffice.vue2.js";
|
15
|
+
import ds from "../../../../../../_virtual/_plugin-vue_export-helper.js";
|
16
|
+
const n = (k) => (K("data-v-36d45d04"), k = k(), X(), k), cs = {
|
17
|
+
key: 0,
|
18
|
+
class: "pd-thin"
|
19
|
+
}, ms = {
|
20
|
+
key: 0,
|
21
|
+
class: "mn-b-thin pos-relative w-100 bg-main radius-big pd-big"
|
22
|
+
}, ps = { class: "mn-b-small flex-nowrap flex" }, _s = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "t-medium p-medium mn-r-auto" }, " Progress ", -1)), hs = { class: "t-medium p-medium" }, bs = { class: "p-small t-transp" }, vs = /* @__PURE__ */ n(() => /* @__PURE__ */ s("h2", { class: "mn-b-small" }, null, -1)), gs = { class: "radius-extra mn-b-medium flex-nowrap flex pos-relative" }, fs = { class: "flex-nowrap flex" }, ys = { class: "w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-white-transp-20" }, ws = { class: "t-medium mn-r-auto" }, ks = { class: "bg-grey radius-small pd-small mn-b-thin" }, xs = { class: "bg-grey pd-small radius-small flex gap-thin flex-column mn-b-semi" }, Cs = {
|
23
|
+
key: 1,
|
24
|
+
class: "gap-thin cols-2"
|
25
|
+
}, Os = { class: "w-100" }, Ss = { class: "mn-b-thin bg-grey w-100 o-hidden radius-medium" }, Ps = { class: "pd-small flex-nowrap flex" }, Is = { class: "mn-r-auto" }, Ds = /* @__PURE__ */ n(() => /* @__PURE__ */ s("span", { class: "d-block t-medium p-medium" }, "Your order is", -1)), Ns = { class: "t-lh-075 h2 d-block mn-b-small" }, $s = /* @__PURE__ */ n(() => /* @__PURE__ */ s("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", -1)), Es = /* @__PURE__ */ n(() => /* @__PURE__ */ s("div", { class: "t-right" }, [
|
26
|
+
/* @__PURE__ */ O(" Cancel order"),
|
27
|
+
/* @__PURE__ */ s("br"),
|
28
|
+
/* @__PURE__ */ O(" Exchange item "),
|
29
|
+
/* @__PURE__ */ s("hr", { class: "mn-b-thin mn-t-thin" }),
|
30
|
+
/* @__PURE__ */ O(" For Delivery Queries Contact Us ")
|
31
|
+
], -1)), Ms = { class: "pd-small cols-2 br-t br-black-transp-10 br-solid" }, zs = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "w-100 t-medium p-medium" }, " Phone ", -1)), Bs = { class: "w-100 t-right" }, Fs = {
|
32
|
+
key: 0,
|
33
|
+
class: "pd-small cols-2 br-t br-black-transp-10 br-solid"
|
34
|
+
}, As = { class: "w-100 t-medium p-medium" }, Rs = { class: "w-100 t-right" }, Vs = /* @__PURE__ */ n(() => /* @__PURE__ */ s("div", { class: "pd-small cols-2 br-t br-black-transp-10 br-solid" }, [
|
35
|
+
/* @__PURE__ */ s("p", { class: "t-medium p-medium" }, " Address "),
|
36
|
+
/* @__PURE__ */ s("p", { class: "w-100 t-right" })
|
37
|
+
], -1)), Ls = { class: "pd-small cols-2 br-t br-black-transp-10 br-solid" }, Ts = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "mn-b-small t-medium p-medium" }, " Delivery ", -1)), Us = { class: "w-100 t-right mn-b-small" }, qs = {
|
38
|
+
key: 2,
|
39
|
+
class: "t-transp"
|
40
|
+
}, Hs = { class: "bg-grey radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100" }, Ws = /* @__PURE__ */ n(() => /* @__PURE__ */ s("h3", { class: "mn-b-small" }, "Order Summary", -1)), Qs = { class: "flex gap-thin flex-column mn-b-semi" }, Ys = { class: "mn-b-medium radius-small br-solid br-1px br-black-transp-10 w-100" }, js = { class: "pd-small br-solid br-b br-black-transp-10 flex" }, Gs = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "mn-r-auto t-transp" }, "In total", -1)), Js = { class: "pd-small br-solid br-b br-black-transp-10 flex" }, Ks = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "mn-r-auto t-transp" }, "Delivery", -1)), Xs = { class: "pd-small flex-bottom flex" }, Zs = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "mn-r-auto t-transp" }, "In total to pay", -1)), st = { class: "p-big t-semi" }, tt = /* @__PURE__ */ n(() => /* @__PURE__ */ s("h3", { class: "mn-b-small" }, "Chat With Us", -1)), et = {
|
41
|
+
__name: "OrderBackoffice",
|
42
|
+
setup(k) {
|
43
|
+
Z();
|
44
|
+
const y = ss(), e = v(null), S = v(null), u = v(null), d = ["created", "confirmed", "packing", "in delivery", "delivered"], E = ["Order Confirming", "Order Confirmed", "Packing", "In Delivery", "Delivered"], P = (t) => d.slice(t).includes(e.value.status), I = v(!1), M = v(null), D = v([]);
|
45
|
+
function Y(t) {
|
46
|
+
I.value = !0, typeof t == "number" && (M.value = t);
|
47
|
+
}
|
48
|
+
function z() {
|
49
|
+
I.value = !1, M.value = null;
|
50
|
+
}
|
51
|
+
G(async () => {
|
52
|
+
var r, i;
|
53
|
+
e.value = await Q.read({ _id: y.params.order }), e.value = e.value[0], S.value = await os.read({
|
54
|
+
organization: e.value.owner.target._id,
|
55
|
+
limit: 1e3
|
56
|
+
}), console.log(S.value);
|
57
|
+
const t = S.value.reduce((p, _) => (p[_._id] = _, p), {});
|
58
|
+
console.log(t), D.value = e.value.positions.map(({ _id: p, quantity: _ }) => {
|
59
|
+
const h = t[p];
|
60
|
+
return {
|
61
|
+
name: h.name,
|
62
|
+
images: h.images,
|
63
|
+
price: h.price,
|
64
|
+
_id: h._id,
|
65
|
+
quantity: _
|
66
|
+
};
|
67
|
+
}), u.value = await us.read({
|
68
|
+
_id: (r = e.value) == null ? void 0 : r.owner.target._id,
|
69
|
+
location: (i = is.position) == null ? void 0 : i.location
|
70
|
+
});
|
71
|
+
});
|
72
|
+
let B = q(() => {
|
73
|
+
var t;
|
74
|
+
return Number((t = e.value) == null ? void 0 : t.positions.reduce((r, i) => r + i.price * i.quantity, 0));
|
75
|
+
});
|
76
|
+
q(() => {
|
77
|
+
var t;
|
78
|
+
return Number((t = e.value) == null ? void 0 : t.positions.reduce((r, i) => r + i.quantity, 0));
|
79
|
+
});
|
80
|
+
function w(t) {
|
81
|
+
const r = d.indexOf(t);
|
82
|
+
return r !== -1 && r + 1 < d.length ? d[r + 1] : null;
|
83
|
+
}
|
84
|
+
function F(t) {
|
85
|
+
const r = d.indexOf(t);
|
86
|
+
return t ? E[r] : "";
|
87
|
+
}
|
88
|
+
async function j() {
|
89
|
+
const t = w(f.current.status);
|
90
|
+
t ? (f.current.status = t, await Q.update(f.current)) : console.error("Next status is void. Must handle somehow."), z();
|
91
|
+
}
|
92
|
+
return (t, r) => {
|
93
|
+
var i, p, _, h, A, R, V, L, T, U;
|
94
|
+
return e.value && u.value ? (l(), o("div", cs, [
|
95
|
+
x(ts, {
|
96
|
+
title: `Order is ${e.value.status}`,
|
97
|
+
class: "mn-b-small bg-grey bg-grey radius-big"
|
98
|
+
}, null, 8, ["title"]),
|
99
|
+
e.value ? (l(), o("div", ms, [
|
100
|
+
s("div", ps, [
|
101
|
+
_s,
|
102
|
+
s("p", hs, [
|
103
|
+
O(" Order No: "),
|
104
|
+
s("span", bs, "#" + a(e.value._id), 1)
|
105
|
+
])
|
106
|
+
]),
|
107
|
+
vs,
|
108
|
+
s("div", gs, [
|
109
|
+
(l(), o(N, null, $(d, (b, c) => s("div", {
|
110
|
+
key: c,
|
111
|
+
class: "mn-r-thin w-20"
|
112
|
+
}, [
|
113
|
+
s("div", {
|
114
|
+
class: H([
|
115
|
+
"bg-grey br-anim br-glow radius-extra h-1r w-100",
|
116
|
+
{ "br-glow-anim": P(c) },
|
117
|
+
{ "t-transp": !P(c) },
|
118
|
+
{ blink: e.value.status === d[c] && w(e.value.status) }
|
119
|
+
])
|
120
|
+
}, null, 2),
|
121
|
+
s("div", {
|
122
|
+
class: H([{ "t-transp": !P(c) }, "mn-t-thin t-medium uppercase"])
|
123
|
+
}, a(E[c]), 3)
|
124
|
+
])), 64))
|
125
|
+
]),
|
126
|
+
s("div", fs, [
|
127
|
+
s("div", ys, [
|
128
|
+
x(as, {
|
129
|
+
class: "i-semi t-transp",
|
130
|
+
fill: "rgb(var(--black)"
|
131
|
+
}),
|
132
|
+
s("p", ws, "Estimated Arrival " + a(t.formatDate(e.value.deadline)), 1)
|
133
|
+
]),
|
134
|
+
w(e.value.status) && g(y).name === "Order Edit" ? (l(), o("button", {
|
135
|
+
key: 0,
|
136
|
+
onClick: Y,
|
137
|
+
class: "mn-l-auto bg-black t-white button"
|
138
|
+
}, " Mark as " + a(F(w(e.value.status))), 1)) : m("", !0)
|
139
|
+
])
|
140
|
+
])) : m("", !0),
|
141
|
+
x(es, {
|
142
|
+
title: "Change status",
|
143
|
+
onClosePopup: z,
|
144
|
+
isPopupOpen: I.value,
|
145
|
+
class: "bg-white w-min-30r w-max-30r radius-big pd-big"
|
146
|
+
}, {
|
147
|
+
default: J(() => [
|
148
|
+
s("p", ks, "Estimated Arrival " + a(t.formatDate(e.value.deadline)), 1),
|
149
|
+
s("ul", xs, [
|
150
|
+
(l(!0), o(N, null, $(D.value, (b, c) => (l(), C(W, {
|
151
|
+
key: b._id,
|
152
|
+
editable: !1,
|
153
|
+
product: b
|
154
|
+
}, null, 8, ["product"]))), 128))
|
155
|
+
]),
|
156
|
+
s("button", {
|
157
|
+
onClick: j,
|
158
|
+
class: "w-100 bg-black-small t-white button"
|
159
|
+
}, a("Confirm Changing to " + F(w(e.value.status))), 1)
|
160
|
+
]),
|
161
|
+
_: 1
|
162
|
+
}, 8, ["isPopupOpen"]),
|
163
|
+
e.value ? (l(), o("div", Cs, [
|
164
|
+
s("div", Os, [
|
165
|
+
u.value[0] ? (l(), C(rs, {
|
166
|
+
key: 0,
|
167
|
+
organization: u.value[0],
|
168
|
+
showRating: !0,
|
169
|
+
showFollowers: !1,
|
170
|
+
showProducts: !1,
|
171
|
+
class: "bg-grey mn-b-thin w-100 o-hidden radius-big pd-small"
|
172
|
+
}, null, 8, ["organization"])) : m("", !0),
|
173
|
+
s("div", Ss, [
|
174
|
+
s("div", Ps, [
|
175
|
+
s("div", Is, [
|
176
|
+
Ds,
|
177
|
+
s("span", Ns, a(e.value.status), 1),
|
178
|
+
$s
|
179
|
+
]),
|
180
|
+
Es
|
181
|
+
]),
|
182
|
+
s("div", Ms, [
|
183
|
+
zs,
|
184
|
+
s("p", Bs, a((i = e.value.user) == null ? void 0 : i.number), 1)
|
185
|
+
]),
|
186
|
+
(p = e.value.user) != null && p.messenger.type ? (l(), o("div", Fs, [
|
187
|
+
s("p", As, a((_ = e.value.user) == null ? void 0 : _.messenger.type), 1),
|
188
|
+
s("p", Rs, a((h = e.value.user) == null ? void 0 : h.messenger.value), 1)
|
189
|
+
])) : m("", !0),
|
190
|
+
Vs,
|
191
|
+
s("div", Ls, [
|
192
|
+
Ts,
|
193
|
+
s("p", Us, a((A = e.value.delivery) == null ? void 0 : A.type), 1)
|
194
|
+
])
|
195
|
+
]),
|
196
|
+
f.current.status_history ? (l(), C(ns, {
|
197
|
+
key: 1,
|
198
|
+
statuses: d,
|
199
|
+
statusHistory: f.current.status_history,
|
200
|
+
statusCurrent: f.current.status,
|
201
|
+
edit: g(y).name === "Order Edit"
|
202
|
+
}, null, 8, ["statusHistory", "statusCurrent", "edit"])) : m("", !0),
|
203
|
+
t.payment && t.payment.Status === "CONFIRMED" ? (l(), o("span", qs, "Paid")) : m("", !0)
|
204
|
+
]),
|
205
|
+
s("div", Hs, [
|
206
|
+
Ws,
|
207
|
+
s("ul", Qs, [
|
208
|
+
(l(!0), o(N, null, $(D.value, (b, c) => (l(), C(W, {
|
209
|
+
key: b._id,
|
210
|
+
editable: !1,
|
211
|
+
product: b
|
212
|
+
}, null, 8, ["product"]))), 128))
|
213
|
+
]),
|
214
|
+
s("div", Ys, [
|
215
|
+
s("div", js, [
|
216
|
+
Gs,
|
217
|
+
s("p", null, a(g(B)) + " " + a(t.returnCurrency()), 1)
|
218
|
+
]),
|
219
|
+
s("div", Js, [
|
220
|
+
Ks,
|
221
|
+
s("p", null, a(t.returnCurrency()) + " " + a(Math.trunc(100 + 20 * ((R = u.value[0]) == null ? void 0 : R.distance) - 7, 5 * (((V = u.value[0]) == null ? void 0 : V.distance) / 10))), 1)
|
222
|
+
]),
|
223
|
+
s("div", Xs, [
|
224
|
+
Zs,
|
225
|
+
s("p", st, a(t.returnCurrency()) + " " + a(Math.trunc(100 + 20 * ((L = u.value[0]) == null ? void 0 : L.distance) - 7, 5 * (((T = u.value[0]) == null ? void 0 : T.distance) / 10)) + g(B)), 1)
|
226
|
+
])
|
227
|
+
]),
|
228
|
+
tt,
|
229
|
+
x(ls, {
|
230
|
+
username: g(y).name === "Order Status" ? ((U = e.value.user) == null ? void 0 : U.name) || "User" : "Weeder Support",
|
231
|
+
chatID: g(y).params.order,
|
232
|
+
class: "radius-semi bg-white o-hidden"
|
233
|
+
}, null, 8, ["username", "chatID"])
|
234
|
+
])
|
235
|
+
])) : m("", !0)
|
236
|
+
])) : m("", !0);
|
237
|
+
};
|
238
|
+
}
|
239
|
+
}, gt = /* @__PURE__ */ ds(et, [["__scopeId", "data-v-36d45d04"]]);
|
240
|
+
export {
|
241
|
+
gt as default
|
242
|
+
};
|
package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.cjs
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),V=require("../blocks/CardOrderItem.vue.cjs"),N=require("../sections/AskToLogin.vue.cjs"),q=require("../sections/Succes.vue.cjs"),E=require("../sections/EmptyState.vue.cjs"),S=require("../sections/FormCustomerDetails.vue.cjs"),P=require("../sections/FormDelivery.vue.cjs"),D=require("../sections/FormPayment.vue.cjs"),
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),V=require("../blocks/CardOrderItem.vue.cjs"),N=require("../sections/AskToLogin.vue.cjs"),q=require("../sections/Succes.vue.cjs"),E=require("../sections/EmptyState.vue.cjs"),S=require("../sections/FormCustomerDetails.vue.cjs"),P=require("../sections/FormDelivery.vue.cjs"),D=require("../sections/FormPayment.vue.cjs"),g=require("vue-router"),w=require("../../../globals/store/globals.cjs"),m=require("../../../auth/store/auth.cjs"),o=require("../../store/shopcart.cjs"),y=require("../../../organizations/store/organizations.cjs"),t=require("../../store/orders.cjs"),M=require("../../../users/store/users.cjs");require("./OrderCreate.vue2.cjs");const O={class:"pd-thin"},T={class:"gap-small mn-b-thin cols-2"},z={key:2,class:"order-form col"},F={key:3},I=e.createElementVNode("p",{class:"p-big mn-b-small"},"Your Order",-1),R={class:"mn-b-semi"},A={style:{"border-bottom":"1px solid #f7f7f7","border-top":"1px solid #f7f7f7"},class:"pd-b-medium pd-t-medium mn-b-medium"},G={class:"mn-b-thin"},L={class:"mn-b-thin"},Q={class:"h3"},j=e.createElementVNode("p",{class:"mn-b-thin"}," By making this purchase you agree to the General Terms and Conditions. ",-1),U=e.createElementVNode("p",{class:"mn-b-small"}," I agree that placing the order places me under an obligation to make a payment in accordance with the General Terms and Conditions. ",-1),Y=["disabled"],$={__name:"OrderCreate",setup(H){g.useRoute();const _=g.useRouter(),p=e.computed(()=>t.state.current);e.computed(()=>M.state.current);const h=e.computed(()=>o.getters.cartTotalPrice),n=e.ref({});e.onMounted(async()=>{var r;n.value=await y.actions.read({_id:o.state.organization,location:(r=w.state.position)==null?void 0:r.location})}),e.watch(()=>t.state.current.delivery.address,async(r,s)=>{n.value=await y.actions.read({_id:o.state.organization,location:t.state.current.delivery.location})},{deep:!0});const v=e.computed(()=>{var r;return((r=t.state.current.customer.name)==null?void 0:r.length)<2}),k=e.computed(()=>{var c,u,i,a;const r=(c=t.state.current.customer.messenger)==null?void 0:c.type,s=((i=(u=t.state.current.customer.messenger)==null?void 0:u.value)==null?void 0:i.length)>2;return!(((a=t.state.current.customer.number)==null?void 0:a.length)>0)&&!(r&&s)}),f=e.computed(()=>t.state.current.delivery.type!=="Pickup"&&t.state.current.delivery.address<2),b=e.computed(()=>!t.state.current.delivery.type),B=e.computed(()=>!t.state.current.payment.type);async function C(){t.state.current.status="created",t.state.current.owner={target:o.state.organization,type:"organization"},m.state.user._id&&(t.state.current.creator={target:m.state.user._id,type:"User"}),t.state.current.positions=o.state.positions;const r=localStorage.getItem("referalCode");r&&(t.state.current.referralCode=r);let s=await t.actions.create(t.state.current);s?(o.actions.resetShopcart(),_.push({name:"Order Status",params:{order:s._id}})):alert("something wrong")}return(r,s)=>{var d,c,u,i;return e.openBlock(),e.createElementBlock("section",O,[m.state.access.status===!1?(e.openBlock(),e.createBlock(N.default,{key:0,class:"mn-b-big"})):e.createCommentVNode("",!0),e.createElementVNode("div",T,[o.state.positions<1?(e.openBlock(),e.createBlock(E.default,{key:0})):e.createCommentVNode("",!0),p.value.status===!0&&o.state.positions.length>0?(e.openBlock(),e.createBlock(q.default,{key:1,order:p.value},null,8,["order"])):e.createCommentVNode("",!0),t.state.current.status!==!0&&o.state.positions.length>0?(e.openBlock(),e.createElementBlock("div",z,[e.createVNode(S.default,{customer:t.state.current.customer},null,8,["customer"]),t.state.current.status!==!0&&o.state.positions.length>0?(e.openBlock(),e.createBlock(P.default,{key:0,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),t.state.current.status!==!0&&o.state.positions.length>0?(e.openBlock(),e.createBlock(D.default,{key:1,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),o.state.positions.length>0?(e.openBlock(),e.createElementBlock("div",F,[I,e.createElementVNode("ul",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.state.positions,a=>(e.openBlock(),e.createBlock(V.default,{key:a._id,editable:"true",product:a,increase:l=>o.actions.incrementItemQuantity(l._id),decrease:l=>o.actions.decrementItemQuantity(l._id),remove:l=>o.actions.removeProduct(l._id)},null,8,["product","increase","decrease","remove"]))),128))]),e.createElementVNode("div",A,[e.createElementVNode("p",G," Subtotal: "+e.toDisplayString(r.returnCurrency())+" "+e.toDisplayString(h.value),1),e.createElementVNode("p",L," Delivery: "+e.toDisplayString(r.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((d=n.value[0])==null?void 0:d.distance)-7,5*(((c=n.value[0])==null?void 0:c.distance)/10))),1),e.createElementVNode("p",Q," Total: "+e.toDisplayString(r.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((u=n.value[0])==null?void 0:u.distance)-7,5*(((i=n.value[0])==null?void 0:i.distance)/10))+h.value.value),1)]),j,U,t.state.current.status!==!0&&o.state.positions.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:v.value||k.value||r.errorCity||f.value||b.value||B.value,onClick:s[0]||(s[0]=a=>C()),class:"bg-main pd-small radius-big w-100 button"}," Place an Order ",8,Y)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])}}};exports.default=$;
|