@ozdao/prometheus-framework 0.2.53 → 0.2.54

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. package/dist/main-180a9315.js +91 -0
  2. package/dist/main-3b7bd446.mjs +13631 -0
  3. package/dist/main-Im8ovDCi.mjs +13609 -0
  4. package/dist/main-MjvO1l5U.js +91 -0
  5. package/dist/main.css +1 -1
  6. package/dist/organizations.server.js +17 -3
  7. package/dist/organizations.server.mjs +17 -3
  8. package/dist/products.server.js +1 -1
  9. package/dist/products.server.mjs +1 -1
  10. package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.cjs +1 -1
  11. package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.js +20 -20
  12. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  13. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +28 -25
  14. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  15. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +70 -2
  16. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +2 -70
  18. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/Select/Select.vue.js +95 -2
  20. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  21. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +2 -95
  22. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  23. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +57 -77
  24. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +1 -1
  25. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js +1 -1
  26. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  27. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  28. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
  30. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
  31. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +65 -2
  32. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
  33. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +2 -65
  34. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  36. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
  38. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +98 -94
  40. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +2 -2
  42. package/dist/prometheus-framework/src/modules/events/components/sections/HeroEvent.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/events/components/sections/HeroEvent.vue.js +59 -52
  44. package/dist/prometheus-framework/src/modules/events/components/sections/SectionPreviousEvents.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/events/components/sections/SectionPreviousEvents.vue.js +1 -1
  46. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  48. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
  50. package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.js +8 -13
  52. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  54. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +11 -2
  56. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  57. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +2 -11
  58. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +53 -77
  60. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/orders/store/orders.js +42 -32
  62. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
  64. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  66. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +1 -1
  68. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  70. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  72. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  74. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  76. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  78. package/dist/prometheus-framework/src/modules/organizations/router/organizations.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/organizations/router/organizations.js +5 -3
  80. package/dist/prometheus-framework/src/modules/organizations/router/organizations.router.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/organizations/router/organizations.router.js +20 -5
  82. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  84. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  86. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
  88. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  90. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  92. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  94. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  96. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +61 -75
  98. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
  99. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +2 -2
  100. package/dist/prometheus-framework.cjs.js +1 -1
  101. package/dist/prometheus-framework.es.js +1 -1
  102. package/dist/style.css +1 -1
  103. package/dist/web-8b404cc2.js +1 -0
  104. package/dist/web-e9b09dc6.mjs +55 -0
  105. package/dist/web-i-suCpLM.mjs +55 -0
  106. package/dist/web-vB7UhMOt.js +1 -0
  107. package/package.json +1 -1
  108. package/src/components/EditImages/EditImages.vue +1 -1
  109. package/src/components/Field/Field.vue +5 -0
  110. package/src/components/LocationSelection/LocationSelection.vue +2 -2
  111. package/src/modules/backoffice/components/pages/Dashboard.vue +4 -25
  112. package/src/modules/backoffice/router/admin.js +0 -14
  113. package/src/modules/backoffice/router/backoffice.js +1 -1
  114. package/src/modules/events/components/pages/EditEvent.vue +10 -6
  115. package/src/modules/events/components/sections/HeroEvent.vue +12 -2
  116. package/src/modules/events/components/sections/SectionPreviousEvents.vue +1 -1
  117. package/src/modules/landing/components/sections/MobileApp.vue +2 -6
  118. package/src/modules/orders/components/blocks/StatusHistory.vue +91 -31
  119. package/src/modules/orders/components/pages/EditOrder.vue +4 -21
  120. package/src/modules/orders/components/pages/FormOrder.vue +53 -15
  121. package/src/modules/orders/components/pages/Order.vue +2 -2
  122. package/src/modules/orders/components/sections/FormClientDetails.vue +63 -0
  123. package/src/modules/orders/components/sections/FormDelivery.vue +72 -0
  124. package/src/modules/orders/components/sections/FormPayment.vue +27 -0
  125. package/src/modules/orders/controllers/orders.controller.js +63 -49
  126. package/src/modules/orders/models/order.model.js +9 -13
  127. package/src/modules/orders/routes/orders.routes.js +6 -20
  128. package/src/modules/orders/store/orders.js +24 -12
  129. package/src/modules/organizations/controllers/organizations.controller.js +28 -9
  130. package/src/modules/organizations/router/organizations.js +4 -1
  131. package/src/modules/organizations/router/organizations.router.js +18 -2
  132. package/src/modules/products/controllers/products.controller.js +3 -2
  133. package/src/modules/users/components/pages/Profile.vue +2 -2
  134. package/src/modules/orders/components/sections/FormOrderDetails.vue +0 -220
@@ -22,10 +22,11 @@
22
22
  style="object-fit: cover;"
23
23
  ref="videoElement"
24
24
  class="pos-absolute pos-t-0 pos-l-0 w-100 h-100"
25
- preload autoplay muted loop playsinlineclass playsinline :src="content.video"
25
+ preload autoplay muted loop playsinlineclass playsinline
26
26
  itemprop="video"
27
27
  type="video/webm"
28
28
  >
29
+ <source :src="content.video" :type="getVideoType(content.video)" />
29
30
  </video>
30
31
  </div>
31
32
 
@@ -38,7 +39,7 @@
38
39
  pd-big mn-r-auto mn-l-auto t-white flex-h-center flex-column o-hidden flex-v-start t-left flex w-100 h-100 gap-zero">
39
40
  <!-- <img src="/logo/jungle-stereo-cosmonaut.png" class="h-8r mn-b-small z-index-1"/> -->
40
41
  <div class="mn-b-big z-index-1 flex-nowrap flex gap-small">
41
- <img v-for="logo in content.logos" class="radius-thin i-big" :src="logo">
42
+ <img v-for="logo in content.logos" class="radius-thin object-fit-contain i-big" :src="logo">
42
43
  </div>
43
44
 
44
45
  <h3 class="pd-thin z-index-1 w-max br-solid br-2px br-white radius-extra mn-b-thin">
@@ -128,6 +129,15 @@
128
129
  };
129
130
  }
130
131
 
132
+ function getVideoType(videoUrl) {
133
+ if (videoUrl.endsWith('.mp4')) {
134
+ return 'video/mp4';
135
+ } else if (videoUrl.endsWith('.webm')) {
136
+ return 'video/webm';
137
+ }
138
+ return '';
139
+ }
140
+
131
141
  async function playVid() {
132
142
  if (videoElement.value.paused && !isPlaying) {
133
143
  return videoElement.value.play();
@@ -3,7 +3,7 @@
3
3
  <div class="cols-2 gap-big pos-relative ">
4
4
  <div class="cols-1 gap-small ">
5
5
  <a v-if="options?.link" @click="clickBuyTicket()" href="#" class="bg-main flex-child-grow-1 flex-child-shrink-0 flex-child-basis-auto o-hidden radius-big pd-big flex-center flex-column flex w-100 gap-zero">
6
- <img v-if="content?.ticket" class="w-100" :src="content?.ticket">
6
+ <img v-if="content?.ticket" class="w-80" :src="content?.ticket">
7
7
 
8
8
  <a class="t-white bg-black pd-l-small pd-b-thin pd-t-thin pd-r-small h4 radius-extra uppercase t-nye204">
9
9
  <!-- SOLD OUT -->
@@ -76,15 +76,11 @@ import LabelGooglePlay from '@pf/src/modules/icons/labels/LabelGooglePlay.vue'
76
76
  const props = defineProps({
77
77
  mockupImage: {
78
78
  type: String,
79
- default: "/landing/mockup.png"
80
- },
81
- mockupMobile: {
82
- type: String,
83
- default: "/landing/mockup-mobile.png"
79
+ default: "/landing/mockup.jpg"
84
80
  },
85
81
  bgImage: {
86
82
  type: String,
87
- default: "" // Введите ваше стандартное значение здесь, если необходимо
83
+ default: ""
88
84
  },
89
85
  textData: {
90
86
  type: Object,
@@ -10,6 +10,7 @@
10
10
  />
11
11
  </div>
12
12
  <p class="h4 w-8r">{{status.name}}</p>
13
+ <!-- <button v-if="status.value === 'delivered'" @click="printReceipt()" class="mn-l-auto bg-main button radius-big">Print</button> -->
13
14
  <button v-if="edit" :disabled="!isNextPossibleStatus(status.value)" @click="setStatus(status)" class="mn-l-auto bg-main button radius-big">Set status</button>
14
15
  </div>
15
16
  </div>
@@ -20,6 +21,8 @@ import { ref, computed } from 'vue';
20
21
 
21
22
  import IconCheckmark from '@pf/src/modules/icons/navigation/IconCheckmark.vue'
22
23
 
24
+ // import Socket from '@vendus/sockets-for-cordova';
25
+
23
26
  const props = defineProps({
24
27
  statusHistory: {
25
28
  type: Array
@@ -33,40 +36,42 @@ const props = defineProps({
33
36
  })
34
37
 
35
38
  // Инициализация состояния компонента
36
- const statuses = ref([{
39
+ const statuses = ref([
40
+ {
37
41
  value: 'created',
38
42
  name: 'Received',
39
43
  nextstatus: 'Confirming order...',
40
44
  description: 'Your order has been successfully created. Our manager will contact you within five minutes to confirm your order.'
41
- },{
42
- value: 'confirming',
43
- name: 'Confirming',
44
- nextstatus: 'Confirming order...',
45
- description: 'Your order has been confirmed. We are now processing your items and preparing them for shipment.'
46
- },{
47
- value: 'confirmed',
48
- name: 'Confirmed',
49
- nextstatus: 'Order is confirmed. Packing order...',
50
- description: 'Your order has been confirmed. We are now processing your items and preparing them for shipment.'
51
- },{
52
- value: 'packing',
53
- name: 'Packing',
54
- nextstatus: 'Packing order...',
55
- description: 'Your order is now awaiting shipment. Once shipped, you will receive a notification with tracking information.'
56
- },{
57
- value: 'packed',
58
- name: 'Packed',
59
- nextstatus: 'Delivering order...',
60
- description: 'Your order is now awaiting shipment. Once shipped, you will receive a notification with tracking information.'
61
- },{
62
- value: 'in delivery',
63
- name: 'Delivering',
64
- description: 'Your order is currently in transit. Our delivery team is working hard to get your items to you as soon as possible.'
65
- },{
66
- value: 'delivered',
67
- name: 'Delivered',
68
- description: 'Congratulations! Your order has been successfully delivered. If you have any concerns or feedback, feel free to contact us.'
69
- }]);
45
+ },{
46
+ value: 'confirming',
47
+ name: 'Confirming',
48
+ nextstatus: 'Confirming order...',
49
+ description: 'Your order has been confirmed. We are now processing your items and preparing them for shipment.'
50
+ },{
51
+ value: 'confirmed',
52
+ name: 'Confirmed',
53
+ nextstatus: 'Order is confirmed. Packing order...',
54
+ description: 'Your order has been confirmed. We are now processing your items and preparing them for shipment.'
55
+ },{
56
+ value: 'packing',
57
+ name: 'Packing',
58
+ nextstatus: 'Packing order...',
59
+ description: 'Your order is now awaiting shipment. Once shipped, you will receive a notification with tracking information.'
60
+ },{
61
+ value: 'packed',
62
+ name: 'Packed',
63
+ nextstatus: 'Delivering order...',
64
+ description: 'Your order is now awaiting shipment. Once shipped, you will receive a notification with tracking information.'
65
+ },{
66
+ value: 'in delivery',
67
+ name: 'Delivering',
68
+ description: 'Your order is currently in transit. Our delivery team is working hard to get your items to you as soon as possible.'
69
+ },{
70
+ value: 'delivered',
71
+ name: 'Delivered',
72
+ description: 'Congratulations! Your order has been successfully delivered. If you have any concerns or feedback, feel free to contact us.'
73
+ }
74
+ ]);
70
75
 
71
76
  const statusCurrent = ref(props.statusCurrent);
72
77
  const statusHistory = ref(props.statusHistory);
@@ -91,5 +96,60 @@ const setStatus = async (newStatus) => {
91
96
  // console.log(status)
92
97
  // orders.state.current.status = status.value
93
98
  // await orders.actions.update(orders.state.current)
94
- }
99
+ }
100
+
101
+ const printerIP = ref('192.168.1.197');
102
+ const printerPort = ref(9100);
103
+ const textToPrint = ref('This is some text to print\n\n');
104
+
105
+ // const printReceipt = async () => {
106
+ // try {
107
+ // const initPrinter = new Uint8Array([0x1b, 0x40]); // Команда инициализации принтера
108
+ // const lineFeed = new Uint8Array([0x0a]); // Перевод строки
109
+ // const cutPaper = new Uint8Array([0x1d, 0x56, 0x01]); // Резка бумаги
110
+
111
+ // const encoder = new TextEncoder();
112
+ // const textData = encoder.encode(textToPrint.value);
113
+
114
+ // const dataToSend = new Uint8Array([
115
+ // ...initPrinter,
116
+ // ...textData,
117
+ // ...lineFeed,
118
+ // ...cutPaper
119
+ // ]);
120
+
121
+ // const socket = new Socket();
122
+
123
+ // socket.onError = function (errorMessage) {
124
+ // console.error('Ошибка при подключении к принтеру:', errorMessage);
125
+ // };
126
+
127
+ // socket.onClose = function (hasError) {
128
+ // console.log('Соединение с принтером закрыто');
129
+ // };
130
+
131
+ // await new Promise((resolve, reject) => {
132
+ // socket.open(
133
+ // printerIP.value,
134
+ // printerPort.value,
135
+ // function () {
136
+ // console.log('Подключено к принтеру');
137
+ // resolve();
138
+ // },
139
+ // function (errorMessage) {
140
+ // console.error('Не удалось подключиться к принтеру:', errorMessage);
141
+ // reject(errorMessage);
142
+ // }
143
+ // );
144
+ // });
145
+
146
+ // socket.write(dataToSend);
147
+
148
+ // socket.shutdownWrite();
149
+
150
+ // console.log('Чек успешно напечатан');
151
+ // } catch (error) {
152
+ // console.error('Ошибка при печати чека:', error);
153
+ // }
154
+ // };
95
155
  </script>
@@ -2,24 +2,7 @@
2
2
  <header class="mn-b-medium flex-v-center flex-nowrap flex">
3
3
  <h2 class="mn-r-medium">Edit Order</h2>
4
4
  </header>
5
-
6
- <section class="gap-thin flex-nowrap flex mn-b-semi">
7
-
8
- <div class="w-100 br-solid br-1px br-black-transp-10 radius-big pd-medium">
9
- <p class=" mn-b-small p-big">
10
- Статус заказа:<br>{{order.status}}
11
- </p>
12
- <button class="button">Подтвердить заказ</button>
13
- </div>
14
-
15
- <div class="w-100 br-solid br-1px br-black-transp-10 radius-big pd-medium">
16
- <p class="mn-b-semi p-big">Статус оплаты:<br>{{order.payment?.status}}</p>
17
- <button class="button">Изменить статус оплаты</button>
18
- </div>
19
-
20
-
21
- </section>
22
-
5
+
23
6
  <Block
24
7
  title="Add Position"
25
8
  class="mn-b-semi"
@@ -51,12 +34,12 @@
51
34
  @update="updateProduct"
52
35
  />
53
36
  </Block>
54
-
37
+ <!--
55
38
  <FormOrderDetails
56
39
  :order="orders.state.current"
57
40
  @create="handleCreate"
58
41
  class="bg-grey pd-medium radius-big mn-b-semi"
59
- />
42
+ /> -->
60
43
 
61
44
 
62
45
  <div class="mn-thinw-100 flex-v-center flex block">
@@ -88,7 +71,7 @@
88
71
  import ListPositions from '@pf/src/modules/products/components/blocks/ListPositions.vue'
89
72
  import CardPosition from '@pf/src/modules/products/components/blocks/CardPosition.vue';
90
73
 
91
- import FormOrderDetails from '@pf/src/modules/orders/components/sections/FormOrderDetails.vue'
74
+ // import FormOrderDetails from '@pf/src/modules/orders/components/sections/FormOrderDetails.vue'
92
75
 
93
76
  // Import your store
94
77
  import * as orders from '@pf/src/modules/orders/store/orders';
@@ -10,15 +10,29 @@
10
10
  <!-- Empty State -->
11
11
  <EmptyState
12
12
  v-if="shopcart.state.positions < 1"
13
- />
13
+ />
14
+
14
15
  <Succes
15
16
  v-if="order.status === true && shopcart.state.positions.length > 0"
16
17
  :order="order"
17
18
  />
18
- <FormOrderDetails
19
- v-if="orders.state.current.status !== true && shopcart.state.positions.length > 0"
20
- :order="orders.state.current"
21
- />
19
+ <!-- Order Form -->
20
+ <div
21
+ v-if="orders.state.current.status !== true && shopcart.state.positions.length > 0"
22
+ class="order-form col"
23
+ >
24
+ <FormClientDetails
25
+ :order="orders.state.current"
26
+ />
27
+ <FormDelivery
28
+ v-if="orders.state.current.status !== true && shopcart.state.positions.length > 0"
29
+ :order="orders.state.current"
30
+ />
31
+ <FormPayment
32
+ v-if="orders.state.current.status !== true && shopcart.state.positions.length > 0"
33
+ :order="orders.state.current"
34
+ />
35
+ </div>
22
36
 
23
37
  <!-- Order positions -->
24
38
  <div
@@ -41,13 +55,33 @@
41
55
  <div
42
56
  style="border-bottom: 1px solid #f7f7f7; border-top: 1px solid #f7f7f7;" class="pd-b-medium pd-t-medium mn-b-medium"
43
57
  >
44
- <p class="mn-b-thin">Subtotal: {{returnCurrency()}} {{ cartTotalPrice }} </p>
45
- <p class="mn-b-thin">Delivery: {{returnCurrency()}} {{ Math.trunc(100 + 20 * orderOrganization[0]?.distance - 7,5 * (orderOrganization[0]?.distance / 10))}} </p>
46
- <p class="h3">Total: {{returnCurrency()}} {{ Math.trunc(100 + 20 * orderOrganization[0]?.distance - 7,5 * (orderOrganization[0]?.distance / 10)) + cartTotalPrice.value }} </p>
58
+ <p class="mn-b-thin">
59
+ Subtotal:
60
+ {{ returnCurrency() }}
61
+ {{ cartTotalPrice }}
62
+ </p>
63
+ <p class="mn-b-thin">
64
+ Delivery:
65
+ {{ returnCurrency() }}
66
+ {{
67
+ Math.trunc(100 + 20 * orderOrganization[0]?.distance - 7,5 * (orderOrganization[0]?.distance / 10))
68
+ }}
69
+ </p>
70
+ <p class="h3">
71
+ Total:
72
+ {{ returnCurrency() }}
73
+ {{
74
+ Math.trunc(100 + 20 * orderOrganization[0]?.distance - 7,5 * (orderOrganization[0]?.distance / 10)) + cartTotalPrice.value
75
+ }}
76
+ </p>
47
77
  </div>
48
78
 
49
- <p class='mn-b-thin'>By making this purchase you agree to the General Terms and Conditions.</p>
50
- <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.</p>
79
+ <p class='mn-b-thin'>
80
+ By making this purchase you agree to the General Terms and Conditions.
81
+ </p>
82
+ <p class='mn-b-small'>
83
+ I agree that placing the order places me under an obligation to make a payment in accordance with the General Terms and Conditions.
84
+ </p>
51
85
  <!-- Send order -->
52
86
  <button
53
87
  v-if="orders.state.current.status !== true && shopcart.state.positions.length > 0"
@@ -85,7 +119,10 @@ import CardOrderItem from '@pf/src/modules/orders/components/blocks/CardOrderIte
85
119
  import AskToLogin from '@pf/src/modules/orders/components/sections/AskToLogin.vue'
86
120
  import Succes from '@pf/src/modules/orders/components/sections/Succes.vue'
87
121
  import EmptyState from '@pf/src/modules/orders/components/sections/EmptyState.vue'
88
- import FormOrderDetails from '@pf/src/modules/orders/components/sections/FormOrderDetails.vue'
122
+
123
+ import FormClientDetails from '@pf/src/modules/orders/components/sections/FormClientDetails.vue'
124
+ import FormDelivery from '@pf/src/modules/orders/components/sections/FormDelivery.vue'
125
+ import FormPayment from '@pf/src/modules/orders/components/sections/FormPayment.vue'
89
126
  ///////////////////////////////////////////////////////////////////////////////////////////////////
90
127
  // Import libs
91
128
  ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -110,6 +147,7 @@ const user = computed(() => users.state.current)
110
147
  const cartTotalPrice = computed(() => shopcart.getters.cartTotalPrice)
111
148
  // Organization
112
149
  const orderOrganization = ref([])
150
+
113
151
  onMounted(async()=> {
114
152
  orderOrganization.value = await organizations.actions.read({
115
153
  _id: shopcart.state.organization,
@@ -129,13 +167,13 @@ watch(() => orders.state.current.delivery.address, async (newFilterValue, oldFil
129
167
  // Store Verification
130
168
  /////////////////////////////
131
169
  const errorName = computed(() => {
132
- if (orders.state.current.user.name?.length < 2) { return true } else { return false }
170
+ if (orders.state.current.client.name?.length < 2) { return true } else { return false }
133
171
  });
134
172
 
135
173
  const errorPhoneOrMessenger = computed(() => {
136
- const hasMessengerType = orders.state.current.user.messenger?.type;
137
- const hasMessengerValue = orders.state.current.user.messenger?.value?.length > 2;
138
- const hasPhone = orders.state.current.user.number?.length > 0;
174
+ const hasMessengerType = orders.state.current.client.messenger?.type;
175
+ const hasMessengerValue = orders.state.current.client.messenger?.value?.length > 2;
176
+ const hasPhone = orders.state.current.client.number?.length > 0;
139
177
  // Ошибка, если нет ни номера телефона, ни корректного типа и значения мессенджера
140
178
  return !hasPhone && !(hasMessengerType && hasMessengerValue);
141
179
  });
@@ -77,7 +77,7 @@
77
77
  <div class="w-100">
78
78
 
79
79
  <CardOrganization
80
- v-if="orderOrganization"
80
+ v-if="orderOrganization[0]"
81
81
  :organization="orderOrganization[0]"
82
82
  :showRating="true"
83
83
  :showFollowers="false"
@@ -239,7 +239,7 @@
239
239
 
240
240
  orderOrganization.value = await organizations.actions.read({
241
241
  _id: order.value.organization,
242
- location: globals.state.position?.location,
242
+ // location: globals.state.position?.location,
243
243
  });
244
244
 
245
245
  })
@@ -0,0 +1,63 @@
1
+ <template>
2
+ <Block title="Personal Data" class="mn-b-thin">
3
+ <Field
4
+ v-model="order.client.name"
5
+ label="Name*"
6
+ placeholder="Enter your name"
7
+ class="bg-white pd-medium radius-small mn-b-thin"
8
+ />
9
+
10
+ <FieldPhone
11
+ v-model="order.client.phone"
12
+ @country="(country) => { order.client.number = country }"
13
+ :inputOptions="{
14
+ placeholder: 'Enter contact phone number',
15
+ type: 'tel',
16
+ }"
17
+ :defaultCountry="'TH'"
18
+ :validCharactersOnly="true"
19
+ :dropdownOptions="{
20
+ showDialCodeInSelection: true,
21
+ showFlags: true,
22
+ showDialCodeInList: true
23
+ }"
24
+ mode="national"
25
+ class="bg-white pd-small radius-small mn-b-thin"
26
+ />
27
+
28
+ <p class="mn-b-small">
29
+ Prefer to chat instead of calling? Just drop your messenger info here:
30
+ </p>
31
+
32
+ <div class="flex-nowrap flex">
33
+ <Select
34
+ :options="[
35
+ {name: 'Telegram', value: 'telegram'},
36
+ {name: 'WhatsApp', value: 'whatsapp'},
37
+ {name: 'Line', value: 'line'},
38
+ ]"
39
+ @update:select="(option) => order.client.messenger.type = option.value"
40
+ placeholder="Messenger"
41
+ size="small"
42
+ class="bg-white pd-medium radius-small mn-r-small"
43
+ />
44
+
45
+ <Field
46
+ v-model="order.client.messenger.value"
47
+ placeholder="Enter your contact here"
48
+ class="bg-white pd-medium radius-small w-100"
49
+ />
50
+ </div>
51
+ </Block>
52
+ </template>
53
+
54
+ <script setup>
55
+ import Block from '@pf/src/components/Block/Block.vue'
56
+ import Field from '@pf/src/components/Field/Field.vue'
57
+ import FieldPhone from '@pf/src/components/FieldPhone/FieldPhone2.vue'
58
+ import Select from '@pf/src/components/Select/Select.vue'
59
+
60
+ defineProps({
61
+ order: Object,
62
+ });
63
+ </script>
@@ -0,0 +1,72 @@
1
+ <template>
2
+ <Block title="Delivery" class="mn-b-thin" :tooltip="'Delivery by mail takes 3-5 days.'">
3
+ <div class="mn-b-small flex-nowrap flex">
4
+ <Radio
5
+ v-model="order.delivery.type"
6
+ label="Courier"
7
+ value="courier"
8
+ class="bg-white pd-medium radius-small w-100 mn-r-small"
9
+ />
10
+ <Radio
11
+ v-model="order.delivery.type"
12
+ label="Post"
13
+ value="Post"
14
+ class="bg-white pd-medium radius-small w-100 mn-r-small"
15
+ />
16
+ </div>
17
+
18
+ <Address
19
+ label="Address"
20
+ :apiKey="GOOGLE_MAPS_API_KEY"
21
+ :address="order.delivery.address"
22
+ :location="order.delivery.location"
23
+ placeholder="Enter your address"
24
+ class="bg-white radius-tl-medium radius-tr-medium t-black br-grey br-solid br-2px pd-medium"
25
+ @update:location="newLocation => {
26
+ order.delivery.location = newLocation;
27
+ }"
28
+ @update:address="newAddress => {
29
+ order.delivery.address = newAddress;
30
+ }"
31
+ />
32
+
33
+ <LocationMarker
34
+ :apiKey="GOOGLE_MAPS_API_KEY"
35
+ :address="order.delivery.address"
36
+ :location="order.delivery.location"
37
+ class="mn-b-thin radius-bl-medium radius-br-medium h-15r o-hidden"
38
+ @update:location="newLocation => {
39
+ order.delivery.location = newLocation;
40
+ }"
41
+ @update:address="newAddress => {
42
+ order.delivery.address = newAddress;
43
+ }"
44
+ />
45
+
46
+ <Field
47
+ v-model="order.comment"
48
+ placeholder="Comments regarding the address (apartment unit, floor level, building section)"
49
+ type="textarea"
50
+ class="bg-white pd-medium radius-small"
51
+ />
52
+ </Block>
53
+ </template>
54
+
55
+ <script setup>
56
+ import { onMounted } from 'vue'
57
+ import * as globals from '@pf/src/modules/globals/store/globals';
58
+ import Block from '@pf/src/components/Block/Block.vue'
59
+ import Address from '@pf/src/components/Address/Address.vue'
60
+ import LocationMarker from "@pf/src/components/LocationMarker/LocationMarker.vue";
61
+ import Radio from '@pf/src/components/Radio/Radio.vue'
62
+ import Field from '@pf/src/components/Field/Field.vue'
63
+
64
+ const props = defineProps({
65
+ order: Object,
66
+ });
67
+
68
+ onMounted(() => {
69
+ if (globals.state.position) props.order.delivery.address = globals.state.position.address
70
+ if (globals.state.position) props.order.delivery.location = globals.state.position.location
71
+ })
72
+ </script>
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <Block title="Payment">
3
+ <div class="mn-b-small flex-nowrap flex">
4
+ <Select
5
+ v-model="order.payment.type"
6
+ :property="'value'"
7
+ :options="[
8
+ {name: 'Cash On Delivery', value: 'cash'},
9
+ {name: 'Bank Transfer', value: 'bank'},
10
+ {name: 'Crypto', value: 'crypto'},
11
+ ]"
12
+ placeholder="Select type of payment"
13
+ size="small"
14
+ class="bg-white pd-medium radius-small w-100"
15
+ />
16
+ </div>
17
+ </Block>
18
+ </template>
19
+
20
+ <script setup>
21
+ import Block from '@pf/src/components/Block/Block.vue'
22
+ import Select from '@pf/src/components/Select/Select.vue'
23
+
24
+ defineProps({
25
+ order: Object,
26
+ });
27
+ </script>