@ozdao/prometheus-framework 0.2.53 → 0.2.55

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. package/dist/main-180a9315.js +91 -0
  2. package/dist/main-3b7bd446.mjs +13631 -0
  3. package/dist/main-B7GT1EB5.js +91 -0
  4. package/dist/main-Im8ovDCi.mjs +13609 -0
  5. package/dist/main-MjvO1l5U.js +91 -0
  6. package/dist/main-N_5Jg8Gx.mjs +13693 -0
  7. package/dist/main.css +1 -1
  8. package/dist/organizations.server.js +17 -3
  9. package/dist/organizations.server.mjs +17 -3
  10. package/dist/products.server.js +1 -1
  11. package/dist/products.server.mjs +1 -1
  12. package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.cjs +1 -1
  13. package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.js +20 -20
  14. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  15. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +28 -25
  16. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +70 -2
  18. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +2 -70
  20. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  21. package/dist/prometheus-framework/src/components/Select/Select.vue.js +95 -2
  22. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  23. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +2 -95
  24. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  25. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +57 -77
  26. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +1 -1
  27. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js +1 -1
  28. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  30. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
  32. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
  33. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +65 -2
  34. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
  35. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +2 -65
  36. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  38. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
  40. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +98 -94
  42. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +2 -2
  44. package/dist/prometheus-framework/src/modules/events/components/sections/HeroEvent.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/events/components/sections/HeroEvent.vue.js +59 -52
  46. package/dist/prometheus-framework/src/modules/events/components/sections/SectionPreviousEvents.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/events/components/sections/SectionPreviousEvents.vue.js +1 -1
  48. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  50. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
  52. package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.js +8 -13
  54. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  56. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +11 -2
  58. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +2 -11
  60. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +53 -77
  62. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/orders/store/orders.js +42 -32
  64. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
  66. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  68. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +1 -1
  70. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  72. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  74. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  76. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  78. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  80. package/dist/prometheus-framework/src/modules/organizations/router/organizations.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/organizations/router/organizations.js +5 -3
  82. package/dist/prometheus-framework/src/modules/organizations/router/organizations.router.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/organizations/router/organizations.router.js +20 -5
  84. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  86. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  88. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
  90. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  92. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  94. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  96. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  98. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  99. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +61 -75
  100. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +2 -2
  102. package/dist/prometheus-framework.cjs.js +1 -1
  103. package/dist/prometheus-framework.es.js +1 -1
  104. package/dist/style.css +1 -1
  105. package/dist/web-8b404cc2.js +1 -0
  106. package/dist/web-e9b09dc6.mjs +55 -0
  107. package/dist/web-i-suCpLM.mjs +55 -0
  108. package/dist/web-ktBiiov5.js +1 -0
  109. package/dist/web-vB7UhMOt.js +1 -0
  110. package/dist/web-xvjLzsHu.mjs +55 -0
  111. package/package.json +1 -1
  112. package/src/components/EditImages/EditImages.vue +1 -1
  113. package/src/components/Feed/Feed.vue +26 -0
  114. package/src/components/Field/Field.vue +5 -0
  115. package/src/components/LocationSelection/LocationSelection.vue +2 -2
  116. package/src/modules/backoffice/components/pages/Dashboard.vue +4 -25
  117. package/src/modules/backoffice/router/admin.js +0 -14
  118. package/src/modules/backoffice/router/backoffice.js +4 -1
  119. package/src/modules/events/components/pages/EditEvent.vue +10 -6
  120. package/src/modules/events/components/sections/HeroEvent.vue +12 -2
  121. package/src/modules/events/components/sections/SectionPreviousEvents.vue +1 -1
  122. package/src/modules/gallery/models/photo.model.js +5 -1
  123. package/src/modules/globals/components/blocks/BlockSearch.vue +4 -3
  124. package/src/modules/globals/store/globals.js +33 -2
  125. package/src/modules/landing/components/sections/MobileApp.vue +2 -6
  126. package/src/modules/orders/components/blocks/CardOrderItem.vue +24 -3
  127. package/src/modules/orders/components/blocks/StatusHistory.vue +91 -31
  128. package/src/modules/orders/components/pages/EditOrder.vue +114 -125
  129. package/src/modules/orders/components/pages/FormOrder.vue +53 -15
  130. package/src/modules/orders/components/pages/Order.vue +2 -2
  131. package/src/modules/orders/components/sections/FormClientDetails.vue +63 -0
  132. package/src/modules/orders/components/sections/FormDelivery.vue +72 -0
  133. package/src/modules/orders/components/sections/FormPayment.vue +27 -0
  134. package/src/modules/orders/controllers/orders.controller.js +63 -49
  135. package/src/modules/orders/models/order.model.js +9 -13
  136. package/src/modules/orders/routes/orders.routes.js +6 -20
  137. package/src/modules/orders/store/orders.js +24 -12
  138. package/src/modules/organizations/components/pages/Organization.vue +1 -0
  139. package/src/modules/organizations/controllers/organizations.controller.js +28 -9
  140. package/src/modules/organizations/router/organizations.js +4 -1
  141. package/src/modules/organizations/router/organizations.router.js +18 -2
  142. package/src/modules/products/components/blocks/CardPosition.vue +7 -7
  143. package/src/modules/products/controllers/products.controller.js +3 -2
  144. package/src/modules/products/store/products.js +2 -0
  145. package/src/modules/users/components/pages/Profile.vue +2 -2
  146. package/src/modules/orders/components/sections/FormOrderDetails.vue +0 -220
@@ -1,79 +1,104 @@
1
1
  <template>
2
- <header class="mn-b-medium flex-v-center flex-nowrap flex">
3
- <h2 class="mn-r-medium">Edit Order</h2>
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
-
23
- <Block
24
- title="Add Position"
25
- class="mn-b-semi"
26
- >
27
- <CardPosition
28
- @add="addProduct"
29
- :products="Products"
30
- />
31
- </Block>
32
-
33
- <Block
34
- title="Invetory Sheet"
35
- class="mn-b-semi"
36
- >
37
- <span
38
- v-if="orders.state.current.positions.length === 0"
39
- class="w-100"
2
+ <div>
3
+ <header class="mn-b-medium flex-v-center flex-nowrap flex">
4
+ <h2 class="mn-r-medium">Create Order</h2>
5
+ </header>
6
+
7
+ <Popup
8
+ title="Добавить участника"
9
+ @close-popup="closeProductsPopup"
10
+ :isPopupOpen="isOpenProductsPopup"
11
+ class="bg-white w-min-30r w-max-30r radius-big pd-medium"
40
12
  >
41
- No positions added yet
42
- </span>
43
-
44
- <CardPosition
45
- v-for="(product, index) in orders.state.current.positions"
46
- :key="product._id"
47
- :product="product"
48
- :products="Products"
49
- @add="addProduct"
50
- @delete="deleteProduct"
51
- @update="updateProduct"
52
- />
53
- </Block>
54
-
55
- <FormOrderDetails
56
- :order="orders.state.current"
57
- @create="handleCreate"
58
- class="bg-grey pd-medium radius-big mn-b-semi"
59
- />
60
-
61
-
62
- <div class="mn-thinw-100 flex-v-center flex block">
63
- <p class="p-big">Сумма к оплате:
64
- <span v-if="order.info?.delivery === 'Самовывоз'" class="p-big t-semi">{{ orderTotalPrice / 100 }} ₽</span>
65
- <span v-if="order.info?.delivery === 'Курьером'" class="p-big t-semi">{{ orderTotalPrice / 100 + 350 }} ₽</span>
66
- <span v-if="order.info?.delivery === 'Почтой'" class="p-big t-semi">{{ orderTotalPrice / 100 + 550 }} ₽</span>
67
- (Заказ {{orderTotalPrice / 100}} ₽ + доставка
68
- <span v-if="order.info?.delivery === 'Самовывоз'" >0</span>
69
- <span v-if="order.info?.delivery === 'Курьером'" >350</span>
70
- <span v-if="order.info?.delivery === 'Почтой'">550</span>
71
- ₽)
72
- </p>
73
-
74
- <button class="mn-l-auto button">Запросить онлайн</button>
75
- </div>
76
13
 
14
+ <h3 class="mn-b-small">Add to order</h3>
15
+
16
+ <div class="bg-grey mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big">
17
+ <Feed
18
+ :search="true"
19
+ :states="{
20
+ empty: {
21
+ title: 'No Products Found',
22
+ description: 'Currently, there are no such products available.'
23
+ }
24
+ }"
25
+ :store="{
26
+ read: (options) => products.actions.read(options),
27
+ state: null
28
+ }"
29
+ :options="{
30
+ organization: route.params._id
31
+ }"
32
+ v-slot="{
33
+ items
34
+ }"
35
+ class=""
36
+ >
37
+ <CardOrderItem
38
+ v-for="(product, index) in items" :key="product._id"
39
+ :editable="false"
40
+ :product="product"
41
+ @click="() => {
42
+ let p = { ...product };
43
+ p.quantity = 1;
44
+ globals.actions.add(orders.state.current.positions, p)
45
+ closeProductsPopup();
46
+ }"
47
+ class="bg-white pd-thin radius-medium w-100 mn-b-thin"
48
+ />
49
+ </Feed>
50
+ </div>
51
+ </Popup>
52
+
53
+ <Block
54
+ title="Invetory Sheet"
55
+ :actions="[{
56
+ label: '+',
57
+ function: () => openProductsPopup()
58
+ }]"
59
+ class="mn-b-semi"
60
+ >
61
+ <span
62
+ v-if="orders.state.current.positions.length === 0"
63
+ class="w-100"
64
+ >
65
+ No positions added yet
66
+ </span>
67
+
68
+ <CardOrderItem
69
+ v-for="(product, index) in orders.state.current.positions"
70
+ :key="product._id"
71
+ :editable="true"
72
+ :product="product"
73
+ @increase="() => { globals.actions.increment(orders.state.current.positions, product) }"
74
+ @decrease="() => { globals.actions.decrement(orders.state.current.positions, product) }"
75
+ @remove="() => { globals.actions.delete(orders.state.current.positions, product) }"
76
+ class="mn-b-thin pd-thin radius-medium bg-white"
77
+ />
78
+ </Block>
79
+ <!--
80
+ <FormOrderDetails
81
+ :order="orders.state.current"
82
+ @create="handleCreate"
83
+ class="bg-grey pd-medium radius-big mn-b-semi"
84
+ /> -->
85
+
86
+
87
+ <div class="mn-thinw-100 flex-v-center flex block">
88
+ <p class="p-big">Сумма к оплате:
89
+ <span v-if="order?.info?.delivery === 'Самовывоз'" class="p-big t-semi">{{ orderTotalPrice / 100 }} ₽</span>
90
+ <span v-if="order?.info?.delivery === 'Курьером'" class="p-big t-semi">{{ orderTotalPrice / 100 + 350 }} ₽</span>
91
+ <span v-if="order?.info?.delivery === 'Почтой'" class="p-big t-semi">{{ orderTotalPrice / 100 + 550 }} ₽</span>
92
+ (Заказ {{orderTotalPrice / 100}} ₽ + доставка
93
+ <span v-if="order?.info?.delivery === 'Самовывоз'" >0</span>
94
+ <span v-if="order?.info?.delivery === 'Курьером'" >350</span>
95
+ <span v-if="order?.info?.delivery === 'Почтой'">550</span>
96
+ ₽)
97
+ </p>
98
+
99
+ <button class="mn-l-auto button">Запросить онлайн</button>
100
+ </div>
101
+ </div>
77
102
 
78
103
 
79
104
  </template>
@@ -83,79 +108,43 @@
83
108
  import { computed, ref, defineProps, onMounted, reactive, toRefs, watch } from 'vue'
84
109
  import { useRoute } from 'vue-router'
85
110
 
111
+ import Feed from '@pf/src/components/Feed/Feed.vue'
112
+ import Popup from '@pf/src/components/Popup/Popup.vue';
86
113
  import Block from '@pf/src/components/Block/Block.vue';
87
114
 
88
- import ListPositions from '@pf/src/modules/products/components/blocks/ListPositions.vue'
115
+ import CardOrderItem from '@pf/src/modules/orders/components/blocks/CardOrderItem.vue'
116
+
89
117
  import CardPosition from '@pf/src/modules/products/components/blocks/CardPosition.vue';
90
118
 
91
- import FormOrderDetails from '@pf/src/modules/orders/components/sections/FormOrderDetails.vue'
92
119
 
93
120
  // Import your store
121
+ import * as globals from '@pf/src/modules/globals/store/globals';
94
122
  import * as orders from '@pf/src/modules/orders/store/orders';
95
123
  import * as products from '@pf/src/modules/products/store/products';
96
124
 
97
125
  // Accessing router
98
126
  const route = useRoute()
99
127
 
100
- // Define props
101
- const props = defineProps(['showProduct'])
102
- props.showProduct = [];
128
+ // Popup
129
+ const isOpenProductsPopup = ref(false);
103
130
 
104
- function addProduct(product) {
105
- orders.actions.addProduct(product);
131
+ function openProductsPopup() {
132
+ isOpenProductsPopup.value = true;
106
133
  }
107
134
 
108
- function deleteProduct(product) {
109
- orders.actions.deleteProduct(product)
135
+ function closeProductsPopup() {
136
+ isOpenProductsPopup.value = false;
110
137
  }
111
138
 
112
- // Reactive data
113
- let data = reactive([])
114
- let reactiveData = toRefs(data)
115
- var showAddNew = ref(false)
116
- const Products = ref([])
139
+ // Data
140
+ let order = ref(null)
117
141
 
118
- // Initialize order and products
119
- let order = ref({})
120
- // Replace store orders.actions with your orders.actions
121
142
  onMounted(async () => {
122
- // Replace Vuex orders.actions with your orders.actions
123
- try {
124
- const productsResponse = await products.actions.read({
125
- organization: '65141c476cf9860013b49f6d'
126
- });
127
- console.log(productsResponse)
128
- Products.value = productsResponse;
129
- } catch (error) {
130
- console.error('error');
131
- }
132
-
133
- await orders.actions.fetchOrder(route.params.id) // Implement this action in your store
134
-
135
- order.value = orders.state.current
136
- })
137
-
138
-
139
- function saveItemList() {
140
- orders.actions.updateOrderpositions(route.params.id) // Replace Vuex action with your action
141
- }
142
-
143
- function changeEdit(index) {
144
- data[index] = !data[index]
145
- }
143
+ // await orders.actions.fetchOrder(route.params.id) // Implement this action in your store
146
144
 
147
- function resetOrderList() {
148
- orders.actions.fetchOrder(route.params.id) // Replace Vuex action with your action
149
- }
150
-
151
- function changeAdd() {
152
- showAddNew.value = !showAddNew.value
153
- }
145
+ // order.value = orders.state.current
146
+ })
154
147
 
155
- // Replace computed properties with reactive orders.state
156
- // Update this line to match your orders.state structure
157
- const orderTotalPrice = computed(() => 100) // Implement this getter in your orders.actions
158
- const orderProducts = computed(() => []) // Implement this getter in your orders.actions
159
148
  </script>
160
149
 
161
150
 
@@ -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>