@ozdao/martyrs 0.2.473 → 0.2.474
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Media-DW8RLbfM.js → Media-_vz04tII.js} +1 -1
- package/dist/{Media-y_TX6us_.mjs → Media-sGk7Bp9b.mjs} +1 -1
- package/dist/auth.server.js +6 -2
- package/dist/auth.server.mjs +6 -2
- package/dist/authJwt-CELQKF2s.js +82 -0
- package/dist/authJwt-DnXu3BFq.mjs +83 -0
- package/dist/builder.js +7 -4
- package/dist/builder.mjs +7 -4
- package/dist/chats.server.js +1 -1
- package/dist/chats.server.mjs +1 -1
- package/dist/community.server.js +4 -4
- package/dist/community.server.mjs +4 -4
- package/dist/events.server.js +4 -4
- package/dist/events.server.mjs +4 -4
- package/dist/files.server.js +1 -1
- package/dist/files.server.mjs +1 -1
- package/dist/gallery.server.js +3 -3
- package/dist/gallery.server.mjs +3 -3
- package/dist/{globals.abac-DT0VjfaZ.js → globals.abac-Bn-4tbX8.js} +110 -16
- package/dist/{globals.abac-CvmZM8XG.mjs → globals.abac-DZpTRxKR.mjs} +110 -16
- package/dist/globals.server.js +70 -10
- package/dist/globals.server.mjs +70 -10
- package/dist/{globals.verifier-C_VZYebB.mjs → globals.verifier-BdJxc8-8.mjs} +34 -0
- package/dist/{globals.verifier-ChDpCdy_.js → globals.verifier-CKYpYfQl.js} +34 -0
- package/dist/{index-CVXl1rB5.js → index-BOmxJQ5W.js} +7 -86
- package/dist/{index-Df8vtZx7.mjs → index-C_Fw0Umg.mjs} +7 -86
- package/dist/{main-CgmHzhq5.mjs → main-CqMtW7Hq.mjs} +274 -276
- package/dist/{main-CCfQH-Dd.js → main-CsGkbSyK.js} +2 -2
- package/dist/martyrs/src/components/Select/Select.vue.cjs +4 -4
- package/dist/martyrs/src/components/Select/Select.vue.cjs.map +1 -1
- package/dist/martyrs/src/components/Select/Select.vue.js +4 -4
- package/dist/martyrs/src/components/Select/Select.vue.js.map +1 -1
- package/dist/martyrs/src/modules/community/community.client.js +27 -27
- package/dist/martyrs/src/modules/community/community.client.js.map +1 -1
- package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.cjs +2 -3
- package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.js +2 -3
- package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs +88 -27
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +89 -28
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/store/shopcart.cjs +1 -0
- package/dist/martyrs/src/modules/orders/store/shopcart.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/store/shopcart.js +1 -0
- package/dist/martyrs/src/modules/orders/store/shopcart.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs +19 -0
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +19 -0
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs +1 -0
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +1 -0
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs +2 -2
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/store/categories.cjs +2 -0
- package/dist/martyrs/src/modules/products/store/categories.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/store/categories.js +2 -0
- package/dist/martyrs/src/modules/products/store/categories.js.map +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs +30 -24
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +30 -24
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.cjs +807 -0
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +807 -0
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js.map +1 -0
- package/dist/martyrs/src/modules/spots/store/spots.cjs +4 -1
- package/dist/martyrs/src/modules/spots/store/spots.cjs.map +1 -1
- package/dist/martyrs/src/modules/spots/store/spots.js +4 -1
- package/dist/martyrs/src/modules/spots/store/spots.js.map +1 -1
- package/dist/martyrs.cjs.js +1 -1
- package/dist/martyrs.css +1 -1
- package/dist/martyrs.es.js +1 -1
- package/dist/notifications.server.js +1 -1
- package/dist/notifications.server.mjs +1 -1
- package/dist/orders.server.js +5 -4
- package/dist/orders.server.mjs +5 -4
- package/dist/organizations.server.js +120 -47
- package/dist/organizations.server.mjs +120 -47
- package/dist/{ownership.schema-C0w02Vw1.mjs → ownership.schema-CNCotD3D.mjs} +10 -4
- package/dist/{ownership.schema-Ck2H9clB.js → ownership.schema-MxfJlPtq.js} +10 -4
- package/dist/products.server.js +415 -149
- package/dist/products.server.mjs +415 -149
- package/dist/{profile.schema-h61hhB2w.js → profile.schema-BLSuV_VC.js} +0 -4
- package/dist/{profile.schema-kP_zKXNt.mjs → profile.schema-BRuvQ7QV.mjs} +0 -4
- package/dist/{queryProcessor-CWnMIe2U.mjs → queryProcessor-CVKI651_.mjs} +62 -8
- package/dist/{queryProcessor-D6GuKfTV.js → queryProcessor-DSUqSk3I.js} +62 -8
- package/dist/rents.server.js +4 -4
- package/dist/rents.server.mjs +4 -4
- package/dist/spots.server.js +162 -8
- package/dist/spots.server.mjs +162 -8
- package/dist/style.css +27 -4
- package/dist/wallet.server.js +2 -2
- package/dist/wallet.server.mjs +2 -2
- package/package.json +1 -1
- package/src/builder/rspack/rspack.config.base.js +1 -1
- package/src/builder/rspack/rspack.config.client.js +13 -5
- package/src/components/Select/Select.vue +4 -2
- package/src/modules/auth/models/user.model.js +4 -1
- package/src/modules/community/components/sections/HotPosts.vue +1 -1
- package/src/modules/globals/controllers/classes/globals.abac.js +148 -23
- package/src/modules/globals/controllers/classes/globals.validator.js +37 -0
- package/src/modules/globals/controllers/classes/globals.verifier.js +2 -0
- package/src/modules/globals/controllers/policies/globals.policies.js +91 -74
- package/src/modules/globals/controllers/utils/queryProcessor.js +59 -11
- package/src/modules/globals/models/schemas/ownership.schema.js +11 -6
- package/src/modules/globals/models/schemas/profile.schema.js +0 -4
- package/src/modules/music/components/layouts/MusicLayout.vue +10 -58
- package/src/modules/music/components/pages/MusicHome.vue +5 -5
- package/src/modules/orders/components/pages/OrderCreate.vue +85 -12
- package/src/modules/orders/controllers/orders.controller.js +3 -0
- package/src/modules/orders/store/shopcart.js +1 -0
- package/src/modules/organizations/models/schemas/accesses.schema.js +18 -0
- package/src/modules/organizations/policies/organizations.policies.js +117 -61
- package/src/modules/products/components/pages/CategoryEdit.vue +27 -2
- package/src/modules/products/components/pages/Product.vue +1 -0
- package/src/modules/products/components/pages/ProductEdit.vue +2 -2
- package/src/modules/products/controllers/categories.controller.js +297 -133
- package/src/modules/products/middlewares/categories.verifier.js +177 -0
- package/src/modules/products/models/category.model.js +12 -14
- package/src/modules/products/routes/categories.routes.js +50 -11
- package/src/modules/products/store/categories.js +2 -0
- package/src/modules/spots/components/pages/SpotEdit.vue +21 -17
- package/src/modules/spots/components/sections/WorktimeEdit.vue +840 -0
- package/src/modules/spots/controllers/queries/getIsOpenNowStage.js +109 -0
- package/src/modules/spots/controllers/spots.controller.js +2 -1
- package/src/modules/spots/models/spot.model.js +59 -13
- package/src/modules/spots/store/spots.js +4 -1
- package/src/modules/products/middlewares/index.js +0 -11
- package/src/modules/products/middlewares/verifyCategory.js +0 -25
|
@@ -24,6 +24,7 @@ const _sfc_main = {
|
|
|
24
24
|
placeholder: { type: String, default: "Please select an item" },
|
|
25
25
|
select: [String, Object],
|
|
26
26
|
property: String,
|
|
27
|
+
value: String,
|
|
27
28
|
options: { type: Array, default: () => [] },
|
|
28
29
|
validation: Boolean
|
|
29
30
|
},
|
|
@@ -71,7 +72,6 @@ const _sfc_main = {
|
|
|
71
72
|
return null;
|
|
72
73
|
}
|
|
73
74
|
return (_ctx, _cache) => {
|
|
74
|
-
var _a, _b;
|
|
75
75
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
76
76
|
vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
77
77
|
onClick: vue.withModifiers(toggleMenu, ["stop"]),
|
|
@@ -81,7 +81,7 @@ const _sfc_main = {
|
|
|
81
81
|
vue.createElementVNode("span", null, vue.toDisplayString(__props.label), 1)
|
|
82
82
|
])) : vue.createCommentVNode("", true),
|
|
83
83
|
vue.createElementVNode("li", _hoisted_2, [
|
|
84
|
-
vue.createElementVNode("span", null, vue.toDisplayString(
|
|
84
|
+
vue.createElementVNode("span", null, vue.toDisplayString(optionsSelected.value ? optionsSelected.value.name || optionsSelected.value[props.value] || optionsSelected.value : __props.placeholder), 1)
|
|
85
85
|
]),
|
|
86
86
|
vue.createVNode(vue.Transition, {
|
|
87
87
|
mode: "out-in",
|
|
@@ -96,7 +96,7 @@ const _sfc_main = {
|
|
|
96
96
|
return vue.openBlock(), vue.createElementBlock("li", {
|
|
97
97
|
onClick: vue.withModifiers(($event) => selectOption(option), ["stop"])
|
|
98
98
|
}, [
|
|
99
|
-
option ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4, vue.toDisplayString(option.name || option), 1)) : vue.createCommentVNode("", true)
|
|
99
|
+
option ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4, vue.toDisplayString(option.name || option[props.value] || option), 1)) : vue.createCommentVNode("", true)
|
|
100
100
|
], 8, _hoisted_3);
|
|
101
101
|
}), 256))
|
|
102
102
|
], 2), [
|
|
@@ -121,6 +121,6 @@ const _sfc_main = {
|
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
|
-
const Select = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-
|
|
124
|
+
const Select = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-026b7d35"]]);
|
|
125
125
|
exports.default = Select;
|
|
126
126
|
//# sourceMappingURL=Select.vue.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.vue.cjs","sources":["../../../../../src/components/Select/Select.vue"],"sourcesContent":["<template>\n <!-- Input Wrapper -->\n <div \n @click.stop=\"toggleMenu\" \n v-click-outside=\"clickedOutside\" \n :class=\"$attrs.class\" \n class=\"cursor-pointer flex-v-center flex-nowrap flex pos-relative\"\n >\n <!-- Label -->\n <div v-if=\"label\" class=\"t-transp mn-r-small\">\n <span>{{label}}</span>\n </div>\n \n <!-- Input -->\n <li class=\"w-100\">\n <!-- Selected Value -->\n <span>\n
|
|
1
|
+
{"version":3,"file":"Select.vue.cjs","sources":["../../../../../src/components/Select/Select.vue"],"sourcesContent":["<template>\n <!-- Input Wrapper -->\n <div \n @click.stop=\"toggleMenu\" \n v-click-outside=\"clickedOutside\" \n :class=\"$attrs.class\" \n class=\"cursor-pointer flex-v-center flex-nowrap flex pos-relative\"\n >\n <!-- Label -->\n <div v-if=\"label\" class=\"t-transp mn-r-small\">\n <span>{{label}}</span>\n </div>\n \n <!-- Input -->\n <li class=\"w-100\">\n <!-- Selected Value -->\n <span>\n {{ optionsSelected ? (optionsSelected.name || optionsSelected[props.value] || optionsSelected) : placeholder }}\n </span>\n </li>\n\n <!-- Dropdown menu -->\n <transition mode=\"out-in\" name=\"TransitionTranslateY\">\n <ul \n v-show=\"showMenu\" \n :class=\"$attrs.class\"\n class=\"bs-black pos-absolute pos-t-100 pos-l-0 z-index-5 w-100 mn-t-thin\"\n style=\"min-width: max-content;\"\n >\n <li @click.stop=\"selectOption(option)\" v-for=\"option in optionsListed\">\n <span v-if=\"option\" class=\"w-100\">\n\n {{ option.name || option[props.value] || option }}\n </span>\n </li>\n </ul>\n </transition>\n </div>\n\n <!-- Validation -->\n <transition mode=\"out-in\" name=\"fade\">\n <div v-if=\"validation\" class=\"mn-t-thin invalid-feedback\">\n * {{validation.message}}\n </div>\n </transition>\n</template>\n\n<script setup>\nimport { ref, computed, watch } from 'vue'\n\nimport clickOutside from '../FieldPhone/click-outside';\n\nlet vClickOutside = clickOutside\n\nconst emit = defineEmits([\n 'update:select', \n 'focus', \n 'blur'\n])\n\nconst props = defineProps({\n label: String,\n placeholder: { type: String, default: 'Please select an item' },\n select: [String, Object],\n property: String,\n value: String,\n options: { type: Array, default: () => [] },\n validation: Boolean,\n})\n\nconst showMenu = ref(false)\n\nconst optionsSelected = ref(\n props.property \n ? findObjectByValue(props.select, props.property, props.options) \n : props.select\n)\n\nconst optionsListed = computed(() => {\n return props.select \n ? props.options.filter(option => option !== props.select) \n : props.options\n})\n\nwatch(() => props.select, (newSelect) => {\n optionsSelected.value = \n props.property \n ? findObjectByValue(props.select, props.property, props.options) \n : props.select;\n});\n\nconst toggleMenu = () => {\n showMenu.value = !showMenu.value\n\n emit(showMenu.value ? 'focus' : 'blur')\n}\n\nfunction clickedOutside () {\n showMenu.value = false\n}\n\nconst selectOption = option => {\n optionsSelected.value = option\n \n toggleMenu()\n\n if (props.property) { \n emit('update:select', optionsSelected.value[props.property])\n } else {\n emit('update:select', optionsSelected.value)\n }\n}\n\nfunction findObjectByValue (value, property, objects) {\n for (const object of objects) {\n if (object[property] === value || object === value) {\n return object;\n }\n }\n return null;\n}\n</script>\n\n<style lang=\"scss\" scoped>\n li {\n list-style-type: none;\n }\n\n ul li {\n line-height: 2;\n }\n</style>\n"],"names":["clickOutside","ref","computed","watch"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,QAAI,gBAAgBA,aAAAA;AAEpB,UAAM,OAAO;AAMb,UAAM,QAAQ;AAUd,UAAM,WAAWC,IAAG,IAAC,KAAK;AAE1B,UAAM,kBAAkBA,IAAG;AAAA,MACzB,MAAM,WACJ,kBAAkB,MAAM,QAAQ,MAAM,UAAU,MAAM,OAAO,IAC7D,MAAM;AAAA,IACV;AAEA,UAAM,gBAAgBC,IAAQ,SAAC,MAAM;AACnC,aAAO,MAAM,SACX,MAAM,QAAQ,OAAO,YAAU,WAAW,MAAM,MAAM,IACtD,MAAM;AAAA,IACV,CAAC;AAEDC,QAAK,MAAC,MAAM,MAAM,QAAQ,CAAC,cAAc;AACvC,sBAAgB,QAChB,MAAM,WACJ,kBAAkB,MAAM,QAAQ,MAAM,UAAU,MAAM,OAAO,IAC7D,MAAM;AAAA,IACV,CAAC;AAED,UAAM,aAAa,MAAM;AACvB,eAAS,QAAQ,CAAC,SAAS;AAE3B,WAAK,SAAS,QAAQ,UAAU,MAAM;AAAA,IACxC;AAEA,aAAS,iBAAkB;AACzB,eAAS,QAAQ;AAAA,IACnB;AAEA,UAAM,eAAe,YAAU;AAC7B,sBAAgB,QAAQ;AAExB,iBAAU;AAEV,UAAI,MAAM,UAAU;AAClB,aAAK,iBAAiB,gBAAgB,MAAM,MAAM,QAAQ,CAAC;AAAA,MAC/D,OAAS;AACL,aAAK,iBAAiB,gBAAgB,KAAK;AAAA,MAC/C;AAAA,IACA;AAEA,aAAS,kBAAmB,OAAO,UAAU,SAAS;AACpD,iBAAW,UAAU,SAAS;AAC5B,YAAI,OAAO,QAAQ,MAAM,SAAS,WAAW,OAAO;AAClD,iBAAO;AAAA,QACb;AAAA,MACA;AACE,aAAO;AAAA,IACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -22,6 +22,7 @@ const _sfc_main = {
|
|
|
22
22
|
placeholder: { type: String, default: "Please select an item" },
|
|
23
23
|
select: [String, Object],
|
|
24
24
|
property: String,
|
|
25
|
+
value: String,
|
|
25
26
|
options: { type: Array, default: () => [] },
|
|
26
27
|
validation: Boolean
|
|
27
28
|
},
|
|
@@ -69,7 +70,6 @@ const _sfc_main = {
|
|
|
69
70
|
return null;
|
|
70
71
|
}
|
|
71
72
|
return (_ctx, _cache) => {
|
|
72
|
-
var _a, _b;
|
|
73
73
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
74
74
|
withDirectives((openBlock(), createElementBlock("div", {
|
|
75
75
|
onClick: withModifiers(toggleMenu, ["stop"]),
|
|
@@ -79,7 +79,7 @@ const _sfc_main = {
|
|
|
79
79
|
createElementVNode("span", null, toDisplayString(__props.label), 1)
|
|
80
80
|
])) : createCommentVNode("", true),
|
|
81
81
|
createElementVNode("li", _hoisted_2, [
|
|
82
|
-
createElementVNode("span", null, toDisplayString(
|
|
82
|
+
createElementVNode("span", null, toDisplayString(optionsSelected.value ? optionsSelected.value.name || optionsSelected.value[props.value] || optionsSelected.value : __props.placeholder), 1)
|
|
83
83
|
]),
|
|
84
84
|
createVNode(Transition, {
|
|
85
85
|
mode: "out-in",
|
|
@@ -94,7 +94,7 @@ const _sfc_main = {
|
|
|
94
94
|
return openBlock(), createElementBlock("li", {
|
|
95
95
|
onClick: withModifiers(($event) => selectOption(option), ["stop"])
|
|
96
96
|
}, [
|
|
97
|
-
option ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(option.name || option), 1)) : createCommentVNode("", true)
|
|
97
|
+
option ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(option.name || option[props.value] || option), 1)) : createCommentVNode("", true)
|
|
98
98
|
], 8, _hoisted_3);
|
|
99
99
|
}), 256))
|
|
100
100
|
], 2), [
|
|
@@ -119,7 +119,7 @@ const _sfc_main = {
|
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
};
|
|
122
|
-
const Select = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
122
|
+
const Select = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-026b7d35"]]);
|
|
123
123
|
export {
|
|
124
124
|
Select as default
|
|
125
125
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.vue.js","sources":["../../../../../src/components/Select/Select.vue"],"sourcesContent":["<template>\n <!-- Input Wrapper -->\n <div \n @click.stop=\"toggleMenu\" \n v-click-outside=\"clickedOutside\" \n :class=\"$attrs.class\" \n class=\"cursor-pointer flex-v-center flex-nowrap flex pos-relative\"\n >\n <!-- Label -->\n <div v-if=\"label\" class=\"t-transp mn-r-small\">\n <span>{{label}}</span>\n </div>\n \n <!-- Input -->\n <li class=\"w-100\">\n <!-- Selected Value -->\n <span>\n
|
|
1
|
+
{"version":3,"file":"Select.vue.js","sources":["../../../../../src/components/Select/Select.vue"],"sourcesContent":["<template>\n <!-- Input Wrapper -->\n <div \n @click.stop=\"toggleMenu\" \n v-click-outside=\"clickedOutside\" \n :class=\"$attrs.class\" \n class=\"cursor-pointer flex-v-center flex-nowrap flex pos-relative\"\n >\n <!-- Label -->\n <div v-if=\"label\" class=\"t-transp mn-r-small\">\n <span>{{label}}</span>\n </div>\n \n <!-- Input -->\n <li class=\"w-100\">\n <!-- Selected Value -->\n <span>\n {{ optionsSelected ? (optionsSelected.name || optionsSelected[props.value] || optionsSelected) : placeholder }}\n </span>\n </li>\n\n <!-- Dropdown menu -->\n <transition mode=\"out-in\" name=\"TransitionTranslateY\">\n <ul \n v-show=\"showMenu\" \n :class=\"$attrs.class\"\n class=\"bs-black pos-absolute pos-t-100 pos-l-0 z-index-5 w-100 mn-t-thin\"\n style=\"min-width: max-content;\"\n >\n <li @click.stop=\"selectOption(option)\" v-for=\"option in optionsListed\">\n <span v-if=\"option\" class=\"w-100\">\n\n {{ option.name || option[props.value] || option }}\n </span>\n </li>\n </ul>\n </transition>\n </div>\n\n <!-- Validation -->\n <transition mode=\"out-in\" name=\"fade\">\n <div v-if=\"validation\" class=\"mn-t-thin invalid-feedback\">\n * {{validation.message}}\n </div>\n </transition>\n</template>\n\n<script setup>\nimport { ref, computed, watch } from 'vue'\n\nimport clickOutside from '../FieldPhone/click-outside';\n\nlet vClickOutside = clickOutside\n\nconst emit = defineEmits([\n 'update:select', \n 'focus', \n 'blur'\n])\n\nconst props = defineProps({\n label: String,\n placeholder: { type: String, default: 'Please select an item' },\n select: [String, Object],\n property: String,\n value: String,\n options: { type: Array, default: () => [] },\n validation: Boolean,\n})\n\nconst showMenu = ref(false)\n\nconst optionsSelected = ref(\n props.property \n ? findObjectByValue(props.select, props.property, props.options) \n : props.select\n)\n\nconst optionsListed = computed(() => {\n return props.select \n ? props.options.filter(option => option !== props.select) \n : props.options\n})\n\nwatch(() => props.select, (newSelect) => {\n optionsSelected.value = \n props.property \n ? findObjectByValue(props.select, props.property, props.options) \n : props.select;\n});\n\nconst toggleMenu = () => {\n showMenu.value = !showMenu.value\n\n emit(showMenu.value ? 'focus' : 'blur')\n}\n\nfunction clickedOutside () {\n showMenu.value = false\n}\n\nconst selectOption = option => {\n optionsSelected.value = option\n \n toggleMenu()\n\n if (props.property) { \n emit('update:select', optionsSelected.value[props.property])\n } else {\n emit('update:select', optionsSelected.value)\n }\n}\n\nfunction findObjectByValue (value, property, objects) {\n for (const object of objects) {\n if (object[property] === value || object === value) {\n return object;\n }\n }\n return null;\n}\n</script>\n\n<style lang=\"scss\" scoped>\n li {\n list-style-type: none;\n }\n\n ul li {\n line-height: 2;\n }\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,QAAI,gBAAgB;AAEpB,UAAM,OAAO;AAMb,UAAM,QAAQ;AAUd,UAAM,WAAW,IAAI,KAAK;AAE1B,UAAM,kBAAkB;AAAA,MACtB,MAAM,WACJ,kBAAkB,MAAM,QAAQ,MAAM,UAAU,MAAM,OAAO,IAC7D,MAAM;AAAA,IACV;AAEA,UAAM,gBAAgB,SAAS,MAAM;AACnC,aAAO,MAAM,SACX,MAAM,QAAQ,OAAO,YAAU,WAAW,MAAM,MAAM,IACtD,MAAM;AAAA,IACV,CAAC;AAED,UAAM,MAAM,MAAM,QAAQ,CAAC,cAAc;AACvC,sBAAgB,QAChB,MAAM,WACJ,kBAAkB,MAAM,QAAQ,MAAM,UAAU,MAAM,OAAO,IAC7D,MAAM;AAAA,IACV,CAAC;AAED,UAAM,aAAa,MAAM;AACvB,eAAS,QAAQ,CAAC,SAAS;AAE3B,WAAK,SAAS,QAAQ,UAAU,MAAM;AAAA,IACxC;AAEA,aAAS,iBAAkB;AACzB,eAAS,QAAQ;AAAA,IACnB;AAEA,UAAM,eAAe,YAAU;AAC7B,sBAAgB,QAAQ;AAExB,iBAAU;AAEV,UAAI,MAAM,UAAU;AAClB,aAAK,iBAAiB,gBAAgB,MAAM,MAAM,QAAQ,CAAC;AAAA,MAC/D,OAAS;AACL,aAAK,iBAAiB,gBAAgB,KAAK;AAAA,MAC/C;AAAA,IACA;AAEA,aAAS,kBAAmB,OAAO,UAAU,SAAS;AACpD,iBAAW,UAAU,SAAS;AAC5B,YAAI,OAAO,QAAQ,MAAM,SAAS,WAAW,OAAO;AAClD,iBAAO;AAAA,QACb;AAAA,MACA;AACE,aAAO;AAAA,IACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as blogposts from "./store/blogposts.js";
|
|
2
2
|
import * as reactions from "./store/reactions.js";
|
|
3
3
|
import community from "./router/blogposts.js";
|
|
4
|
-
import _sfc_main$
|
|
5
|
-
import _sfc_main$
|
|
6
|
-
import _sfc_main$
|
|
7
|
-
import _sfc_main$
|
|
8
|
-
import _sfc_main$
|
|
9
|
-
import _sfc_main$
|
|
10
|
-
import _sfc_main$
|
|
11
|
-
import _sfc_main from "./components/sections/Comments.vue.js";
|
|
12
|
-
import
|
|
4
|
+
import _sfc_main$8 from "./components/layouts/Community.vue.js";
|
|
5
|
+
import _sfc_main$7 from "./components/pages/CreateBlogPost.vue.js";
|
|
6
|
+
import _sfc_main$6 from "./components/pages/BlogPost.vue.js";
|
|
7
|
+
import _sfc_main$5 from "./components/pages/Blog.vue.js";
|
|
8
|
+
import _sfc_main$4 from "./components/blocks/FooterBlogpost.vue.js";
|
|
9
|
+
import _sfc_main$3 from "./components/blocks/Activity.vue.js";
|
|
10
|
+
import _sfc_main$2 from "./components/blocks/CardBlogpost.vue.js";
|
|
11
|
+
import _sfc_main$1 from "./components/sections/Comments.vue.js";
|
|
12
|
+
import _sfc_main from "./components/sections/HotPosts.vue.js";
|
|
13
13
|
function initializeCommunity(app, store, router, options = {}) {
|
|
14
14
|
const route = options.route || "Home";
|
|
15
15
|
router.addRoute(route, community);
|
|
@@ -28,31 +28,31 @@ const ModuleCommunity = {
|
|
|
28
28
|
},
|
|
29
29
|
components: {
|
|
30
30
|
// Layouts
|
|
31
|
-
Community: _sfc_main$
|
|
31
|
+
Community: _sfc_main$8,
|
|
32
32
|
// Pages
|
|
33
|
-
CreateBlogPost: _sfc_main$
|
|
34
|
-
BlogPost: _sfc_main$
|
|
35
|
-
Blog: _sfc_main$
|
|
33
|
+
CreateBlogPost: _sfc_main$7,
|
|
34
|
+
BlogPost: _sfc_main$6,
|
|
35
|
+
Blog: _sfc_main$5,
|
|
36
36
|
// Blocks
|
|
37
|
-
FooterBlogpost: _sfc_main$
|
|
38
|
-
Activity: _sfc_main$
|
|
39
|
-
CardBlogpost: _sfc_main$
|
|
37
|
+
FooterBlogpost: _sfc_main$4,
|
|
38
|
+
Activity: _sfc_main$3,
|
|
39
|
+
CardBlogpost: _sfc_main$2,
|
|
40
40
|
// Sections
|
|
41
|
-
Comments: _sfc_main,
|
|
42
|
-
HotPosts
|
|
41
|
+
Comments: _sfc_main$1,
|
|
42
|
+
HotPosts: _sfc_main
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
export {
|
|
47
|
-
_sfc_main$
|
|
48
|
-
_sfc_main$
|
|
49
|
-
_sfc_main$
|
|
50
|
-
_sfc_main$
|
|
51
|
-
_sfc_main as Comments,
|
|
52
|
-
_sfc_main$
|
|
53
|
-
_sfc_main$
|
|
54
|
-
_sfc_main$
|
|
55
|
-
HotPosts,
|
|
47
|
+
_sfc_main$3 as Activity,
|
|
48
|
+
_sfc_main$5 as Blog,
|
|
49
|
+
_sfc_main$6 as BlogPost,
|
|
50
|
+
_sfc_main$2 as CardBlogpost,
|
|
51
|
+
_sfc_main$1 as Comments,
|
|
52
|
+
_sfc_main$8 as Community,
|
|
53
|
+
_sfc_main$7 as CreateBlogPost,
|
|
54
|
+
_sfc_main$4 as FooterBlogpost,
|
|
55
|
+
_sfc_main as HotPosts,
|
|
56
56
|
ModuleCommunity as default,
|
|
57
57
|
community as routerCommunity,
|
|
58
58
|
blogposts as storeBlogposts,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"community.client.js","sources":["../../../../../src/modules/community/community.client.js"],"sourcesContent":["// Store\nimport * as storeBlogposts from './store/blogposts.js';\nimport * as storeReactions from './store/reactions.js';\n\n// Router\nimport routerCommunity from './router/blogposts';\n\n// Views\n// Layouts\nimport Community from './components/layouts/Community.vue';\n\n// Pages\nimport CreateBlogPost from './components/pages/CreateBlogPost.vue';\nimport BlogPost from './components/pages/BlogPost.vue';\nimport Blog from './components/pages/Blog.vue';\n\n// Blocks\nimport FooterBlogpost from './components/blocks/FooterBlogpost.vue';\nimport Activity from './components/blocks/Activity.vue';\nimport CardBlogpost from './components/blocks/CardBlogpost.vue';\n\n// Sections\nimport Comments from './components/sections/Comments.vue';\nimport HotPosts from './components/sections/HotPosts.vue';\n\n// Пример функции инициализации для модуля сообщества\nfunction initializeCommunity(app, store, router, options = {}) {\n const route = options.route || 'Home';\n\n router.addRoute(route, routerCommunity);\n \n store.addStore('blogposts', storeBlogposts);\n store.addStore('reactions', storeReactions);\n}\n\nconst ModuleCommunity = {\n initialize: initializeCommunity,\n views: {\n store: {\n storeBlogposts,\n storeReactions\n },\n router: {\n routerCommunity\n },\n components: {\n // Layouts\n Community,\n // Pages\n CreateBlogPost,\n BlogPost,\n Blog,\n // Blocks\n FooterBlogpost,\n Activity,\n CardBlogpost,\n // Sections\n Comments,\n HotPosts\n }\n }\n}\n\nexport {\n Community,\n CreateBlogPost,\n BlogPost,\n Blog,\n FooterBlogpost,\n Activity,\n CardBlogpost,\n Comments,\n HotPosts,\n storeBlogposts,\n storeReactions,\n routerCommunity\n};\n\nexport default ModuleCommunity;"],"names":["routerCommunity","storeBlogposts","storeReactions","Community","CreateBlogPost","BlogPost","Blog","FooterBlogpost","Activity","CardBlogpost","Comments"],"mappings":";;;;;;;;;;;;AA0BA,SAAS,oBAAoB,KAAK,OAAO,QAAQ,UAAU,CAAA,GAAI;AAC7D,QAAM,QAAQ,QAAQ,SAAS;AAE/B,SAAO,SAAS,OAAOA,SAAe;AAEtC,QAAM,SAAS,aAAaC,SAAc;AAC1C,QAAM,SAAS,aAAaC,SAAc;AAC5C;AAEK,MAAC,kBAAkB;AAAA,EACtB,YAAY;AAAA,EACZ,OAAO;AAAA,IACL,OAAO;AAAA,MACX,gBAAMD;AAAAA,MACAC,gBAAAA;AAAAA,IACD;AAAA,IACD,QAAQ;AAAA,MACNF,iBAAAA;AAAAA,IACD;AAAA,IACD,YAAY;AAAA;AAAA,MAEhB,WAAMG;AAAAA;AAAAA,MAEN,gBAAMC;AAAAA,MACN,UAAMC;AAAAA,MACN,MAAMC;AAAAA;AAAAA,MAEN,gBAAMC;AAAAA,MACN,UAAMC;AAAAA,MACN,cAAMC;AAAAA;AAAAA,MAEN,UAAMC;AAAAA,
|
|
1
|
+
{"version":3,"file":"community.client.js","sources":["../../../../../src/modules/community/community.client.js"],"sourcesContent":["// Store\nimport * as storeBlogposts from './store/blogposts.js';\nimport * as storeReactions from './store/reactions.js';\n\n// Router\nimport routerCommunity from './router/blogposts';\n\n// Views\n// Layouts\nimport Community from './components/layouts/Community.vue';\n\n// Pages\nimport CreateBlogPost from './components/pages/CreateBlogPost.vue';\nimport BlogPost from './components/pages/BlogPost.vue';\nimport Blog from './components/pages/Blog.vue';\n\n// Blocks\nimport FooterBlogpost from './components/blocks/FooterBlogpost.vue';\nimport Activity from './components/blocks/Activity.vue';\nimport CardBlogpost from './components/blocks/CardBlogpost.vue';\n\n// Sections\nimport Comments from './components/sections/Comments.vue';\nimport HotPosts from './components/sections/HotPosts.vue';\n\n// Пример функции инициализации для модуля сообщества\nfunction initializeCommunity(app, store, router, options = {}) {\n const route = options.route || 'Home';\n\n router.addRoute(route, routerCommunity);\n \n store.addStore('blogposts', storeBlogposts);\n store.addStore('reactions', storeReactions);\n}\n\nconst ModuleCommunity = {\n initialize: initializeCommunity,\n views: {\n store: {\n storeBlogposts,\n storeReactions\n },\n router: {\n routerCommunity\n },\n components: {\n // Layouts\n Community,\n // Pages\n CreateBlogPost,\n BlogPost,\n Blog,\n // Blocks\n FooterBlogpost,\n Activity,\n CardBlogpost,\n // Sections\n Comments,\n HotPosts\n }\n }\n}\n\nexport {\n Community,\n CreateBlogPost,\n BlogPost,\n Blog,\n FooterBlogpost,\n Activity,\n CardBlogpost,\n Comments,\n HotPosts,\n storeBlogposts,\n storeReactions,\n routerCommunity\n};\n\nexport default ModuleCommunity;"],"names":["routerCommunity","storeBlogposts","storeReactions","Community","CreateBlogPost","BlogPost","Blog","FooterBlogpost","Activity","CardBlogpost","Comments","HotPosts"],"mappings":";;;;;;;;;;;;AA0BA,SAAS,oBAAoB,KAAK,OAAO,QAAQ,UAAU,CAAA,GAAI;AAC7D,QAAM,QAAQ,QAAQ,SAAS;AAE/B,SAAO,SAAS,OAAOA,SAAe;AAEtC,QAAM,SAAS,aAAaC,SAAc;AAC1C,QAAM,SAAS,aAAaC,SAAc;AAC5C;AAEK,MAAC,kBAAkB;AAAA,EACtB,YAAY;AAAA,EACZ,OAAO;AAAA,IACL,OAAO;AAAA,MACX,gBAAMD;AAAAA,MACAC,gBAAAA;AAAAA,IACD;AAAA,IACD,QAAQ;AAAA,MACNF,iBAAAA;AAAAA,IACD;AAAA,IACD,YAAY;AAAA;AAAA,MAEhB,WAAMG;AAAAA;AAAAA,MAEN,gBAAMC;AAAAA,MACN,UAAMC;AAAAA,MACN,MAAMC;AAAAA;AAAAA,MAEN,gBAAMC;AAAAA,MACN,UAAMC;AAAAA,MACN,cAAMC;AAAAA;AAAAA,MAEN,UAAMC;AAAAA,MACAC,UAAAA;AAAAA,IACN;AAAA,EACA;AACA;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vue = require("vue");
|
|
4
|
-
const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.cjs");
|
|
5
4
|
;/* empty css */
|
|
6
5
|
;/* empty css */
|
|
7
6
|
;/* empty css */
|
|
@@ -10,6 +9,7 @@ const Slider_native = require("../../../../components/Slider/Slider.native.vue.c
|
|
|
10
9
|
const CardBlogpost = require("../blocks/CardBlogpost.vue.cjs");
|
|
11
10
|
const blogposts = require("../../store/blogposts.cjs");
|
|
12
11
|
const auth = require("../../../auth/views/store/auth.cjs");
|
|
12
|
+
;/* empty css */
|
|
13
13
|
const _sfc_main = {
|
|
14
14
|
__name: "HotPosts",
|
|
15
15
|
props: {
|
|
@@ -71,6 +71,5 @@ const _sfc_main = {
|
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
|
-
|
|
75
|
-
exports.default = HotPosts;
|
|
74
|
+
exports.default = _sfc_main;
|
|
76
75
|
//# sourceMappingURL=HotPosts.vue.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HotPosts.vue.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HotPosts.vue.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createBlock, openBlock, withCtx } from "vue";
|
|
2
|
-
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
2
|
/* empty css */
|
|
4
3
|
/* empty css */
|
|
5
4
|
/* empty css */
|
|
@@ -8,6 +7,7 @@ import SliderNative from "../../../../components/Slider/Slider.native.vue.js";
|
|
|
8
7
|
import _sfc_main$1 from "../blocks/CardBlogpost.vue.js";
|
|
9
8
|
import { read } from "../../store/blogposts.js";
|
|
10
9
|
import { state } from "../../../auth/views/store/auth.js";
|
|
10
|
+
/* empty css */
|
|
11
11
|
const _sfc_main = {
|
|
12
12
|
__name: "HotPosts",
|
|
13
13
|
props: {
|
|
@@ -69,8 +69,7 @@ const _sfc_main = {
|
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
|
-
const HotPosts = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e26065cc"]]);
|
|
73
72
|
export {
|
|
74
|
-
|
|
73
|
+
_sfc_main as default
|
|
75
74
|
};
|
|
76
75
|
//# sourceMappingURL=HotPosts.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HotPosts.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HotPosts.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -20,17 +20,30 @@ const orders = require("../../store/orders.cjs");
|
|
|
20
20
|
const users = require("../../../auth/views/store/users.cjs");
|
|
21
21
|
;/* empty css */
|
|
22
22
|
const _hoisted_1 = { class: "bg-white pd-thin" };
|
|
23
|
-
const _hoisted_2 = {
|
|
23
|
+
const _hoisted_2 = {
|
|
24
|
+
key: 3,
|
|
25
|
+
class: "w-100 gap-thin cols-1 mn-b-thin"
|
|
26
|
+
};
|
|
24
27
|
const _hoisted_3 = {
|
|
25
|
-
key:
|
|
26
|
-
class: "
|
|
28
|
+
key: 0,
|
|
29
|
+
class: "bg-fifth-nano pd-small radius-medium t-center"
|
|
27
30
|
};
|
|
28
31
|
const _hoisted_4 = {
|
|
29
|
-
key:
|
|
32
|
+
key: 1,
|
|
33
|
+
class: "bg-fourth-nano pd-small radius-medium t-center"
|
|
34
|
+
};
|
|
35
|
+
const _hoisted_5 = { class: "t-fourth" };
|
|
36
|
+
const _hoisted_6 = { class: "gap-small mn-b-thin cols-2" };
|
|
37
|
+
const _hoisted_7 = {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: "rows-1 gap-thin"
|
|
40
|
+
};
|
|
41
|
+
const _hoisted_8 = {
|
|
42
|
+
key: 1,
|
|
30
43
|
class: "bg-white br-solid br-light br-1px pd-medium radius-medium"
|
|
31
44
|
};
|
|
32
|
-
const
|
|
33
|
-
const
|
|
45
|
+
const _hoisted_9 = { class: "flex gap-thin flex-wrap mn-b-thin" };
|
|
46
|
+
const _hoisted_10 = { class: "mn-b-thin" };
|
|
34
47
|
const _sfc_main = {
|
|
35
48
|
__name: "OrderCreate",
|
|
36
49
|
emits: ["page-loading", "page-loaded"],
|
|
@@ -39,7 +52,7 @@ const _sfc_main = {
|
|
|
39
52
|
const isLocationLoading = vue.ref(false);
|
|
40
53
|
vueRouter.useRoute();
|
|
41
54
|
const router = vueRouter.useRouter();
|
|
42
|
-
const { returnCurrency } = mixins.useGlobalMixins();
|
|
55
|
+
const { returnCurrency, formatPrice } = mixins.useGlobalMixins();
|
|
43
56
|
const order = vue.computed(() => orders.state.current);
|
|
44
57
|
vue.computed(() => users.state.current);
|
|
45
58
|
const cartTotalPrice = shopcart.getters.cartTotalPrice;
|
|
@@ -51,12 +64,46 @@ const _sfc_main = {
|
|
|
51
64
|
return orders.getters.getDeliveryPrice(type, distance, config);
|
|
52
65
|
});
|
|
53
66
|
const orderOrganization = vue.ref({});
|
|
67
|
+
const spotOrganization = vue.ref({});
|
|
68
|
+
const isOpen = vue.ref(true);
|
|
69
|
+
const minOrderAmount = vue.ref(0);
|
|
70
|
+
function checkIsOpenNow(worktime) {
|
|
71
|
+
var _a, _b, _c;
|
|
72
|
+
try {
|
|
73
|
+
console.log("[checkIsOpenNow] worktime:", worktime);
|
|
74
|
+
if (!worktime || typeof worktime !== "object" || Array.isArray(worktime) || !worktime.regular) {
|
|
75
|
+
console.log("[checkIsOpenNow] invalid, returning true");
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
const now = /* @__PURE__ */ new Date();
|
|
79
|
+
const currentDay = now.getDay();
|
|
80
|
+
const currentTime = `${String(now.getHours()).padStart(2, "0")}:${String(now.getMinutes()).padStart(2, "0")}`;
|
|
81
|
+
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
82
|
+
console.log("[checkIsOpenNow] currentDay:", currentDay);
|
|
83
|
+
console.log("[checkIsOpenNow] currentTime:", currentTime);
|
|
84
|
+
const specialDay = (_a = worktime.special) == null ? void 0 : _a.find((s) => {
|
|
85
|
+
const d = new Date(s.date);
|
|
86
|
+
return d.getFullYear() === today.getFullYear() && d.getMonth() === today.getMonth() && d.getDate() === today.getDate();
|
|
87
|
+
});
|
|
88
|
+
if (specialDay) {
|
|
89
|
+
console.log("[checkIsOpenNow] specialDay:", specialDay);
|
|
90
|
+
if (!specialDay.isOpen) return false;
|
|
91
|
+
return (_b = specialDay.periods) == null ? void 0 : _b.some((p) => p.open <= currentTime && p.close > currentTime);
|
|
92
|
+
}
|
|
93
|
+
const regularDay = worktime.regular.find((d) => d.dayOfWeek === currentDay);
|
|
94
|
+
if (!regularDay || !regularDay.isOpen) return false;
|
|
95
|
+
return (_c = regularDay.periods) == null ? void 0 : _c.some((p) => p.open <= currentTime && p.close > currentTime);
|
|
96
|
+
} catch (err) {
|
|
97
|
+
console.error("[checkIsOpenNow] error:", err);
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
54
101
|
if (!globals.state.options.orders.allowUnauthenticatedOrders && !auth.state.user._id) {
|
|
55
102
|
router.push({ name: "Sign In" });
|
|
56
103
|
}
|
|
57
104
|
orders.mutations.resetOrder();
|
|
58
105
|
vue.onMounted(async () => {
|
|
59
|
-
var _a, _b, _c;
|
|
106
|
+
var _a, _b, _c, _d, _e;
|
|
60
107
|
emits("page-loading");
|
|
61
108
|
isLocationLoading.value = true;
|
|
62
109
|
if (auth.state.user._id) {
|
|
@@ -70,6 +117,12 @@ const _sfc_main = {
|
|
|
70
117
|
location: (_a = globals.state.position) == null ? void 0 : _a.location,
|
|
71
118
|
lookup: ["spots"]
|
|
72
119
|
});
|
|
120
|
+
if (orderOrganization.value && ((_c = (_b = orderOrganization.value[0]) == null ? void 0 : _b.spots) == null ? void 0 : _c.length) > 0) {
|
|
121
|
+
spotOrganization.value = orderOrganization.value[0].spots[0];
|
|
122
|
+
isOpen.value = checkIsOpenNow(spotOrganization.value.worktime);
|
|
123
|
+
console.log(spotOrganization.value);
|
|
124
|
+
minOrderAmount.value = spotOrganization.value || 0;
|
|
125
|
+
}
|
|
73
126
|
isLocationLoading.value = false;
|
|
74
127
|
emits("page-loaded");
|
|
75
128
|
if (typeof gtag === "function") {
|
|
@@ -78,18 +131,18 @@ const _sfc_main = {
|
|
|
78
131
|
// Замените на вашу валюту
|
|
79
132
|
value: cartTotalPrice || 0,
|
|
80
133
|
items: shopcart.state.positions.map((item) => {
|
|
81
|
-
var _a2, _b2, _c2,
|
|
134
|
+
var _a2, _b2, _c2, _d2;
|
|
82
135
|
return {
|
|
83
136
|
item_id: (_a2 = item.product) == null ? void 0 : _a2._id,
|
|
84
137
|
item_name: (_b2 = item.product) == null ? void 0 : _b2.name,
|
|
85
138
|
price: item.price || 0,
|
|
86
139
|
quantity: item.quantity || 1,
|
|
87
140
|
item_category: ((_c2 = item.product) == null ? void 0 : _c2.category) || "",
|
|
88
|
-
item_brand: ((
|
|
141
|
+
item_brand: ((_d2 = orderOrganization.value.profile) == null ? void 0 : _d2.name) || ""
|
|
89
142
|
};
|
|
90
143
|
}),
|
|
91
|
-
organization: ((
|
|
92
|
-
location: ((
|
|
144
|
+
organization: ((_d = orderOrganization.value.profile) == null ? void 0 : _d.name) || "",
|
|
145
|
+
location: ((_e = globals.state.position) == null ? void 0 : _e.location) || "unknown"
|
|
93
146
|
});
|
|
94
147
|
}
|
|
95
148
|
});
|
|
@@ -219,13 +272,21 @@ const _sfc_main = {
|
|
|
219
272
|
key: 0,
|
|
220
273
|
class: "mn-b-thin"
|
|
221
274
|
})) : vue.createCommentVNode("", true),
|
|
222
|
-
vue.
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
275
|
+
shopcart.state.positions < 1 ? (vue.openBlock(), vue.createBlock(EmptyState.default, { key: 1 })) : vue.createCommentVNode("", true),
|
|
276
|
+
order.value.status === true && shopcart.state.positions.length > 0 ? (vue.openBlock(), vue.createBlock(Succes.default, {
|
|
277
|
+
key: 2,
|
|
278
|
+
order: order.value
|
|
279
|
+
}, null, 8, ["order"])) : vue.createCommentVNode("", true),
|
|
280
|
+
shopcart.state.positions.length > 0 && orders.state.current.status !== true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
|
|
281
|
+
!isOpen.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, _cache[0] || (_cache[0] = [
|
|
282
|
+
vue.createElementVNode("p", { class: "t-fourth" }, "⚠️ This spot is currently closed. You can place an order, but it will be processed when the spot opens.", -1)
|
|
283
|
+
]))) : vue.createCommentVNode("", true),
|
|
284
|
+
vue.unref(cartTotalPrice) < minOrderAmount.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
|
|
285
|
+
vue.createElementVNode("p", _hoisted_5, "⚠️ Minimum order amount is " + vue.toDisplayString(vue.unref(formatPrice)(minOrderAmount.value)) + ". Your current total is " + vue.toDisplayString(vue.unref(formatPrice)(vue.unref(cartTotalPrice))) + ".", 1)
|
|
286
|
+
])) : vue.createCommentVNode("", true)
|
|
287
|
+
])) : vue.createCommentVNode("", true),
|
|
288
|
+
vue.createElementVNode("div", _hoisted_6, [
|
|
289
|
+
orders.state.current.status !== true && shopcart.state.positions.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
|
|
229
290
|
vue.createVNode(FormCustomerDetails.default, {
|
|
230
291
|
customer: orders.state.current.customer
|
|
231
292
|
}, null, 8, ["customer"]),
|
|
@@ -240,9 +301,9 @@ const _sfc_main = {
|
|
|
240
301
|
organization: orderOrganization.value[0]
|
|
241
302
|
}, null, 8, ["order", "organization"])) : vue.createCommentVNode("", true)
|
|
242
303
|
])) : vue.createCommentVNode("", true),
|
|
243
|
-
shopcart.state.positions.length > 0 ? (vue.openBlock(), vue.createElementBlock("div",
|
|
244
|
-
_cache[
|
|
245
|
-
vue.createElementVNode("ul",
|
|
304
|
+
shopcart.state.positions.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
|
|
305
|
+
_cache[2] || (_cache[2] = vue.createElementVNode("h4", { class: "font-second mn-b-thin" }, "Your Order", -1)),
|
|
306
|
+
vue.createElementVNode("ul", _hoisted_9, [
|
|
246
307
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(shopcart.state.positions, (product) => {
|
|
247
308
|
return vue.openBlock(), vue.createBlock(CardOrderItem.default, {
|
|
248
309
|
key: product._id,
|
|
@@ -256,7 +317,7 @@ const _sfc_main = {
|
|
|
256
317
|
}, null, 8, ["product", "increase", "decrease", "remove", "onUpdateRentDates"]);
|
|
257
318
|
}), 128))
|
|
258
319
|
]),
|
|
259
|
-
vue.createElementVNode("div",
|
|
320
|
+
vue.createElementVNode("div", _hoisted_10, [
|
|
260
321
|
vue.createVNode(PriceTotal.default, {
|
|
261
322
|
totalPrice: vue.unref(cartTotalPrice),
|
|
262
323
|
deliveryRate: deliveryCost.value,
|
|
@@ -272,14 +333,14 @@ const _sfc_main = {
|
|
|
272
333
|
key: 0,
|
|
273
334
|
submit: () => handleCreate(),
|
|
274
335
|
class: "bg-main mn-b-small pd-small radius-big w-100 button",
|
|
275
|
-
disabled: errorName.value || errorPhoneOrMessenger.value || _ctx.errorCity || errorAddress.value || errorDelivery.value || errorPayment.value || isLocationLoading.value
|
|
336
|
+
disabled: errorName.value || errorPhoneOrMessenger.value || _ctx.errorCity || errorAddress.value || errorDelivery.value || errorPayment.value || isLocationLoading.value || vue.unref(cartTotalPrice) < minOrderAmount.value
|
|
276
337
|
}, {
|
|
277
|
-
default: vue.withCtx(() => _cache[
|
|
338
|
+
default: vue.withCtx(() => _cache[1] || (_cache[1] = [
|
|
278
339
|
vue.createElementVNode("span", null, "Place an Order", -1)
|
|
279
340
|
])),
|
|
280
341
|
_: 1
|
|
281
342
|
}, 8, ["submit", "disabled"])) : vue.createCommentVNode("", true),
|
|
282
|
-
_cache[
|
|
343
|
+
_cache[3] || (_cache[3] = vue.createElementVNode("p", { class: "mn-b-thin" }, [
|
|
283
344
|
vue.createTextVNode(" I agree that placing the order places me under an obligation to make a payment in accordance with "),
|
|
284
345
|
vue.createElementVNode("a", {
|
|
285
346
|
class: "t-semi font-second t-second",
|
|
@@ -287,7 +348,7 @@ const _sfc_main = {
|
|
|
287
348
|
target: "_blank"
|
|
288
349
|
}, "Terms of Use.")
|
|
289
350
|
], -1)),
|
|
290
|
-
_cache[
|
|
351
|
+
_cache[4] || (_cache[4] = vue.createElementVNode("p", null, null, -1))
|
|
291
352
|
])) : vue.createCommentVNode("", true)
|
|
292
353
|
])
|
|
293
354
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderCreate.vue.cjs","sources":["../../../../../../../src/modules/orders/components/pages/OrderCreate.vue"],"sourcesContent":["<template>\n\n<section class=\"bg-white pd-thin\">\n\n\t<!-- Ask to login -->\n\t<AskToLogin class=\"mn-b-thin\" v-if=\"auth.state.access.status === false\" /> \n\t<!-- Order form -->\n\t<div class=\"gap-small mn-b-thin cols-2\">\n\t\t<!-- Empty State -->\n\t\t<EmptyState \n\t\t\tv-if=\"shopcart.state.positions < 1\" \n\t\t/>\t\n\n\t\t<Succes \n\t\t\tv-if=\"order.status === true && shopcart.state.positions.length > 0\" \n\t\t\t:order=\"order\" \n\t\t/>\n\t\t<!-- Order Form -->\n\t\t<div\n\t\t\tv-if=\"orders.state.current.status !== true && shopcart.state.positions.length > 0\" \n\t\t\tclass=\"rows-1 gap-thin\"\n\t\t>\n\t\t\t<FormCustomerDetails\n\t\t\t\t:customer=\"orders.state.current.customer\"\n\t\t\t/>\n\t\t\t<FormPayment \t\n\t\t\t\tv-if=\"orders.state.current.status !== true && shopcart.state.positions.length > 0\"\n\t\t\t\t:order=\"orders.state.current\" \n\t\t\t\t:organization=\"orderOrganization[0]\" \n\t\t\t/>\n\t\t\t<FormDelivery \t\n\t\t\t\tv-if=\"orders.state.current.status !== true && shopcart.state.positions.length > 0\"\n\t\t\t\t:order=\"orders.state.current\" \n\t\t\t\t:organization=\"orderOrganization[0]\" \n\t\t\t/>\n\t\t\t\n\t\t</div>\n\n\t\t<!-- Order positions -->\n\t\t<div \n\t\t\tv-if=\"shopcart.state.positions.length > 0\" \n\t\t\tclass=\"bg-white br-solid br-light br-1px pd-medium radius-medium\"\n\t\t>\n\t\t\t<h4 class=\"font-second mn-b-thin\">Your Order</h4>\n\n\t\t\t<ul class=\"flex gap-thin flex-wrap mn-b-thin\">\n\t\t\t\t<CardOrderItem \n\t\t\t\t\tv-for=\"product in shopcart.state.positions\" \n\t\t\t\t\t:key=\"product._id\" \n\t\t\t\t\t:editable=\"true\" \n\t\t\t\t\t:product=\"product\" \n\t :increase=\"product => shopcart.actions.incrementItemQuantity(product._id)\"\n\t :decrease=\"product => shopcart.actions.decrementItemQuantity(product._id)\"\n\t :remove=\"product => shopcart.actions.removeProduct(product._id)\"\n\t\t\t\t\t@updateRentDates=\"(product, dates) => shopcart.actions.updateRentDates({ productId: product._id, dates })\"\n\t class=\"w-100 bg-white \"\n\t />\n\t\t\t</ul>\n\n\t\t\t\t<div \n\t\t\t\tclass=\"mn-b-thin\"\n\t\t\t>\t\n\t\t\t\t<PriceTotal \n :totalPrice=\"cartTotalPrice\"\n :deliveryRate=\"deliveryCost\"\n :currency=\"returnCurrency()\"\n :showFees=\"globals.state.options?.orders.showFees\"\n :feesRate=\"globals.state.options?.orders.feesRate || 0\"\n :showVat=\"globals.state.options?.orders.showVat\"\n :vatRate=\"globals.state.options?.orders.vatRate || 0\"\n :showDeliveryFee=\"globals.state.options?.orders.showDeliveryFee\"\n />\n\t\t\t</div>\n\t\t\t<!-- Send order -->\n\t\t <Button\n v-if=\"orders.state.current.status !== true && shopcart.state.positions.length > 0\"\n :submit=\"() => handleCreate()\"\n class=\"bg-main mn-b-small pd-small radius-big w-100 button\"\n :disabled=\"\n\t\t errorName \n\t\t || errorPhoneOrMessenger \n\t\t || errorCity \n\t\t || errorAddress \n\t\t || errorDelivery \n\t\t || errorPayment\n\t\t || isLocationLoading\n\t\t \"\n >\n <span>Place an Order</span>\n </Button>\n\n\t\t <p class='mn-b-thin'>\n\t\t\t\tI agree that placing the order places me under an obligation to make a payment in accordance with <a class=\"t-semi font-second t-second\" href=\"/legal/terms-of-use\" target=\"_blank\">Terms of Use.</a>\n\t\t\t</p>\n\t\t\t<p >\n\t\t\t\t\n\t\t\t</p>\n\t\t</div>\n\n\t</div>\n\n\t\n\t\n</section>\n\n</template>\n\n\n<script setup>\n///////////////////////////////////////////////////////////////////////////////////////////////////\n// Import components\n///////////////////////////////////////////////////////////////////////////////////////////////////\nimport Button from '@martyrs/src/components/Button/Button.vue'\n// Block\nimport CardOrderItem from '@martyrs/src/modules/orders/components/blocks/CardOrderItem.vue'\n// Sections\nimport AskToLogin from '@martyrs/src/modules/orders/components/sections/AskToLogin.vue'\nimport Succes from '@martyrs/src/modules/orders/components/sections/Succes.vue'\nimport EmptyState from '@martyrs/src/modules/orders/components/sections/EmptyState.vue'\n\nimport PriceTotal from '@martyrs/src/modules/orders/components/elements/PriceTotal.vue';\n\nimport FormCustomerDetails from '@martyrs/src/modules/orders/components/sections/FormCustomerDetails.vue'\nimport FormDelivery from '@martyrs/src/modules/orders/components/sections/FormDelivery.vue'\nimport FormPayment from '@martyrs/src/modules/orders/components/sections/FormPayment.vue'\n///////////////////////////////////////////////////////////////////////////////////////////////////\n// Import libs\n///////////////////////////////////////////////////////////////////////////////////////////////////\nimport { ref, computed, onMounted, watch } from 'vue'\nimport { useRoute,useRouter } from 'vue-router'\nimport { useGlobalMixins } from \"@martyrs/src/modules/globals/views/mixins/mixins.js\"\n\n// Store\nimport * as globals from '@martyrs/src/modules/globals/views/store/globals';\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth';\nimport * as shopcart from '@martyrs/src/modules/orders/store/shopcart';\nimport * as organizations from '@martyrs/src/modules/organizations/store/organizations';\nimport * as orders from '@martyrs/src/modules/orders/store/orders';\nimport * as users from '@martyrs/src/modules/auth/views/store/users';\n\nconst emits = defineEmits(['page-loading', 'page-loaded']);\n\n///////////////////////////////////////////////////////////////////////////////////////////////////\n// Variables and computed\n//////////////////////////////////////////////////////////////////////////////////////////////////\nconst isLocationLoading = ref(false)\n// Accessing router and store\nconst route = useRoute()\nconst router = useRouter()\nconst { returnCurrency } = useGlobalMixins()\n// COMPUTED\nconst order = computed(() => orders.state.current)\nconst user = computed(() => users.state.current)\n\nconst cartTotalPrice = shopcart.getters.cartTotalPrice\n\nconst deliveryCost = computed(() => {\n const type = orders.state.current.delivery.type\n const distance = orderOrganization.value[0]?.distance || 0\n const config = globals.state.options?.orders?.delivery_formula || {}\n\n return orders.getters.getDeliveryPrice(type, distance, config)\n})\n\n// Organization\nconst orderOrganization = ref({})\n\n\nif (!globals.state.options.orders.allowUnauthenticatedOrders && !auth.state.user._id) { \n\trouter.push({name: 'Sign In'})\t\n}\n\n\norders.mutations.resetOrder()\n\nonMounted(async()=> {\n\temits('page-loading');\n\n\tisLocationLoading.value = true\n\n\tif (auth.state.user._id) {\n\t\tlet data = await users.actions.read({ _id:auth.state.user._id, user: auth.state.user._id });\n\n\t\torders.state.current.customer.profile.name = users.state.current.profile.name\n\t\torders.state.current.customer.phone = users.state.current.phone\n\t\torders.state.current.customer.phone = users.state.current.phone\n\t}\n\n\torderOrganization.value = await organizations.actions.read({\n\t _id: shopcart.state.organization,\n\t location: globals.state.position?.location,\n\t lookup: ['spots']\n\t})\n\t\n \tisLocationLoading.value = false\n emits('page-loaded');\n\n if (typeof gtag === 'function') {\n gtag('event', 'begin_checkout', {\n currency: returnCurrency(), // Замените на вашу валюту\n value: cartTotalPrice || 0,\n items: shopcart.state.positions.map(item => ({\n item_id: item.product?._id,\n item_name: item.product?.name,\n price: item.price || 0,\n quantity: item.quantity || 1,\n item_category: item.product?.category || '',\n item_brand: orderOrganization.value.profile?.name || ''\n })),\n organization: orderOrganization.value.profile?.name || '',\n location: globals.state.position?.location || 'unknown'\n });\n }\n})\n\n\nwatch(\n () => orders.state.current.delivery,\n async (newVal) => {\n if (newVal?.location) {\n \tisLocationLoading.value = true\n\n orderOrganization.value = await organizations.actions.read({\n _id: shopcart.state.organization,\n location: newVal.location,\n lookup: ['spots']\n })\n\n isLocationLoading.value = false\n }\n },\n { deep: true }\n)\n\n\n/////////////////////////////\n// Store Verification\n/////////////////////////////\nconst errorName = computed(() => {\n if (orders.state.current.customer.name?.length < 2) { return true } else { return false }\n});\n\nconst errorPhoneOrMessenger = computed(() => {\n const hasMessengerType = orders.state.current.customer.messenger?.type;\n const hasMessengerValue = orders.state.current.customer.messenger?.value?.length >\t 2;\n const hasPhone = orders.state.current.customer.number?.length > 0;\n // Ошибка, если нет ни номера телефона, ни корректного типа и значения мессенджера\n return !hasPhone && !(hasMessengerType && hasMessengerValue);\n});\n\nconst errorAddress = computed(() => {\n const type = orders.state.current.delivery.type;\n if (type === \"pickup\") {\n return !orders.state.current.delivery.spot;\n } else if (type === \"courier\" || type === \"mail\") {\n const address = orders.state.current.delivery.address;\n return !address || typeof address !== 'string' || address.length < 2;\n }\n return false;\n});\n\nconst errorDelivery = computed(() => {\n if (orders.state.current.delivery.type) {return false } else {return true } \n})\n\nconst errorPayment = computed(() => {\n if (orders.state.current.payment.type) { return false } else {return true } \n})\n/////////////////////////////\n// Methods\n/////////////////////////////\nasync function handleCreate() {\n\n\torders.state.current.status = 'created';\n\n\torders.state.current.owner = {\n\t\ttarget: orderOrganization.value[0]._id,\n\t\ttype: 'organization'\n\t}\n\n\tif (auth.state.user._id) {\n\t\torders.state.current.creator = {\n\t\t\ttarget: auth.state.user._id,\n\t\t\ttype: 'user'\n\t\t}\n\t}\n\n\tif (auth.state.user._id) {\n\t\torders.state.current.customer = {\n\t\t\ttarget: auth.state.user._id,\n\t\t\ttype: 'user'\n\t\t}\n\t}\n\n\torders.state.current.positions = shopcart.state.positions\n\n \tconst referralCode = localStorage.getItem('referalCode');\n \n if (referralCode) {\n orders.state.current.referralCode = referralCode;\n }\n\n let order = await orders.actions.create(orders.state.current);\n\n if (order) {\n\t if (typeof gtag === 'function') {\n\t gtag('event', 'purchase', {\n\t transaction_id: order._id,\n\t value: cartTotalPrice || 0,\n\t currency: returnCurrency(), // Замените на вашу валюту\n\t tax: 0, // Если есть данные о налоге\n\t shipping: deliveryCost.value, // Если есть данные о доставке\n\t items: shopcart.state.positions.map(item => ({\n\t item_id: item.product?._id,\n\t item_name: item.product?.name ,\n\t price: item.price || 0,\n\t quantity: item.quantity || 1,\n\t item_category: item.product?.category || ''\n\t })),\n\t organization: orderOrganization.value?.profile?.name,\n\t location: globals.state.position?.location || 'unknown',\n\t referral_code: referralCode || null,\n\t user_id: auth.state.user._id || 'anonymous'\n\t });\n\t }\n\t}\n\n if (order) {\n \tawait router.push({\n \t\tname: 'Order',\n \t\tparams: {\n \t\t\torder: order._id\n \t\t}\n \t})\n \t\t\n \tshopcart.actions.resetShopcart()\n\n } else {\n \talert('something wrong')\n }\n}\n</script>\n\n<style lang=\"scss\">\n\n.round-wrapper {\n\tposition: relative;\n\n\t.round {\n\t\tmargin: 0;\n\t\tmargin-right: 1rem;\n\t}\n\n\tinput:checked {\n\t\tbackground: #00ff88;\n\t}\n\n\t.round-checkmark {\n\t\tposition: absolute;\n\t\twidth: 0.5rem;\n\t\theight: 0.5rem;\n\t\tbackground: white;\n\n\t\tleft: 0.5rem;\n\t\ttop: 0.5rem;\n\n\t\topacity: 1;\n\t}\n}\n</style>"],"names":["ref","useRoute","useRouter","useGlobalMixins","computed","orders.state","users.state","shopcart.getters","globals.state","orders.getters","auth.state","orders.mutations","onMounted","users.actions","organizations.actions","shopcart.state","_a","_b","_c","watch","order","orders.actions","shopcart.actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4IA,UAAM,QAAQ;AAKd,UAAM,oBAAoBA,IAAG,IAAC,KAAK;AAErBC,cAAQ,SAAA;AACtB,UAAM,SAASC,UAAS,UAAA;AACxB,UAAM,EAAE,eAAgB,IAAGC,OAAe,gBAAA;AAE1C,UAAM,QAAQC,IAAAA,SAAS,MAAMC,OAAAA,MAAa,OAAO;AACpCD,QAAAA,SAAS,MAAME,MAAW,MAAC,OAAO;AAE/C,UAAM,iBAAiBC,SAAAA,QAAiB;AAExC,UAAM,eAAeH,IAAQ,SAAC,MAAM;;AAClC,YAAM,OAAOC,OAAAA,MAAa,QAAQ,SAAS;AAC3C,YAAM,aAAW,uBAAkB,MAAM,CAAC,MAAzB,mBAA4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/orders/components/pages/OrderCreate.vue"],"sourcesContent":["<template>\n\n<section class=\"bg-white pd-thin\">\n\n\t<!-- Ask to login -->\n\t<AskToLogin class=\"mn-b-thin\" v-if=\"auth.state.access.status === false\" /> \n\n\t<!-- Empty State -->\n\t<EmptyState \n\t\tv-if=\"shopcart.state.positions < 1\" \n\t/>\t\n\t<Succes \n\t\tv-if=\"order.status === true && shopcart.state.positions.length > 0\" \n\t\t:order=\"order\" \n\t/>\n\t<!-- Уведомления о минимальной сумме заказа и времени работы -->\n\t<div v-if=\"shopcart.state.positions.length > 0 && orders.state.current.status !== true\" class=\"w-100 gap-thin cols-1 mn-b-thin\">\n\t\t<div v-if=\"!isOpen\" class=\"bg-fifth-nano pd-small radius-medium t-center\">\n\t\t\t<p class=\"t-fourth\">⚠️ This spot is currently closed. You can place an order, but it will be processed when the spot opens.</p>\n\t\t</div>\n\t\t<div v-if=\"cartTotalPrice < minOrderAmount\" class=\"bg-fourth-nano pd-small radius-medium t-center\">\n\t\t\t<p class=\"t-fourth\">⚠️ Minimum order amount is {{ formatPrice(minOrderAmount) }}. Your current total is {{ formatPrice(cartTotalPrice) }}.</p>\n\t\t</div>\n\t</div>\n\t\n\t<!-- Order form -->\n\t<div class=\"gap-small mn-b-thin cols-2\">\n\t\t<!-- Order Form -->\n\t\t<div\n\t\t\tv-if=\"orders.state.current.status !== true && shopcart.state.positions.length > 0\" \n\t\t\tclass=\"rows-1 gap-thin\"\n\t\t>\n\t\t\t<FormCustomerDetails\n\t\t\t\t:customer=\"orders.state.current.customer\"\n\t\t\t/>\n\t\t\t<FormPayment \t\n\t\t\t\tv-if=\"orders.state.current.status !== true && shopcart.state.positions.length > 0\"\n\t\t\t\t:order=\"orders.state.current\" \n\t\t\t\t:organization=\"orderOrganization[0]\" \n\t\t\t/>\n\t\t\t<FormDelivery \t\n\t\t\t\tv-if=\"orders.state.current.status !== true && shopcart.state.positions.length > 0\"\n\t\t\t\t:order=\"orders.state.current\" \n\t\t\t\t:organization=\"orderOrganization[0]\" \n\t\t\t/>\n\t\t\t\n\t\t</div>\n\n\t\t<!-- Order positions -->\n\t\t<div \n\t\t\tv-if=\"shopcart.state.positions.length > 0\" \n\t\t\tclass=\"bg-white br-solid br-light br-1px pd-medium radius-medium\"\n\t\t>\n\t\t\t<h4 class=\"font-second mn-b-thin\">Your Order</h4>\n\n\t\t\t<ul class=\"flex gap-thin flex-wrap mn-b-thin\">\n\t\t\t\t<CardOrderItem \n\t\t\t\t\tv-for=\"product in shopcart.state.positions\" \n\t\t\t\t\t:key=\"product._id\" \n\t\t\t\t\t:editable=\"true\" \n\t\t\t\t\t:product=\"product\" \n\t :increase=\"product => shopcart.actions.incrementItemQuantity(product._id)\"\n\t :decrease=\"product => shopcart.actions.decrementItemQuantity(product._id)\"\n\t :remove=\"product => shopcart.actions.removeProduct(product._id)\"\n\t\t\t\t\t@updateRentDates=\"(product, dates) => shopcart.actions.updateRentDates({ productId: product._id, dates })\"\n\t class=\"w-100 bg-white \"\n\t />\n\t\t\t</ul>\n\n\t\t\t\t<div \n\t\t\t\tclass=\"mn-b-thin\"\n\t\t\t>\t\n\t\t\t\t<PriceTotal \n :totalPrice=\"cartTotalPrice\"\n :deliveryRate=\"deliveryCost\"\n :currency=\"returnCurrency()\"\n :showFees=\"globals.state.options?.orders.showFees\"\n :feesRate=\"globals.state.options?.orders.feesRate || 0\"\n :showVat=\"globals.state.options?.orders.showVat\"\n :vatRate=\"globals.state.options?.orders.vatRate || 0\"\n :showDeliveryFee=\"globals.state.options?.orders.showDeliveryFee\"\n />\n\t\t\t</div>\n\t\t\t<!-- Send order -->\n\t\t <Button\n v-if=\"orders.state.current.status !== true && shopcart.state.positions.length > 0\"\n :submit=\"() => handleCreate()\"\n class=\"bg-main mn-b-small pd-small radius-big w-100 button\"\n :disabled=\"\n\t\t errorName \n\t\t || errorPhoneOrMessenger \n\t\t || errorCity \n\t\t || errorAddress \n\t\t || errorDelivery \n\t\t || errorPayment\n\t\t || isLocationLoading\n\t\t || cartTotalPrice < minOrderAmount\n\t\t \"\n >\n <span>Place an Order</span>\n </Button>\n\n\t\t <p class='mn-b-thin'>\n\t\t\t\tI agree that placing the order places me under an obligation to make a payment in accordance with <a class=\"t-semi font-second t-second\" href=\"/legal/terms-of-use\" target=\"_blank\">Terms of Use.</a>\n\t\t\t</p>\n\t\t\t<p >\n\t\t\t\t\n\t\t\t</p>\n\t\t</div>\n\n\t</div>\n\n\t\n\t\n</section>\n\n</template>\n\n\n<script setup>\n///////////////////////////////////////////////////////////////////////////////////////////////////\n// Import components\n///////////////////////////////////////////////////////////////////////////////////////////////////\nimport Button from '@martyrs/src/components/Button/Button.vue'\n// Block\nimport CardOrderItem from '@martyrs/src/modules/orders/components/blocks/CardOrderItem.vue'\n// Sections\nimport AskToLogin from '@martyrs/src/modules/orders/components/sections/AskToLogin.vue'\nimport Succes from '@martyrs/src/modules/orders/components/sections/Succes.vue'\nimport EmptyState from '@martyrs/src/modules/orders/components/sections/EmptyState.vue'\n\nimport PriceTotal from '@martyrs/src/modules/orders/components/elements/PriceTotal.vue';\n\nimport FormCustomerDetails from '@martyrs/src/modules/orders/components/sections/FormCustomerDetails.vue'\nimport FormDelivery from '@martyrs/src/modules/orders/components/sections/FormDelivery.vue'\nimport FormPayment from '@martyrs/src/modules/orders/components/sections/FormPayment.vue'\n///////////////////////////////////////////////////////////////////////////////////////////////////\n// Import libs\n///////////////////////////////////////////////////////////////////////////////////////////////////\nimport { ref, computed, onMounted, watch } from 'vue'\nimport { useRoute,useRouter } from 'vue-router'\nimport { useGlobalMixins } from \"@martyrs/src/modules/globals/views/mixins/mixins.js\"\n\n// Store\nimport * as globals from '@martyrs/src/modules/globals/views/store/globals';\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth';\nimport * as shopcart from '@martyrs/src/modules/orders/store/shopcart';\nimport * as organizations from '@martyrs/src/modules/organizations/store/organizations';\nimport * as orders from '@martyrs/src/modules/orders/store/orders';\nimport * as users from '@martyrs/src/modules/auth/views/store/users';\n\nconst emits = defineEmits(['page-loading', 'page-loaded']);\n\n///////////////////////////////////////////////////////////////////////////////////////////////////\n// Variables and computed\n//////////////////////////////////////////////////////////////////////////////////////////////////\nconst isLocationLoading = ref(false)\n// Accessing router and store\nconst route = useRoute()\nconst router = useRouter()\nconst { returnCurrency, formatPrice } = useGlobalMixins()\n// COMPUTED\nconst order = computed(() => orders.state.current)\nconst user = computed(() => users.state.current)\n\nconst cartTotalPrice = shopcart.getters.cartTotalPrice\n\nconst deliveryCost = computed(() => {\n const type = orders.state.current.delivery.type\n const distance = orderOrganization.value[0]?.distance || 0\n const config = globals.state.options?.orders?.delivery_formula || {}\n\n return orders.getters.getDeliveryPrice(type, distance, config)\n})\n\n// Organization\nconst orderOrganization = ref({})\nconst spotOrganization = ref({})\nconst isOpen = ref(true)\n\n// Новые переменные для проверки минимальной суммы заказа и времени работы\nconst minOrderAmount = ref(0)\n\nfunction checkIsOpenNow(worktime) {\n try {\n console.log('[checkIsOpenNow] worktime:', worktime);\n\n if (\n !worktime ||\n typeof worktime !== 'object' ||\n Array.isArray(worktime) ||\n !worktime.regular\n ) {\n console.log('[checkIsOpenNow] invalid, returning true');\n return true;\n }\n\n const now = new Date();\n const currentDay = now.getDay();\n const currentTime = `${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`;\n const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());\n\n console.log('[checkIsOpenNow] currentDay:', currentDay);\n console.log('[checkIsOpenNow] currentTime:', currentTime);\n\n const specialDay = worktime.special?.find(s => {\n const d = new Date(s.date);\n return (\n d.getFullYear() === today.getFullYear() &&\n d.getMonth() === today.getMonth() &&\n d.getDate() === today.getDate()\n );\n });\n\n if (specialDay) {\n console.log('[checkIsOpenNow] specialDay:', specialDay);\n if (!specialDay.isOpen) return false;\n return specialDay.periods?.some(p => p.open <= currentTime && p.close > currentTime);\n }\n\n const regularDay = worktime.regular.find(d => d.dayOfWeek === currentDay);\n if (!regularDay || !regularDay.isOpen) return false;\n\n return regularDay.periods?.some(p => p.open <= currentTime && p.close > currentTime);\n } catch (err) {\n console.error('[checkIsOpenNow] error:', err);\n return true;\n }\n}\n\n\nif (!globals.state.options.orders.allowUnauthenticatedOrders && !auth.state.user._id) { \n\trouter.push({name: 'Sign In'})\t\n}\n\n\norders.mutations.resetOrder()\n\nonMounted(async()=> {\n\temits('page-loading');\n\n\tisLocationLoading.value = true\n\n\tif (auth.state.user._id) {\n\t\tlet data = await users.actions.read({ _id:auth.state.user._id, user: auth.state.user._id });\n\n\t\torders.state.current.customer.profile.name = users.state.current.profile.name\n\t\torders.state.current.customer.phone = users.state.current.phone\n\t\torders.state.current.customer.phone = users.state.current.phone\n\t}\n\t\n\torderOrganization.value = await organizations.actions.read({\n\t _id: shopcart.state.organization,\n\t location: globals.state.position?.location,\n\t lookup: ['spots']\n\t})\n\t\n\t// Получаем информацию о минимальной сумме заказа и времени работы из spot\n\tif (orderOrganization.value && orderOrganization.value[0]?.spots?.length > 0) {\n\t spotOrganization.value = orderOrganization.value[0].spots[0];\n\t\tisOpen.value = checkIsOpenNow(spotOrganization.value.worktime);\n\t console.log(spotOrganization.value)\n\t minOrderAmount.value = spotOrganization.value || 0;\n\t}\n\n\n\t\n \tisLocationLoading.value = false\n emits('page-loaded');\n\n if (typeof gtag === 'function') {\n gtag('event', 'begin_checkout', {\n currency: returnCurrency(), // Замените на вашу валюту\n value: cartTotalPrice || 0,\n items: shopcart.state.positions.map(item => ({\n item_id: item.product?._id,\n item_name: item.product?.name,\n price: item.price || 0,\n quantity: item.quantity || 1,\n item_category: item.product?.category || '',\n item_brand: orderOrganization.value.profile?.name || ''\n })),\n organization: orderOrganization.value.profile?.name || '',\n location: globals.state.position?.location || 'unknown'\n });\n }\n})\n\n\nwatch(\n () => orders.state.current.delivery,\n async (newVal) => {\n if (newVal?.location) {\n \tisLocationLoading.value = true\n\n orderOrganization.value = await organizations.actions.read({\n _id: shopcart.state.organization,\n location: newVal.location,\n lookup: ['spots']\n })\n \n isLocationLoading.value = false\n }\n },\n { deep: true }\n)\n\n\n/////////////////////////////\n// Store Verification\n/////////////////////////////\nconst errorName = computed(() => {\n if (orders.state.current.customer.name?.length < 2) { return true } else { return false }\n});\n\nconst errorPhoneOrMessenger = computed(() => {\n const hasMessengerType = orders.state.current.customer.messenger?.type;\n const hasMessengerValue = orders.state.current.customer.messenger?.value?.length >\t 2;\n const hasPhone = orders.state.current.customer.number?.length > 0;\n // Ошибка, если нет ни номера телефона, ни корректного типа и значения мессенджера\n return !hasPhone && !(hasMessengerType && hasMessengerValue);\n});\n\nconst errorAddress = computed(() => {\n const type = orders.state.current.delivery.type;\n if (type === \"pickup\") {\n return !orders.state.current.delivery.spot;\n } else if (type === \"courier\" || type === \"mail\") {\n const address = orders.state.current.delivery.address;\n return !address || typeof address !== 'string' || address.length < 2;\n }\n return false;\n});\n\nconst errorDelivery = computed(() => {\n if (orders.state.current.delivery.type) {return false } else {return true } \n})\n\nconst errorPayment = computed(() => {\n if (orders.state.current.payment.type) { return false } else {return true } \n})\n/////////////////////////////\n// Methods\n/////////////////////////////\nasync function handleCreate() {\n\n\torders.state.current.status = 'created';\n\n\torders.state.current.owner = {\n\t\ttarget: orderOrganization.value[0]._id,\n\t\ttype: 'organization'\n\t}\n\n\tif (auth.state.user._id) {\n\t\torders.state.current.creator = {\n\t\t\ttarget: auth.state.user._id,\n\t\t\ttype: 'user'\n\t\t}\n\t}\n\n\tif (auth.state.user._id) {\n\t\torders.state.current.customer = {\n\t\t\ttarget: auth.state.user._id,\n\t\t\ttype: 'user'\n\t\t}\n\t}\n\n\torders.state.current.positions = shopcart.state.positions\n\n \tconst referralCode = localStorage.getItem('referalCode');\n \n if (referralCode) {\n orders.state.current.referralCode = referralCode;\n }\n\n let order = await orders.actions.create(orders.state.current);\n\n if (order) {\n\t if (typeof gtag === 'function') {\n\t gtag('event', 'purchase', {\n\t transaction_id: order._id,\n\t value: cartTotalPrice || 0,\n\t currency: returnCurrency(), // Замените на вашу валюту\n\t tax: 0, // Если есть данные о налоге\n\t shipping: deliveryCost.value, // Если есть данные о доставке\n\t items: shopcart.state.positions.map(item => ({\n\t item_id: item.product?._id,\n\t item_name: item.product?.name ,\n\t price: item.price || 0,\n\t quantity: item.quantity || 1,\n\t item_category: item.product?.category || ''\n\t })),\n\t organization: orderOrganization.value?.profile?.name,\n\t location: globals.state.position?.location || 'unknown',\n\t referral_code: referralCode || null,\n\t user_id: auth.state.user._id || 'anonymous'\n\t });\n\t }\n\t}\n\n if (order) {\n \tawait router.push({\n \t\tname: 'Order',\n \t\tparams: {\n \t\t\torder: order._id\n \t\t}\n \t})\n \t\t\n \tshopcart.actions.resetShopcart()\n\n } else {\n \talert('something wrong')\n }\n}\n</script>\n\n<style lang=\"scss\">\n\n.round-wrapper {\n\tposition: relative;\n\n\t.round {\n\t\tmargin: 0;\n\t\tmargin-right: 1rem;\n\t}\n\n\tinput:checked {\n\t\tbackground: #00ff88;\n\t}\n\n\t.round-checkmark {\n\t\tposition: absolute;\n\t\twidth: 0.5rem;\n\t\theight: 0.5rem;\n\t\tbackground: white;\n\n\t\tleft: 0.5rem;\n\t\ttop: 0.5rem;\n\n\t\topacity: 1;\n\t}\n}\n</style>"],"names":["ref","useRoute","useRouter","useGlobalMixins","computed","orders.state","users.state","shopcart.getters","globals.state","orders.getters","auth.state","orders.mutations","onMounted","users.actions","organizations.actions","shopcart.state","_a","_b","_c","_d","watch","order","orders.actions","shopcart.actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuJA,UAAM,QAAQ;AAKd,UAAM,oBAAoBA,IAAG,IAAC,KAAK;AAErBC,cAAQ,SAAA;AACtB,UAAM,SAASC,UAAS,UAAA;AACxB,UAAM,EAAE,gBAAgB,YAAW,IAAKC,OAAe,gBAAA;AAEvD,UAAM,QAAQC,IAAAA,SAAS,MAAMC,OAAAA,MAAa,OAAO;AACpCD,QAAAA,SAAS,MAAME,MAAW,MAAC,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