@lancom/shared 0.0.277 → 0.0.279

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.
Files changed (42) hide show
  1. package/assets/js/api/admin.js +6 -0
  2. package/assets/js/utils/quote.js +3 -0
  3. package/components/common/progress_steps/progress-steps.scss +3 -1
  4. package/components/common/progress_steps/progress-steps.vue +9 -1
  5. package/components/editor/editor.vue +18 -1
  6. package/components/editor/editor_wizard/editor-wizard.scss +22 -0
  7. package/components/editor/editor_wizard/editor-wizard.vue +66 -0
  8. package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +1 -1
  9. package/components/order/order_view/order-view.scss +1 -1
  10. package/components/product/gallery/gallery.scss +21 -0
  11. package/components/product/gallery/gallery.vue +33 -4
  12. package/components/product/wizard/wizard.scss +222 -0
  13. package/components/product/wizard/wizard.vue +274 -0
  14. package/components/product/wizard/wizard_print/wizard-print.scss +94 -0
  15. package/components/product/wizard/wizard_print/wizard-print.vue +130 -0
  16. package/components/product/wizard/wizard_print_area/wizard-print-area.scss +101 -0
  17. package/components/product/wizard/wizard_print_area/wizard-print-area.vue +86 -0
  18. package/components/product/wizard/wizard_print_layers/wizard-print-layers.scss +60 -0
  19. package/components/product/wizard/wizard_print_layers/wizard-print-layers.vue +67 -0
  20. package/components/product/wizard/wizard_print_layers/wizard_print_layer/wizard-print-layer.scss +47 -0
  21. package/components/product/wizard/wizard_print_layers/wizard_print_layer/wizard-print-layer.vue +210 -0
  22. package/components/product/wizard/wizard_print_review/wizard-print-review.scss +0 -0
  23. package/components/product/wizard/wizard_print_review/wizard-print-review.vue +71 -0
  24. package/components/product/wizard/wizard_print_size/wizard-print-size.scss +68 -0
  25. package/components/product/wizard/wizard_print_size/wizard-print-size.vue +49 -0
  26. package/components/product/wizard/wizard_print_size/wizard_print_area_print_size/wizard-print-area-print-size.scss +65 -0
  27. package/components/product/wizard/wizard_print_size/wizard_print_area_print_size/wizard-print-area-print-size.vue +106 -0
  28. package/components/product/wizard/wizard_print_text_or_logo/wizard-print-text-or-logo.scss +65 -0
  29. package/components/product/wizard/wizard_print_text_or_logo/wizard-print-text-or-logo.vue +116 -0
  30. package/components/product/wizard/wizard_print_text_or_logo/wizard_text_or_logo_form/wizard-text-or-logo-form.scss +138 -0
  31. package/components/product/wizard/wizard_print_text_or_logo/wizard_text_or_logo_form/wizard-text-or-logo-form.vue +157 -0
  32. package/components/product/wizard/wizard_print_type/wizard-print-type.scss +65 -0
  33. package/components/product/wizard/wizard_print_type/wizard-print-type.vue +49 -0
  34. package/components/product/wizard/wizard_print_type/wizard_print_area_print_type/wizard-print-area-print-type.scss +87 -0
  35. package/components/product/wizard/wizard_print_type/wizard_print_area_print_type/wizard-print-area-print-type.vue +114 -0
  36. package/components/product/wizard/wizard_print_underbase/wizard-print-underbase.scss +65 -0
  37. package/components/product/wizard/wizard_print_underbase/wizard-print-underbase.vue +49 -0
  38. package/components/product/wizard/wizard_print_underbase/wizard_print_area_print_underbase/wizard-print-area-print-underbase.scss +87 -0
  39. package/components/product/wizard/wizard_print_underbase/wizard_print_area_print_underbase/wizard-print-area-print-underbase.vue +90 -0
  40. package/package.json +1 -1
  41. package/store/layers.js +6 -1
  42. package/store/product.js +42 -0
@@ -140,6 +140,9 @@ export default {
140
140
  exportOrderToShippingService(order, shipment) {
141
141
  return _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/export-to-shipping-service`, shipment);
142
142
  },
143
+ returnShipments(body) {
144
+ return _post('admin/shipments/return', body);
145
+ },
143
146
  markShipmentAsDispatched(order, shipment) {
144
147
  return _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/dispatched`, shipment);
145
148
  },
@@ -164,6 +167,9 @@ export default {
164
167
  createOrderRefund(order, refund, shop) {
165
168
  return _post(`shop/${shop}/order/${order}/refund`, refund);
166
169
  },
170
+ createOrderReturn(order, refund, shop) {
171
+ return _post(`shop/${shop}/order/${order}/return`, refund);
172
+ },
167
173
  sendOrderRefundRequest(order, refund, shop) {
168
174
  return _post(`shop/${shop}/order/${order}/refund/${refund}/send`);
169
175
  },
@@ -1,6 +1,9 @@
1
1
  export function convertQuoteToOrder(quote, option) {
2
2
  const files = [quote.file, ...(quote.files || [])].filter(f => !!f);
3
3
  return {
4
+ isUrgent: quote.isUrgent,
5
+ deliveryBy: quote.deliveryBy,
6
+ deliveryAfter: quote.deliveryAfter,
4
7
  referenceField: quote.reference,
5
8
  paymentMethod: option.paymentMethod || 'deposit',
6
9
  billingAddress: quote.address,
@@ -2,7 +2,9 @@
2
2
 
3
3
  .ProgressSteps {
4
4
  &__wrapper {
5
- border: 2px solid $gray;
5
+ &--border {
6
+ border: 2px solid $gray;
7
+ }
6
8
  }
7
9
  &__steps-wrapper {
8
10
  position: relative;
@@ -1,5 +1,9 @@
1
1
  <template>
2
- <div class="ProgressSteps__wrapper">
2
+ <div
3
+ class="ProgressSteps__wrapper"
4
+ :class="{
5
+ 'ProgressSteps__wrapper--border': hasBorder
6
+ }">
3
7
  <div class="ProgressSteps__steps-wrapper">
4
8
  <div
5
9
  class="ProgressSteps__progress"
@@ -89,6 +93,10 @@ export default {
89
93
  type: Boolean,
90
94
  default: true
91
95
  },
96
+ hasBorder: {
97
+ type: Boolean,
98
+ default: true
99
+ },
92
100
  visibleStepName: {
93
101
  type: Boolean,
94
102
  default: false
@@ -13,7 +13,7 @@
13
13
  @select="selectTab">
14
14
  <template v-slot:default="{ currentTab }">
15
15
  <component
16
- :is="`editor-${currentTab === 'product' ? 'product-details' : 'layers'}`"
16
+ :is="editorCurrentTabComponent(currentTab)"
17
17
  v-if="currentTab">
18
18
  </component>
19
19
  </template>
@@ -83,6 +83,7 @@ import EditorWorkspace from './editor_workspace/editor-workspace';
83
83
  import EditorProductDetails from './editor_product_details/editor-product-details';
84
84
  import MobileEditorProductDetails from './mobile_editor_product_details/mobile-editor-product-details';
85
85
  import EditorLayers from './editor_layers/editor-layers';
86
+ import EditorWizard from './editor_wizard/editor-wizard';
86
87
 
87
88
  const MIN_SCREEN_AMOUNT = 125;
88
89
 
@@ -92,6 +93,7 @@ export default {
92
93
  EditorWorkspace,
93
94
  EditorProductDetails,
94
95
  EditorLayers,
96
+ EditorWizard,
95
97
  MobileEditorProductDetails,
96
98
  ProductsListDropdown,
97
99
  Tabs
@@ -112,6 +114,11 @@ export default {
112
114
  icon: 'icon-edit',
113
115
  value: 'design',
114
116
  description: 'Add text and upload images'
117
+ }, {
118
+ label: 'Easy Design Wizard',
119
+ icon: 'icon-edit',
120
+ value: 'wizard',
121
+ description: 'Create Custom Designs'
115
122
  }],
116
123
  offerScreenPrintingAmount: 0
117
124
  };
@@ -168,6 +175,16 @@ export default {
168
175
  'setSelectedTab'
169
176
  ]),
170
177
  ...mapMutations('layers', ['resetLayers']),
178
+ editorCurrentTabComponent(currentTab) {
179
+ switch(currentTab) {
180
+ case 'product':
181
+ return 'editor-product-details';
182
+ case 'wizard':
183
+ return 'editor-wizard';
184
+ default:
185
+ return 'editor-layers';
186
+ }
187
+ },
171
188
  selectTab(tab) {
172
189
  this.setSelectedTab(tab);
173
190
  this.setEditModeSelectedLayer(false);
@@ -0,0 +1,22 @@
1
+ @import "@/assets/scss/variables";
2
+
3
+ .EditorWizard {
4
+ &__wrapper {
5
+ padding: 20px 0;
6
+ }
7
+ &__list-header {
8
+ padding: 12px 0;
9
+ margin-top: 24px;
10
+ border-top: 1px solid #E5E5E5;
11
+ }
12
+ &__close-editable {
13
+ color: $grey_1;
14
+ cursor: pointer;
15
+ &-icon {
16
+ color: $grey_5;
17
+ }
18
+ }
19
+ &__pricing {
20
+ margin-top: 30px;
21
+ }
22
+ }
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <div class="EditorWizard__wrapper">
3
+ <wizard
4
+ :hidden-done-step-number="false"
5
+ :has-border="false" />
6
+ <div
7
+ v-if="hasLayers && isPrintPricing"
8
+ class="EditorWizard__add-btn">
9
+ <btn
10
+ btn-class="green"
11
+ btn-label="Add Another Print"
12
+ @onclick="addAnotherPrint()">
13
+ <i
14
+ slot="icon-before"
15
+ class="icon-plus"></i>
16
+ </btn>
17
+ </div>
18
+ <editor-pricing
19
+ v-if="hasPricing"
20
+ class="EditorWizard__pricing" />
21
+ </div>
22
+ </template>
23
+
24
+ <script>
25
+ import { mapGetters, mapMutations } from 'vuex';
26
+ import EditorPricing from '@lancom/shared/components/editor/editor_pricing/editor-pricing';
27
+ import Wizard from '@lancom/shared/components/product/wizard/wizard';
28
+
29
+ export default {
30
+ name: 'EditorWizard',
31
+ components: {
32
+ EditorPricing,
33
+ Wizard
34
+ },
35
+ props: {
36
+ hasPricing: {
37
+ type: Boolean,
38
+ default: true
39
+ }
40
+ },
41
+ computed: {
42
+ ...mapGetters('product', ['hasLayers', 'isPrintPricing'])
43
+ },
44
+ methods: {
45
+ ...mapMutations('product', [
46
+ 'setVisibleSteps',
47
+ 'clearWizardData'
48
+ ]),
49
+ ...mapMutations('layers', [
50
+ 'setEditableLayers'
51
+ ]),
52
+ addAnotherPrint() {
53
+ this.setVisibleSteps(false);
54
+ this.$nextTick(() => {
55
+ this.setEditableLayers();
56
+ this.clearWizardData();
57
+ this.setVisibleSteps(true);
58
+ });
59
+ },
60
+ }
61
+ };
62
+ </script>
63
+
64
+ <style lang="scss" scoped>
65
+ @import 'editor-wizard.scss';
66
+ </style>
@@ -151,7 +151,7 @@ export default {
151
151
  );
152
152
  },
153
153
  printAreaIsSmall() {
154
- return this.printAreaSize.alias === 'rect10';
154
+ return this.printAreaSize?.alias === 'rect10';
155
155
  },
156
156
  backgroundColor() {
157
157
  return this.backgroundImageLoaded && this.editableColor?.rgb;
@@ -44,7 +44,7 @@
44
44
  background-image: url(../../../static/images/paid.svg);
45
45
  background-repeat: no-repeat;
46
46
  background-position: 0px 0px;
47
- background-size: contain;
47
+ background-size: 500px;
48
48
  }
49
49
  &--small {
50
50
  margin: 0 0;
@@ -50,11 +50,15 @@
50
50
  }
51
51
 
52
52
  .Gallery {
53
+ &__wrapper {
54
+ position: relative;
55
+ }
53
56
  &__big,
54
57
  &__small {
55
58
  overflow: hidden;
56
59
  position: relative;
57
60
  margin: 20px 0;
61
+ z-index: 1;
58
62
  }
59
63
  &__zoom {
60
64
  position: absolute;
@@ -195,4 +199,21 @@
195
199
  background-color: $gray;
196
200
  margin-top: 20px;
197
201
  }
202
+ &__zoom-image {
203
+ position: absolute;
204
+ right: -250px;
205
+ top: 0;
206
+ width: 350px;
207
+ height: 350px;
208
+ z-index: 2;
209
+ background-color: white;
210
+ box-shadow: 0 0 10px gray;
211
+ overflow: hidden;
212
+ pointer-events: none;
213
+ img {
214
+ position: absolute;
215
+ max-width: 800px;
216
+ max-height: 800px;
217
+ }
218
+ }
198
219
  }
@@ -5,9 +5,10 @@
5
5
  <img
6
6
  :src="staticLink(currentImage.large)"
7
7
  :alt="product.name"
8
- width="400"
9
- height="400"
10
- class="Gallery__big-image-src" />
8
+ class="Gallery__big-image-src"
9
+ @mouseenter="startZoom"
10
+ @mousemove="updateZoomWithThrottle"
11
+ @mouseleave="stopZoom" />
11
12
  <div
12
13
  v-if="currentImage.print"
13
14
  class="Gallery__big-print">
@@ -37,6 +38,14 @@
37
38
  Next
38
39
  </button>
39
40
  </div>
41
+ <div
42
+ v-if="isZooming"
43
+ class="Gallery__zoom-image">
44
+ <img
45
+ :src="staticLink(currentImage.large)"
46
+ :style="zoomImageStyles"
47
+ class="Gallery__zoom-image-src" />
48
+ </div>
40
49
  <div class="Gallery__small">
41
50
  <div
42
51
  v-for="(image, index) in visibleImages"
@@ -96,6 +105,7 @@ import { mapGetters, mapActions } from 'vuex';
96
105
  import { staticLink } from '@lancom/shared/assets/js/utils/filters';
97
106
  import { isValidImageTypes } from '@lancom/shared/assets/js/utils/colors';
98
107
  import Price from '@lancom/shared/components/common/price';
108
+ import throttle from 'lodash.throttle';
99
109
 
100
110
  export default {
101
111
  name: 'Gallery',
@@ -127,7 +137,10 @@ export default {
127
137
  galerySize: null,
128
138
  backgroundSize: null,
129
139
  backgroundPosition: null,
130
- skipUpdateGallery: false
140
+ skipUpdateGallery: false,
141
+ zoomImageStyles: null,
142
+ isZooming: false,
143
+ updateZoomWithThrottle: throttle(this.updateZoom, 50, { trailing: false }),
131
144
  };
132
145
  },
133
146
  computed: {
@@ -183,6 +196,22 @@ export default {
183
196
  methods: {
184
197
  ...mapActions('product', ['selectColor']),
185
198
  staticLink,
199
+ startZoom() {
200
+ this.isZooming = true;
201
+ },
202
+ stopZoom() {
203
+ this.isZooming = false;
204
+ this.zoomImageStyles = null;
205
+ },
206
+ updateZoom(e) {
207
+ if (this.isZooming) {
208
+ const { offsetX, offsetY } = e;
209
+ this.zoomImageStyles = {
210
+ top: `${-offsetY * 2 + 175}px`,
211
+ left: `${-offsetX * 2 + 175}px`
212
+ };
213
+ }
214
+ },
186
215
  goToSlideAndChangeColor(index) {
187
216
  this.skipUpdateGallery = true;
188
217
  const { color } = this.filteredImages[index] || {};
@@ -0,0 +1,222 @@
1
+ @import '@/assets/scss/variables';
2
+
3
+ .Wizard {
4
+ &__header {
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: space-between;
8
+ padding: 22px;
9
+ background-color: $wizard_primary;
10
+ font-weight: 800;
11
+ font-size: 16px;
12
+ line-height: 22px;
13
+ text-transform: uppercase;
14
+ color: $wizard_primary_text;
15
+ cursor: pointer;
16
+ @media (max-width: $bp-extra-small-max) {
17
+ padding: 14px;
18
+ font-size: 13px;
19
+ flex-direction: column;
20
+ align-items: baseline;
21
+ }
22
+ &:hover,
23
+ &--active {
24
+ background-color: $green;
25
+ background-color: $wizard_primary_active;
26
+ }
27
+ &-state {
28
+ text-decoration: underline;
29
+ }
30
+ }
31
+ &__print-types {
32
+ display: flex;
33
+ margin: 31px 0 36px -5px;
34
+ width: calc(100% + 5px);
35
+ }
36
+ &__print-type {
37
+ margin: 5px 0 0 5px;
38
+ cursor: pointer;
39
+ &-name {
40
+ display: flex;
41
+ text-transform: uppercase;
42
+ align-items: center;
43
+ justify-content: center;
44
+ height: 60px;
45
+ background-color: $gray;
46
+ color: $black;
47
+ &--selected {
48
+ background-color: $green;
49
+ }
50
+ }
51
+ &-description {
52
+ padding: 12px 16px;
53
+ border: 1px solid $gray;
54
+ color: $gray_main;
55
+ &--selected {
56
+ border: 1px solid $green;
57
+ color: $black;
58
+ }
59
+ ul {
60
+ list-style: circle;
61
+ margin-left: 13px;
62
+ li {
63
+ margin-bottom: 8px;
64
+ }
65
+ }
66
+ }
67
+ &-icon {
68
+ width: 22px;
69
+ height: 22px;
70
+ background-position: center;
71
+ background-size: cover;
72
+ margin-right: 10px;
73
+ &--blank {
74
+ background-image: url(~/static/images/blank_tee.svg);
75
+ }
76
+ &--printed {
77
+ background-image: url(~/static/images/printed_tee.svg);
78
+ }
79
+ }
80
+ }
81
+ &__add-btn {
82
+ margin-top: 15px;
83
+ width: 100%;
84
+ display: flex;
85
+ .Btn__wrapper {
86
+ flex-grow: 1;
87
+ }
88
+ }
89
+ &__layers {
90
+ border: 2px solid $gray;
91
+ background-color: #FCFCFC;
92
+ padding: 30px;
93
+ margin-bottom: 20px;
94
+ &-info {
95
+ margin-top: 20px;
96
+ padding-top: 20px;
97
+ border-top: 2px solid $gray;
98
+ font-size: 14px;
99
+ line-height: 19px;
100
+ color: $gray_main;
101
+ p {
102
+ margin-bottom: 10px;
103
+ }
104
+ }
105
+ }
106
+ &__info {
107
+ display: flex;
108
+ margin-top: 11px;
109
+ flex-direction: column;
110
+ &-item {
111
+ margin-right: 0;
112
+ margin: 7px 0;
113
+ }
114
+ }
115
+ &__step {
116
+ height: 68px;
117
+ padding: 0 20px;
118
+ display: flex;
119
+ justify-content: center;
120
+ flex-direction: column;
121
+ width: 100%;
122
+ position: relative;
123
+ @media (max-width: $bp-large-max) {
124
+ padding: 0 10px;
125
+ }
126
+ &::after {
127
+ content: '';
128
+ position: absolute;
129
+ top: -3px;
130
+ right: 0px;
131
+ bottom: -3px;
132
+ width: 16px;
133
+ background-image: url(~/static/images/step-arrow.svg);
134
+ background-position: top right;
135
+ background-repeat: no-repeat;
136
+ background-size: cover;
137
+ z-index: 3;
138
+ }
139
+ &::before {
140
+ content: '';
141
+ position: absolute;
142
+ left: -14px;
143
+ top: 0px;
144
+ right: 15px;
145
+ bottom: 0px;
146
+ background-color: #f4f4f4;
147
+ z-index: 1;
148
+ }
149
+ &--last {
150
+ &::before {
151
+ right: 0;
152
+ }
153
+ &::after {
154
+ display: none;
155
+ }
156
+ }
157
+ &-progress {
158
+ position: relative;
159
+ z-index: 2;
160
+ }
161
+ &-number {
162
+ font-weight: 800;
163
+ font-size: 16px;
164
+ color: $black;
165
+ }
166
+ &--active {
167
+ .Wizard__step-number {
168
+ color: $wizard_primary_text;
169
+ }
170
+ &::before {
171
+ background-color: $wizard_primary_secondary;
172
+ }
173
+ &::after {
174
+ background-image: url(~/static/images/step-arrow--success.svg);
175
+ }
176
+ }
177
+ &-name {
178
+ font-weight: bold;
179
+ font-size: 14px;
180
+ color: $gray_main;
181
+ margin-top: 4px;
182
+ @media (max-width: $bp-large-max) {
183
+ font-size: 11px;
184
+ }
185
+ }
186
+ &-success {
187
+ font-size: 19px;
188
+ width: 40px;
189
+ height: 40px;
190
+ background-color: $green;
191
+ border-radius: 20px;
192
+ display: flex;
193
+ align-items: center;
194
+ justify-content: center;
195
+ }
196
+ }
197
+ &__content {
198
+ display: none;
199
+ &--visible {
200
+ display: block;
201
+ }
202
+ .ProgressSteps {
203
+ &__wrapper {
204
+ margin-top: 12px;
205
+ }
206
+ &__steps-wrapper {
207
+ padding: 0 !important;
208
+ border-bottom: none;
209
+ @media (max-width: $bp-extra-small-max) {
210
+ display: none;
211
+ }
212
+ }
213
+ &__steps {
214
+ overflow: hidden;
215
+ padding-left: 15px;
216
+ }
217
+ &__step {
218
+ height: auto;
219
+ }
220
+ }
221
+ }
222
+ }